@bendyline/docblocks-cli 1.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -76
- package/dist/commands/build.d.ts +11 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +61 -45
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/convert.d.ts +12 -2
- package/dist/commands/convert.d.ts.map +1 -1
- package/dist/commands/convert.js +272 -101
- package/dist/commands/convert.js.map +1 -1
- package/dist/commands/mcp.d.ts +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +90 -4
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/parse.js +1 -1
- package/dist/commands/parse.js.map +1 -1
- package/dist/commands/serve.d.ts +33 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +340 -3
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/themes.js +1 -1
- package/dist/commands/themes.js.map +1 -1
- package/dist/commands/transforms.js +1 -1
- package/dist/commands/transforms.js.map +1 -1
- package/dist/commands/video.d.ts +8 -1
- package/dist/commands/video.d.ts.map +1 -1
- package/dist/commands/video.js +50 -30
- package/dist/commands/video.js.map +1 -1
- package/dist/contained-file.d.ts +8 -0
- package/dist/contained-file.d.ts.map +1 -0
- package/dist/contained-file.js +77 -0
- package/dist/contained-file.js.map +1 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/agentic-tools.d.ts +16 -0
- package/dist/mcp/agentic-tools.d.ts.map +1 -0
- package/dist/mcp/agentic-tools.js +967 -0
- package/dist/mcp/agentic-tools.js.map +1 -0
- package/dist/mcp/artifact-store.d.ts +98 -0
- package/dist/mcp/artifact-store.d.ts.map +1 -0
- package/dist/mcp/artifact-store.js +542 -0
- package/dist/mcp/artifact-store.js.map +1 -0
- package/dist/mcp/authority.d.ts +53 -0
- package/dist/mcp/authority.d.ts.map +1 -0
- package/dist/mcp/authority.js +433 -0
- package/dist/mcp/authority.js.map +1 -0
- package/dist/mcp/conversion-service.d.ts +111 -0
- package/dist/mcp/conversion-service.d.ts.map +1 -0
- package/dist/mcp/conversion-service.js +512 -0
- package/dist/mcp/conversion-service.js.map +1 -0
- package/dist/mcp/discovery-tools.d.ts +4 -0
- package/dist/mcp/discovery-tools.d.ts.map +1 -0
- package/dist/mcp/discovery-tools.js +114 -0
- package/dist/mcp/discovery-tools.js.map +1 -0
- package/dist/mcp/document-service.d.ts +47 -0
- package/dist/mcp/document-service.d.ts.map +1 -0
- package/dist/mcp/document-service.js +424 -0
- package/dist/mcp/document-service.js.map +1 -0
- package/dist/mcp/error-result.d.ts +17 -0
- package/dist/mcp/error-result.d.ts.map +1 -0
- package/dist/mcp/error-result.js +82 -0
- package/dist/mcp/error-result.js.map +1 -0
- package/dist/mcp/intelligence.d.ts +15 -0
- package/dist/mcp/intelligence.d.ts.map +1 -0
- package/dist/mcp/intelligence.js +855 -0
- package/dist/mcp/intelligence.js.map +1 -0
- package/dist/mcp/output-bounds.d.ts +13 -0
- package/dist/mcp/output-bounds.d.ts.map +1 -0
- package/dist/mcp/output-bounds.js +61 -0
- package/dist/mcp/output-bounds.js.map +1 -0
- package/dist/mcp/preview-service.d.ts +54 -0
- package/dist/mcp/preview-service.d.ts.map +1 -0
- package/dist/mcp/preview-service.js +454 -0
- package/dist/mcp/preview-service.js.map +1 -0
- package/dist/mcp/progress.d.ts +18 -0
- package/dist/mcp/progress.d.ts.map +1 -0
- package/dist/mcp/progress.js +28 -0
- package/dist/mcp/progress.js.map +1 -0
- package/dist/mcp/prompts.d.ts +4 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +124 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/rendered-conversion.d.ts +34 -0
- package/dist/mcp/rendered-conversion.d.ts.map +1 -0
- package/dist/mcp/rendered-conversion.js +364 -0
- package/dist/mcp/rendered-conversion.js.map +1 -0
- package/dist/mcp/server.d.ts +67 -10
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +228 -496
- package/dist/mcp/server.js.map +1 -1
- package/dist/preview-policy.d.ts +8 -0
- package/dist/preview-policy.d.ts.map +1 -0
- package/dist/preview-policy.js +85 -0
- package/dist/preview-policy.js.map +1 -0
- package/dist/render-html.d.ts +17 -0
- package/dist/render-html.d.ts.map +1 -0
- package/dist/render-html.js +85 -0
- package/dist/render-html.js.map +1 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +104 -0
- package/dist/version.js.map +1 -0
- package/package.json +11 -11
- 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/README.md
CHANGED
|
@@ -1,109 +1,93 @@
|
|
|
1
1
|
# @bendyline/docblocks-cli
|
|
2
2
|
|
|
3
|
-
DocBlocks
|
|
3
|
+
The DocBlocks command-line surface for document build and preview, linked-Squisq
|
|
4
|
+
format conversion, MP4 rendering, document parsing, and a local MCP server for
|
|
5
|
+
agents.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
9
|
+
Node.js 22.14 or newer is required.
|
|
10
|
+
|
|
7
11
|
```bash
|
|
8
12
|
npm install -g @bendyline/docblocks-cli
|
|
13
|
+
docblocks --help
|
|
9
14
|
```
|
|
10
15
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
### `docblocks init [dir]`
|
|
14
|
-
|
|
15
|
-
Initialize a new DocBlocks workspace. Creates a `.docblocks` directory with configuration.
|
|
16
|
+
## Documentation
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
- [Authoritative CLI reference](https://github.com/bendyline/docblocks/blob/main/docs/cli.md)
|
|
19
|
+
- [MCP architecture and protocol guide](https://github.com/bendyline/docblocks/blob/main/docs/mcp.md)
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
Those guides describe current input support, linked Squisq ownership, format
|
|
22
|
+
directions, overwrite behavior, MCP authority, artifact lifecycle, and assurance.
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
docblocks build -i ./docs -o ./dist
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### `docblocks serve`
|
|
24
|
+
## Commands
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
| Command | Purpose |
|
|
27
|
+
| ---------------------------------- | ----------------------------------------------------- |
|
|
28
|
+
| `docblocks init [dir]` | Create minimal `.docblocks/config.json` metadata. |
|
|
29
|
+
| `docblocks build` | Recursively build Markdown into standalone HTML. |
|
|
30
|
+
| `docblocks serve` | Run a constrained local preview server. |
|
|
31
|
+
| `docblocks convert <input>` | Convert through the linked Squisq registry. |
|
|
32
|
+
| `docblocks video <input> [output]` | Render a configurable MP4. |
|
|
33
|
+
| `docblocks mcp` | Start the artifact-first MCP server over local stdio. |
|
|
34
|
+
| `docblocks themes` | List linked Squisq theme IDs. |
|
|
35
|
+
| `docblocks transforms` | List linked Squisq transform IDs. |
|
|
36
|
+
| `docblocks parse <input>` | Parse UTF-8 Markdown into Squisq Markdown AST JSON. |
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
Use `docblocks help <command>` for the installed option summary.
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
## Examples
|
|
32
41
|
|
|
33
42
|
```bash
|
|
34
|
-
#
|
|
35
|
-
docblocks
|
|
36
|
-
|
|
37
|
-
# Convert to specific formats with a theme
|
|
38
|
-
docblocks convert story.md -f docx,pdf -t cinematic
|
|
39
|
-
|
|
40
|
-
# Apply a transform style before exporting
|
|
41
|
-
docblocks convert story.md --transform documentary -o ./output
|
|
42
|
-
```
|
|
43
|
+
# Build and preview Markdown
|
|
44
|
+
docblocks build --input ./docs --output ./dist
|
|
45
|
+
docblocks serve --dir ./docs
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- `-o, --output-dir <dir>` — Output directory
|
|
47
|
-
- `-f, --formats <list>` — Comma-separated formats: docx, pptx, pdf, html, dbk
|
|
48
|
-
- `-t, --theme <id>` — Visual theme (use `docblocks themes` to list)
|
|
49
|
-
- `--transform <style>` — Transform style (use `docblocks transforms` to list)
|
|
50
|
-
|
|
51
|
-
### `docblocks video <input> [output]`
|
|
47
|
+
# The no-flag conversion set is exactly DOCX, PPTX, PDF, HTML, and DBK
|
|
48
|
+
docblocks convert story.md
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
# Select any export-capable linked-registry formats
|
|
51
|
+
docblocks convert report.docx --formats md,pdf,pptx --output-dir ./exports
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
# Render MP4 with explicit media controls
|
|
56
54
|
docblocks video story.md --quality high --orientation portrait
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Options:**
|
|
60
|
-
|
|
61
|
-
- `-o, --output <path>` — Output MP4 path
|
|
62
|
-
- `--fps <number>` — Frames per second (1-120, default: 30)
|
|
63
|
-
- `--quality <level>` — draft, normal, or high
|
|
64
|
-
- `--orientation <orient>` — landscape or portrait
|
|
65
|
-
- `--captions <style>` — off, standard, or social
|
|
66
|
-
- `--width <pixels>` / `--height <pixels>` — Override dimensions
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
# Discover authoring vocabulary from linked Squisq
|
|
57
|
+
docblocks themes
|
|
58
|
+
docblocks transforms
|
|
69
59
|
|
|
70
|
-
Start
|
|
71
|
-
|
|
72
|
-
```bash
|
|
60
|
+
# Start MCP with no filesystem authority
|
|
73
61
|
docblocks mcp
|
|
74
|
-
```
|
|
75
62
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- `export_markdown_to_docx` / `_pdf` / `_pptx` / `_html` / `_video` — Export markdown to polished output formats
|
|
79
|
-
- `analyze_markdown` — Extract content structure (stats, quotes, facts, dates)
|
|
80
|
-
- `restyle_markdown` — Apply a transform style and return restyled markdown
|
|
81
|
-
- `list_themes` / `list_transform_styles` / `list_export_formats` — Discovery tools
|
|
82
|
-
|
|
83
|
-
All export tools accept raw markdown text directly — AI agents can write content and immediately export without temp files.
|
|
84
|
-
|
|
85
|
-
**Claude Desktop / Copilot integration:**
|
|
86
|
-
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"mcpServers": {
|
|
90
|
-
"docblocks": { "command": "npx", "args": ["docblocks", "mcp"] }
|
|
91
|
-
}
|
|
92
|
-
}
|
|
63
|
+
# Grant independent roots when an agent needs files or durable output
|
|
64
|
+
docblocks mcp --allow-read ./documents --allow-write ./exports
|
|
93
65
|
```
|
|
94
66
|
|
|
95
|
-
|
|
67
|
+
`convert` and `video` accept Markdown, Squisq JSON Doc, DBK/ZIP, folders, and
|
|
68
|
+
import-capable linked-registry formats. Direct `build`, `convert`, and `video`
|
|
69
|
+
outputs replace existing destination files. MCP conversions instead return
|
|
70
|
+
immutable session artifacts; only explicit `save_artifact` materializes one, using
|
|
71
|
+
no-replace or hash-conditional replacement semantics.
|
|
96
72
|
|
|
97
|
-
|
|
73
|
+
The live linked registry currently covers Markdown, DOCX, PDF, PPTX, XLSX, CSV,
|
|
74
|
+
HTML, HTML ZIP, EPUB, DBK, MP4, and GIF. Direction varies by format, so use the
|
|
75
|
+
CLI reference or MCP `list_formats` rather than assuming every format imports.
|
|
98
76
|
|
|
99
|
-
|
|
77
|
+
MP4/GIF rendering requires Chromium and FFmpeg. Install Chromium with
|
|
78
|
+
`npx playwright install chromium`; Squisq resolves FFmpeg from `SQUISQ_FFMPEG`,
|
|
79
|
+
`PATH`, or `ffmpeg-static`, in that order.
|
|
100
80
|
|
|
101
|
-
|
|
81
|
+
## Development with linked Squisq
|
|
102
82
|
|
|
103
|
-
|
|
83
|
+
From the DocBlocks repository root:
|
|
104
84
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
85
|
+
```bash
|
|
86
|
+
npm run link:squisq
|
|
87
|
+
npm run check:squisq-linked
|
|
88
|
+
npm run test:mcp:linked
|
|
89
|
+
npm run all
|
|
90
|
+
```
|
|
108
91
|
|
|
109
|
-
|
|
92
|
+
The linked assurance commands use the sibling `..\squisq` source checkout, not the
|
|
93
|
+
npm package copy.
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
export interface BuildOptions {
|
|
3
|
+
input: string;
|
|
4
|
+
output: string;
|
|
5
|
+
theme?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BuildResult {
|
|
8
|
+
inputDir: string;
|
|
9
|
+
outputDir: string;
|
|
10
|
+
builtFiles: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function runBuild(opts: BuildOptions): Promise<BuildResult>;
|
|
2
13
|
export declare const buildCommand: Command;
|
|
3
14
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAmCvE;AAED,eAAO,MAAM,YAAY,SAiBrB,CAAC"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,58 +1,74 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import
|
|
2
|
+
import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import {
|
|
4
|
+
import { renderMarkdownHtml } from '../render-html.js';
|
|
5
|
+
export async function runBuild(opts) {
|
|
6
|
+
const inputDir = path.resolve(opts.input);
|
|
7
|
+
const outputDir = path.resolve(opts.output);
|
|
8
|
+
const inputStat = await stat(inputDir).catch(() => null);
|
|
9
|
+
if (!inputStat?.isDirectory()) {
|
|
10
|
+
throw new Error(`Input directory not found: ${inputDir}`);
|
|
11
|
+
}
|
|
12
|
+
const markdownFiles = await listMarkdownFiles(inputDir);
|
|
13
|
+
if (markdownFiles.length === 0) {
|
|
14
|
+
throw new Error(`No markdown files found in ${inputDir}.`);
|
|
15
|
+
}
|
|
16
|
+
await mkdir(outputDir, { recursive: true });
|
|
17
|
+
const builtFiles = [];
|
|
18
|
+
for (const sourcePath of markdownFiles) {
|
|
19
|
+
const relativePath = path.relative(inputDir, sourcePath);
|
|
20
|
+
const outputPath = path.join(outputDir, replaceMarkdownExtension(relativePath));
|
|
21
|
+
const source = await readFile(sourcePath, 'utf-8');
|
|
22
|
+
const html = await renderMarkdownHtml(source, {
|
|
23
|
+
title: titleFromPath(relativePath),
|
|
24
|
+
sourcePath,
|
|
25
|
+
assetRoot: inputDir,
|
|
26
|
+
themeId: opts.theme,
|
|
27
|
+
mode: 'static',
|
|
28
|
+
});
|
|
29
|
+
await mkdir(path.dirname(outputPath), { recursive: true });
|
|
30
|
+
await writeFile(outputPath, html, 'utf-8');
|
|
31
|
+
builtFiles.push(outputPath);
|
|
32
|
+
}
|
|
33
|
+
return { inputDir, outputDir, builtFiles };
|
|
34
|
+
}
|
|
5
35
|
export const buildCommand = new Command('build')
|
|
6
36
|
.description('Build markdown files into HTML output')
|
|
7
37
|
.option('-i, --input <dir>', 'input directory', '.')
|
|
8
38
|
.option('-o, --output <dir>', 'output directory', 'dist')
|
|
39
|
+
.option('-t, --theme <id>', 'Squisq theme ID to apply')
|
|
9
40
|
.action(async (opts) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
fs.mkdirSync(outputDir, { recursive: true });
|
|
18
|
-
const files = fs.readdirSync(inputDir).filter((f) => f.endsWith('.md'));
|
|
19
|
-
if (files.length === 0) {
|
|
20
|
-
console.error('No markdown files found.');
|
|
21
|
-
return;
|
|
41
|
+
try {
|
|
42
|
+
const result = await runBuild(opts);
|
|
43
|
+
for (const outFile of result.builtFiles) {
|
|
44
|
+
console.error(`Built: ${outFile}`);
|
|
45
|
+
}
|
|
46
|
+
console.error(`Done. ${result.builtFiles.length} file(s) built to ${result.outputDir}`);
|
|
22
47
|
}
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const outFile = path.join(outputDir, file.replace(/\.md$/, '.html'));
|
|
28
|
-
fs.writeFileSync(outFile, html);
|
|
29
|
-
console.error(`Built: ${outFile}`);
|
|
48
|
+
catch (err) {
|
|
49
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
50
|
+
console.error(`Error: ${message}`);
|
|
51
|
+
process.exitCode = 1;
|
|
30
52
|
}
|
|
31
|
-
console.error(`Done. ${files.length} file(s) built to ${outputDir}`);
|
|
32
53
|
});
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</body>
|
|
49
|
-
</html>`;
|
|
54
|
+
async function listMarkdownFiles(root) {
|
|
55
|
+
const entries = await readdir(root, { withFileTypes: true });
|
|
56
|
+
const files = await Promise.all(entries.map(async (entry) => {
|
|
57
|
+
const absolutePath = path.join(root, entry.name);
|
|
58
|
+
if (entry.isDirectory())
|
|
59
|
+
return listMarkdownFiles(absolutePath);
|
|
60
|
+
return isMarkdownFile(entry.name) ? [absolutePath] : [];
|
|
61
|
+
}));
|
|
62
|
+
return files.flat().sort((a, b) => a.localeCompare(b));
|
|
63
|
+
}
|
|
64
|
+
function isMarkdownFile(fileName) {
|
|
65
|
+
return /\.(md|markdown)$/i.test(fileName);
|
|
66
|
+
}
|
|
67
|
+
function replaceMarkdownExtension(filePath) {
|
|
68
|
+
return filePath.replace(/\.(md|markdown)$/i, '.html');
|
|
50
69
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.replace(/</g, '<')
|
|
55
|
-
.replace(/>/g, '>')
|
|
56
|
-
.replace(/"/g, '"');
|
|
70
|
+
function titleFromPath(filePath) {
|
|
71
|
+
const baseName = path.basename(filePath).replace(/\.(md|markdown)$/i, '');
|
|
72
|
+
return baseName || 'DocBlocks Document';
|
|
57
73
|
}
|
|
58
74
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE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AC,QAAQ,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAC1E,OAAO,QAAQ,IAAI,oBAAoB,CAAC;AAC1C,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* convert command
|
|
3
3
|
*
|
|
4
|
-
* Reads
|
|
5
|
-
*
|
|
4
|
+
* Reads any input supported by the linked Squisq CLI and exports through its
|
|
5
|
+
* canonical format registry. The historical default set remains DOCX, PPTX,
|
|
6
|
+
* PDF, HTML, and DBK; callers may explicitly request any export-capable
|
|
7
|
+
* registry format.
|
|
6
8
|
*
|
|
7
9
|
* Wraps the same logic as squisq-cli's convert command, reusing the
|
|
8
10
|
* underlying squisq libraries directly.
|
|
@@ -10,17 +12,25 @@
|
|
|
10
12
|
import { Command } from 'commander';
|
|
11
13
|
import type { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
12
14
|
import type { ContentContainer } from '@bendyline/squisq/storage';
|
|
15
|
+
import type { FormatRegistry } from '@bendyline/squisq-cli/api';
|
|
13
16
|
export interface ConvertOptions {
|
|
14
17
|
outputDir?: string;
|
|
15
18
|
formats?: string;
|
|
16
19
|
theme?: string;
|
|
17
20
|
transform?: string;
|
|
21
|
+
/** Cancel reading, transformation, conversion, or publication at a bounded boundary. */
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
/** Programmatic registry override; the CLI defaults to the linked Squisq registry. */
|
|
24
|
+
registry?: FormatRegistry;
|
|
18
25
|
}
|
|
19
26
|
export interface ConvertResult {
|
|
20
27
|
outputFiles: {
|
|
21
28
|
path: string;
|
|
22
29
|
format: string;
|
|
23
30
|
size: number;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
suggestedFilename: string;
|
|
33
|
+
warnings: string[];
|
|
24
34
|
}[];
|
|
25
35
|
}
|
|
26
36
|
export declare function runConvert(inputPath: string, opts: ConvertOptions): Promise<ConvertResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/commands/convert.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/commands/convert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAA2B,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIzF,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,EAAE,CAAC;CACL;AAED,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAiHhG;AAUD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,gBAAgB,EAC3B,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,CAAC,CAoB3B;AA6LD,eAAO,MAAM,cAAc,SAyBvB,CAAC"}
|