@bendyline/docblocks-cli 1.1.2 → 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 -88
- 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 +9 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +209 -44
- 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 +1 -1
- 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 +227 -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 +8 -0
- package/dist/render-html.d.ts.map +1 -1
- package/dist/render-html.js +32 -7
- package/dist/render-html.js.map +1 -1
- package/dist/version.d.ts +4 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +95 -6
- package/dist/version.js.map +1 -1
- 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,121 +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
|
|
|
7
|
-
|
|
8
|
-
npm install -g @bendyline/docblocks-cli
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Commands
|
|
12
|
-
|
|
13
|
-
### `docblocks init [dir]`
|
|
14
|
-
|
|
15
|
-
Initialize a new DocBlocks workspace. Creates a `.docblocks` directory with configuration.
|
|
16
|
-
|
|
17
|
-
### `docblocks build`
|
|
18
|
-
|
|
19
|
-
Build markdown files into HTML output.
|
|
9
|
+
Node.js 22.14 or newer is required.
|
|
20
10
|
|
|
21
11
|
```bash
|
|
22
|
-
|
|
12
|
+
npm install -g @bendyline/docblocks-cli
|
|
13
|
+
docblocks --help
|
|
23
14
|
```
|
|
24
15
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `-i, --input <dir>` — Input directory (default: `.`)
|
|
28
|
-
- `-o, --output <dir>` — Output directory (default: `dist`)
|
|
29
|
-
- `-t, --theme <id>` — Visual theme to apply
|
|
16
|
+
## Documentation
|
|
30
17
|
|
|
31
|
-
|
|
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)
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
Those guides describe current input support, linked Squisq ownership, format
|
|
22
|
+
directions, overwrite behavior, MCP authority, artifact lifecycle, and assurance.
|
|
34
23
|
|
|
35
|
-
|
|
24
|
+
## Commands
|
|
36
25
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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. |
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
Use `docblocks help <command>` for the installed option summary.
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
## Examples
|
|
44
41
|
|
|
45
42
|
```bash
|
|
46
|
-
#
|
|
47
|
-
docblocks
|
|
48
|
-
|
|
49
|
-
# Convert to specific formats with a theme
|
|
50
|
-
docblocks convert story.md -f docx,pdf -t cinematic
|
|
51
|
-
|
|
52
|
-
# Apply a transform style before exporting
|
|
53
|
-
docblocks convert story.md --transform documentary -o ./output
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Options:**
|
|
43
|
+
# Build and preview Markdown
|
|
44
|
+
docblocks build --input ./docs --output ./dist
|
|
45
|
+
docblocks serve --dir ./docs
|
|
57
46
|
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
- `-t, --theme <id>` — Visual theme (use `docblocks themes` to list)
|
|
61
|
-
- `--transform <style>` — Transform style (use `docblocks transforms` to list)
|
|
62
|
-
|
|
63
|
-
### `docblocks video <input> [output]`
|
|
47
|
+
# The no-flag conversion set is exactly DOCX, PPTX, PDF, HTML, and DBK
|
|
48
|
+
docblocks convert story.md
|
|
64
49
|
|
|
65
|
-
|
|
50
|
+
# Select any export-capable linked-registry formats
|
|
51
|
+
docblocks convert report.docx --formats md,pdf,pptx --output-dir ./exports
|
|
66
52
|
|
|
67
|
-
|
|
53
|
+
# Render MP4 with explicit media controls
|
|
68
54
|
docblocks video story.md --quality high --orientation portrait
|
|
69
|
-
```
|
|
70
55
|
|
|
71
|
-
|
|
56
|
+
# Discover authoring vocabulary from linked Squisq
|
|
57
|
+
docblocks themes
|
|
58
|
+
docblocks transforms
|
|
72
59
|
|
|
73
|
-
|
|
74
|
-
- `--fps <number>` — Frames per second (1-120, default: 30)
|
|
75
|
-
- `--quality <level>` — draft, normal, or high
|
|
76
|
-
- `--orientation <orient>` — landscape or portrait
|
|
77
|
-
- `--captions <style>` — off, standard, or social
|
|
78
|
-
- `--width <pixels>` / `--height <pixels>` — Override dimensions
|
|
79
|
-
|
|
80
|
-
### `docblocks mcp`
|
|
81
|
-
|
|
82
|
-
Start an MCP (Model Context Protocol) server over stdio for AI-assisted document operations.
|
|
83
|
-
|
|
84
|
-
```bash
|
|
60
|
+
# Start MCP with no filesystem authority
|
|
85
61
|
docblocks mcp
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**MCP Tools exposed:**
|
|
89
|
-
|
|
90
|
-
- `export_markdown_to_docx` / `_pdf` / `_pptx` / `_html` / `_video` — Export markdown to polished output formats
|
|
91
|
-
- `analyze_markdown` — Extract content structure (stats, quotes, facts, dates)
|
|
92
|
-
- `restyle_markdown` — Apply a transform style and return restyled markdown
|
|
93
|
-
- `list_themes` / `list_transform_styles` / `list_export_formats` — Discovery tools
|
|
94
|
-
|
|
95
|
-
All export tools accept raw markdown text directly — AI agents can write content and immediately export without temp files.
|
|
96
62
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"mcpServers": {
|
|
102
|
-
"docblocks": { "command": "npx", "args": ["docblocks", "mcp"] }
|
|
103
|
-
}
|
|
104
|
-
}
|
|
63
|
+
# Grant independent roots when an agent needs files or durable output
|
|
64
|
+
docblocks mcp --allow-read ./documents --allow-write ./exports
|
|
105
65
|
```
|
|
106
66
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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.
|
|
110
72
|
|
|
111
|
-
|
|
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.
|
|
112
76
|
|
|
113
|
-
|
|
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.
|
|
114
80
|
|
|
115
|
-
|
|
81
|
+
## Development with linked Squisq
|
|
116
82
|
|
|
117
|
-
|
|
83
|
+
From the DocBlocks repository root:
|
|
118
84
|
|
|
119
|
-
|
|
85
|
+
```bash
|
|
86
|
+
npm run link:squisq
|
|
87
|
+
npm run check:squisq-linked
|
|
88
|
+
npm run test:mcp:linked
|
|
89
|
+
npm run all
|
|
90
|
+
```
|
|
120
91
|
|
|
121
|
-
|
|
92
|
+
The linked assurance commands use the sibling `..\squisq` source checkout, not the
|
|
93
|
+
npm package copy.
|
|
@@ -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"}
|