@mailquilt/mcp 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/bin.js +1154 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1105 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -3
- package/src/bin.ts +53 -0
- package/src/catalog.ts +188 -0
- package/src/index.ts +32 -0
- package/src/server.ts +299 -0
- package/src/summary.ts +179 -0
- package/src/tools.ts +882 -0
- package/src/workspace.ts +401 -0
package/src/server.ts
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { createInterface } from "node:readline";
|
|
2
|
+
import type { Readable, Writable } from "node:stream";
|
|
3
|
+
|
|
4
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
5
|
+
import { dispatchTool, getToolDefinitions } from "./tools.js";
|
|
6
|
+
import type { McpToolDefinition, McpToolResult } from "./tools.js";
|
|
7
|
+
import { canonicalizeRoot } from "./workspace.js";
|
|
8
|
+
|
|
9
|
+
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
10
|
+
"2025-11-25",
|
|
11
|
+
"2025-06-18",
|
|
12
|
+
"2025-03-26",
|
|
13
|
+
"2024-11-05",
|
|
14
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
const DEFAULT_PROTOCOL_VERSION = "2025-03-26";
|
|
17
|
+
|
|
18
|
+
const JSON_RPC_PARSE_ERROR = -32_700;
|
|
19
|
+
const JSON_RPC_INVALID_REQUEST = -32_600;
|
|
20
|
+
const JSON_RPC_METHOD_NOT_FOUND = -32_601;
|
|
21
|
+
const JSON_RPC_INVALID_PARAMS = -32_602;
|
|
22
|
+
const JSON_RPC_INTERNAL_ERROR = -32_603;
|
|
23
|
+
|
|
24
|
+
type JsonRpcId = string | number | null;
|
|
25
|
+
|
|
26
|
+
export interface JsonRpcSuccess {
|
|
27
|
+
readonly jsonrpc: "2.0";
|
|
28
|
+
readonly id: JsonRpcId;
|
|
29
|
+
readonly result: unknown;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface JsonRpcFailure {
|
|
33
|
+
readonly jsonrpc: "2.0";
|
|
34
|
+
readonly id: JsonRpcId;
|
|
35
|
+
readonly error: {
|
|
36
|
+
readonly code: number;
|
|
37
|
+
readonly message: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type JsonRpcResponse = JsonRpcSuccess | JsonRpcFailure;
|
|
42
|
+
|
|
43
|
+
export interface McpServerOptions {
|
|
44
|
+
/** Workspace root directory; all file reads/writes are restricted inside it. */
|
|
45
|
+
readonly root?: string | undefined;
|
|
46
|
+
/** Optional active `mailquilt dev` preview URL (overrides MAILQUILT_DEV_URL). */
|
|
47
|
+
readonly devUrl?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface McpServer {
|
|
51
|
+
readonly root: string;
|
|
52
|
+
readonly listTools: () => readonly McpToolDefinition[];
|
|
53
|
+
readonly callTool: (
|
|
54
|
+
name: string,
|
|
55
|
+
args?: Record<string, unknown>
|
|
56
|
+
) => Promise<McpToolResult>;
|
|
57
|
+
readonly handleJsonRpcMessage: (
|
|
58
|
+
message: unknown
|
|
59
|
+
) => Promise<JsonRpcResponse | readonly JsonRpcResponse[] | null>;
|
|
60
|
+
readonly handleLine: (line: string) => Promise<string | null>;
|
|
61
|
+
readonly startStdio: (input?: Readable, output?: Writable) => Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
65
|
+
typeof value === "object" && value !== null && !Array.isArray(value);
|
|
66
|
+
|
|
67
|
+
const isValidId = (value: unknown): value is JsonRpcId =>
|
|
68
|
+
value === null ||
|
|
69
|
+
typeof value === "string" ||
|
|
70
|
+
(typeof value === "number" && Number.isFinite(value));
|
|
71
|
+
|
|
72
|
+
const success = (id: JsonRpcId, result: unknown): JsonRpcSuccess => ({
|
|
73
|
+
id,
|
|
74
|
+
jsonrpc: "2.0",
|
|
75
|
+
result,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const failure = (
|
|
79
|
+
id: JsonRpcId,
|
|
80
|
+
code: number,
|
|
81
|
+
message: string
|
|
82
|
+
): JsonRpcFailure => ({
|
|
83
|
+
error: { code, message },
|
|
84
|
+
id,
|
|
85
|
+
jsonrpc: "2.0",
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const negotiateProtocolVersion = (requested: unknown): string => {
|
|
89
|
+
if (
|
|
90
|
+
typeof requested === "string" &&
|
|
91
|
+
(SUPPORTED_PROTOCOL_VERSIONS as readonly string[]).includes(requested)
|
|
92
|
+
) {
|
|
93
|
+
return requested;
|
|
94
|
+
}
|
|
95
|
+
return DEFAULT_PROTOCOL_VERSION;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const handleMethod = async (
|
|
99
|
+
context: { readonly devUrl?: string | undefined; readonly root: string },
|
|
100
|
+
id: JsonRpcId,
|
|
101
|
+
method: string,
|
|
102
|
+
params: unknown
|
|
103
|
+
): Promise<JsonRpcResponse> => {
|
|
104
|
+
switch (method) {
|
|
105
|
+
case "initialize": {
|
|
106
|
+
const requestedVersion = isRecord(params)
|
|
107
|
+
? params.protocolVersion
|
|
108
|
+
: undefined;
|
|
109
|
+
return success(id, {
|
|
110
|
+
capabilities: {
|
|
111
|
+
tools: { listChanged: false },
|
|
112
|
+
},
|
|
113
|
+
instructions:
|
|
114
|
+
"Use list_block_types to inspect live Mail Quilt Block types, Row layouts, and JSON Schemas. All file operations are restricted to the configured workspace root and validated through loadDocument().",
|
|
115
|
+
protocolVersion: negotiateProtocolVersion(requestedVersion),
|
|
116
|
+
serverInfo: {
|
|
117
|
+
name: packageJson.name,
|
|
118
|
+
version: packageJson.version,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
case "ping": {
|
|
123
|
+
return success(id, {});
|
|
124
|
+
}
|
|
125
|
+
case "tools/list": {
|
|
126
|
+
return success(id, { tools: getToolDefinitions() });
|
|
127
|
+
}
|
|
128
|
+
case "tools/call": {
|
|
129
|
+
if (!isRecord(params) || typeof params.name !== "string") {
|
|
130
|
+
return failure(
|
|
131
|
+
id,
|
|
132
|
+
JSON_RPC_INVALID_PARAMS,
|
|
133
|
+
"tools/call requires params.name as a string."
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
const rawArgs = params.arguments ?? {};
|
|
137
|
+
if (!isRecord(rawArgs)) {
|
|
138
|
+
return failure(
|
|
139
|
+
id,
|
|
140
|
+
JSON_RPC_INVALID_PARAMS,
|
|
141
|
+
"tools/call params.arguments must be an object."
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
const result = await dispatchTool(context, params.name, rawArgs);
|
|
145
|
+
if (result === null) {
|
|
146
|
+
return failure(
|
|
147
|
+
id,
|
|
148
|
+
JSON_RPC_INVALID_PARAMS,
|
|
149
|
+
`Unknown tool: ${params.name}`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
return success(id, result);
|
|
153
|
+
}
|
|
154
|
+
default: {
|
|
155
|
+
return failure(
|
|
156
|
+
id,
|
|
157
|
+
JSON_RPC_METHOD_NOT_FOUND,
|
|
158
|
+
`Method not found: ${method}`
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const runSequentialBatch = async (
|
|
165
|
+
items: readonly unknown[],
|
|
166
|
+
index: number,
|
|
167
|
+
handleOne: (item: unknown) => Promise<JsonRpcResponse | null>,
|
|
168
|
+
collected: JsonRpcResponse[]
|
|
169
|
+
): Promise<JsonRpcResponse[]> => {
|
|
170
|
+
if (index >= items.length) {
|
|
171
|
+
return collected;
|
|
172
|
+
}
|
|
173
|
+
const response = await handleOne(items[index]);
|
|
174
|
+
if (response !== null) {
|
|
175
|
+
collected.push(response);
|
|
176
|
+
}
|
|
177
|
+
return await runSequentialBatch(items, index + 1, handleOne, collected);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Creates a Mail Quilt MCP server scoped to `options.root` (default `process.cwd()`).
|
|
182
|
+
*/
|
|
183
|
+
export const createMcpServer = (options: McpServerOptions = {}): McpServer => {
|
|
184
|
+
const root = canonicalizeRoot(options.root ?? process.cwd());
|
|
185
|
+
const context = { devUrl: options.devUrl, root };
|
|
186
|
+
|
|
187
|
+
const callTool = async (
|
|
188
|
+
name: string,
|
|
189
|
+
args: Record<string, unknown> = {}
|
|
190
|
+
): Promise<McpToolResult> => {
|
|
191
|
+
const result = await dispatchTool(context, name, args);
|
|
192
|
+
if (result === null) {
|
|
193
|
+
throw new Error(`Unknown tool "${name}".`);
|
|
194
|
+
}
|
|
195
|
+
return result;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const handleSingleMessage = async (
|
|
199
|
+
message: unknown
|
|
200
|
+
): Promise<JsonRpcResponse | null> => {
|
|
201
|
+
if (!isRecord(message)) {
|
|
202
|
+
return failure(null, JSON_RPC_INVALID_REQUEST, "Invalid Request");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const hasId = Object.hasOwn(message, "id") && message.id !== undefined;
|
|
206
|
+
const id: JsonRpcId = hasId && isValidId(message.id) ? message.id : null;
|
|
207
|
+
|
|
208
|
+
if (message.jsonrpc !== "2.0" || typeof message.method !== "string") {
|
|
209
|
+
return hasId
|
|
210
|
+
? failure(id, JSON_RPC_INVALID_REQUEST, "Invalid Request")
|
|
211
|
+
: null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Notifications carry no `id` and MUST NOT receive a response.
|
|
215
|
+
if (!hasId) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (!isValidId(message.id)) {
|
|
220
|
+
return failure(null, JSON_RPC_INVALID_REQUEST, "Invalid Request id");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
try {
|
|
224
|
+
return await handleMethod(context, id, message.method, message.params);
|
|
225
|
+
} catch (error) {
|
|
226
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
227
|
+
return failure(id, JSON_RPC_INTERNAL_ERROR, detail);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const handleJsonRpcMessage = async (
|
|
232
|
+
message: unknown
|
|
233
|
+
): Promise<JsonRpcResponse | readonly JsonRpcResponse[] | null> => {
|
|
234
|
+
if (Array.isArray(message)) {
|
|
235
|
+
if (message.length === 0) {
|
|
236
|
+
return failure(null, JSON_RPC_INVALID_REQUEST, "Invalid Request");
|
|
237
|
+
}
|
|
238
|
+
const responses = await runSequentialBatch(
|
|
239
|
+
message,
|
|
240
|
+
0,
|
|
241
|
+
handleSingleMessage,
|
|
242
|
+
[]
|
|
243
|
+
);
|
|
244
|
+
return responses.length > 0 ? responses : null;
|
|
245
|
+
}
|
|
246
|
+
return await handleSingleMessage(message);
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const handleLine = async (line: string): Promise<string | null> => {
|
|
250
|
+
const trimmed = line.trim();
|
|
251
|
+
if (trimmed === "") {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
let parsed: unknown;
|
|
255
|
+
try {
|
|
256
|
+
parsed = JSON.parse(trimmed);
|
|
257
|
+
} catch {
|
|
258
|
+
return JSON.stringify(failure(null, JSON_RPC_PARSE_ERROR, "Parse error"));
|
|
259
|
+
}
|
|
260
|
+
const response = await handleJsonRpcMessage(parsed);
|
|
261
|
+
return response === null ? null : JSON.stringify(response);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const startStdio = async (
|
|
265
|
+
input: Readable = process.stdin,
|
|
266
|
+
output: Writable = process.stdout
|
|
267
|
+
): Promise<void> => {
|
|
268
|
+
const lines = createInterface({
|
|
269
|
+
crlfDelay: Number.POSITIVE_INFINITY,
|
|
270
|
+
input,
|
|
271
|
+
});
|
|
272
|
+
for await (const line of lines) {
|
|
273
|
+
const response = await handleLine(line);
|
|
274
|
+
if (response !== null) {
|
|
275
|
+
output.write(`${response}\n`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
return {
|
|
281
|
+
callTool,
|
|
282
|
+
handleJsonRpcMessage,
|
|
283
|
+
handleLine,
|
|
284
|
+
listTools: getToolDefinitions,
|
|
285
|
+
root,
|
|
286
|
+
startStdio,
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/** Starts the Mail Quilt MCP stdio server and resolves once stdin closes. */
|
|
291
|
+
export const startMcpStdioServer = async (
|
|
292
|
+
options: McpServerOptions & {
|
|
293
|
+
readonly input?: Readable | undefined;
|
|
294
|
+
readonly output?: Writable | undefined;
|
|
295
|
+
} = {}
|
|
296
|
+
): Promise<void> => {
|
|
297
|
+
const server = createMcpServer(options);
|
|
298
|
+
await server.startStdio(options.input, options.output);
|
|
299
|
+
};
|
package/src/summary.ts
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { Block, BlocksDocument } from "@mailquilt/core";
|
|
2
|
+
import { rowLayoutOf } from "@mailquilt/core/internal";
|
|
3
|
+
|
|
4
|
+
export interface BlockSummary {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly index: number;
|
|
7
|
+
readonly type: Block["type"];
|
|
8
|
+
readonly preview?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ColumnSummary {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly index: number;
|
|
14
|
+
readonly width: number;
|
|
15
|
+
readonly blockCount: number;
|
|
16
|
+
readonly blocks: readonly BlockSummary[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface RowSummary {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly index: number;
|
|
22
|
+
readonly layout?: string;
|
|
23
|
+
readonly columnCount: number;
|
|
24
|
+
readonly columns: readonly ColumnSummary[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DocumentSummary {
|
|
28
|
+
readonly version: number;
|
|
29
|
+
readonly settings: {
|
|
30
|
+
readonly width: number;
|
|
31
|
+
readonly backgroundColor: string;
|
|
32
|
+
readonly fontFamily: string;
|
|
33
|
+
readonly preheader?: string;
|
|
34
|
+
readonly language?: string;
|
|
35
|
+
readonly hasStyle: boolean;
|
|
36
|
+
};
|
|
37
|
+
readonly rowCount: number;
|
|
38
|
+
readonly blockCount: number;
|
|
39
|
+
readonly rows: readonly RowSummary[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const MAX_PREVIEW_LENGTH = 80;
|
|
43
|
+
|
|
44
|
+
const truncate = (value: string): string => {
|
|
45
|
+
const collapsed = value.replaceAll(/\s+/gu, " ").trim();
|
|
46
|
+
if (collapsed.length <= MAX_PREVIEW_LENGTH) {
|
|
47
|
+
return collapsed;
|
|
48
|
+
}
|
|
49
|
+
return `${collapsed.slice(0, MAX_PREVIEW_LENGTH - 1)}…`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const extractRichTextSnippet = (node: unknown): string => {
|
|
53
|
+
if (typeof node !== "object" || node === null) {
|
|
54
|
+
return "";
|
|
55
|
+
}
|
|
56
|
+
const record = node as Record<string, unknown>;
|
|
57
|
+
if (record.type === "text" && typeof record.text === "string") {
|
|
58
|
+
return record.text;
|
|
59
|
+
}
|
|
60
|
+
if (record.type === "mergeTag") {
|
|
61
|
+
const attrs = record.attrs as { name?: unknown } | undefined;
|
|
62
|
+
return typeof attrs?.name === "string" ? `{{${attrs.name}}}` : "";
|
|
63
|
+
}
|
|
64
|
+
if (record.type === "hardBreak") {
|
|
65
|
+
return " ";
|
|
66
|
+
}
|
|
67
|
+
if (Array.isArray(record.content)) {
|
|
68
|
+
return record.content
|
|
69
|
+
.map((child) => extractRichTextSnippet(child))
|
|
70
|
+
.filter((part) => part !== "")
|
|
71
|
+
.join(" ");
|
|
72
|
+
}
|
|
73
|
+
return "";
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const summarizeBlockPreview = (block: Block): string | undefined => {
|
|
77
|
+
const props = block.props as Record<string, unknown>;
|
|
78
|
+
if ("content" in props) {
|
|
79
|
+
const snippet = truncate(extractRichTextSnippet(props.content));
|
|
80
|
+
if (snippet !== "") {
|
|
81
|
+
return snippet;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (typeof props.label === "string" && props.label.trim() !== "") {
|
|
85
|
+
return truncate(props.label);
|
|
86
|
+
}
|
|
87
|
+
if (typeof props.alt === "string" && props.alt.trim() !== "") {
|
|
88
|
+
return truncate(props.alt);
|
|
89
|
+
}
|
|
90
|
+
if (typeof props.src === "string" && props.src.trim() !== "") {
|
|
91
|
+
return truncate(props.src);
|
|
92
|
+
}
|
|
93
|
+
if (typeof props.url === "string" && props.url.trim() !== "") {
|
|
94
|
+
return truncate(props.url);
|
|
95
|
+
}
|
|
96
|
+
if (Array.isArray(props.links)) {
|
|
97
|
+
const items = props.links
|
|
98
|
+
.map((item) => {
|
|
99
|
+
if (typeof item !== "object" || item === null) {
|
|
100
|
+
return "";
|
|
101
|
+
}
|
|
102
|
+
const entry = item as Record<string, unknown>;
|
|
103
|
+
if (typeof entry.label === "string" && entry.label.trim() !== "") {
|
|
104
|
+
return entry.label.trim();
|
|
105
|
+
}
|
|
106
|
+
if (typeof entry.network === "string") {
|
|
107
|
+
return entry.network;
|
|
108
|
+
}
|
|
109
|
+
return "";
|
|
110
|
+
})
|
|
111
|
+
.filter((part) => part !== "");
|
|
112
|
+
if (items.length > 0) {
|
|
113
|
+
return truncate(items.join(", "));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (typeof props.height === "number") {
|
|
117
|
+
return `${props.height}px`;
|
|
118
|
+
}
|
|
119
|
+
if (typeof props.thickness === "number") {
|
|
120
|
+
return `${props.thickness}px`;
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Produces a concise structural outline of an email (Rows, Columns, Blocks and
|
|
127
|
+
* their IDs) so agents can target Commands without scanning full ProseMirror JSON.
|
|
128
|
+
*/
|
|
129
|
+
export const summarizeDocument = (
|
|
130
|
+
document: BlocksDocument
|
|
131
|
+
): DocumentSummary => {
|
|
132
|
+
let blockCount = 0;
|
|
133
|
+
const rows: RowSummary[] = document.rows.map((row, rowIndex) => {
|
|
134
|
+
const layout = rowLayoutOf(row);
|
|
135
|
+
const columns: ColumnSummary[] = row.columns.map((column, columnIndex) => {
|
|
136
|
+
const blocks: BlockSummary[] = column.blocks.map((block, blockIndex) => {
|
|
137
|
+
blockCount += 1;
|
|
138
|
+
const preview = summarizeBlockPreview(block);
|
|
139
|
+
return preview === undefined
|
|
140
|
+
? { id: block.id, index: blockIndex, type: block.type }
|
|
141
|
+
: { id: block.id, index: blockIndex, preview, type: block.type };
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
blockCount: blocks.length,
|
|
145
|
+
blocks,
|
|
146
|
+
id: column.id,
|
|
147
|
+
index: columnIndex,
|
|
148
|
+
width: column.width,
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
return {
|
|
152
|
+
columnCount: columns.length,
|
|
153
|
+
columns,
|
|
154
|
+
id: row.id,
|
|
155
|
+
index: rowIndex,
|
|
156
|
+
...(layout === undefined ? {} : { layout }),
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const { settings } = document;
|
|
161
|
+
return {
|
|
162
|
+
blockCount,
|
|
163
|
+
rowCount: rows.length,
|
|
164
|
+
rows,
|
|
165
|
+
settings: {
|
|
166
|
+
backgroundColor: settings.backgroundColor,
|
|
167
|
+
fontFamily: settings.fontFamily,
|
|
168
|
+
hasStyle: settings.style !== undefined,
|
|
169
|
+
...(settings.language === undefined
|
|
170
|
+
? {}
|
|
171
|
+
: { language: settings.language }),
|
|
172
|
+
...(settings.preheader === undefined
|
|
173
|
+
? {}
|
|
174
|
+
: { preheader: settings.preheader }),
|
|
175
|
+
width: settings.width,
|
|
176
|
+
},
|
|
177
|
+
version: document.version,
|
|
178
|
+
};
|
|
179
|
+
};
|