mcp-sunsama 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/CLAUDE.md +32 -8
- package/bun.lock +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -2
- package/dist/schemas.d.ts +1 -11
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +3 -9
- package/dist/tools/task-tools.d.ts.map +1 -1
- package/dist/tools/task-tools.js +6 -0
- package/package.json +3 -3
- package/scripts/sync-version.ts +35 -0
- package/src/constants.ts +3 -2
- package/src/schemas.ts +4 -13
- package/src/tools/task-tools.ts +7 -0
- package/tsconfig.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# mcp-sunsama
|
|
2
2
|
|
|
3
|
+
## 0.16.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5df00f4: Bump sunsama-api dependency from 0.12.0 to 0.12.1
|
|
8
|
+
- 14c0713: Fix update-task-notes tool failing with MCP error -32603. Removed Zod `.refine()` from schema which was causing MCP SDK to fail parsing the tool parameters. XOR validation between html/markdown is now handled at runtime.
|
|
9
|
+
|
|
3
10
|
## 0.16.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/CLAUDE.md
CHANGED
|
@@ -28,6 +28,31 @@ bun run version # Apply changesets and update version
|
|
|
28
28
|
bun run release # Build and publish to npm
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
## Contribution Workflow
|
|
32
|
+
|
|
33
|
+
**IMPORTANT**: When making changes that affect package users, always create a changeset.
|
|
34
|
+
|
|
35
|
+
### When to Create a Changeset
|
|
36
|
+
- ✅ New user-facing features or tools
|
|
37
|
+
- ✅ Bug fixes that affect npm package users
|
|
38
|
+
- ✅ API changes or breaking changes
|
|
39
|
+
- ✅ Dependency updates that change behavior
|
|
40
|
+
|
|
41
|
+
### When NOT to Create a Changeset
|
|
42
|
+
- ❌ Infrastructure/deployment changes (CI/CD, Docker, Smithery config)
|
|
43
|
+
- ❌ Internal refactoring with no behavior changes
|
|
44
|
+
- ❌ Documentation updates
|
|
45
|
+
- ❌ Development tooling changes
|
|
46
|
+
|
|
47
|
+
### Standard Workflow
|
|
48
|
+
1. Create a branch: `git checkout -b {type}/{short-name}`
|
|
49
|
+
2. Make changes and test: `bun test && bun run typecheck`
|
|
50
|
+
3. **Create a changeset**: `bun run changeset` (if changes affect users)
|
|
51
|
+
4. Commit with conventional format: `git commit -m "fix: description"`
|
|
52
|
+
5. Push and create PR
|
|
53
|
+
|
|
54
|
+
See `CONTRIBUTING.md` for full details.
|
|
55
|
+
|
|
31
56
|
## Architecture Overview
|
|
32
57
|
|
|
33
58
|
### Dual Transport MCP Server
|
|
@@ -87,8 +112,8 @@ All tools use Zod schemas from `schemas.ts`:
|
|
|
87
112
|
- Automatic TypeScript inference
|
|
88
113
|
- Comprehensive parameter documentation
|
|
89
114
|
- Union types for completion filters
|
|
90
|
-
-
|
|
91
|
-
- Example: `update-task-notes` requires either `html` OR `markdown`,
|
|
115
|
+
- **Important**: Avoid using `.refine()` on schemas - it transforms `ZodObject` into `ZodEffects` which the MCP SDK cannot parse (results in empty `properties`). Handle complex validation (e.g., XOR between fields) in the tool's `execute` function instead.
|
|
116
|
+
- Example: `update-task-notes` requires either `html` OR `markdown`, validated at runtime
|
|
92
117
|
- Discriminated unions for task integrations (GitHub, Gmail)
|
|
93
118
|
|
|
94
119
|
### Integration Support
|
|
@@ -235,7 +260,7 @@ Tests are organized in the `__tests__/` directory following standard conventions
|
|
|
235
260
|
## Important Notes
|
|
236
261
|
|
|
237
262
|
### Version Synchronization
|
|
238
|
-
|
|
263
|
+
The MCP server version in `src/constants.ts` is automatically synced from `package.json` when running `bun run version`.
|
|
239
264
|
|
|
240
265
|
### Environment Variables
|
|
241
266
|
Required for stdio transport:
|
|
@@ -262,12 +287,11 @@ Configure different server variants in `mcp-inspector.json` for testing various
|
|
|
262
287
|
|
|
263
288
|
## Version Management
|
|
264
289
|
|
|
265
|
-
|
|
290
|
+
Version is managed automatically via changesets. When you run `bun run version`:
|
|
291
|
+
1. Changesets updates `package.json` version
|
|
292
|
+
2. `scripts/sync-version.ts` automatically syncs the version to `src/constants.ts`
|
|
266
293
|
|
|
267
|
-
|
|
268
|
-
1. Update `package.json` version (done automatically by changesets)
|
|
269
|
-
2. Manually update the FastMCP server version in `src/main.ts` (line 19)
|
|
270
|
-
3. Both versions must be identical for consistency
|
|
294
|
+
No manual version updates needed.
|
|
271
295
|
|
|
272
296
|
## Git Rules
|
|
273
297
|
|
package/bun.lock
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 0,
|
|
3
4
|
"workspaces": {
|
|
4
5
|
"": {
|
|
5
6
|
"name": "mcp-sunsama",
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
"cors": "^2.8.5",
|
|
10
11
|
"express": "^5.1.0",
|
|
11
12
|
"papaparse": "^5.5.3",
|
|
12
|
-
"sunsama-api": "0.12.
|
|
13
|
+
"sunsama-api": "0.12.1",
|
|
13
14
|
"zod": "3.24.4",
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
@@ -396,7 +397,7 @@
|
|
|
396
397
|
|
|
397
398
|
"strip-bom": ["strip-bom@3.0.0", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="],
|
|
398
399
|
|
|
399
|
-
"sunsama-api": ["sunsama-api@0.12.
|
|
400
|
+
"sunsama-api": ["sunsama-api@0.12.1", "", { "dependencies": { "graphql": "^16.11.0", "graphql-tag": "^2.12.6", "marked": "^14.1.3", "tough-cookie": "^5.1.2", "tslib": "^2.8.1", "turndown": "^7.2.0", "yjs": "^13.6.27", "zod": "^3.25.64" } }, "sha512-F2GLJjanAeboP4vYg3VIKP8xxQ/8LLqHhNFx3lm9oONOSvLzVAXEJlwonESuUI/iIf93b2i/jYCJ/2guoUhRYQ=="],
|
|
400
401
|
|
|
401
402
|
"term-size": ["term-size@2.2.1", "", {}, "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg=="],
|
|
402
403
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Application constants
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* VERSION is automatically synced from package.json by scripts/sync-version.ts
|
|
5
|
+
* when running `bun run version`
|
|
5
6
|
*/
|
|
6
|
-
export declare const VERSION = "0.16.
|
|
7
|
+
export declare const VERSION = "0.16.1";
|
|
7
8
|
export declare const SERVER_NAME = "Sunsama API Server";
|
|
8
9
|
export declare const PACKAGE_NAME = "mcp-sunsama";
|
|
9
10
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,WAAW,CAAC;AAChC,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,YAAY,gBAAgB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Application constants
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* VERSION is automatically synced from package.json by scripts/sync-version.ts
|
|
5
|
+
* when running `bun run version`
|
|
5
6
|
*/
|
|
6
|
-
export const VERSION = "0.16.
|
|
7
|
+
export const VERSION = "0.16.1";
|
|
7
8
|
export const SERVER_NAME = "Sunsama API Server";
|
|
8
9
|
export const PACKAGE_NAME = "mcp-sunsama";
|
package/dist/schemas.d.ts
CHANGED
|
@@ -282,7 +282,7 @@ export declare const updateTaskPlannedTimeSchema: z.ZodObject<{
|
|
|
282
282
|
timeEstimateMinutes: number;
|
|
283
283
|
limitResponsePayload?: boolean | undefined;
|
|
284
284
|
}>;
|
|
285
|
-
export declare const updateTaskNotesSchema: z.
|
|
285
|
+
export declare const updateTaskNotesSchema: z.ZodObject<{
|
|
286
286
|
taskId: z.ZodString;
|
|
287
287
|
html: z.ZodOptional<z.ZodString>;
|
|
288
288
|
markdown: z.ZodOptional<z.ZodString>;
|
|
@@ -297,16 +297,6 @@ export declare const updateTaskNotesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
297
297
|
limitResponsePayload?: boolean | undefined;
|
|
298
298
|
html?: string | undefined;
|
|
299
299
|
markdown?: string | undefined;
|
|
300
|
-
}>, {
|
|
301
|
-
taskId: string;
|
|
302
|
-
limitResponsePayload?: boolean | undefined;
|
|
303
|
-
html?: string | undefined;
|
|
304
|
-
markdown?: string | undefined;
|
|
305
|
-
}, {
|
|
306
|
-
taskId: string;
|
|
307
|
-
limitResponsePayload?: boolean | undefined;
|
|
308
|
-
html?: string | undefined;
|
|
309
|
-
markdown?: string | undefined;
|
|
310
300
|
}>;
|
|
311
301
|
export declare const updateTaskDueDateSchema: z.ZodObject<{
|
|
312
302
|
taskId: z.ZodString;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,+CAIjC,CAAC;AAGH,eAAO,MAAM,mBA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|
|
119
119
|
timeEstimateMinutes: z.number().int().min(0).describe("Time estimate in minutes (use 0 to clear the time estimate)"),
|
|
120
120
|
limitResponsePayload: z.boolean().optional().describe("Whether to limit the response payload size"),
|
|
121
121
|
});
|
|
122
|
-
// Update task notes parameters
|
|
122
|
+
// Update task notes parameters
|
|
123
|
+
// Note: XOR validation between html/markdown is done in the tool execute function
|
|
124
|
+
// to keep the schema as a plain ZodObject (required for MCP SDK compatibility)
|
|
123
125
|
export const updateTaskNotesSchema = z.object({
|
|
124
126
|
taskId: z.string().min(1, "Task ID is required").describe("The ID of the task to update notes for"),
|
|
125
127
|
html: z.string().optional().describe("HTML content for the task notes (mutually exclusive with markdown)"),
|
|
126
128
|
markdown: z.string().optional().describe("Markdown content for the task notes (mutually exclusive with html)"),
|
|
127
129
|
limitResponsePayload: z.boolean().optional().describe("Whether to limit the response payload size (defaults to true)"),
|
|
128
|
-
}).refine((data) => {
|
|
129
|
-
// Exactly one of html or markdown must be provided
|
|
130
|
-
const hasHtml = data.html !== undefined;
|
|
131
|
-
const hasMarkdown = data.markdown !== undefined;
|
|
132
|
-
return hasHtml !== hasMarkdown; // XOR: exactly one must be true
|
|
133
|
-
}, {
|
|
134
|
-
message: "Exactly one of 'html' or 'markdown' must be provided",
|
|
135
|
-
path: [], // This will show the error at the root level
|
|
136
130
|
});
|
|
137
131
|
// Update task due date parameters
|
|
138
132
|
export const updateTaskDueDateSchema = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../src/tools/task-tools.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,mBAAmB;;;;;CAU9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;CAqB5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;CA2B/B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;CAS1B,CAAC;AAGH,eAAO,MAAM,cAAc;;;;;CAsCzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;CAqBzB,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;CAqBjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;CA6BnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;CA2BhC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;CAsBpC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;
|
|
1
|
+
{"version":3,"file":"task-tools.d.ts","sourceRoot":"","sources":["../../src/tools/task-tools.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,mBAAmB;;;;;CAU9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;CAqB5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;CA2B/B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;CAS1B,CAAC;AAGH,eAAO,MAAM,cAAc;;;;;CAsCzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;CAqBzB,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;CAqBjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;CA6BnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;CA2BhC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;CAsBpC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;CAwC9B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;CAsBhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;CA8B7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;CAsB/B,CAAC;AAGH,eAAO,MAAM,SAAS;;;;;GAoBrB,CAAC"}
|
package/dist/tools/task-tools.js
CHANGED
|
@@ -180,6 +180,12 @@ export const updateTaskNotesTool = withTransportClient({
|
|
|
180
180
|
description: "Update the notes content for a task",
|
|
181
181
|
parameters: updateTaskNotesSchema,
|
|
182
182
|
execute: async ({ taskId, html, markdown, limitResponsePayload }, context) => {
|
|
183
|
+
// XOR validation: exactly one of html or markdown must be provided
|
|
184
|
+
const hasHtml = html !== undefined;
|
|
185
|
+
const hasMarkdown = markdown !== undefined;
|
|
186
|
+
if (hasHtml === hasMarkdown) {
|
|
187
|
+
throw new Error("Exactly one of 'html' or 'markdown' must be provided");
|
|
188
|
+
}
|
|
183
189
|
const content = html
|
|
184
190
|
? { type: "html", value: html }
|
|
185
191
|
: { type: "markdown", value: markdown };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-sunsama",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "MCP server for Sunsama API integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"postbuild": "chmod +x dist/main.js",
|
|
25
25
|
"inspect": "bunx @modelcontextprotocol/inspector --config ./mcp-inspector.json --server sunsama",
|
|
26
26
|
"changeset": "changeset",
|
|
27
|
-
"version": "changeset version",
|
|
27
|
+
"version": "changeset version && bun scripts/sync-version.ts",
|
|
28
28
|
"release": "npm run build && changeset publish",
|
|
29
29
|
"prepublishOnly": "npm run build:clean"
|
|
30
30
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"cors": "^2.8.5",
|
|
35
35
|
"express": "^5.1.0",
|
|
36
36
|
"papaparse": "^5.5.3",
|
|
37
|
-
"sunsama-api": "0.12.
|
|
37
|
+
"sunsama-api": "0.12.1",
|
|
38
38
|
"zod": "3.24.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Syncs the version from package.json to src/constants.ts
|
|
4
|
+
* Run automatically as part of `bun run version`
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
|
|
10
|
+
const ROOT_DIR = join(import.meta.dirname, "..");
|
|
11
|
+
const PACKAGE_JSON_PATH = join(ROOT_DIR, "package.json");
|
|
12
|
+
const CONSTANTS_PATH = join(ROOT_DIR, "src", "constants.ts");
|
|
13
|
+
|
|
14
|
+
// Read version from package.json
|
|
15
|
+
const packageJson = JSON.parse(readFileSync(PACKAGE_JSON_PATH, "utf-8"));
|
|
16
|
+
const version = packageJson.version;
|
|
17
|
+
|
|
18
|
+
// Read constants.ts
|
|
19
|
+
let constantsContent = readFileSync(CONSTANTS_PATH, "utf-8");
|
|
20
|
+
|
|
21
|
+
// Replace VERSION value
|
|
22
|
+
const versionRegex = /export const VERSION = "[^"]+";/;
|
|
23
|
+
const newVersionLine = `export const VERSION = "${version}";`;
|
|
24
|
+
|
|
25
|
+
if (!versionRegex.test(constantsContent)) {
|
|
26
|
+
console.error("Could not find VERSION export in constants.ts");
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
constantsContent = constantsContent.replace(versionRegex, newVersionLine);
|
|
31
|
+
|
|
32
|
+
// Write back
|
|
33
|
+
writeFileSync(CONSTANTS_PATH, constantsContent);
|
|
34
|
+
|
|
35
|
+
console.log(`Synced VERSION to ${version} in src/constants.ts`);
|
package/src/constants.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Application constants
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* VERSION is automatically synced from package.json by scripts/sync-version.ts
|
|
5
|
+
* when running `bun run version`
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
export const VERSION = "0.16.
|
|
8
|
+
export const VERSION = "0.16.1";
|
|
8
9
|
export const SERVER_NAME = "Sunsama API Server";
|
|
9
10
|
export const PACKAGE_NAME = "mcp-sunsama";
|
package/src/schemas.ts
CHANGED
|
@@ -200,7 +200,9 @@ export const updateTaskPlannedTimeSchema = z.object({
|
|
|
200
200
|
),
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
// Update task notes parameters
|
|
203
|
+
// Update task notes parameters
|
|
204
|
+
// Note: XOR validation between html/markdown is done in the tool execute function
|
|
205
|
+
// to keep the schema as a plain ZodObject (required for MCP SDK compatibility)
|
|
204
206
|
export const updateTaskNotesSchema = z.object({
|
|
205
207
|
taskId: z.string().min(1, "Task ID is required").describe(
|
|
206
208
|
"The ID of the task to update notes for",
|
|
@@ -214,18 +216,7 @@ export const updateTaskNotesSchema = z.object({
|
|
|
214
216
|
limitResponsePayload: z.boolean().optional().describe(
|
|
215
217
|
"Whether to limit the response payload size (defaults to true)",
|
|
216
218
|
),
|
|
217
|
-
})
|
|
218
|
-
(data) => {
|
|
219
|
-
// Exactly one of html or markdown must be provided
|
|
220
|
-
const hasHtml = data.html !== undefined;
|
|
221
|
-
const hasMarkdown = data.markdown !== undefined;
|
|
222
|
-
return hasHtml !== hasMarkdown; // XOR: exactly one must be true
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
message: "Exactly one of 'html' or 'markdown' must be provided",
|
|
226
|
-
path: [], // This will show the error at the root level
|
|
227
|
-
},
|
|
228
|
-
);
|
|
219
|
+
});
|
|
229
220
|
|
|
230
221
|
// Update task due date parameters
|
|
231
222
|
export const updateTaskDueDateSchema = z.object({
|
package/src/tools/task-tools.ts
CHANGED
|
@@ -295,6 +295,13 @@ export const updateTaskNotesTool = withTransportClient({
|
|
|
295
295
|
{ taskId, html, markdown, limitResponsePayload }: UpdateTaskNotesInput,
|
|
296
296
|
context: ToolContext,
|
|
297
297
|
) => {
|
|
298
|
+
// XOR validation: exactly one of html or markdown must be provided
|
|
299
|
+
const hasHtml = html !== undefined;
|
|
300
|
+
const hasMarkdown = markdown !== undefined;
|
|
301
|
+
if (hasHtml === hasMarkdown) {
|
|
302
|
+
throw new Error("Exactly one of 'html' or 'markdown' must be provided");
|
|
303
|
+
}
|
|
304
|
+
|
|
298
305
|
const content = html
|
|
299
306
|
? { type: "html" as const, value: html }
|
|
300
307
|
: { type: "markdown" as const, value: markdown! };
|