@fluxmail/core 0.27.0 → 0.29.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/dist/folders.d.ts +27 -0
- package/dist/folders.d.ts.map +1 -0
- package/dist/folders.js +62 -0
- package/dist/folders.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/apps.d.ts +204 -0
- package/dist/mcp/apps.d.ts.map +1 -0
- package/dist/mcp/apps.js +269 -0
- package/dist/mcp/apps.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/invalidArguments.d.ts +49 -0
- package/dist/mcp/invalidArguments.d.ts.map +1 -0
- package/dist/mcp/invalidArguments.js +208 -0
- package/dist/mcp/invalidArguments.js.map +1 -0
- package/dist/mcp/pdf.d.ts +3 -1
- package/dist/mcp/pdf.d.ts.map +1 -1
- package/dist/mcp/pdf.js.map +1 -1
- package/dist/mcp/pdfMemory.d.ts +24 -0
- package/dist/mcp/pdfMemory.d.ts.map +1 -0
- package/dist/mcp/pdfMemory.js +107 -0
- package/dist/mcp/pdfMemory.js.map +1 -0
- package/dist/mcp/results.d.ts +6 -1
- package/dist/mcp/results.d.ts.map +1 -1
- package/dist/mcp/results.js +13 -2
- package/dist/mcp/results.js.map +1 -1
- package/dist/mcp/sendConfirmationView.d.ts +14 -0
- package/dist/mcp/sendConfirmationView.d.ts.map +1 -0
- package/dist/mcp/sendConfirmationView.js +816 -0
- package/dist/mcp/sendConfirmationView.js.map +1 -0
- package/dist/mcp/tools.d.ts +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.generated.d.ts.map +1 -1
- package/dist/mcp/tools.generated.js +47 -0
- package/dist/mcp/tools.generated.js.map +1 -1
- package/dist/mcp/tools.js +10 -0
- package/dist/mcp/tools.js.map +1 -1
- package/dist/provider.d.ts +15 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/text.d.ts +13 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +25 -0
- package/dist/text.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EmailError, type ProviderFailure } from './errors.js';
|
|
2
|
+
import type { FolderRole } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A folder name Fluxmail or the mail provider refused, with a message Fluxmail wrote. The message names only the
|
|
5
|
+
* requested folder and folders in the same mailbox, never provider response text, so a product can return it to
|
|
6
|
+
* the caller instead of a generic refusal.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FolderNameError extends EmailError {
|
|
9
|
+
constructor(message: string, failure?: ProviderFailure);
|
|
10
|
+
}
|
|
11
|
+
/** Every folder role. Each names a system folder or view, which callers reach by role rather than create. */
|
|
12
|
+
export declare const FOLDER_ROLES: readonly FolderRole[];
|
|
13
|
+
/** Whether a name is a folder role word, such as Inbox or TRASH, which searches and moves read as the role. */
|
|
14
|
+
export declare function isFolderRoleName(name: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The name of a folder to create, trimmed, after the checks every provider shares. The name can't be blank,
|
|
17
|
+
* contain control characters, or be a folder role such as inbox or trash, in any case, since searches and
|
|
18
|
+
* moves read those words as the system folder. Providers add their own checks for names that would take a role.
|
|
19
|
+
*/
|
|
20
|
+
export declare function newFolderName(name: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The levels of a folder path, split at the mailbox's hierarchy separator. A mailbox without one has a single
|
|
23
|
+
* level. Spaces around a level are dropped, so "Projects / 2026" names the same folder as "Projects/2026". A path
|
|
24
|
+
* with an empty level, such as "Projects/" or "Projects//2026", is rejected.
|
|
25
|
+
*/
|
|
26
|
+
export declare function folderPathLevels(path: string, separator: string | undefined): string[];
|
|
27
|
+
//# sourceMappingURL=folders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folders.d.ts","sourceRoot":"","sources":["../src/folders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe;CAGvD;AAcD,6GAA6G;AAC7G,eAAO,MAAM,YAAY,EAA+B,SAAS,UAAU,EAAE,CAAC;AAI9E,+GAA+G;AAC/G,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWlD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAUtF"}
|
package/dist/folders.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { EmailError } from './errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* A folder name Fluxmail or the mail provider refused, with a message Fluxmail wrote. The message names only the
|
|
4
|
+
* requested folder and folders in the same mailbox, never provider response text, so a product can return it to
|
|
5
|
+
* the caller instead of a generic refusal.
|
|
6
|
+
*/
|
|
7
|
+
export class FolderNameError extends EmailError {
|
|
8
|
+
constructor(message, failure) {
|
|
9
|
+
super('invalid_request', message, undefined, failure);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
// A record, so adding a role to FolderRole without listing it here fails to compile.
|
|
13
|
+
const ROLE_RECORD = {
|
|
14
|
+
inbox: true,
|
|
15
|
+
sent: true,
|
|
16
|
+
drafts: true,
|
|
17
|
+
trash: true,
|
|
18
|
+
spam: true,
|
|
19
|
+
archive: true,
|
|
20
|
+
starred: true,
|
|
21
|
+
all: true,
|
|
22
|
+
};
|
|
23
|
+
/** Every folder role. Each names a system folder or view, which callers reach by role rather than create. */
|
|
24
|
+
export const FOLDER_ROLES = Object.keys(ROLE_RECORD);
|
|
25
|
+
const FOLDER_ROLE_NAMES = new Set(FOLDER_ROLES);
|
|
26
|
+
/** Whether a name is a folder role word, such as Inbox or TRASH, which searches and moves read as the role. */
|
|
27
|
+
export function isFolderRoleName(name) {
|
|
28
|
+
return FOLDER_ROLE_NAMES.has(name.trim().toLowerCase());
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The name of a folder to create, trimmed, after the checks every provider shares. The name can't be blank,
|
|
32
|
+
* contain control characters, or be a folder role such as inbox or trash, in any case, since searches and
|
|
33
|
+
* moves read those words as the system folder. Providers add their own checks for names that would take a role.
|
|
34
|
+
*/
|
|
35
|
+
export function newFolderName(name) {
|
|
36
|
+
const trimmed = name.trim();
|
|
37
|
+
if (!trimmed)
|
|
38
|
+
throw new FolderNameError('The folder name is empty.');
|
|
39
|
+
// eslint-disable-next-line no-control-regex
|
|
40
|
+
if (/[\u0000-\u001f\u007f]/.test(trimmed)) {
|
|
41
|
+
throw new FolderNameError('Folder names cannot contain control characters.');
|
|
42
|
+
}
|
|
43
|
+
if (isFolderRoleName(trimmed)) {
|
|
44
|
+
throw new FolderNameError(`"${trimmed}" is a system folder. Choose another name.`);
|
|
45
|
+
}
|
|
46
|
+
return trimmed;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The levels of a folder path, split at the mailbox's hierarchy separator. A mailbox without one has a single
|
|
50
|
+
* level. Spaces around a level are dropped, so "Projects / 2026" names the same folder as "Projects/2026". A path
|
|
51
|
+
* with an empty level, such as "Projects/" or "Projects//2026", is rejected.
|
|
52
|
+
*/
|
|
53
|
+
export function folderPathLevels(path, separator) {
|
|
54
|
+
const levels = (separator ? path.split(separator) : [path]).map((level) => level.trim());
|
|
55
|
+
if (levels.some((level) => !level)) {
|
|
56
|
+
throw new FolderNameError(separator
|
|
57
|
+
? `Every level of the folder path "${path}" needs a name. This mailbox separates levels with "${separator}".`
|
|
58
|
+
: `The folder name "${path}" is empty.`);
|
|
59
|
+
}
|
|
60
|
+
return levels;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=folders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folders.js","sourceRoot":"","sources":["../src/folders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAG/D;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,OAAe,EAAE,OAAyB;QACpD,KAAK,CAAC,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AAED,qFAAqF;AACrF,MAAM,WAAW,GAA6B;IAC5C,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,GAAG,EAAE,IAAI;CACV,CAAC;AAEF,6GAA6G;AAC7G,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAA0B,CAAC;AAE9E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS,YAAY,CAAC,CAAC;AAExD,+GAA+G;AAC/G,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO;QAAE,MAAM,IA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C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { SEND_CONFIRMATION_HTML, SEND_CONFIRMATION_MAX_BODY_CHARS, SEND_CONFIRMATION_RESULT_META_KEY } from './sendConfirmationView.js';
|
|
2
|
+
export { SEND_CONFIRMATION_HTML, SEND_CONFIRMATION_MAX_BODY_CHARS, SEND_CONFIRMATION_RESULT_META_KEY };
|
|
3
|
+
/** The MCP Apps extension identifier clients advertise under `capabilities.extensions`. */
|
|
4
|
+
export declare const MCP_APPS_EXTENSION_ID = "io.modelcontextprotocol/ui";
|
|
5
|
+
/** The MIME type of an MCP Apps HTML view. */
|
|
6
|
+
export declare const MCP_APPS_MIME_TYPE = "text/html;profile=mcp-app";
|
|
7
|
+
/** Version the URI with the view: hosts may cache a resource by its URI. */
|
|
8
|
+
export declare const SEND_CONFIRMATION_RESOURCE_URI = "ui://fluxmail/send-confirmation-v4.html";
|
|
9
|
+
/** The shared tool whose result the card renders. */
|
|
10
|
+
export declare const SEND_CONFIRMATION_TOOL = "preview_send";
|
|
11
|
+
/** The shared tool the card calls when the user clicks Send. */
|
|
12
|
+
export declare const SEND_CONFIRMATION_SEND_TOOL = "send_email";
|
|
13
|
+
/**
|
|
14
|
+
* Resource metadata for the card. Empty CSP lists declare that the view loads nothing from any origin, the
|
|
15
|
+
* strictest policy MCP Apps allows. The card requests no device permissions.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SEND_CONFIRMATION_RESOURCE_META: {
|
|
18
|
+
readonly ui: {
|
|
19
|
+
readonly csp: {
|
|
20
|
+
readonly connectDomains: readonly [];
|
|
21
|
+
readonly resourceDomains: readonly [];
|
|
22
|
+
readonly frameDomains: readonly [];
|
|
23
|
+
readonly baseUriDomains: readonly [];
|
|
24
|
+
};
|
|
25
|
+
readonly prefersBorder: true;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** The card as `resources/list` advertises it. */
|
|
29
|
+
export declare const SEND_CONFIRMATION_RESOURCE: {
|
|
30
|
+
readonly uri: "ui://fluxmail/send-confirmation-v4.html";
|
|
31
|
+
readonly name: "send_confirmation";
|
|
32
|
+
readonly title: "Send email";
|
|
33
|
+
readonly description: "Shows an email exactly as it will be sent, with a Send button.";
|
|
34
|
+
readonly mimeType: "text/html;profile=mcp-app";
|
|
35
|
+
readonly _meta: {
|
|
36
|
+
readonly ui: {
|
|
37
|
+
readonly csp: {
|
|
38
|
+
readonly connectDomains: readonly [];
|
|
39
|
+
readonly resourceDomains: readonly [];
|
|
40
|
+
readonly frameDomains: readonly [];
|
|
41
|
+
readonly baseUriDomains: readonly [];
|
|
42
|
+
};
|
|
43
|
+
readonly prefersBorder: true;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/** The card's `resources/read` contents. */
|
|
48
|
+
export declare function sendConfirmationResourceContents(): Array<{
|
|
49
|
+
uri: string;
|
|
50
|
+
mimeType: string;
|
|
51
|
+
text: string;
|
|
52
|
+
_meta: typeof SEND_CONFIRMATION_RESOURCE_META;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* The `_meta` preview_send's tool definition carries to link the card. `ui/resourceUri` is the deprecated flat
|
|
56
|
+
* key, kept for hosts that read only it, as the MCP Apps SDK's registerAppTool does.
|
|
57
|
+
*/
|
|
58
|
+
export declare const SEND_CONFIRMATION_TOOL_META: {
|
|
59
|
+
readonly ui: {
|
|
60
|
+
readonly resourceUri: "ui://fluxmail/send-confirmation-v4.html";
|
|
61
|
+
};
|
|
62
|
+
readonly 'ui/resourceUri': "ui://fluxmail/send-confirmation-v4.html";
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Added to send_email's description in `tools/list` for a client that declared MCP Apps, so the assistant
|
|
66
|
+
* previews an email the user has not approved and leaves the send to the card. Clients whose
|
|
67
|
+
* capabilities are unknown get the plain description: the hint is wrong where no card appears.
|
|
68
|
+
*/
|
|
69
|
+
export declare const SEND_CONFIRMATION_SEND_TOOL_HINT: string;
|
|
70
|
+
/** What the card needs beyond preview_send's structured result. */
|
|
71
|
+
export interface SendConfirmationData {
|
|
72
|
+
version: 1;
|
|
73
|
+
/**
|
|
74
|
+
* The key the card sends with, so a double click, retry or re-render delivers once. Issued by
|
|
75
|
+
* issueSendConfirmationKey, it also binds the send to the previewed message and the preview time.
|
|
76
|
+
*/
|
|
77
|
+
idempotencyKey: string;
|
|
78
|
+
/**
|
|
79
|
+
* The display name the message's From header will carry. Left out when it carries none or the name isn't
|
|
80
|
+
* known, so the card shows the address alone instead of a guess.
|
|
81
|
+
*/
|
|
82
|
+
fromName?: string;
|
|
83
|
+
/** The body as it will be sent, each part cut to SEND_CONFIRMATION_MAX_BODY_CHARS. */
|
|
84
|
+
body: {
|
|
85
|
+
text?: string;
|
|
86
|
+
html?: string;
|
|
87
|
+
textTruncated?: boolean;
|
|
88
|
+
htmlTruncated?: boolean;
|
|
89
|
+
/** Images the HTML references as cid:<Content-ID>, as data: URLs, within the image limits. */
|
|
90
|
+
inlineImages?: Record<string, string>;
|
|
91
|
+
/** How many inline images were left out for their type or size. */
|
|
92
|
+
inlineImagesOmitted?: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** Base64 characters of one inline image the card receives, about 384 KB of image data. */
|
|
96
|
+
export declare const SEND_CONFIRMATION_MAX_IMAGE_CHARS: number;
|
|
97
|
+
/** Base64 characters of all inline images the card receives, about 1.5 MB of image data. */
|
|
98
|
+
export declare const SEND_CONFIRMATION_MAX_IMAGES_CHARS: number;
|
|
99
|
+
/** Characters of the sender name the card receives. */
|
|
100
|
+
export declare const SEND_CONFIRMATION_MAX_NAME_CHARS = 200;
|
|
101
|
+
/**
|
|
102
|
+
* The `_meta` to add to a successful preview_send result for hosts that may render the card. Its content and
|
|
103
|
+
* structuredContent stay unchanged; hosts don't add `_meta` to model context.
|
|
104
|
+
*/
|
|
105
|
+
export declare function sendConfirmationResultMeta(input: {
|
|
106
|
+
idempotencyKey: string;
|
|
107
|
+
/** The display name the message's From header will carry, when known. Cut to SEND_CONFIRMATION_MAX_NAME_CHARS. */
|
|
108
|
+
fromName?: string | undefined;
|
|
109
|
+
body: {
|
|
110
|
+
text?: string;
|
|
111
|
+
html?: string;
|
|
112
|
+
};
|
|
113
|
+
/** Attachments with a Content-ID; the HTML may show them as cid: images. */
|
|
114
|
+
inlineImages?: ReadonlyArray<{
|
|
115
|
+
contentId?: string;
|
|
116
|
+
mimeType: string;
|
|
117
|
+
content: string;
|
|
118
|
+
}>;
|
|
119
|
+
}): Record<string, SendConfirmationData>;
|
|
120
|
+
/**
|
|
121
|
+
* Whether a client renders MCP Apps HTML views, from the capabilities it declared. Returns undefined when the
|
|
122
|
+
* capabilities are unknown, such as a stateless HTTP request from a client that declared them only at
|
|
123
|
+
* initialization. Advertise the card unless this returns false: hosts without the extension ignore `_meta`.
|
|
124
|
+
*/
|
|
125
|
+
export declare function clientSupportsMcpApps(capabilities: unknown): boolean | undefined;
|
|
126
|
+
/** What a send confirmation key binds: the message the user saw. */
|
|
127
|
+
export interface SendConfirmationMessage {
|
|
128
|
+
from: string;
|
|
129
|
+
to: ReadonlyArray<{
|
|
130
|
+
email: string;
|
|
131
|
+
name?: string;
|
|
132
|
+
}>;
|
|
133
|
+
cc: ReadonlyArray<{
|
|
134
|
+
email: string;
|
|
135
|
+
name?: string;
|
|
136
|
+
}>;
|
|
137
|
+
bcc: ReadonlyArray<{
|
|
138
|
+
email: string;
|
|
139
|
+
name?: string;
|
|
140
|
+
}>;
|
|
141
|
+
subject: string;
|
|
142
|
+
attachments: ReadonlyArray<{
|
|
143
|
+
filename: string;
|
|
144
|
+
mimeType: string;
|
|
145
|
+
sizeBytes: number;
|
|
146
|
+
}>;
|
|
147
|
+
body: {
|
|
148
|
+
text?: string;
|
|
149
|
+
html?: string;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** How long a card can send after its preview. */
|
|
153
|
+
export declare const SEND_CONFIRMATION_KEY_TTL_MS: number;
|
|
154
|
+
/** A short digest of the resolved message, compared again when the card sends. */
|
|
155
|
+
export declare function sendConfirmationContentHash(message: SendConfirmationMessage): string;
|
|
156
|
+
/**
|
|
157
|
+
* A keyed digest of who an email goes to and its subject, stored with each delivery. A card is refused only when
|
|
158
|
+
* a later send from the same mailbox has the same digest, so the assistant sending the previewed email in its own
|
|
159
|
+
* words still blocks the card and an unrelated email doesn't. To, Cc and Bcc count as one set, and the subject
|
|
160
|
+
* ignores case and spacing.
|
|
161
|
+
*/
|
|
162
|
+
export declare function sendConfirmationMatchHash(secret: Uint8Array, message: Pick<SendConfirmationMessage, 'to' | 'cc' | 'bcc' | 'subject'>): string;
|
|
163
|
+
/**
|
|
164
|
+
* The idempotency key a card sends with. It is signed with a server secret and carries the preview time and
|
|
165
|
+
* the content hash, so the server can refuse a card whose message changed or that another send overtook.
|
|
166
|
+
*/
|
|
167
|
+
export declare function issueSendConfirmationKey(secret: Uint8Array, contentHash: string, issuedAt?: number): string;
|
|
168
|
+
/** Whether an idempotency key has the card prefix, so the server must check it before sending. */
|
|
169
|
+
export declare function isSendConfirmationKey(key: string): boolean;
|
|
170
|
+
/** How long after a card's send an identical send made without the card counts as a repeat of it. */
|
|
171
|
+
export declare const SEND_CONFIRMATION_REPEAT_WINDOW_MS: number;
|
|
172
|
+
/** What a send refused as a repeat of a card's send is told. */
|
|
173
|
+
export declare const SEND_CONFIRMATION_REPEAT_MESSAGE: string;
|
|
174
|
+
/**
|
|
175
|
+
* The hash of the message a card key was issued for, or undefined for any other idempotency key. A product
|
|
176
|
+
* may issue a key with more after the hash, following a `~`, which no hash contains; that part is left out.
|
|
177
|
+
* It checks no signature, so use it only on a key stored with a delivery, where a key that merely has the
|
|
178
|
+
* card's shape can affect only its own member's sends.
|
|
179
|
+
*/
|
|
180
|
+
export declare function sendConfirmationKeyContentHash(key: string): string | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Whether a send made without the card repeats a send a card just made: the same resolved message, by
|
|
183
|
+
* `sendConfirmationContentHash`, going out within `SEND_CONFIRMATION_REPEAT_WINDOW_MS` of the card's send.
|
|
184
|
+
* A user who clicks Send on the card and then tells the assistant to send would otherwise send the email
|
|
185
|
+
* twice.
|
|
186
|
+
*
|
|
187
|
+
* `cardSends` are the card sends by the same user from the same mailbox that succeeded or are still going
|
|
188
|
+
* out. One that failed, or whose outcome is unknown, doesn't count, so the user can send the email again. A
|
|
189
|
+
* message that differs in any part, such as a reworded body, is a new email and never a repeat. `sendsAt`
|
|
190
|
+
* is when the send goes out: now, or a scheduled send's time.
|
|
191
|
+
*/
|
|
192
|
+
export declare function repeatsCardSend(contentHash: string, cardSends: Iterable<{
|
|
193
|
+
contentHash: string;
|
|
194
|
+
sentAt: number;
|
|
195
|
+
}>, sendsAt?: number): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Reads a send confirmation key. Returns undefined for any other idempotency key, and `invalid` for a key with
|
|
198
|
+
* the card prefix that this server did not sign or that expired.
|
|
199
|
+
*/
|
|
200
|
+
export declare function readSendConfirmationKey(secret: Uint8Array, key: string, now?: number): {
|
|
201
|
+
issuedAt: number;
|
|
202
|
+
contentHash: string;
|
|
203
|
+
} | 'invalid' | undefined;
|
|
204
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/mcp/apps.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,CAAC;AAEvG,2FAA2F;AAC3F,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAClE,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B,4CAA4C,CAAC;AACxF,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,gEAAgE;AAChE,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;CAKlC,CAAC;AAEX,kDAAkD;AAClD,eAAO,MAAM,0BAA0B;;;;;;;;;;;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EAAE,IAAI,CAAC,uBAAuB,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC,GACtE,MAAM,CAWR;AAQD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,SAAa,GAAG,MAAM,CAG/G;AAED,kGAAkG;AAClG,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,qGAAqG;AACrG,eAAO,MAAM,kCAAkC,QAAiB,CAAC;AAEjE,gEAAgE;AAChE,eAAO,MAAM,gCAAgC,QAE8C,CAAC;AAS5F;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,QAAQ,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5D,OAAO,SAAa,GACnB,OAAO,CAKT;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,GAAG,SAAa,GACf;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,SAAS,CAWnE"}
|
package/dist/mcp/apps.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { createHash, createHmac, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { SEND_CONFIRMATION_HTML, SEND_CONFIRMATION_MAX_BODY_CHARS, SEND_CONFIRMATION_RESULT_META_KEY, } from './sendConfirmationView.js';
|
|
3
|
+
export { SEND_CONFIRMATION_HTML, SEND_CONFIRMATION_MAX_BODY_CHARS, SEND_CONFIRMATION_RESULT_META_KEY };
|
|
4
|
+
/** The MCP Apps extension identifier clients advertise under `capabilities.extensions`. */
|
|
5
|
+
export const MCP_APPS_EXTENSION_ID = 'io.modelcontextprotocol/ui';
|
|
6
|
+
/** The MIME type of an MCP Apps HTML view. */
|
|
7
|
+
export const MCP_APPS_MIME_TYPE = 'text/html;profile=mcp-app';
|
|
8
|
+
/** Version the URI with the view: hosts may cache a resource by its URI. */
|
|
9
|
+
export const SEND_CONFIRMATION_RESOURCE_URI = 'ui://fluxmail/send-confirmation-v4.html';
|
|
10
|
+
/** The shared tool whose result the card renders. */
|
|
11
|
+
export const SEND_CONFIRMATION_TOOL = 'preview_send';
|
|
12
|
+
/** The shared tool the card calls when the user clicks Send. */
|
|
13
|
+
export const SEND_CONFIRMATION_SEND_TOOL = 'send_email';
|
|
14
|
+
/**
|
|
15
|
+
* Resource metadata for the card. Empty CSP lists declare that the view loads nothing from any origin, the
|
|
16
|
+
* strictest policy MCP Apps allows. The card requests no device permissions.
|
|
17
|
+
*/
|
|
18
|
+
export const SEND_CONFIRMATION_RESOURCE_META = {
|
|
19
|
+
ui: {
|
|
20
|
+
csp: { connectDomains: [], resourceDomains: [], frameDomains: [], baseUriDomains: [] },
|
|
21
|
+
prefersBorder: true,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/** The card as `resources/list` advertises it. */
|
|
25
|
+
export const SEND_CONFIRMATION_RESOURCE = {
|
|
26
|
+
uri: SEND_CONFIRMATION_RESOURCE_URI,
|
|
27
|
+
name: 'send_confirmation',
|
|
28
|
+
title: 'Send email',
|
|
29
|
+
description: 'Shows an email exactly as it will be sent, with a Send button.',
|
|
30
|
+
mimeType: MCP_APPS_MIME_TYPE,
|
|
31
|
+
_meta: SEND_CONFIRMATION_RESOURCE_META,
|
|
32
|
+
};
|
|
33
|
+
/** The card's `resources/read` contents. */
|
|
34
|
+
export function sendConfirmationResourceContents() {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
uri: SEND_CONFIRMATION_RESOURCE_URI,
|
|
38
|
+
mimeType: MCP_APPS_MIME_TYPE,
|
|
39
|
+
text: SEND_CONFIRMATION_HTML,
|
|
40
|
+
_meta: SEND_CONFIRMATION_RESOURCE_META,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The `_meta` preview_send's tool definition carries to link the card. `ui/resourceUri` is the deprecated flat
|
|
46
|
+
* key, kept for hosts that read only it, as the MCP Apps SDK's registerAppTool does.
|
|
47
|
+
*/
|
|
48
|
+
export const SEND_CONFIRMATION_TOOL_META = {
|
|
49
|
+
ui: { resourceUri: SEND_CONFIRMATION_RESOURCE_URI },
|
|
50
|
+
'ui/resourceUri': SEND_CONFIRMATION_RESOURCE_URI,
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Added to send_email's description in `tools/list` for a client that declared MCP Apps, so the assistant
|
|
54
|
+
* previews an email the user has not approved and leaves the send to the card. Clients whose
|
|
55
|
+
* capabilities are unknown get the plain description: the hint is wrong where no card appears.
|
|
56
|
+
*/
|
|
57
|
+
export const SEND_CONFIRMATION_SEND_TOOL_HINT = 'This client shows preview_send as a card with a Send button. When the user asks you to send an email now and ' +
|
|
58
|
+
'has not yet approved its final text, call preview_send for the same message instead of send_email, and let ' +
|
|
59
|
+
'them send it from the card. preview_send takes no idempotencyKey or sendAt. An email the user sends from the ' +
|
|
60
|
+
'card is already sent, so do not call send_email for it too. Call send_email directly when the user has ' +
|
|
61
|
+
'approved the final text or asked to send without a preview, when scheduling with sendAt, or when no user is ' +
|
|
62
|
+
'present to click Send.';
|
|
63
|
+
/** Base64 characters of one inline image the card receives, about 384 KB of image data. */
|
|
64
|
+
export const SEND_CONFIRMATION_MAX_IMAGE_CHARS = 512 * 1024;
|
|
65
|
+
/** Base64 characters of all inline images the card receives, about 1.5 MB of image data. */
|
|
66
|
+
export const SEND_CONFIRMATION_MAX_IMAGES_CHARS = 2 * 1024 * 1024;
|
|
67
|
+
const CARD_IMAGE_TYPES = new Set(['image/png', 'image/gif', 'image/jpeg', 'image/webp']);
|
|
68
|
+
function inlineImageUrls(images) {
|
|
69
|
+
const urls = {};
|
|
70
|
+
let omitted = 0;
|
|
71
|
+
let total = 0;
|
|
72
|
+
for (const image of images) {
|
|
73
|
+
if (!image.contentId)
|
|
74
|
+
continue;
|
|
75
|
+
const content = image.content.replace(/\s+/g, '');
|
|
76
|
+
const mimeType = image.mimeType.toLowerCase().split(';')[0].trim();
|
|
77
|
+
if (!CARD_IMAGE_TYPES.has(mimeType) ||
|
|
78
|
+
!/^[A-Za-z0-9+/]+={0,2}$/.test(content) ||
|
|
79
|
+
content.length > SEND_CONFIRMATION_MAX_IMAGE_CHARS ||
|
|
80
|
+
total + content.length > SEND_CONFIRMATION_MAX_IMAGES_CHARS) {
|
|
81
|
+
omitted += 1;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
total += content.length;
|
|
85
|
+
// The card matches cid: references without angle brackets.
|
|
86
|
+
urls[image.contentId.trim().replace(/^<|>$/g, '')] = `data:${mimeType};base64,${content}`;
|
|
87
|
+
}
|
|
88
|
+
return { urls, omitted };
|
|
89
|
+
}
|
|
90
|
+
/** Characters of the sender name the card receives. */
|
|
91
|
+
export const SEND_CONFIRMATION_MAX_NAME_CHARS = 200;
|
|
92
|
+
/** A display name on one line, without control characters, cut to the name limit. */
|
|
93
|
+
function boundedName(value) {
|
|
94
|
+
// eslint-disable-next-line no-control-regex
|
|
95
|
+
const name = value?.replace(/[\u0000-\u001f\u007f-\u009f]+/g, ' ').trim();
|
|
96
|
+
if (!name)
|
|
97
|
+
return undefined;
|
|
98
|
+
let end = Math.min(name.length, SEND_CONFIRMATION_MAX_NAME_CHARS);
|
|
99
|
+
// Don't split a surrogate pair.
|
|
100
|
+
const code = name.charCodeAt(end - 1);
|
|
101
|
+
if (end < name.length && code >= 0xd800 && code <= 0xdbff)
|
|
102
|
+
end -= 1;
|
|
103
|
+
return name.slice(0, end).trim();
|
|
104
|
+
}
|
|
105
|
+
function bounded(value) {
|
|
106
|
+
if (!value)
|
|
107
|
+
return {};
|
|
108
|
+
if (value.length <= SEND_CONFIRMATION_MAX_BODY_CHARS)
|
|
109
|
+
return { value };
|
|
110
|
+
let end = SEND_CONFIRMATION_MAX_BODY_CHARS;
|
|
111
|
+
// Don't split a surrogate pair.
|
|
112
|
+
const code = value.charCodeAt(end - 1);
|
|
113
|
+
if (code >= 0xd800 && code <= 0xdbff)
|
|
114
|
+
end -= 1;
|
|
115
|
+
return { value: value.slice(0, end), truncated: true };
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The `_meta` to add to a successful preview_send result for hosts that may render the card. Its content and
|
|
119
|
+
* structuredContent stay unchanged; hosts don't add `_meta` to model context.
|
|
120
|
+
*/
|
|
121
|
+
export function sendConfirmationResultMeta(input) {
|
|
122
|
+
const text = bounded(input.body.text);
|
|
123
|
+
const html = bounded(input.body.html);
|
|
124
|
+
const fromName = boundedName(input.fromName);
|
|
125
|
+
const images = html.value ? inlineImageUrls(input.inlineImages ?? []) : { urls: {}, omitted: 0 };
|
|
126
|
+
return {
|
|
127
|
+
[SEND_CONFIRMATION_RESULT_META_KEY]: {
|
|
128
|
+
version: 1,
|
|
129
|
+
idempotencyKey: input.idempotencyKey,
|
|
130
|
+
...(fromName ? { fromName } : {}),
|
|
131
|
+
body: {
|
|
132
|
+
...(text.value !== undefined ? { text: text.value } : {}),
|
|
133
|
+
...(text.truncated ? { textTruncated: true } : {}),
|
|
134
|
+
...(html.value !== undefined ? { html: html.value } : {}),
|
|
135
|
+
...(html.truncated ? { htmlTruncated: true } : {}),
|
|
136
|
+
...(Object.keys(images.urls).length ? { inlineImages: images.urls } : {}),
|
|
137
|
+
...(images.omitted ? { inlineImagesOmitted: images.omitted } : {}),
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Whether a client renders MCP Apps HTML views, from the capabilities it declared. Returns undefined when the
|
|
144
|
+
* capabilities are unknown, such as a stateless HTTP request from a client that declared them only at
|
|
145
|
+
* initialization. Advertise the card unless this returns false: hosts without the extension ignore `_meta`.
|
|
146
|
+
*/
|
|
147
|
+
export function clientSupportsMcpApps(capabilities) {
|
|
148
|
+
if (!capabilities || typeof capabilities !== 'object')
|
|
149
|
+
return undefined;
|
|
150
|
+
const extensions = capabilities.extensions;
|
|
151
|
+
const ui = extensions && typeof extensions === 'object'
|
|
152
|
+
? extensions[MCP_APPS_EXTENSION_ID]
|
|
153
|
+
: undefined;
|
|
154
|
+
const mimeTypes = ui && typeof ui === 'object' ? ui.mimeTypes : undefined;
|
|
155
|
+
return Array.isArray(mimeTypes) && mimeTypes.includes(MCP_APPS_MIME_TYPE);
|
|
156
|
+
}
|
|
157
|
+
const KEY_PREFIX = 'fxui1.';
|
|
158
|
+
/** How long a card can send after its preview. */
|
|
159
|
+
export const SEND_CONFIRMATION_KEY_TTL_MS = 24 * 60 * 60 * 1000;
|
|
160
|
+
function base64url(bytes) {
|
|
161
|
+
return Buffer.from(bytes).toString('base64url');
|
|
162
|
+
}
|
|
163
|
+
/** A short digest of the resolved message, compared again when the card sends. */
|
|
164
|
+
export function sendConfirmationContentHash(message) {
|
|
165
|
+
const addresses = (list) => list.map((address) => [address.email.toLowerCase(), address.name ?? '']);
|
|
166
|
+
const canonical = JSON.stringify([
|
|
167
|
+
message.from.toLowerCase(),
|
|
168
|
+
addresses(message.to),
|
|
169
|
+
addresses(message.cc),
|
|
170
|
+
addresses(message.bcc),
|
|
171
|
+
message.subject,
|
|
172
|
+
message.attachments.map((attachment) => [attachment.filename, attachment.mimeType, attachment.sizeBytes]),
|
|
173
|
+
message.body.text ?? '',
|
|
174
|
+
message.body.html ?? '',
|
|
175
|
+
]);
|
|
176
|
+
return base64url(createHash('sha256').update(canonical).digest().subarray(0, 16));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* A keyed digest of who an email goes to and its subject, stored with each delivery. A card is refused only when
|
|
180
|
+
* a later send from the same mailbox has the same digest, so the assistant sending the previewed email in its own
|
|
181
|
+
* words still blocks the card and an unrelated email doesn't. To, Cc and Bcc count as one set, and the subject
|
|
182
|
+
* ignores case and spacing.
|
|
183
|
+
*/
|
|
184
|
+
export function sendConfirmationMatchHash(secret, message) {
|
|
185
|
+
const recipients = [
|
|
186
|
+
...new Set([...message.to, ...message.cc, ...message.bcc].map((address) => address.email.trim().toLowerCase())),
|
|
187
|
+
].sort();
|
|
188
|
+
const subject = message.subject.trim().replace(/\s+/g, ' ').toLowerCase();
|
|
189
|
+
return base64url(createHmac('sha256', secret)
|
|
190
|
+
.update(`fluxmail send confirmation match\0${JSON.stringify([recipients, subject])}`)
|
|
191
|
+
.digest()
|
|
192
|
+
.subarray(0, 16));
|
|
193
|
+
}
|
|
194
|
+
function keyMac(secret, payload) {
|
|
195
|
+
return base64url(createHmac('sha256', secret).update(`fluxmail send confirmation\0${payload}`).digest().subarray(0, 16));
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The idempotency key a card sends with. It is signed with a server secret and carries the preview time and
|
|
199
|
+
* the content hash, so the server can refuse a card whose message changed or that another send overtook.
|
|
200
|
+
*/
|
|
201
|
+
export function issueSendConfirmationKey(secret, contentHash, issuedAt = Date.now()) {
|
|
202
|
+
const payload = `${issuedAt.toString(36)}.${contentHash}`;
|
|
203
|
+
return `${KEY_PREFIX}${payload}.${keyMac(secret, payload)}`;
|
|
204
|
+
}
|
|
205
|
+
/** Whether an idempotency key has the card prefix, so the server must check it before sending. */
|
|
206
|
+
export function isSendConfirmationKey(key) {
|
|
207
|
+
return key.startsWith(KEY_PREFIX);
|
|
208
|
+
}
|
|
209
|
+
/** How long after a card's send an identical send made without the card counts as a repeat of it. */
|
|
210
|
+
export const SEND_CONFIRMATION_REPEAT_WINDOW_MS = 10 * 60 * 1000;
|
|
211
|
+
/** What a send refused as a repeat of a card's send is told. */
|
|
212
|
+
export const SEND_CONFIRMATION_REPEAT_MESSAGE = 'This email may have been sent already from its preview, so it was not sent again. Check your Sent folder. ' +
|
|
213
|
+
`A second copy can be sent after ${SEND_CONFIRMATION_REPEAT_WINDOW_MS / 60_000} minutes.`;
|
|
214
|
+
/** The time, content hash and signature of a key with the card prefix, or `invalid` when it has another shape. */
|
|
215
|
+
function cardKeyParts(key) {
|
|
216
|
+
if (!key.startsWith(KEY_PREFIX))
|
|
217
|
+
return undefined;
|
|
218
|
+
const parts = key.slice(KEY_PREFIX.length).split('.');
|
|
219
|
+
return parts.length === 3 ? parts : 'invalid';
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The hash of the message a card key was issued for, or undefined for any other idempotency key. A product
|
|
223
|
+
* may issue a key with more after the hash, following a `~`, which no hash contains; that part is left out.
|
|
224
|
+
* It checks no signature, so use it only on a key stored with a delivery, where a key that merely has the
|
|
225
|
+
* card's shape can affect only its own member's sends.
|
|
226
|
+
*/
|
|
227
|
+
export function sendConfirmationKeyContentHash(key) {
|
|
228
|
+
const parts = cardKeyParts(key);
|
|
229
|
+
if (!parts || parts === 'invalid')
|
|
230
|
+
return undefined;
|
|
231
|
+
return parts[1].split('~', 1)[0] || undefined;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Whether a send made without the card repeats a send a card just made: the same resolved message, by
|
|
235
|
+
* `sendConfirmationContentHash`, going out within `SEND_CONFIRMATION_REPEAT_WINDOW_MS` of the card's send.
|
|
236
|
+
* A user who clicks Send on the card and then tells the assistant to send would otherwise send the email
|
|
237
|
+
* twice.
|
|
238
|
+
*
|
|
239
|
+
* `cardSends` are the card sends by the same user from the same mailbox that succeeded or are still going
|
|
240
|
+
* out. One that failed, or whose outcome is unknown, doesn't count, so the user can send the email again. A
|
|
241
|
+
* message that differs in any part, such as a reworded body, is a new email and never a repeat. `sendsAt`
|
|
242
|
+
* is when the send goes out: now, or a scheduled send's time.
|
|
243
|
+
*/
|
|
244
|
+
export function repeatsCardSend(contentHash, cardSends, sendsAt = Date.now()) {
|
|
245
|
+
for (const send of cardSends) {
|
|
246
|
+
if (send.contentHash === contentHash && sendsAt - send.sentAt <= SEND_CONFIRMATION_REPEAT_WINDOW_MS)
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Reads a send confirmation key. Returns undefined for any other idempotency key, and `invalid` for a key with
|
|
253
|
+
* the card prefix that this server did not sign or that expired.
|
|
254
|
+
*/
|
|
255
|
+
export function readSendConfirmationKey(secret, key, now = Date.now()) {
|
|
256
|
+
const parts = cardKeyParts(key);
|
|
257
|
+
if (!parts || parts === 'invalid')
|
|
258
|
+
return parts;
|
|
259
|
+
const [time, contentHash, mac] = parts;
|
|
260
|
+
const expected = Buffer.from(keyMac(secret, `${time}.${contentHash}`));
|
|
261
|
+
const received = Buffer.from(mac);
|
|
262
|
+
if (expected.length !== received.length || !timingSafeEqual(expected, received))
|
|
263
|
+
return 'invalid';
|
|
264
|
+
const issuedAt = parseInt(time, 36);
|
|
265
|
+
if (!Number.isSafeInteger(issuedAt) || issuedAt > now + 60_000 || now - issuedAt > SEND_CONFIRMATION_KEY_TTL_MS)
|
|
266
|
+
return 'invalid';
|
|
267
|
+
return { issuedAt, contentHash };
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=apps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/mcp/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,CAAC;AAEvG,2FAA2F;AAC3F,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAClE,8CAA8C;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,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IAClG,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,GAAG,GAAG,MAAM,IAAI,GAAG,GAAG,QAAQ,GAAG,4BAA4B;QAC7G,OAAO,SAAS,CAAC;IACnB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AACnC,CAAC"}
|
package/dist/mcp/index.d.ts
CHANGED
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC"}
|