@suzumiyaaoba/mdxr 0.15.0 → 0.17.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 +40 -2
- package/dist/check-github-DeMlvk8G.mjs +4724 -0
- package/dist/check.d.mts +43 -0
- package/dist/check.mjs +3 -0
- package/dist/cli.mjs +3731 -7323
- package/dist/components.d.mts +7 -7
- package/dist/components.mjs +2 -2
- package/dist/config-DCGclLGG.d.mts +26 -0
- package/dist/{config-DSZfMOIO.mjs → config-DJ5ZGAfs.mjs} +45 -11
- package/dist/{doc-context-Cye5isVT.d.mts → doc-context-DRVFpkFD.d.mts} +14 -3
- package/dist/index.d.mts +3 -19
- package/dist/index.mjs +2 -2
- package/dist/{ui-CyLil0AF.mjs → ui-DxuI7OUF.mjs} +1119 -251
- package/package.json +6 -1
- package/skill/SKILL.md +2 -1
- package/skill/references/components/output.md +36 -3
- package/skill/references/components/reports.md +1 -1
- package/skill/references/components.md +1 -0
- package/src/agent-http.ts +14 -33
- package/src/agent-preview.ts +2 -2
- package/src/agent-session.ts +38 -35
- package/src/annotation-html.ts +37 -37
- package/src/annotations.ts +3 -1
- package/src/ascii/output.ts +25 -1
- package/src/assets/annotations.css +119 -120
- package/src/assets/css.ts +188 -188
- package/src/assets/library.css +114 -115
- package/src/assets/pages.css +49 -49
- package/src/assets/scripts.ts +8 -8
- package/src/assets/section-reviews.css +14 -14
- package/src/assets/workspace.css +305 -229
- package/src/check-api.ts +9 -0
- package/src/check-components.ts +164 -0
- package/src/check-diagnostics.ts +66 -0
- package/src/check-github.ts +21 -0
- package/src/check-source.ts +308 -0
- package/src/check-watch.ts +92 -0
- package/src/check.ts +169 -0
- package/src/cli-args.ts +25 -0
- package/src/cli.ts +202 -15
- package/src/client/annotation-anchors.ts +1 -1
- package/src/client/annotation-resolution.ts +3 -3
- package/src/client/annotation-view.ts +30 -30
- package/src/client/annotations.ts +22 -10
- package/src/client/diagram-viewports.ts +4 -4
- package/src/client/doc-events/ask.ts +3 -3
- package/src/client/doc-events/board.ts +15 -10
- package/src/client/doc-events/comments.ts +4 -4
- package/src/client/doc-events/shared.ts +10 -10
- package/src/client/doc-events.ts +4 -4
- package/src/client/document-identity.ts +24 -0
- package/src/client/entry.ts +2 -0
- package/src/client/linked-documents.ts +5 -5
- package/src/client/pages.ts +25 -23
- package/src/client/related-snapshot.ts +191 -0
- package/src/client/section-reviews.ts +40 -14
- package/src/client/storage.ts +14 -0
- package/src/client/theme.ts +7 -5
- package/src/client/widget-autosave.ts +143 -0
- package/src/client/widget-controls.ts +208 -0
- package/src/client/workspace-export-state.ts +7 -7
- package/src/client/workspace-snapshot.ts +23 -4
- package/src/client-js.ts +1 -1
- package/src/config.ts +86 -8
- package/src/define.ts +7 -1
- package/src/dependency-history.ts +125 -0
- package/src/document-history-http.ts +31 -38
- package/src/document-history.ts +59 -52
- package/src/extended/data.ts +7 -3
- package/src/file-lock.ts +77 -0
- package/src/file-preview-http.ts +19 -31
- package/src/format-error.ts +18 -7
- package/src/html.ts +18 -19
- package/src/hydrate-runtime.ts +5 -3
- package/src/hydrate.ts +12 -8
- package/src/hydration-ready.ts +9 -0
- package/src/library-app.tsx +10 -604
- package/src/library-controls.tsx +186 -0
- package/src/library-delete.tsx +13 -13
- package/src/library-document.ts +242 -0
- package/src/library-files.ts +162 -0
- package/src/library-index.ts +55 -439
- package/src/library-language.ts +186 -0
- package/src/library-page.ts +5 -4
- package/src/library-results.tsx +328 -0
- package/src/library-search.ts +3 -0
- package/src/library-state.ts +1 -1
- package/src/library-types.ts +3 -0
- package/src/library.ts +83 -68
- package/src/load-user-module.ts +9 -1
- package/src/local-http.ts +43 -0
- package/src/mdx.ts +3 -1
- package/src/preview-diagnostics.ts +94 -0
- package/src/preview-document.ts +103 -0
- package/src/preview-http.ts +115 -0
- package/src/preview-watch.ts +345 -0
- package/src/remark/code-file.ts +5 -2
- package/src/remark/file-paths.ts +28 -12
- package/src/remark/include.ts +123 -15
- package/src/remark/no-js.ts +30 -20
- package/src/remark/pages.ts +3 -3
- package/src/remark/reference-definitions.ts +45 -0
- package/src/remark/references.ts +58 -35
- package/src/remark/section-reviews.ts +8 -47
- package/src/render.ts +66 -28
- package/src/review-transfer.ts +103 -0
- package/src/section-review-html.ts +6 -6
- package/src/serve-lifetime.ts +119 -0
- package/src/serve.ts +131 -333
- package/src/styles/globals.css +1 -0
- package/src/styles/interactive-graph.css +345 -0
- package/src/styles/motion.css +17 -17
- package/src/styles/wireframe.css +8 -8
- package/src/templates.ts +61 -0
- package/src/ui/ask-question.tsx +11 -11
- package/src/ui/ask.tsx +5 -3
- package/src/ui/bits.tsx +13 -13
- package/src/ui/board.tsx +19 -10
- package/src/ui/comments.tsx +5 -5
- package/src/ui/details.tsx +2 -2
- package/src/ui/diagram-viewport.tsx +5 -5
- package/src/ui/diff.tsx +3 -3
- package/src/ui/document-inputs.tsx +5 -5
- package/src/ui/document-media.tsx +1 -1
- package/src/ui/document-references.tsx +2 -2
- package/src/ui/document-tabs.tsx +2 -2
- package/src/ui/file-ref.tsx +2 -2
- package/src/ui/graph-node-inspector.tsx +232 -0
- package/src/ui/graph-specs.tsx +16 -2
- package/src/ui/graph-view-rail.tsx +195 -0
- package/src/ui/graph-viewport.tsx +5 -5
- package/src/ui/graph.tsx +13 -5
- package/src/ui/index.ts +13 -0
- package/src/ui/interactive-graph-model.ts +212 -0
- package/src/ui/interactive-graph-specs.tsx +149 -0
- package/src/ui/interactive-graph.tsx +462 -0
- package/src/ui/json.tsx +2 -2
- package/src/ui/pre.tsx +14 -4
- package/src/ui/tests.tsx +13 -2
- package/src/ui/toc.tsx +3 -3
- package/src/ui/tree.tsx +1 -1
- package/src/ui/wireframe-layout.tsx +1 -1
- package/src/widget-state.ts +54 -0
- package/src/wireframe/component.tsx +1 -0
- package/src/workspace-api.ts +5 -5
- package/src/workspace-app.tsx +15 -9
- package/src/workspace-chat.tsx +23 -28
- package/src/workspace-code.tsx +2 -2
- package/src/workspace-dependencies.tsx +104 -0
- package/src/workspace-diagnostics.tsx +184 -0
- package/src/workspace-diff.tsx +15 -17
- package/src/workspace-document.ts +7 -7
- package/src/workspace-export-data.ts +35 -31
- package/src/workspace-export-html.ts +78 -36
- package/src/workspace-export-options.ts +23 -0
- package/src/workspace-export.tsx +131 -26
- package/src/workspace-panes.tsx +23 -23
- package/src/workspace-review.tsx +199 -0
- package/src/workspace-state.ts +13 -12
package/README.md
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
<h1>
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-wordmark-dark.svg">
|
|
4
|
+
<img src="assets/logo-wordmark.svg" alt="mdxr" width="218" height="70">
|
|
5
|
+
</picture>
|
|
6
|
+
</h1>
|
|
2
7
|
|
|
3
8
|
Render agent-authored MDX documents (plans, reports) to standalone HTML with a semantic component catalog.
|
|
4
9
|
|
|
10
|
+
[](assets/mdxr-launch.mp4)
|
|
11
|
+
|
|
5
12
|
## Usage
|
|
6
13
|
|
|
7
14
|
Run directly with `npx` — no install required:
|
|
@@ -11,6 +18,7 @@ npx @suzumiyaaoba/mdxr render plan.mdx # writes plan.html
|
|
|
11
18
|
npx @suzumiyaaoba/mdxr serve # serve .mdxr at http://localhost:3737
|
|
12
19
|
npx @suzumiyaaoba/mdxr library # browse and search .mdxr
|
|
13
20
|
npx @suzumiyaaoba/mdxr catalog # list available components
|
|
21
|
+
npx @suzumiyaaoba/mdxr check # validate all documents in .mdxr
|
|
14
22
|
npx @suzumiyaaoba/mdxr --version # print the package version
|
|
15
23
|
npx @suzumiyaaoba/mdxr init # install mdxr instructions for Codex and Claude
|
|
16
24
|
```
|
|
@@ -22,6 +30,20 @@ npm install -g @suzumiyaaoba/mdxr # global CLI
|
|
|
22
30
|
npm install @suzumiyaaoba/mdxr # library: import { render } from "@suzumiyaaoba/mdxr"
|
|
23
31
|
```
|
|
24
32
|
|
|
33
|
+
### `mdxr check [path]`
|
|
34
|
+
|
|
35
|
+
Validate one Markdown/MDX document or every document under a directory (defaults to `.mdxr`) without writing HTML. Checks include syntax, component names and attributes, local resources, Include cycles, citations, and cross references. Diagnostics include file, line, and column; errors exit with code 1, and checking continues after a malformed document.
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
mdxr check # validate .mdxr
|
|
39
|
+
mdxr check ./reports --format json # structured diagnostics for CI and agents
|
|
40
|
+
mdxr check ./reports --strict # fail on warnings too
|
|
41
|
+
mdxr check plan.mdx --render # also load project components and validate rendering
|
|
42
|
+
cat plan.mdx | mdxr check - # validate stdin
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The default check does not execute document JavaScript, project configuration, or custom components. Use `--render` when checking trusted project components. See the [CLI reference](docs/docs/cli.mdx) for the diagnostic format and reference rules.
|
|
46
|
+
|
|
25
47
|
### `mdxr library [dir]`
|
|
26
48
|
|
|
27
49
|
Browse and search Markdown and MDX documents under a directory (defaults to `.mdxr`). The local browser UI searches titles, document text, and relative paths; supports status filtering and relevance, update-date, or title sorting; and opens each result in a new tab with the live preview workspace.
|
|
@@ -62,6 +84,8 @@ cat plan.mdx | mdxr serve - --open # explicit st
|
|
|
62
84
|
|
|
63
85
|
`--open <file>` takes a document path relative to the working directory, or an absolute path. It opens that document directly, with its relative file path in the preview URL. `--agent codex` or `--agent claude` enables chat in every document workspace. A file argument such as `mdxr serve .mdxr/20260930170000-plan/index.mdx --open` serves the containing `.mdxr/` library and opens that file; outside `.mdxr/`, it serves the file's parent directory.
|
|
64
86
|
|
|
87
|
+
After all browser tabs are closed, unused previews and their file watchers stop automatically after five minutes. Active agent turns keep their preview alive. `--idle-timeout <seconds>` changes this delay; `--idle-timeout 0` keeps the server running until you stop it. This also applies to `mdxr library`. Ctrl+C, SIGTERM, and SIGHUP close the library, its document previews, and agent connections.
|
|
88
|
+
|
|
65
89
|
### Review the rendered document
|
|
66
90
|
|
|
67
91
|
Select text and click **Add comment**, or open **Annotate → Select figure** to comment on an image, diagram, or chart. Edit or delete comments in the panel, then **Copy Markdown** to send the quoted targets, source locations, and feedback to a coding agent.
|
|
@@ -70,7 +94,13 @@ Saved annotations remain in your browser for that document; they do not modify t
|
|
|
70
94
|
|
|
71
95
|
Each document-level `##` section also has a **Not reviewed / Reviewed** toggle. Review status is saved locally per document and restored after reload; sections with changed content require review again. In **Pages** view, the sidebar shows section statuses and review progress. See [Section review status](https://suzumiyaaoba.com/mdxr/authoring#section-review-status).
|
|
72
96
|
|
|
73
|
-
In the `mdxr serve` workspace, choose **Export HTML
|
|
97
|
+
In the `mdxr serve` workspace, choose **Export HTML**, select the contents, then **Download HTML**:
|
|
98
|
+
|
|
99
|
+
- **Document only** preserves the displayed document and entered values, omitting review controls and records. It does not fetch chat or version history.
|
|
100
|
+
- **Document and review** adds current comments, section review statuses, and answers. Chat, unsent drafts, comment handoff history, saved MDX versions, and diffs are excluded from both visible HTML and embedded JSON.
|
|
101
|
+
- **All records** (the default) includes the document, chat, comments, drafts, section reviews, every saved MDX version, and their diffs. Resolved comments retain their resolution time and reviewed version, with links to matching archived versions.
|
|
102
|
+
|
|
103
|
+
Images and stylesheets are embedded in every snapshot; if an external resource cannot be captured, export reports an error instead of omitting it. Open the file locally to review or share the captured state without running the server. Escape or **Cancel** closes the dialog without exporting.
|
|
74
104
|
|
|
75
105
|
### `mdxr text [file]`
|
|
76
106
|
|
|
@@ -136,6 +166,14 @@ Once the instructions or skill are installed, ask your agent, for example:
|
|
|
136
166
|
|
|
137
167
|
Plans, reports, reviews, investigation summaries, release notes, and postmortems all work. By default, new documents use `.mdxr/yyyyMMddhhmmss-<name>/index.mdx`, with a zero-padded 14-digit local creation time in 24-hour format (for example, `.mdxr/20260929140530-auth-plan/index.mdx`). Keep images and related MDX files in the document's directory. A file path you provide takes priority, and existing documents keep their current paths. If you specify only a directory, create a timestamped subdirectory there and save the document as `index.mdx`. Serve the directory and open the new document directly with `mdxr serve .mdxr/ --open .mdxr/20260929140530-auth-plan/index.mdx`.
|
|
138
168
|
|
|
169
|
+
## Document workflows
|
|
170
|
+
|
|
171
|
+
Create editable MDX with `mdxr new --template plan|investigation|review --title "…"`; list or inspect templates with `mdxr templates [name]`. Generated files include a stable document ID and are never overwritten. `check`, `render` and `serve` discover ancestor configuration and accept `--config` / `--project`.
|
|
172
|
+
|
|
173
|
+
Use `mdxr check .mdxr --watch`, `--format github` for CI annotations, or the typed Node.js API from `@suzumiyaaoba/mdxr/check`. Live workspaces show validation diagnostics and source locations even when rendering fails; the library lists static diagnostic counts.
|
|
174
|
+
|
|
175
|
+
The Review dialog saves and imports versioned review JSON with conflict previews and explicit document mapping. Ask answers and Board placement survive reloads; stable widget IDs protect restoration after source edits. HTML exports can include nested related documents for offline reading. History records dependency hashes and reports changed or missing files; historical previews still use current dependency contents. See [Document workflows](https://suzumiyaaoba.com/mdxr/workflows) for examples and details.
|
|
176
|
+
|
|
139
177
|
## License
|
|
140
178
|
|
|
141
179
|
MIT
|