@suzumiyaaoba/mdxr 0.8.0 → 0.9.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.
Files changed (56) hide show
  1. package/README.md +17 -16
  2. package/dist/cli.mjs +820 -477
  3. package/dist/components.d.mts +1 -1
  4. package/dist/components.mjs +1 -1
  5. package/dist/{config-HGfE6JlG.mjs → config-CkuczeTw.mjs} +12 -5
  6. package/dist/index.mjs +2 -2
  7. package/dist/{ui-BhvyxJNU.mjs → ui-WWQsRQbX.mjs} +35 -17
  8. package/package.json +1 -1
  9. package/src/agent-http.ts +10 -4
  10. package/src/agent-markdown.ts +15 -3
  11. package/src/ascii/ast.ts +47 -2
  12. package/src/ascii/charts.ts +5 -3
  13. package/src/ascii/reports.ts +4 -4
  14. package/src/assets/css.ts +40 -12
  15. package/src/assets/pages.css +23 -0
  16. package/src/assets/scripts.ts +4 -0
  17. package/src/assets/workspace.css +85 -1
  18. package/src/cli.ts +61 -25
  19. package/src/client/annotations.ts +19 -0
  20. package/src/client/doc-events/ask.ts +148 -0
  21. package/src/client/doc-events/board.ts +305 -0
  22. package/src/client/doc-events/comments.ts +406 -0
  23. package/src/client/doc-events/serialization.ts +33 -0
  24. package/src/client/doc-events/shared.ts +103 -0
  25. package/src/client/doc-events.ts +7 -984
  26. package/src/client/section-reviews.ts +11 -0
  27. package/src/client/workspace-export-state.ts +211 -0
  28. package/src/client/workspace-snapshot.ts +249 -0
  29. package/src/codex-app-server-error.ts +15 -0
  30. package/src/codex-app-server-turn.ts +123 -0
  31. package/src/codex-app-server.ts +281 -392
  32. package/src/document-history-http.ts +101 -56
  33. package/src/document-history.ts +165 -97
  34. package/src/editor.ts +8 -2
  35. package/src/extended/diagrams.ts +16 -14
  36. package/src/extended/plots.ts +26 -12
  37. package/src/html.ts +10 -1
  38. package/src/init.ts +16 -4
  39. package/src/instructions.ts +147 -0
  40. package/src/load-user-module.ts +19 -9
  41. package/src/remark/headings.ts +22 -13
  42. package/src/remark/include.ts +32 -12
  43. package/src/render.ts +6 -0
  44. package/src/serve.ts +72 -40
  45. package/src/styles/globals.css +1 -0
  46. package/src/styles/motion.css +124 -0
  47. package/src/workspace-api.ts +186 -0
  48. package/src/workspace-app.tsx +85 -709
  49. package/src/workspace-chat.tsx +115 -103
  50. package/src/workspace-document.ts +55 -0
  51. package/src/workspace-export-data.ts +111 -0
  52. package/src/workspace-export-html.ts +103 -0
  53. package/src/workspace-export.tsx +143 -0
  54. package/src/workspace-panes.tsx +334 -0
  55. package/src/workspace-state.ts +241 -0
  56. package/src/workspace-theme.ts +21 -0
package/README.md CHANGED
@@ -10,7 +10,7 @@ Run directly with `npx` — no install required:
10
10
  npx @suzumiyaaoba/mdxr render plan.mdx # writes plan.html
11
11
  npx @suzumiyaaoba/mdxr serve plan.mdx # live preview at http://localhost:3737
12
12
  npx @suzumiyaaoba/mdxr catalog # list available components
