dsh-mermaid-smooth 0.2.1 → 0.2.3
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 +78 -14
- package/README.zh.md +47 -7
- package/icon.svg +17 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +30 -3
package/README.md
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Render mermaid code fences in DeepSeek Harness (
|
|
6
|
-
default, with smooth zoom and pan, a per-fence
|
|
7
|
-
card's top-right, a persisted per-fence
|
|
8
|
-
fully bundled offline engine (zero CDN).
|
|
5
|
+
Render mermaid code fences in DeepSeek Harness (DSH) Web chat and the DSH
|
|
6
|
+
Desktop app as diagrams by default, with smooth zoom and pan, a per-fence
|
|
7
|
+
diagram/code toggle at each card's top-right, a persisted per-fence
|
|
8
|
+
preference, dark-mode follow, and a fully bundled offline engine (zero CDN).
|
|
9
|
+
|
|
10
|
+
The Desktop app is an Electron shell around the complete DSH Web application,
|
|
11
|
+
so it loads the same Web frontend and the same plugin bundle — one client
|
|
12
|
+
build serves both, with no Desktop-specific code path.
|
|
9
13
|
|
|
10
14
|
## Supported diagram types
|
|
11
15
|
|
|
@@ -68,12 +72,12 @@ to screen readers via `aria-live="polite"`.
|
|
|
68
72
|
|
|
69
73
|
## Install
|
|
70
74
|
|
|
71
|
-
dsh-mermaid-smooth is a plugin for the DeepSeek Harness (
|
|
72
|
-
proceeding, make sure
|
|
73
|
-
up.
|
|
75
|
+
dsh-mermaid-smooth is a plugin for the DeepSeek Harness (DSH) Web UI and the
|
|
76
|
+
DSH Desktop app. Before proceeding, make sure DSH is installed and set up.
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
sessions are persisted on disk and can be resumed after
|
|
78
|
+
Six ways — pick one, then restart DSH Web or the Desktop app (the current
|
|
79
|
+
session ends, but DSH sessions are persisted on disk and can be resumed after
|
|
80
|
+
restart).
|
|
77
81
|
|
|
78
82
|
**1. npm package (recommended, simplest)**
|
|
79
83
|
|
|
@@ -97,18 +101,34 @@ history page); later changes on `main` will not silently alter installed code.
|
|
|
97
101
|
The source is installed and built at install time (`prepare` runs the esbuild
|
|
98
102
|
bundle), so git and Node.js ≥ 20 are required.
|
|
99
103
|
|
|
104
|
+
pnpm ≥ 10 blocks that `prepare` build for git-hosted packages until you
|
|
105
|
+
allowlist it: the first install fails with `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`
|
|
106
|
+
and prints the exact key to add. Copy that key verbatim (it embeds the
|
|
107
|
+
codeload URL with the full commit sha — a bare package name does not match)
|
|
108
|
+
under `allowBuilds` in the profile's `pnpm-workspace.yaml`, then re-run:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
allowBuilds:
|
|
112
|
+
dsh-mermaid-smooth@https://codeload.github.com/gitByteFree/dsh-mermaid-smooth/tar.gz/<full-commit-sha>: true
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
This is the same trust decision as any build-time script: only allowlist
|
|
116
|
+
packages whose source you have reviewed. If you would rather not run
|
|
117
|
+
build-time code at all, use methods 1 or 3, which ship the prebuilt bundle
|
|
118
|
+
and need no `allowBuilds` entry.
|
|
119
|
+
|
|
100
120
|
**3. From a release tarball (offline / where git is inconvenient)**
|
|
101
121
|
|
|
102
|
-
Download `dsh-mermaid-smooth-0.2.
|
|
122
|
+
Download `dsh-mermaid-smooth-0.2.1.tgz` from this repo's
|
|
103
123
|
[Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) (it
|
|
104
124
|
contains the prebuilt `lib/client.js`, so no `prepare` script runs at install
|
|
105
125
|
time), then run from the directory you downloaded it to:
|
|
106
126
|
|
|
107
127
|
```sh
|
|
108
|
-
dsh plugin --profile web add ./dsh-mermaid-smooth-0.2.
|
|
128
|
+
dsh plugin --profile web add ./dsh-mermaid-smooth-0.2.1.tgz
|
|
109
129
|
```
|
|
110
130
|
|
|
111
|
-
`0.2.
|
|
131
|
+
`0.2.1` above is a real filename, not a placeholder — match the version you
|
|
112
132
|
downloaded and drop any `<...>` brackets (zsh reads a bare `<...>` as input
|
|
113
133
|
redirection and fails with "no such file or directory"). Keep the `./`
|
|
114
134
|
prefix: `dsh plugin add` anchors `./`-relative paths to your current
|
|
@@ -122,8 +142,52 @@ cd dsh-mermaid-smooth
|
|
|
122
142
|
dsh plugin --profile web add .
|
|
123
143
|
```
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
|
|
145
|
+
**5. From the DSH plugin market (Discover)**
|
|
146
|
+
|
|
147
|
+
This repo publishes its own market index, so the plugin can be installed from
|
|
148
|
+
**Discover** without typing a package name:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
https://cdn.jsdelivr.net/gh/gitByteFree/dsh-mermaid-smooth@main/market/index.json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Open **Plugins** in the sidebar, switch on **Custom plugin markets** under
|
|
155
|
+
**Experimental plugins** if it is off, then in **Discover** add the index URL
|
|
156
|
+
above as a source and install **Mermaid Smooth**. The same index works in the
|
|
157
|
+
Desktop app.
|
|
158
|
+
|
|
159
|
+
jsDelivr serves the index because Discover needs a direct `200` without
|
|
160
|
+
redirects; a release can take up to 12 hours to appear there. To pick up a
|
|
161
|
+
fresh release immediately, pin an immutable commit (`@<commit>` instead of
|
|
162
|
+
`@main`) or use
|
|
163
|
+
`https://raw.githubusercontent.com/gitByteFree/dsh-mermaid-smooth/main/market/index.json`.
|
|
164
|
+
|
|
165
|
+
**6. DSH Desktop app (Electron)**
|
|
166
|
+
|
|
167
|
+
The Desktop app bundles the complete DSH Web application, so this plugin needs
|
|
168
|
+
no separate Desktop build. Desktop exclusively owns the `desktop` profile, and
|
|
169
|
+
only the CLI bundled with the app can manage it — an npm-installed `dsh`
|
|
170
|
+
refuses it with
|
|
171
|
+
`profile "desktop" is managed exclusively by the Electron application`.
|
|
172
|
+
|
|
173
|
+
1. Launch the Desktop app once so it initializes `$DSH_HOME/profiles/desktop`,
|
|
174
|
+
then quit it completely.
|
|
175
|
+
2. Install the app's command from the menu (**Manage dsh Command… →
|
|
176
|
+
Install**) and run:
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
dsh plugin --profile desktop add dsh-mermaid-smooth
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. Reopen the app. You can also install from its **Plugins** page or from the
|
|
183
|
+
market index in method 5.
|
|
184
|
+
|
|
185
|
+
Runtime behaviour is identical: diagrams, wheel zoom and drag, the per-fence
|
|
186
|
+
switch, the persisted preference, theme follow, copy, SVG download, and
|
|
187
|
+
fullscreen all run in the shared Web client.
|
|
188
|
+
|
|
189
|
+
Restart the web app (`dsh web`, or your `dsh-web` service) or reopen the
|
|
190
|
+
Desktop app so the new bundle layer is composed.
|
|
127
191
|
|
|
128
192
|
## License
|
|
129
193
|
|
package/README.zh.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
将 DeepSeek Harness(
|
|
5
|
+
将 DeepSeek Harness(DSH)**Web 与桌面版**对话中的 mermaid 代码围栏**默认渲染为图**:丝滑的缩放与拖拽,每张图右上角提供图/文案切换,偏好按围栏记忆,明暗主题跟随,渲染引擎完全本地打包(零 CDN)。
|
|
6
|
+
|
|
7
|
+
桌面版是完整 DSH Web 应用的 Electron 外壳,加载的是同一份 Web 前端与同一份插件 bundle —— 一份客户端产物同时服务两端,没有桌面版专用的代码分支。
|
|
6
8
|
|
|
7
9
|
## 支持的图表类型
|
|
8
10
|
|
|
@@ -52,9 +54,9 @@
|
|
|
52
54
|
|
|
53
55
|
## 安装
|
|
54
56
|
|
|
55
|
-
dsh-mermaid-smooth 是 DeepSeek Harness
|
|
57
|
+
dsh-mermaid-smooth 是 DeepSeek Harness(DSH)Web 界面与桌面版的插件。使用前请确保你已安装并配置好 dsh。
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
六种方式任选其一,装完重启 DSH Web 或桌面版即生效(当前会话会中断,但 DSH 会话有磁盘持久化,重启后可以恢复)。
|
|
58
60
|
|
|
59
61
|
**方式一:npm 正式包(推荐,最简单)**
|
|
60
62
|
|
|
@@ -72,15 +74,24 @@ dsh plugin --profile web add 'github:gitByteFree/dsh-mermaid-smooth#<40位commit
|
|
|
72
74
|
|
|
73
75
|
固定到你想装的 commit(如仓库提交历史页显示的 main HEAD),之后 main 的新改动不会静默改变已安装代码。源码安装时会在本机构建(`prepare` 脚本执行 esbuild 打包),需要 git 与 Node.js ≥ 20。
|
|
74
76
|
|
|
77
|
+
pnpm ≥ 10 默认拦截 git 来源包的 `prepare` 构建脚本:首次安装会报 `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`,并把需要加白名单的精确键名打印在报错里。把该键**原样**复制(内嵌 codeload URL 和完整 commit sha,只写短包名匹配不上)到 profile 的 `pnpm-workspace.yaml` 的 `allowBuilds` 下,再重新执行安装:
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
allowBuilds:
|
|
81
|
+
dsh-mermaid-smooth@https://codeload.github.com/gitByteFree/dsh-mermaid-smooth/tar.gz/<40位commit>: true
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
这与任何构建期脚本是同一种信任决定:只对你审查过来源的包放行。如果不想在安装时执行构建代码,请用方式一或方式三 —— 它们内置预构建产物,无需任何 `allowBuilds` 条目。
|
|
85
|
+
|
|
75
86
|
**方式三:从 Release tarball 安装(离线 / 不便走 git 的环境)**
|
|
76
87
|
|
|
77
|
-
从本仓库 [Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) 下载 `dsh-mermaid-smooth-0.2.
|
|
88
|
+
从本仓库 [Releases](https://github.com/gitByteFree/dsh-mermaid-smooth/releases) 下载 `dsh-mermaid-smooth-0.2.1.tgz`(内含构建好的 `lib/client.js`,安装时无需执行任何 prepare 脚本),进入下载目录后执行:
|
|
78
89
|
|
|
79
90
|
```sh
|
|
80
|
-
dsh plugin --profile web add ./dsh-mermaid-smooth-0.2.
|
|
91
|
+
dsh plugin --profile web add ./dsh-mermaid-smooth-0.2.1.tgz
|
|
81
92
|
```
|
|
82
93
|
|
|
83
|
-
命令里的 `0.2.
|
|
94
|
+
命令里的 `0.2.1` 是**真实文件名**,不是占位符 —— 请改成你实际下载的版本,并去掉一切 `<...>` 尖括号(zsh 会把裸的 `<...>` 当作输入重定向,报「没有那个文件或目录」)。保留 `./` 前缀:`dsh plugin add` 只把 `./`、`../` 开头的路径锚定到你当前所在目录,裸文件名会在 profile 目录里查找。
|
|
84
95
|
|
|
85
96
|
**方式四:克隆后从本地路径安装(开发迭代)**
|
|
86
97
|
|
|
@@ -90,7 +101,36 @@ cd dsh-mermaid-smooth
|
|
|
90
101
|
dsh plugin --profile web add .
|
|
91
102
|
```
|
|
92
103
|
|
|
93
|
-
|
|
104
|
+
**方式五:从 DSH 插件市场(Discover)安装**
|
|
105
|
+
|
|
106
|
+
本仓库自带一份插件市场索引,因此可以在 **Discover** 里直接安装,无需手输包名:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
https://cdn.jsdelivr.net/gh/gitByteFree/dsh-mermaid-smooth@main/market/index.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
打开侧边栏 **Plugins**,若 **Experimental plugins** 下的 **Custom plugin markets** 未开启则先打开;随后在 **Discover** 中把上面的索引 URL 添加为来源,再安装 **Mermaid 丝滑图表**。桌面版同样可用这份索引。
|
|
113
|
+
|
|
114
|
+
索引走 jsDelivr 分发,因为 Discover 要求直接返回 `200` 且不重定向;新版本可能需要最多 12 小时才会出现在上面。想立刻拿到刚发布的版本,可以把索引 URL 钉到不可变 commit(用 `@<commit>` 代替 `@main`),或改用
|
|
115
|
+
`https://raw.githubusercontent.com/gitByteFree/dsh-mermaid-smooth/main/market/index.json`。
|
|
116
|
+
|
|
117
|
+
**方式六:从 DSH 桌面版(Electron)安装**
|
|
118
|
+
|
|
119
|
+
桌面版内置了完整的 DSH Web 应用,因此本插件无需单独的桌面版构建。`desktop` profile 由桌面版独占,只有桌面版自带的 CLI 能管理它 —— npm 全局安装的 `dsh` 会直接拒绝:
|
|
120
|
+
`profile "desktop" is managed exclusively by the Electron application`。
|
|
121
|
+
|
|
122
|
+
1. 先启动一次桌面版,让它初始化 `$DSH_HOME/profiles/desktop`,然后**完全退出**应用。
|
|
123
|
+
2. 从应用菜单 **Manage dsh Command… → Install** 安装 CLI,然后执行:
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
dsh plugin --profile desktop add dsh-mermaid-smooth
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
3. 重新打开桌面版即可。也可以通过应用内 **Plugins** 页或方式五的市场索引安装。
|
|
130
|
+
|
|
131
|
+
两端运行时行为一致:成图、滚轮缩放与拖拽、按围栏切换、偏好记忆、主题跟随、复制、SVG 下载、全屏都跑在同一份 Web 客户端里。
|
|
132
|
+
|
|
133
|
+
安装后重启 web 应用(`dsh web` 或你的 `dsh-web` 服务)或重新打开桌面版,使新 bundle 层生效。
|
|
94
134
|
|
|
95
135
|
## 许可
|
|
96
136
|
|
package/icon.svg
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Mermaid Smooth">
|
|
2
|
+
<rect x="1" y="1" width="62" height="62" rx="14" fill="#111827"/>
|
|
3
|
+
<g fill="none" stroke="#5eead4" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
4
|
+
<path d="M32 20 L32 28"/>
|
|
5
|
+
<path d="M32 28 L18 28 L18 36"/>
|
|
6
|
+
<path d="M32 28 L46 28 L46 36"/>
|
|
7
|
+
</g>
|
|
8
|
+
<g fill="#1f2937" stroke="#f472b6" stroke-width="2.5">
|
|
9
|
+
<rect x="21" y="8" width="22" height="12" rx="4"/>
|
|
10
|
+
<rect x="9" y="36" width="18" height="12" rx="4"/>
|
|
11
|
+
<rect x="37" y="36" width="18" height="12" rx="4"/>
|
|
12
|
+
</g>
|
|
13
|
+
<g stroke="#5eead4" stroke-width="2" stroke-linecap="round">
|
|
14
|
+
<path d="M14 42 L22 42"/>
|
|
15
|
+
<path d="M42 42 L50 42"/>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,30 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mermaid-smooth",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Render mermaid fences in
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Render mermaid fences in DeepSeek Harness (Web and Desktop) chat as diagrams by default with smooth zoom/pan, per-fence diagram/code toggle at top-right, persisted per-fence preference, dark-mode follow, and full offline (bundled engine, zero CDN). DSH Web 与桌面版对话中的 mermaid 围栏默认成图:丝滑缩放拖拽、图右上角图/文案切换、按围栏记忆偏好、明暗主题跟随、引擎本地打包完全离线。",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": "chris",
|
|
7
|
+
"homepage": "https://github.com/gitByteFree/dsh-mermaid-smooth#readme",
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
10
|
"url": "git+https://github.com/gitByteFree/dsh-mermaid-smooth.git"
|
|
9
11
|
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/gitByteFree/dsh-mermaid-smooth/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"dsh",
|
|
17
|
+
"dsh-plugin",
|
|
18
|
+
"deepseek-harness",
|
|
19
|
+
"mermaid",
|
|
20
|
+
"diagram",
|
|
21
|
+
"flowchart",
|
|
22
|
+
"markdown",
|
|
23
|
+
"visualization",
|
|
24
|
+
"offline"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"dsh": ">=0.2.1-rc.2"
|
|
31
|
+
},
|
|
10
32
|
"type": "module",
|
|
11
33
|
"main": "lib/index.js",
|
|
12
34
|
"exports": {
|
|
13
35
|
".": "./lib/index.js",
|
|
14
36
|
"./client": "./lib/client.js",
|
|
37
|
+
"./locale/*.json": "./locale/*.json",
|
|
38
|
+
"./icon": "./icon.svg",
|
|
15
39
|
"./package.json": "./package.json"
|
|
16
40
|
},
|
|
17
41
|
"files": [
|
|
18
42
|
"lib/index.js",
|
|
19
43
|
"lib/client.js",
|
|
20
44
|
"cordis.patch.yml",
|
|
45
|
+
"icon.svg",
|
|
46
|
+
"locale/*.json",
|
|
21
47
|
"README.md",
|
|
22
48
|
"LICENSE"
|
|
23
49
|
],
|
|
24
50
|
"scripts": {
|
|
25
51
|
"build": "node scripts/build.mjs",
|
|
26
52
|
"prepare": "node scripts/build.mjs",
|
|
27
|
-
"test": "node --test \"test/*.test.mjs\""
|
|
53
|
+
"test": "node --test \"test/*.test.mjs\"",
|
|
54
|
+
"market": "node scripts/market.mjs"
|
|
28
55
|
},
|
|
29
56
|
"devDependencies": {
|
|
30
57
|
"mermaid": "^11.17.2",
|