dsh-markdown-typora 0.0.0-stage → 0.3.11

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 (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -2
  3. package/THIRD-PARTY-NOTICES.md +15 -0
  4. package/cordis.patch.yml +4 -0
  5. package/core.json +630 -0
  6. package/host/document-store.js +181 -0
  7. package/host/live-documents.js +524 -0
  8. package/host/native/file-worker.exe +0 -0
  9. package/host/native/file-worker.exe.build.json +10 -0
  10. package/host/native-worker-lease.js +127 -0
  11. package/host/native-worker-path.ps1 +63 -0
  12. package/host/package.json +1 -0
  13. package/host/safe-file.js +137 -0
  14. package/host/text-codec.js +67 -0
  15. package/host.json +50 -0
  16. package/icon.png +0 -0
  17. package/lib/client.js +2136 -0
  18. package/lib/index.js +1506 -0
  19. package/package.json +70 -4
  20. package/renderer-cm6/cm6/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  21. package/renderer-cm6/cm6/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  22. package/renderer-cm6/cm6/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  23. package/renderer-cm6/cm6/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  24. package/renderer-cm6/cm6/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  25. package/renderer-cm6/cm6/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  26. package/renderer-cm6/cm6/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  27. package/renderer-cm6/cm6/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  28. package/renderer-cm6/cm6/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  29. package/renderer-cm6/cm6/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  30. package/renderer-cm6/cm6/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  31. package/renderer-cm6/cm6/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  32. package/renderer-cm6/cm6/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  33. package/renderer-cm6/cm6/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  34. package/renderer-cm6/cm6/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  35. package/renderer-cm6/cm6/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  36. package/renderer-cm6/cm6/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  37. package/renderer-cm6/cm6/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  38. package/renderer-cm6/cm6/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  39. package/renderer-cm6/cm6/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  40. package/renderer-cm6/cm6/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  41. package/renderer-cm6/cm6/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  42. package/renderer-cm6/cm6/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  43. package/renderer-cm6/cm6/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  44. package/renderer-cm6/cm6/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  45. package/renderer-cm6/cm6/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  46. package/renderer-cm6/cm6/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  47. package/renderer-cm6/cm6/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  48. package/renderer-cm6/cm6/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  49. package/renderer-cm6/cm6/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  50. package/renderer-cm6/cm6/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  51. package/renderer-cm6/cm6/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  52. package/renderer-cm6/cm6/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  53. package/renderer-cm6/cm6/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  54. package/renderer-cm6/cm6/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  55. package/renderer-cm6/cm6/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  56. package/renderer-cm6/cm6/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  57. package/renderer-cm6/cm6/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  58. package/renderer-cm6/cm6/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  59. package/renderer-cm6/cm6/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  60. package/renderer-cm6/cm6/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  61. package/renderer-cm6/cm6/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  62. package/renderer-cm6/cm6/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  63. package/renderer-cm6/cm6/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  64. package/renderer-cm6/cm6/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  65. package/renderer-cm6/cm6/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  66. package/renderer-cm6/cm6/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  67. package/renderer-cm6/cm6/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  68. package/renderer-cm6/cm6/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  69. package/renderer-cm6/cm6/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  70. package/renderer-cm6/cm6/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  71. package/renderer-cm6/cm6/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  72. package/renderer-cm6/cm6/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  73. package/renderer-cm6/cm6/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  74. package/renderer-cm6/cm6/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  75. package/renderer-cm6/cm6/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  76. package/renderer-cm6/cm6/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  77. package/renderer-cm6/cm6/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  78. package/renderer-cm6/cm6/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  79. package/renderer-cm6/cm6/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  80. package/renderer-cm6/cm6/app.css +1 -0
  81. package/renderer-cm6/cm6/app.js +1216 -0
  82. package/renderer-cm6/cm6/fonts/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  83. package/renderer-cm6/cm6/fonts/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  84. package/renderer-cm6/cm6/fonts/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  85. package/renderer-cm6/cm6/fonts/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  86. package/renderer-cm6/cm6/fonts/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  87. package/renderer-cm6/cm6/fonts/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  88. package/renderer-cm6/cm6/fonts/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  89. package/renderer-cm6/cm6/fonts/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  90. package/renderer-cm6/cm6/fonts/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  91. package/renderer-cm6/cm6/fonts/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  92. package/renderer-cm6/cm6/fonts/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  93. package/renderer-cm6/cm6/fonts/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  94. package/renderer-cm6/cm6/fonts/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  95. package/renderer-cm6/cm6/fonts/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  96. package/renderer-cm6/cm6/fonts/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  97. package/renderer-cm6/cm6/fonts/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  98. package/renderer-cm6/cm6/fonts/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  99. package/renderer-cm6/cm6/fonts/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  100. package/renderer-cm6/cm6/fonts/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  101. package/renderer-cm6/cm6/fonts/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  102. package/renderer-cm6/cm6/fonts/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  103. package/renderer-cm6/cm6/fonts/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  104. package/renderer-cm6/cm6/fonts/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  105. package/renderer-cm6/cm6/fonts/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  106. package/renderer-cm6/cm6/fonts/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  107. package/renderer-cm6/cm6/fonts/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  108. package/renderer-cm6/cm6/fonts/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  109. package/renderer-cm6/cm6/fonts/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  110. package/renderer-cm6/cm6/fonts/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  111. package/renderer-cm6/cm6/fonts/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  112. package/renderer-cm6/cm6/fonts/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  113. package/renderer-cm6/cm6/fonts/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  114. package/renderer-cm6/cm6/fonts/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  115. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  116. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  117. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  118. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  119. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  120. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  121. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  122. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  123. package/renderer-cm6/cm6/fonts/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  124. package/renderer-cm6/cm6/fonts/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  125. package/renderer-cm6/cm6/fonts/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  126. package/renderer-cm6/cm6/fonts/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  127. package/renderer-cm6/cm6/fonts/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  128. package/renderer-cm6/cm6/fonts/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  129. package/renderer-cm6/cm6/fonts/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  130. package/renderer-cm6/cm6/fonts/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  131. package/renderer-cm6/cm6/fonts/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  132. package/renderer-cm6/cm6/fonts/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  133. package/renderer-cm6/cm6/fonts/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  134. package/renderer-cm6/cm6/fonts/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  135. package/renderer-cm6/cm6/fonts/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  136. package/renderer-cm6/cm6/fonts/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  137. package/renderer-cm6/cm6/fonts/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  138. package/renderer-cm6/cm6/fonts/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  139. package/renderer-cm6/cm6/fonts/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  140. package/renderer-cm6/cm6/fonts/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  141. package/renderer-cm6/cm6/fonts/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  142. package/renderer-cm6/cm6/markdown-worker.js +6 -0
  143. package/renderer-cm6/cm6/mermaid.min.js +3636 -0
  144. package/renderer-cm6/dsh-bridge.js +617 -0
  145. package/renderer-cm6/dsh-selection.js +345 -0
  146. package/renderer-cm6/index.html +173 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ltmroberthk915
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,114 @@
1
- # Temporary Holding Version
1
+ # dsh-markdown-typora
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **A Markdown editor for the DeepSeek Harness right sidebar, built on MarkPilot CM6 3.6.16.**
4
+
5
+ Write Markdown in DSH with Typora-style live rendering; select a passage and send its **Markdown source** straight into the current conversation.
6
+
7
+ ## Screenshots
8
+
9
+ | | |
10
+ | --- | --- |
11
+ | **Selection → chat, inside DSH**<br>![A selection inserted into the DSH conversation](assets/screenshots/01-dsh-insert-to-chat.jpg) | **A formula block, Typora-style — click a glyph and the source caret lands on it**<br>![Formula source with its rendered preview](assets/screenshots/02-math-formula-box.jpg) |
12
+ | **Notion dark**<br>![Editor in the Notion dark theme](assets/screenshots/03-hero-notion-dark.jpg) | **护眼米黄 (sepia light)**<br>![Editor in the sepia light theme](assets/screenshots/04-hero-sepia-light.jpg) |
13
+ | **9 themes, switchable from the toolbar**<br>![Theme picker](assets/screenshots/05-theme-panel.jpg) | **A selection that crosses inline formulas**<br>![Selection across inline math](assets/screenshots/06-selection-across-math.jpg) |
14
+ | **Table cells are real cells**<br>![Table cell toolbar](assets/screenshots/07-table-toolbar.jpg) | **Images render in the document**<br>![Image in the document](assets/screenshots/08-image-in-doc.jpg) |
15
+
16
+ ## Beyond Typora, inside DSH
17
+
18
+ - **Click a formula to edit its source** — block and inline math expand to the editable `$…$` source in place, and return to the rendered form when the caret leaves.
19
+ - **Selections keep formulas whole** — a selection that crosses inline math carries complete formulas; copy and cut hand back the Markdown source, not the rendered glyphs.
20
+ - **Table cells, not table text** — an alignment toolbar appears over the table, with row/column operations, escaped pipes, Chinese IME composition and undo/redo kept in sync with the cell source.
21
+ - **Nine built-in themes** — 宋韵 (dark/light), Notion (dark/light), Solarized (dark/light), GitHub dark, 护眼米黄 and 柔和淡绿. Follow the host, or pick one from the toolbar.
22
+ - **Live Mermaid, KaTeX and the Markdown worker, all offline** — diagrams, math and fonts load from the plugin; there is no CDN in the path.
23
+ - **Large documents** — the Markdown syntax tree is built in a web worker, so a 150,000-character document loads and accepts typing without the UI thread parsing it.
24
+ - **Selection → chat** — the DSH-specific move: the selection's Markdown source goes into the current conversation from the floating button or `Ctrl/Cmd + Shift + Enter`.
25
+ - **Guarded saves** — version-checked writes, a conflict banner instead of an overwrite, and a recovery slot when a tab closes with unsaved edits.
26
+
27
+ ## Features
28
+
29
+ - **Real editor, not a preview** — CodeMirror 6 with live headings, lists, tables, inline math, code blocks and Mermaid.
30
+ - **Selection → chat** — a floating **Insert into chat** button appears beside a selection; `Ctrl/Cmd + Shift + Enter` does the same. The payload starts with the document's absolute path, then a blank line and the Markdown source (not the rendered text), inserted at the composer caret without stealing focus.
31
+ - **Guarded saves** — debounced autosave with version checks; `Ctrl/Cmd + S` saves immediately with a visible result, whether the caret is in the editor or elsewhere in the panel. An external edit is never overwritten. A dirty buffer is kept in a recovery slot when the tab closes.
32
+ - **Shared notes across windows** — the same file can be edited in the MarkPilot desktop app and the DSH sidebar at once. Unsaved changes are exchanged live, each window keeps its own undo history, and a genuine conflict is reported with the draft preserved.
33
+ - **Save files outside the session workspace** — a file opened from the sidebar saves directly to its own folder even when it sits outside the workspace root of the current session; version checks and conflict warnings are unchanged. Files that are read-only or locked at the OS level still report an error.
34
+ - **Theme-aware** — follows the host's light/dark theme, including the first frame.
35
+ - **Offline assets** — KaTeX fonts, the Markdown worker and Mermaid ship with the plugin; no CDN.
36
+ - **Document reference** — type `@mp` in the composer to reference the open document.
37
+ - **Local images in the document** — `![](assets/diagram.png)` and parent-folder references such as `![](../figures/a.png)` render in the panel, read through the plugin's own read-only image route; a file that is genuinely missing still shows an explicit placeholder instead of an empty box.
38
+ - **Edit right beside an image** — a click in the blank to the right of an image starts editing on the following line (headings, lists and task items keep their markers), instead of opening the image's Markdown source; clicking the image itself still opens its source.
39
+
40
+ ## What's new in the 3.6.16 engine
41
+
42
+ The editor engine is the same accepted build that ships with MarkPilot 3.6.16. Since the 0.3.4 plugin, the right sidebar gained the engine's multi-window work and the save-path fixes that came with it:
43
+
44
+ - **Shared editing across windows** — the same note can be open in the desktop app and the DSH sidebar. Unsaved edits are exchanged live, each window undoes only its own typing, and a real conflict is shown with the draft kept instead of overwriting the other window.
45
+ - **Save while typing** — a save in flight is re-synced to the latest text; an external writer is detected and reported; the recovery banner's **Keep my changes** now actually writes the shared draft; and a cut → undo → redo followed by Ctrl+S no longer fails as an invalid collaborative edit.
46
+ - **Reverse selections** — dragging from a rendered formula across code, images or into the previous paragraph keeps the selection under the pointer, including auto-scroll at the top edge.
47
+ - **Table and rich-paste editing** — cell commands, End/Backspace, escaped pipes, Chinese IME composition, and pasted HTML tables keep captions, source links, inline images and alignment.
48
+ - **Cross-note cut** — real images and local Markdown links are re-based when a passage moves between lecture and summary notes; included definitions are renamed without breaking existing references.
49
+ - **Plugin manager reload** — notes opened after a plugin reload still join the live session, and repeated reloads reuse the background writer instead of leaking workers.
50
+
51
+ ## Install
52
+
53
+ ### From npm
54
+
55
+ ```sh
56
+ dsh plugin --profile web add dsh-markdown-typora
57
+ dsh plugin --profile desktop add dsh-markdown-typora
58
+ ```
59
+
60
+ Or open **Settings → Plugins → Add plugin** and enter `dsh-markdown-typora`. Restart the host afterwards; the plugin then appears on the **Plugins** page and opens from the right sidebar.
61
+
62
+ ### From a GitHub release
63
+
64
+ Download `dsh-markdown-typora-0.3.11.tgz` from the [MarkPilot releases](https://github.com/ltmroberthk915/markpilot/releases) and add it to the profile that runs your host:
65
+
66
+ ```sh
67
+ dsh plugin --profile web add ./dsh-markdown-typora-0.3.11.tgz
68
+ dsh plugin --profile desktop add ./dsh-markdown-typora-0.3.11.tgz
69
+ ```
70
+
71
+ When the npm registry lists 0.3.11, installing by package name above gives this build; if the registry copy still lags, use the TGZ above to get exactly 0.3.11.
72
+ ### Manual (development checkout)
73
+
74
+ The plugin is the `dsh-markdown-typora/` subdirectory of the [MarkPilot repository](https://github.com/ltmroberthk915/markpilot). To load a checkout as a bundle:
75
+
76
+ ```sh
77
+ git clone https://github.com/ltmroberthk915/markpilot.git
78
+ ```
79
+
80
+ Then add a junction/symlink from the profile's `node_modules` to `markpilot/dsh-markdown-typora`, add `"dsh-markdown-typora"` to the profile `package.json`'s `dsh.profile.bundles`, and restart the host. The plugin must be a bundle, not a raw `cordis.patch.yml` file-URL insert, to appear in the Plugins page.
81
+
82
+ ## Use
83
+
84
+ 1. Open the right sidebar, press `Ctrl+P` (workspace files) and click a `.md` file.
85
+ 2. Write; the editor autosaves after 1.5 s and refuses to overwrite a newer file on disk.
86
+ 3. Select a passage → click **Insert into chat** (or `Ctrl/Cmd + Shift + Enter`). The document's absolute path is placed at the top, then a blank line and the selection.
87
+ 4. To undo the insertion, click back into the composer and press `Ctrl/Cmd + Z`; focus stays in the editor by design.
88
+
89
+ ## How it is built
90
+
91
+ The editor engine is the already-built MarkPilot CM6 3.6.16 renderer, copied byte-for-byte into `renderer-cm6/cm6/`. The plugin adds only:
92
+
93
+ - `renderer-cm6/index.html` + `dsh-bridge.js` + `dsh-selection.js` — the DSH skin and selection bridge;
94
+ - `lib/index.js` — static routes, version-guarded file API, SSE change stream;
95
+ - `lib/client.js` — the right-sidebar tab, iframe lifecycle, save/conflict/recovery, composer insertion.
96
+
97
+ The engine source is not modified. `core.json` records the version and a SHA-256 for every core file. Maintainers of the MarkPilot monorepo can refresh it with:
98
+
99
+ ```sh
100
+ node dsh-markdown-typora/scripts/sync-core.mjs
101
+ node dsh-markdown-typora/scripts/sync-core.mjs --check
102
+ ```
103
+
104
+ ## Known limits
105
+
106
+ - Desktop-only MarkPilot features that need Electron native APIs (export, image picker) may be unavailable in DSH.
107
+ - Image references are resolved against the document's folder, so relative paths (`assets/…`, `../figures/…`) work; an absolute Windows path (`![](D:\pics\a.png)`) does not render in DSH, and a reference whose filename contains `#`, `?` or `%` cannot be addressed as a URL.
108
+ - A selection over 256 KiB is rejected with a message instead of being silently truncated.
109
+ - Insertion does not steal focus; undo it from the composer.
110
+ - Tested against DSH 0.2.1-rc.3; the plugin requires `dsh >= 0.2.0-rc.2`.
111
+
112
+ ## License
113
+
114
+ MIT. The MarkPilot engine and its bundled Mermaid/KaTeX assets retain their upstream licenses; see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).
@@ -0,0 +1,15 @@
1
+ # Third-party notices
2
+
3
+ `dsh-markdown-typora` is a DSH wrapper around the already-built MarkPilot CM6 renderer.
4
+ The following upstream projects are included in, or bundled by, that renderer:
5
+
6
+ - **MarkPilot** — MIT — <https://github.com/ltmroberthk915/markpilot>
7
+ - **CodeMirror 6** — MIT — <https://github.com/codemirror/dev>
8
+ - **Mermaid** — MIT — <https://github.com/mermaid-js/mermaid>
9
+ - **KaTeX** — MIT — <https://github.com/KaTeX/KaTeX>
10
+ - **KaTeX fonts** — SIL Open Font License 1.1 — <https://github.com/KaTeX/KaTeX/tree/main/fonts>
11
+
12
+ The plugin's own code (`lib/`, `renderer-cm6/index.html`,
13
+ `renderer-cm6/dsh-bridge.js`, `renderer-cm6/dsh-selection.js`) is MIT; see
14
+ [LICENSE](LICENSE). The built files under `renderer-cm6/cm6/` are copied
15
+ byte-for-byte from MarkPilot and retain their upstream notices.
@@ -0,0 +1,4 @@
1
+ # dsh bundle patch: 把 dsh-markdown-typora 插进 profile 组合层。
2
+ - insert:
3
+ - id: dsh-markdown-typora
4
+ name: dsh-markdown-typora