13
- npx @suzumiyaaoba/mdxr init # install the mdxr agent skill into the project
13
+ npx @suzumiyaaoba/mdxr init # install mdxr instructions for Codex and Claude
14
14
  ```
15
15
 
16
16
  Or install it:
@@ -45,6 +45,8 @@ Saved annotations remain in your browser for that document; they do not modify t
45
45
 
46
46
  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).
47
47
 
48
+ In the `mdxr serve` workspace, choose **Export HTML** to download one standalone review archive with the rendered document, chat, comments, section review statuses, every saved MDX version, and their diffs. Images and stylesheets are embedded in the 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.
49
+
48
50
  ### `mdxr text [file]`
49
51
 
50
52
  Render an `.mdx` document to plain Markdown — every component becomes an ASCII/text stand-in (status checkbox lists, block-bar charts, GFM tables, `<details>` disclosures) so the document stays readable in any Markdown viewer or terminal. Interactive-only widgets (dialogs, menus, shadcn chrome) degrade to their text content; unknown components warn to stderr and keep their children.
@@ -61,16 +63,18 @@ List built-in and project-defined components (`--json` for machine-readable outp
61
63
 
62
64
  ### `mdxr init`
63
65
 
64
- Install the mdxr agent skill so coding agents know the component catalog.
66
+ Install mdxr's authoring instructions for Codex and Claude. By default, the instructions go into your home directory and are referenced from the global agent config files.
65
67
 
66
68
  ```sh
67
- mdxr init # → .agents/skills/mdxr/
68
- mdxr init --tool claude # → .claude/skills/mdxr/
69
- mdxr init --tool all # all supported tools
70
- mdxr init --global # into your home directory instead
69
+ mdxr init # Codex + Claude, in your home directory
70
+ mdxr init --tool codex # Codex only
71
+ mdxr init --tool claude --local # Claude only, in this project
72
+ mdxr init --global # explicitly install into your home directory
73
+ mdxr init --force # refresh generated instructions and references
74
+ mdxr init --skill # install the Agent Skill instead
71
75
  ```
72
76
 
73
- Local installs also add `.mdxr/` to the project's `.gitignore` — the untracked scratch dir agents write documents to.
77
+ The global install creates `$CODEX_HOME/MDXR.md` (or `~/.codex/MDXR.md` when `CODEX_HOME` is unset) and its `mdxr/references/`, plus matching files under `~/.claude/`. It adds a read instruction to `$CODEX_HOME/AGENTS.md`; Claude's `~/.claude/CLAUDE.md` imports `@./MDXR.md`. Use `--local` to create `.codex/MDXR.md` and `.claude/MDXR.md` in the project, with references from the root `AGENTS.md` and `CLAUDE.md`. A local install also adds `.mdxr/` to `.gitignore` for agent-authored documents and rendered HTML. `--force` refreshes generated instruction files and references while preserving the rest of your config files.
74
78
 
75
79
  ## Wireframes
76
80
 
@@ -89,24 +93,21 @@ Build screen mockups with the built-in `Wireframe*` components, adapted from [wi
89
93
 
90
94
  Render with `mdxr render wireframe.mdx`. Text/media placeholders, cards, avatars, lists, section presets, and editable fields support light/dark themes and Markdown output. See the [guide](docs/docs/wireframe.mdx) and [examples](examples/catalog/wireframe.mdx). Adapted source retains the [upstream MIT license](src/wireframe-ui.LICENSE.md).
91
95
 
92
- ## Agent skill
96
+ ## Agent Skill
93
97
 
94
- The `mdxr` skill teaches coding agents the component catalog and the render workflow. Install it into your project (or globally) with the [`skills` CLI](https://github.com/vercel-labs/skills):
98
+ If you prefer the Agent Skills format, `mdxr init --skill` installs the bundled skill. You can also install it from the repo with the [`skills` CLI](https://github.com/vercel-labs/skills):
95
99
 
96
100
  ```sh
101
+ mdxr init --skill
97
102
  npx skills add Suzumiyaaoba/mdxr --skill mdxr
98
103
  # add -g for a global install, or -a claude-code to target a specific agent
99
104
  ```
100
105
 
101
- Then ask your agent, for example:
102
-
103
- > Use the mdxr skill to write an implementation plan for the auth feature and render it to HTML.
106
+ Once the instructions or skill are installed, ask your agent, for example:
104
107
 
105
- Not just plans — any deliverable works (reports, reviews, investigation summaries, …). To make this automatic, add a standing instruction to your agent config (e.g. `AGENTS.md` / `CLAUDE.md`):
108
+ > Write an implementation plan for the auth feature and render it to HTML with mdxr.
106
109
 
107
- ```md
108
- - Whenever the user explicitly asks for a deliverable with mdxr, use the mdxr skill to write and render it.
109
- ```
110
+ Plans, reports, reviews, investigation summaries, release notes, and postmortems all work. Documents go in `.mdxr/` unless you specify another location.
110
111
 
111
112
  ## License
112
113