@bendyline/docblocks-cli 1.1.2 → 2.1.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 +55 -94
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7183 -18
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
- package/dist/commands/build.d.ts +0 -14
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -74
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/convert.d.ts +0 -32
- package/dist/commands/convert.d.ts.map +0 -1
- package/dist/commands/convert.js +0 -168
- package/dist/commands/convert.js.map +0 -1
- package/dist/commands/init.d.ts +0 -3
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -23
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -12
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -20
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/parse.d.ts +0 -6
- package/dist/commands/parse.d.ts.map +0 -1
- package/dist/commands/parse.js +0 -38
- package/dist/commands/parse.js.map +0 -1
- package/dist/commands/serve.d.ts +0 -28
- package/dist/commands/serve.d.ts.map +0 -1
- package/dist/commands/serve.js +0 -182
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/themes.d.ts +0 -6
- package/dist/commands/themes.d.ts.map +0 -1
- package/dist/commands/themes.js +0 -15
- package/dist/commands/themes.js.map +0 -1
- package/dist/commands/transforms.d.ts +0 -6
- package/dist/commands/transforms.d.ts.map +0 -1
- package/dist/commands/transforms.js +0 -15
- package/dist/commands/transforms.js.map +0 -1
- package/dist/commands/video.d.ts +0 -31
- package/dist/commands/video.d.ts.map +0 -1
- package/dist/commands/video.js +0 -116
- package/dist/commands/video.js.map +0 -1
- package/dist/converters/docx-to-md.d.ts +0 -10
- package/dist/converters/docx-to-md.d.ts.map +0 -1
- package/dist/converters/docx-to-md.js +0 -17
- package/dist/converters/docx-to-md.js.map +0 -1
- package/dist/converters/pdf-to-md.d.ts +0 -14
- package/dist/converters/pdf-to-md.d.ts.map +0 -1
- package/dist/converters/pdf-to-md.js +0 -51
- package/dist/converters/pdf-to-md.js.map +0 -1
- package/dist/converters/pptx-to-md.d.ts +0 -13
- package/dist/converters/pptx-to-md.d.ts.map +0 -1
- package/dist/converters/pptx-to-md.js +0 -67
- package/dist/converters/pptx-to-md.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/mcp/server.d.ts +0 -12
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -518
- package/dist/mcp/server.js.map +0 -1
- package/dist/render-html.d.ts +0 -9
- package/dist/render-html.d.ts.map +0 -1
- package/dist/render-html.js +0 -60
- package/dist/render-html.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -15
- package/dist/version.js.map +0 -1
package/dist/mcp/server.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DocBlocks MCP Server
|
|
3
|
-
*
|
|
4
|
-
* Exposes document conversion, analysis, and transformation tools
|
|
5
|
-
* via the Model Context Protocol (MCP) over stdio.
|
|
6
|
-
*
|
|
7
|
-
* Designed for AI agents: tools accept raw markdown text so agents
|
|
8
|
-
* can write content and immediately export it without temp files.
|
|
9
|
-
*/
|
|
10
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
11
|
-
export declare function createMcpServer(): McpServer;
|
|
12
|
-
//# sourceMappingURL=server.d.ts.map
|
package/dist/mcp/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA+DpE,wBAAgB,eAAe,IAAI,SAAS,CA8iB3C"}
|
package/dist/mcp/server.js
DELETED
|
@@ -1,518 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DocBlocks MCP Server
|
|
3
|
-
*
|
|
4
|
-
* Exposes document conversion, analysis, and transformation tools
|
|
5
|
-
* via the Model Context Protocol (MCP) over stdio.
|
|
6
|
-
*
|
|
7
|
-
* Designed for AI agents: tools accept raw markdown text so agents
|
|
8
|
-
* can write content and immediately export it without temp files.
|
|
9
|
-
*/
|
|
10
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
11
|
-
import { z } from 'zod';
|
|
12
|
-
import { writeFile, readFile, stat, rm, rename } from 'node:fs/promises';
|
|
13
|
-
import { resolve, dirname, join } from 'node:path';
|
|
14
|
-
import { tmpdir } from 'node:os';
|
|
15
|
-
import { randomBytes } from 'node:crypto';
|
|
16
|
-
import { getPackageVersion } from '../version.js';
|
|
17
|
-
/**
|
|
18
|
-
* Resolve markdown input: either raw text or a file path.
|
|
19
|
-
* Returns the resolved file path (writing to a temp file if given raw text).
|
|
20
|
-
*/
|
|
21
|
-
async function resolveMarkdownInput(markdown) {
|
|
22
|
-
// If it looks like a file path (no newlines, ends with known ext or exists on disk)
|
|
23
|
-
if (!markdown.includes('\n') && markdown.length < 500) {
|
|
24
|
-
try {
|
|
25
|
-
const resolved = resolve(markdown);
|
|
26
|
-
const info = await stat(resolved);
|
|
27
|
-
if (info.isFile() || info.isDirectory()) {
|
|
28
|
-
return { filePath: resolved, isTemp: false };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
// Not a valid path — treat as raw markdown
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// Write raw markdown to a temp file
|
|
36
|
-
const tmpId = randomBytes(8).toString('hex');
|
|
37
|
-
const tmpPath = join(tmpdir(), `docblocks-mcp-${tmpId}.md`);
|
|
38
|
-
await writeFile(tmpPath, markdown, 'utf-8');
|
|
39
|
-
return { filePath: tmpPath, isTemp: true };
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Clean up a temp file if needed.
|
|
43
|
-
*/
|
|
44
|
-
async function cleanupTemp(filePath, isTemp) {
|
|
45
|
-
if (isTemp) {
|
|
46
|
-
await rm(filePath, { force: true });
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Resolve markdown input to text content. Used by tools that operate
|
|
51
|
-
* on the markdown string directly (analyze, restyle) rather than via file.
|
|
52
|
-
*/
|
|
53
|
-
async function resolveMarkdownText(markdown) {
|
|
54
|
-
if (!markdown.includes('\n') && markdown.length < 500) {
|
|
55
|
-
try {
|
|
56
|
-
const resolved = resolve(markdown);
|
|
57
|
-
const info = await stat(resolved);
|
|
58
|
-
if (info.isFile()) {
|
|
59
|
-
return await readFile(resolved, 'utf-8');
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
// Not a valid path — use as-is
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return markdown;
|
|
67
|
-
}
|
|
68
|
-
export function createMcpServer() {
|
|
69
|
-
const server = new McpServer({
|
|
70
|
-
name: 'docblocks',
|
|
71
|
-
version: getPackageVersion(),
|
|
72
|
-
});
|
|
73
|
-
// ── Export Tools ─────────────────────────────────────────────────
|
|
74
|
-
const EXPORT_FORMATS = [
|
|
75
|
-
{
|
|
76
|
-
format: 'docx',
|
|
77
|
-
description: 'Export a markdown document to a polished Microsoft Word (.docx) file with professional formatting and themes. Accepts raw markdown text or a file path.',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
format: 'pdf',
|
|
81
|
-
description: 'Export a markdown document to a styled PDF file. Accepts raw markdown text or a file path.',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
format: 'pptx',
|
|
85
|
-
description: 'Export a markdown document to a PowerPoint presentation — each section becomes a slide. Accepts raw markdown text or a file path.',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
format: 'html',
|
|
89
|
-
description: 'Export a markdown document to a self-contained interactive HTML page with an embedded player. Accepts raw markdown text or a file path.',
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
for (const { format, description } of EXPORT_FORMATS) {
|
|
93
|
-
server.tool(`export_markdown_to_${format}`, description, {
|
|
94
|
-
markdown: z
|
|
95
|
-
.string()
|
|
96
|
-
.describe('Raw markdown text or path to a .md/.zip/.dbk file or folder'),
|
|
97
|
-
outputPath: z.string().describe(`Output .${format} file path`),
|
|
98
|
-
theme: z.string().optional().describe('Visual theme ID (use list_themes to see options)'),
|
|
99
|
-
transform: z
|
|
100
|
-
.string()
|
|
101
|
-
.optional()
|
|
102
|
-
.describe('Transform style to apply before export (use list_transform_styles to see options)'),
|
|
103
|
-
}, async ({ markdown, outputPath, theme, transform }) => {
|
|
104
|
-
const { filePath, isTemp } = await resolveMarkdownInput(markdown);
|
|
105
|
-
try {
|
|
106
|
-
const { runConvert } = await import('../commands/convert.js');
|
|
107
|
-
const resolvedOutput = resolve(outputPath);
|
|
108
|
-
const result = await runConvert(filePath, {
|
|
109
|
-
outputDir: dirname(resolvedOutput),
|
|
110
|
-
formats: format,
|
|
111
|
-
theme,
|
|
112
|
-
transform,
|
|
113
|
-
});
|
|
114
|
-
const file = result.outputFiles[0];
|
|
115
|
-
// runConvert names the output after the input basename; rename to
|
|
116
|
-
// honor the caller's requested outputPath.
|
|
117
|
-
if (file.path !== resolvedOutput) {
|
|
118
|
-
await rename(file.path, resolvedOutput);
|
|
119
|
-
file.path = resolvedOutput;
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
content: [
|
|
123
|
-
{
|
|
124
|
-
type: 'text',
|
|
125
|
-
text: JSON.stringify({
|
|
126
|
-
outputPath: file.path,
|
|
127
|
-
fileSize: file.size,
|
|
128
|
-
format,
|
|
129
|
-
}),
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
finally {
|
|
135
|
-
await cleanupTemp(filePath, isTemp);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
server.tool('export_markdown_to_video', 'Render a markdown document as an MP4 video with narration-synced animations. Requires ffmpeg and Playwright. Accepts raw markdown text or a file path.', {
|
|
140
|
-
markdown: z.string().describe('Raw markdown text or path to a .md/.zip/.dbk file or folder'),
|
|
141
|
-
outputPath: z.string().describe('Output .mp4 file path'),
|
|
142
|
-
fps: z.number().min(1).max(120).optional().describe('Frames per second (default: 30)'),
|
|
143
|
-
quality: z
|
|
144
|
-
.enum(['draft', 'normal', 'high'])
|
|
145
|
-
.optional()
|
|
146
|
-
.describe('Encoding quality (default: normal)'),
|
|
147
|
-
orientation: z
|
|
148
|
-
.enum(['landscape', 'portrait'])
|
|
149
|
-
.optional()
|
|
150
|
-
.describe('Video orientation (default: landscape)'),
|
|
151
|
-
captions: z
|
|
152
|
-
.enum(['off', 'standard', 'social'])
|
|
153
|
-
.optional()
|
|
154
|
-
.describe('Caption style (default: off)'),
|
|
155
|
-
width: z.number().optional().describe('Override video width in pixels'),
|
|
156
|
-
height: z.number().optional().describe('Override video height in pixels'),
|
|
157
|
-
}, async ({ markdown, outputPath, fps, quality, orientation, captions, width, height }) => {
|
|
158
|
-
const { filePath, isTemp } = await resolveMarkdownInput(markdown);
|
|
159
|
-
try {
|
|
160
|
-
const { runVideo } = await import('../commands/video.js');
|
|
161
|
-
const result = await runVideo(filePath, {
|
|
162
|
-
output: outputPath,
|
|
163
|
-
fps,
|
|
164
|
-
quality,
|
|
165
|
-
orientation,
|
|
166
|
-
captions: captions,
|
|
167
|
-
width,
|
|
168
|
-
height,
|
|
169
|
-
});
|
|
170
|
-
return {
|
|
171
|
-
content: [
|
|
172
|
-
{
|
|
173
|
-
type: 'text',
|
|
174
|
-
text: JSON.stringify({
|
|
175
|
-
outputPath: result.outputPath,
|
|
176
|
-
duration: result.duration,
|
|
177
|
-
frameCount: result.frameCount,
|
|
178
|
-
}),
|
|
179
|
-
},
|
|
180
|
-
],
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
finally {
|
|
184
|
-
await cleanupTemp(filePath, isTemp);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
// ── Reverse Conversion Tools ─────────────────────────────────────
|
|
188
|
-
const REVERSE_FORMATS = [
|
|
189
|
-
{
|
|
190
|
-
ext: 'docx',
|
|
191
|
-
description: 'Convert a Microsoft Word (.docx) file to Markdown. Preserves headings, paragraphs, emphasis, lists, and tables on a best-effort basis.',
|
|
192
|
-
loader: async () => (await import('../converters/docx-to-md.js')).docxToMarkdown,
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
ext: 'pptx',
|
|
196
|
-
description: 'Convert a PowerPoint (.pptx) file to Markdown. Each slide becomes a section; the first paragraph on each slide is treated as the slide title.',
|
|
197
|
-
loader: async () => (await import('../converters/pptx-to-md.js')).pptxToMarkdown,
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
ext: 'pdf',
|
|
201
|
-
description: 'Convert a PDF file to Markdown. Extracts text from each page; formatting and layout are not preserved. Each page becomes a section.',
|
|
202
|
-
loader: async () => (await import('../converters/pdf-to-md.js')).pdfToMarkdown,
|
|
203
|
-
},
|
|
204
|
-
];
|
|
205
|
-
for (const { ext, description, loader } of REVERSE_FORMATS) {
|
|
206
|
-
server.tool(`convert_${ext}_to_markdown`, description, {
|
|
207
|
-
inputPath: z.string().describe(`Path to the source .${ext} file`),
|
|
208
|
-
outputPath: z
|
|
209
|
-
.string()
|
|
210
|
-
.optional()
|
|
211
|
-
.describe('If provided, write the resulting markdown to this file path'),
|
|
212
|
-
}, async ({ inputPath, outputPath }) => {
|
|
213
|
-
const convert = await loader();
|
|
214
|
-
const resolvedInput = resolve(inputPath);
|
|
215
|
-
const markdown = await convert(resolvedInput);
|
|
216
|
-
if (outputPath) {
|
|
217
|
-
await writeFile(resolve(outputPath), markdown, 'utf-8');
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
content: [
|
|
221
|
-
{
|
|
222
|
-
type: 'text',
|
|
223
|
-
text: markdown,
|
|
224
|
-
},
|
|
225
|
-
],
|
|
226
|
-
};
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
// ── Markdown Intelligence Tools ──────────────────────────────────
|
|
230
|
-
server.tool('analyze_markdown', "Analyze a markdown document's structure, extracting key content elements: statistics, quotes, dates, facts, comparisons, and lists. Use this to understand what a document contains before choosing a theme or transform. Accepts raw markdown text or a file path.", {
|
|
231
|
-
markdown: z.string().describe('Raw markdown text or path to a .md file'),
|
|
232
|
-
}, async ({ markdown }) => {
|
|
233
|
-
const content = await resolveMarkdownText(markdown);
|
|
234
|
-
const { parseMarkdown } = await import('@bendyline/squisq/markdown');
|
|
235
|
-
const { extractContent } = await import('@bendyline/squisq/generate');
|
|
236
|
-
const { markdownToDoc } = await import('@bendyline/squisq/doc');
|
|
237
|
-
const markdownDoc = parseMarkdown(content);
|
|
238
|
-
const doc = markdownToDoc(markdownDoc);
|
|
239
|
-
// Extract content elements
|
|
240
|
-
const extracted = extractContent(content);
|
|
241
|
-
// Compute structure stats
|
|
242
|
-
const stats = {
|
|
243
|
-
blockCount: doc.blocks?.length ?? 0,
|
|
244
|
-
headingCount: 0,
|
|
245
|
-
paragraphCount: 0,
|
|
246
|
-
wordCount: content.split(/\s+/).filter(Boolean).length,
|
|
247
|
-
characterCount: content.length,
|
|
248
|
-
};
|
|
249
|
-
if (markdownDoc.children) {
|
|
250
|
-
for (const node of markdownDoc.children) {
|
|
251
|
-
if (node.type === 'heading')
|
|
252
|
-
stats.headingCount++;
|
|
253
|
-
if (node.type === 'paragraph')
|
|
254
|
-
stats.paragraphCount++;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return {
|
|
258
|
-
content: [
|
|
259
|
-
{
|
|
260
|
-
type: 'text',
|
|
261
|
-
text: JSON.stringify({ stats, extracted }, null, 2),
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
};
|
|
265
|
-
});
|
|
266
|
-
server.tool('restyle_markdown', 'Restyle a markdown document by applying a visual transform — restructures content for a specific presentation style (documentary, magazine, data-driven, narrative, minimal). Returns the transformed markdown text. Use list_transform_styles to see available styles. Accepts raw markdown text or a file path.', {
|
|
267
|
-
markdown: z.string().describe('Raw markdown text or path to a .md file'),
|
|
268
|
-
style: z.string().describe('Transform style ID (use list_transform_styles to see options)'),
|
|
269
|
-
theme: z
|
|
270
|
-
.string()
|
|
271
|
-
.optional()
|
|
272
|
-
.describe('Visual theme ID to apply (use list_themes to see options)'),
|
|
273
|
-
outputPath: z
|
|
274
|
-
.string()
|
|
275
|
-
.optional()
|
|
276
|
-
.describe('If provided, write the transformed markdown to this file path'),
|
|
277
|
-
}, async ({ markdown, style, theme, outputPath }) => {
|
|
278
|
-
const content = await resolveMarkdownText(markdown);
|
|
279
|
-
const { getTransformStyleIds } = await import('@bendyline/squisq/transform');
|
|
280
|
-
const validStyles = getTransformStyleIds();
|
|
281
|
-
if (!validStyles.includes(style)) {
|
|
282
|
-
return {
|
|
283
|
-
content: [
|
|
284
|
-
{
|
|
285
|
-
type: 'text',
|
|
286
|
-
text: `Unknown transform style "${style}". Available: ${validStyles.join(', ')}`,
|
|
287
|
-
},
|
|
288
|
-
],
|
|
289
|
-
isError: true,
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
const { parseMarkdown, stringifyMarkdown } = await import('@bendyline/squisq/markdown');
|
|
293
|
-
const { MemoryContentContainer } = await import('@bendyline/squisq/storage');
|
|
294
|
-
const { applyTransformToMarkdown } = await import('../commands/convert.js');
|
|
295
|
-
const markdownDoc = parseMarkdown(content);
|
|
296
|
-
const container = new MemoryContentContainer();
|
|
297
|
-
const transformedMarkdownDoc = await applyTransformToMarkdown(markdownDoc, container, style, theme);
|
|
298
|
-
const transformedText = stringifyMarkdown(transformedMarkdownDoc);
|
|
299
|
-
if (outputPath) {
|
|
300
|
-
await writeFile(resolve(outputPath), transformedText, 'utf-8');
|
|
301
|
-
}
|
|
302
|
-
return {
|
|
303
|
-
content: [
|
|
304
|
-
{
|
|
305
|
-
type: 'text',
|
|
306
|
-
text: transformedText,
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
};
|
|
310
|
-
});
|
|
311
|
-
// ── Discovery Tools ──────────────────────────────────────────────
|
|
312
|
-
server.tool('list_themes', 'List all available visual themes (e.g., documentary, cinematic, bold) with descriptions. Use to choose a theme before exporting.', {}, async () => {
|
|
313
|
-
const { getThemeSummaries } = await import('@bendyline/squisq/schemas');
|
|
314
|
-
const themes = getThemeSummaries();
|
|
315
|
-
return {
|
|
316
|
-
content: [
|
|
317
|
-
{
|
|
318
|
-
type: 'text',
|
|
319
|
-
text: JSON.stringify(themes, null, 2),
|
|
320
|
-
},
|
|
321
|
-
],
|
|
322
|
-
};
|
|
323
|
-
});
|
|
324
|
-
server.tool('list_transform_styles', 'List all available transform styles (e.g., documentary, magazine, minimal) with descriptions. Use before calling restyle_markdown to see what styles are available.', {}, async () => {
|
|
325
|
-
const { getTransformStyleSummaries } = await import('@bendyline/squisq/transform');
|
|
326
|
-
const styles = getTransformStyleSummaries();
|
|
327
|
-
return {
|
|
328
|
-
content: [
|
|
329
|
-
{
|
|
330
|
-
type: 'text',
|
|
331
|
-
text: JSON.stringify(styles, null, 2),
|
|
332
|
-
},
|
|
333
|
-
],
|
|
334
|
-
};
|
|
335
|
-
});
|
|
336
|
-
server.tool('list_export_formats', 'List all supported export formats with descriptions of what each produces. Use to help choose the right output format.', {}, async () => {
|
|
337
|
-
const formats = {
|
|
338
|
-
input: [
|
|
339
|
-
{ ext: '.md', description: 'Markdown file' },
|
|
340
|
-
{ ext: '.zip/.dbk', description: 'Container archive with embedded media' },
|
|
341
|
-
{ ext: 'folder', description: 'Directory with markdown and media files' },
|
|
342
|
-
{
|
|
343
|
-
ext: '.docx',
|
|
344
|
-
description: 'Microsoft Word document — via convert_docx_to_markdown',
|
|
345
|
-
tool: 'convert_docx_to_markdown',
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
ext: '.pptx',
|
|
349
|
-
description: 'PowerPoint presentation — via convert_pptx_to_markdown',
|
|
350
|
-
tool: 'convert_pptx_to_markdown',
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
ext: '.pdf',
|
|
354
|
-
description: 'PDF document — via convert_pdf_to_markdown',
|
|
355
|
-
tool: 'convert_pdf_to_markdown',
|
|
356
|
-
},
|
|
357
|
-
],
|
|
358
|
-
output: [
|
|
359
|
-
{
|
|
360
|
-
format: 'docx',
|
|
361
|
-
description: 'Microsoft Word document with professional formatting',
|
|
362
|
-
tool: 'export_markdown_to_docx',
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
format: 'pdf',
|
|
366
|
-
description: 'Styled PDF document',
|
|
367
|
-
tool: 'export_markdown_to_pdf',
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
format: 'pptx',
|
|
371
|
-
description: 'PowerPoint presentation — each section becomes a slide',
|
|
372
|
-
tool: 'export_markdown_to_pptx',
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
format: 'html',
|
|
376
|
-
description: 'Self-contained interactive HTML page with embedded player',
|
|
377
|
-
tool: 'export_markdown_to_html',
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
format: 'mp4',
|
|
381
|
-
description: 'Video with narration-synced animations (requires ffmpeg)',
|
|
382
|
-
tool: 'export_markdown_to_video',
|
|
383
|
-
},
|
|
384
|
-
],
|
|
385
|
-
};
|
|
386
|
-
return {
|
|
387
|
-
content: [
|
|
388
|
-
{
|
|
389
|
-
type: 'text',
|
|
390
|
-
text: JSON.stringify(formats, null, 2),
|
|
391
|
-
},
|
|
392
|
-
],
|
|
393
|
-
};
|
|
394
|
-
});
|
|
395
|
-
// ── Resources ────────────────────────────────────────────────────
|
|
396
|
-
server.resource('formats', 'docblocks://formats', async () => {
|
|
397
|
-
return {
|
|
398
|
-
contents: [
|
|
399
|
-
{
|
|
400
|
-
uri: 'docblocks://formats',
|
|
401
|
-
mimeType: 'application/json',
|
|
402
|
-
text: JSON.stringify({
|
|
403
|
-
description: 'DocBlocks supports converting markdown documents to multiple professional output formats',
|
|
404
|
-
inputFormats: ['.md', '.zip', '.dbk', 'folder', '.docx', '.pptx', '.pdf'],
|
|
405
|
-
outputFormats: ['docx', 'pptx', 'pdf', 'html', 'mp4', 'dbk', 'markdown'],
|
|
406
|
-
}, null, 2),
|
|
407
|
-
},
|
|
408
|
-
],
|
|
409
|
-
};
|
|
410
|
-
});
|
|
411
|
-
// ── Prompts ──────────────────────────────────────────────────────
|
|
412
|
-
server.prompt('create-presentation', 'Create a presentation-ready document from markdown. Guides you through writing content, choosing a theme, applying a transform style, and exporting to PPTX or PDF.', {
|
|
413
|
-
topic: z.string().describe('The topic or subject for the presentation'),
|
|
414
|
-
style: z
|
|
415
|
-
.string()
|
|
416
|
-
.optional()
|
|
417
|
-
.describe('Transform style (documentary, magazine, data-driven, narrative, minimal). If omitted, you will be guided to choose.'),
|
|
418
|
-
}, async ({ topic, style }) => {
|
|
419
|
-
return {
|
|
420
|
-
messages: [
|
|
421
|
-
{
|
|
422
|
-
role: 'user',
|
|
423
|
-
content: {
|
|
424
|
-
type: 'text',
|
|
425
|
-
text: `Create a presentation about: ${topic}
|
|
426
|
-
|
|
427
|
-
Instructions for the AI agent:
|
|
428
|
-
|
|
429
|
-
1. First, call list_themes and list_transform_styles to see available options.
|
|
430
|
-
2. Write well-structured markdown content about the topic. Structure it with clear sections using ## headings — each heading becomes a slide.
|
|
431
|
-
3. Call restyle_markdown with style="${style ?? 'documentary'}" to transform the content for presentation.
|
|
432
|
-
4. Review the restyled markdown and make any adjustments.
|
|
433
|
-
5. Call export_markdown_to_pptx to generate the PowerPoint file.
|
|
434
|
-
|
|
435
|
-
Tips for great presentations:
|
|
436
|
-
- Use ## for slide breaks
|
|
437
|
-
- Keep each section focused on one idea
|
|
438
|
-
- Include statistics and quotes when relevant — they become visual highlights
|
|
439
|
-
- Use bullet lists for key points
|
|
440
|
-
- Add image references with  for visual slides`,
|
|
441
|
-
},
|
|
442
|
-
},
|
|
443
|
-
],
|
|
444
|
-
};
|
|
445
|
-
});
|
|
446
|
-
server.prompt('create-video', 'Create a video from markdown content. Guides you through writing content optimized for video, choosing a theme, and rendering to MP4.', {
|
|
447
|
-
topic: z.string().describe('The topic or subject for the video'),
|
|
448
|
-
orientation: z
|
|
449
|
-
.enum(['landscape', 'portrait'])
|
|
450
|
-
.optional()
|
|
451
|
-
.describe('Video orientation (default: landscape)'),
|
|
452
|
-
}, async ({ topic, orientation }) => {
|
|
453
|
-
return {
|
|
454
|
-
messages: [
|
|
455
|
-
{
|
|
456
|
-
role: 'user',
|
|
457
|
-
content: {
|
|
458
|
-
type: 'text',
|
|
459
|
-
text: `Create a video about: ${topic}
|
|
460
|
-
|
|
461
|
-
Instructions for the AI agent:
|
|
462
|
-
|
|
463
|
-
1. First, call list_themes to see available visual themes.
|
|
464
|
-
2. Write markdown content optimized for video presentation. The document will be rendered as an animated sequence.
|
|
465
|
-
3. Call analyze_markdown to understand the content structure and choose the best theme.
|
|
466
|
-
4. Call export_markdown_to_video with orientation="${orientation ?? 'landscape'}" to render the video.
|
|
467
|
-
|
|
468
|
-
Tips for great video content:
|
|
469
|
-
- Use clear ## section headings — they create visual transitions
|
|
470
|
-
- Include statistics (numbers with context) — they animate dramatically
|
|
471
|
-
- Add quotes with attribution — they get cinematic treatment
|
|
472
|
-
- Keep paragraphs concise — each maps to a timed visual block
|
|
473
|
-
- The video player auto-times content, so focus on clarity over length`,
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
],
|
|
477
|
-
};
|
|
478
|
-
});
|
|
479
|
-
server.prompt('create-document', 'Create a professional document from markdown. Guides you through writing content, choosing a theme, and exporting to DOCX or PDF.', {
|
|
480
|
-
topic: z.string().describe('The topic or subject for the document'),
|
|
481
|
-
format: z.enum(['docx', 'pdf']).optional().describe('Output format (default: pdf)'),
|
|
482
|
-
}, async ({ topic, format }) => {
|
|
483
|
-
const outputFormat = format ?? 'pdf';
|
|
484
|
-
const toolName = outputFormat === 'docx' ? 'export_markdown_to_docx' : 'export_markdown_to_pdf';
|
|
485
|
-
return {
|
|
486
|
-
messages: [
|
|
487
|
-
{
|
|
488
|
-
role: 'user',
|
|
489
|
-
content: {
|
|
490
|
-
type: 'text',
|
|
491
|
-
text: `Create a professional document about: ${topic}
|
|
492
|
-
|
|
493
|
-
Instructions for the AI agent:
|
|
494
|
-
|
|
495
|
-
1. First, call list_themes to see available visual themes.
|
|
496
|
-
2. Write well-structured markdown content. Use standard markdown formatting:
|
|
497
|
-
- # for the document title
|
|
498
|
-
- ## for major sections
|
|
499
|
-
- ### for subsections
|
|
500
|
-
- **bold** and *italic* for emphasis
|
|
501
|
-
- > for important quotes or callouts
|
|
502
|
-
- Numbered and bullet lists for organized content
|
|
503
|
-
3. Optionally call restyle_markdown to apply a professional transform.
|
|
504
|
-
4. Call ${toolName} to generate the final document.
|
|
505
|
-
|
|
506
|
-
Tips for professional documents:
|
|
507
|
-
- Start with a clear title and introduction
|
|
508
|
-
- Use consistent heading hierarchy
|
|
509
|
-
- Include data and statistics where appropriate
|
|
510
|
-
- End with a conclusion or summary section`,
|
|
511
|
-
},
|
|
512
|
-
},
|
|
513
|
-
],
|
|
514
|
-
};
|
|
515
|
-
});
|
|
516
|
-
return server;
|
|
517
|
-
}
|
|
518
|
-
//# sourceMappingURL=server.js.map
|
package/dist/mcp/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC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|
|
|
1
|
-
export interface RenderMarkdownHtmlOptions {
|
|
2
|
-
title: string;
|
|
3
|
-
sourcePath?: string;
|
|
4
|
-
assetRoot?: string;
|
|
5
|
-
themeId?: string;
|
|
6
|
-
mode?: 'slideshow' | 'static';
|
|
7
|
-
}
|
|
8
|
-
export declare function renderMarkdownHtml(markdown: string, options: RenderMarkdownHtmlOptions): Promise<string>;
|
|
9
|
-
//# sourceMappingURL=render-html.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-html.d.ts","sourceRoot":"","sources":["../src/render-html.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;CAC/B;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
package/dist/render-html.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { markdownToDoc } from '@bendyline/squisq/doc';
|
|
4
|
-
import { parseMarkdown } from '@bendyline/squisq/markdown';
|
|
5
|
-
import { collectImagePaths, docToHtml } from '@bendyline/squisq-formats/html';
|
|
6
|
-
import { PLAYER_BUNDLE } from '@bendyline/squisq-react/standalone-source';
|
|
7
|
-
export async function renderMarkdownHtml(markdown, options) {
|
|
8
|
-
const markdownDoc = parseMarkdown(markdown);
|
|
9
|
-
const doc = markdownToDoc(markdownDoc);
|
|
10
|
-
const images = options.sourcePath && options.assetRoot
|
|
11
|
-
? await readReferencedImages(doc, options.sourcePath, options.assetRoot)
|
|
12
|
-
: undefined;
|
|
13
|
-
return docToHtml(doc, {
|
|
14
|
-
playerScript: PLAYER_BUNDLE,
|
|
15
|
-
images,
|
|
16
|
-
title: options.title,
|
|
17
|
-
mode: options.mode ?? 'static',
|
|
18
|
-
themeId: options.themeId,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
async function readReferencedImages(doc, sourcePath, assetRoot) {
|
|
22
|
-
const images = new Map();
|
|
23
|
-
const baseDir = path.dirname(path.resolve(sourcePath));
|
|
24
|
-
const root = path.resolve(assetRoot);
|
|
25
|
-
for (const imagePath of collectImagePaths(doc)) {
|
|
26
|
-
if (!isLocalRelativePath(imagePath))
|
|
27
|
-
continue;
|
|
28
|
-
const normalizedPath = stripUrlSuffix(imagePath);
|
|
29
|
-
const absolutePath = path.resolve(baseDir, normalizedPath);
|
|
30
|
-
if (!isPathInside(root, absolutePath))
|
|
31
|
-
continue;
|
|
32
|
-
try {
|
|
33
|
-
const data = await readFile(absolutePath);
|
|
34
|
-
images.set(imagePath, toExactArrayBuffer(data));
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
// Missing assets should not prevent the document from rendering.
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return images;
|
|
41
|
-
}
|
|
42
|
-
function isLocalRelativePath(candidate) {
|
|
43
|
-
return (!path.isAbsolute(candidate) &&
|
|
44
|
-
!candidate.startsWith('/') &&
|
|
45
|
-
!/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(candidate) &&
|
|
46
|
-
!candidate.startsWith('data:'));
|
|
47
|
-
}
|
|
48
|
-
function stripUrlSuffix(candidate) {
|
|
49
|
-
return candidate.split(/[?#]/, 1)[0] ?? candidate;
|
|
50
|
-
}
|
|
51
|
-
function isPathInside(rootAbs, candidateAbs) {
|
|
52
|
-
const rel = path.relative(path.resolve(rootAbs), path.resolve(candidateAbs));
|
|
53
|
-
return rel === '' || (!rel.startsWith(`..${path.sep}`) && rel !== '..' && !path.isAbsolute(rel));
|
|
54
|
-
}
|
|
55
|
-
function toExactArrayBuffer(data) {
|
|
56
|
-
const copy = new Uint8Array(data.byteLength);
|
|
57
|
-
copy.set(data);
|
|
58
|
-
return copy.buffer;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=render-html.js.map
|
package/dist/render-html.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-html.js","sourceRoot":"","sources":["../src/render-html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAU1E,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB,EAChB,OAAkC;IAElC,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,MAAM,MAAM,GACV,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS;QACrC,CAAC,CAAC,MAAM,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC;QACxE,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,SAAS,CAAC,GAAG,EAAE;QACpB,YAAY,EAAE,aAAa;QAC3B,MAAM;QACN,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,QAAQ;QAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,oBAAoB,CACjC,GAAqC,EACrC,UAAkB,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,YAAY,CAAC,OAAe,EAAE,YAAoB;IACzD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAC7E,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACnG,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACf,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC"}
|
package/dist/version.d.ts
DELETED
package/dist/version.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,IAAI,MAAM,CAY1C"}
|
package/dist/version.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
export function getPackageVersion() {
|
|
3
|
-
try {
|
|
4
|
-
const raw = readFileSync(new URL('../package.json', import.meta.url), 'utf-8');
|
|
5
|
-
const pkg = JSON.parse(raw);
|
|
6
|
-
if (typeof pkg.version === 'string' && pkg.version.length > 0) {
|
|
7
|
-
return pkg.version;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
// Fall through to a conservative fallback for unusual bundled layouts.
|
|
12
|
-
}
|
|
13
|
-
return '0.0.0';
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=version.js.map
|