Commit 59c1f49
feat: MCP export tool — theme override, export:current resource, full integration tests
- Enhance export tool: add optional theme param (paper/sepia/midnight) for
HTML exports; validated in tool_export, forwarded as 'theme' in IPC body
- Add export:current MCP resource (text/html, read-only): polls /export/preview
on the IPC server and returns live HTML with a metadata comment header so
agents can preview rendered output without writing any files
- 29 new Rust integration tests in tests/integration.rs covering:
- Successful export for pdf/docx/html formats
- output_path forwarded (or null) in IPC body
- theme override for all three values; invalid theme → -32602
- File-write errors (permission denied, disk full, app not running) → -32000
- export:current in resources/list (mime type, description)
- resources/read export:current: success, metadata comment, IPC errors
- dispatch routing for both resources/list and resources/read
- Add src/mcp/bridge.test.ts (32 tests) verifying:
- mcp://export → uiStore.openExport() when doc open; toast when no doc
- All three export formats (pdf/html/docx) open the dialog
- mcp://set-content → store update + immediate mcp_sync_state push
- mcp://edit → find/replace on live content + mcp_edit_result (ok/fail)
- mcp://review → pending review registered in reviewStore
- mcp://present → zenMode=true + viewMode=read
- mcp://open → read_markdown_file invoked + mode applied
- Mount: mcp_sync_state + mcp_sync_vault called on startup
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 098fc37 commit 59c1f49
3 files changed
Lines changed: 1048 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
294 | 299 | | |
295 | 300 | | |
296 | 301 | | |
| |||
565 | 570 | | |
566 | 571 | | |
567 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
568 | 589 | | |
569 | 590 | | |
570 | 591 | | |
571 | 592 | | |
572 | | - | |
| 593 | + | |
573 | 594 | | |
574 | 595 | | |
575 | 596 | | |
| |||
878 | 899 | | |
879 | 900 | | |
880 | 901 | | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
887 | 916 | | |
888 | 917 | | |
889 | 918 | | |
| |||
914 | 943 | | |
915 | 944 | | |
916 | 945 | | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
917 | 974 | | |
918 | 975 | | |
919 | 976 | | |
| |||
0 commit comments