@wisdoverse/dsh-inline-media-viewer 1.0.2 → 1.0.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/CHANGELOG.md +7 -0
- package/README.md +10 -4
- package/README.zh-CN.md +9 -4
- package/client/client.js +11 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
- Clarify and enforce the transport split: workspace files use the DSH host,
|
|
6
|
+
regular HTTP(S) media loads directly, and only recognized ComfyUI URLs use
|
|
7
|
+
the optional proxy.
|
|
8
|
+
- Mark ComfyUI as optional throughout the bilingual settings UI and README.
|
|
9
|
+
|
|
3
10
|
## 1.0.2
|
|
4
11
|
|
|
5
12
|
- Make the settings navigation and all setting copy react live to DSH's
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<a href="CHANGELOG.md"><img alt="Latest tag" src="https://img.shields.io/github/v/tag/Wisdoverse/dsh-inline-media-viewer-plugin?style=flat-square&label=version"></a>
|
|
9
9
|
<a href="LICENSE"><img alt="License" src="https://img.shields.io/github/license/Wisdoverse/dsh-inline-media-viewer-plugin?style=flat-square"></a>
|
|
10
10
|
<a href="package.json"><img alt="Top language" src="https://img.shields.io/github/languages/top/Wisdoverse/dsh-inline-media-viewer-plugin?style=flat-square"></a>
|
|
11
|
-
<a href="#configuration"><img alt="ComfyUI
|
|
11
|
+
<a href="#configuration"><img alt="Optional ComfyUI" src="https://img.shields.io/badge/ComfyUI-optional-ff6f00?style=flat-square"></a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
@@ -40,9 +40,14 @@ audio/sound.mp3 → <audio controls>
|
|
|
40
40
|
| --- | --- |
|
|
41
41
|
| Inline rendering | Displays images, videos, and audio directly below the chat turn that mentions them. |
|
|
42
42
|
| Workspace-safe reads | Resolves local paths with `realpath` and rejects traversal, out-of-workspace paths, and symlink escapes. |
|
|
43
|
-
| ComfyUI proxy | Fetches recognized ComfyUI media URLs server-side from the configured origin, including for remote users and HTTPS pages. |
|
|
43
|
+
| Optional ComfyUI proxy | Fetches recognized ComfyUI media URLs server-side from the configured origin, including for remote users and HTTPS pages. |
|
|
44
44
|
| Bounded transfers | Limits each file or response to 48 MiB and remote requests to 20 seconds. |
|
|
45
|
-
| User controls | Provides auto-render, per-turn item limit, media height, and ComfyUI origin settings. |
|
|
45
|
+
| User controls | Provides auto-render, per-turn item limit, media height, and optional ComfyUI origin settings. |
|
|
46
|
+
|
|
47
|
+
> [!NOTE]
|
|
48
|
+
> ComfyUI is not required. Workspace files and regular HTTP(S) media URLs work
|
|
49
|
+
> when ComfyUI is not installed or running; its proxy is activated only for
|
|
50
|
+
> recognized ComfyUI URLs.
|
|
46
51
|
|
|
47
52
|
## Supported media
|
|
48
53
|
|
|
@@ -105,7 +110,7 @@ switch live between English and Chinese.
|
|
|
105
110
|
| Auto-render detected media | On | On / off |
|
|
106
111
|
| Maximum items per turn | `12` | `1`–`30` |
|
|
107
112
|
| Maximum media height | `380 px` | `160`–`1200 px` |
|
|
108
|
-
| ComfyUI origin | Empty | `http(s)://host[:port]` |
|
|
113
|
+
| ComfyUI origin (optional) | Empty | `http(s)://host[:port]` |
|
|
109
114
|
|
|
110
115
|
Settings are stored in the DSH settings document. Writes are available only on
|
|
111
116
|
loopback connections; remote browsers can read settings but cannot persist
|
|
@@ -113,6 +118,7 @@ changes.
|
|
|
113
118
|
|
|
114
119
|
### ComfyUI origin
|
|
115
120
|
|
|
121
|
+
- Skip this setting entirely if you do not use ComfyUI.
|
|
116
122
|
- Leave the field empty to use `http://127.0.0.1:8188`.
|
|
117
123
|
- Accepted forms are `http://host[:port]`, `https://host[:port]`, and bare
|
|
118
124
|
`host[:port]` (`http` is assumed).
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<a href="CHANGELOG.md"><img alt="最新标签" src="https://img.shields.io/github/v/tag/Wisdoverse/dsh-inline-media-viewer-plugin?style=flat-square&label=version"></a>
|
|
9
9
|
<a href="LICENSE"><img alt="许可证" src="https://img.shields.io/github/license/Wisdoverse/dsh-inline-media-viewer-plugin?style=flat-square"></a>
|
|
10
10
|
<a href="package.json"><img alt="主要语言" src="https://img.shields.io/github/languages/top/Wisdoverse/dsh-inline-media-viewer-plugin?style=flat-square"></a>
|
|
11
|
-
<a href="#配置"><img alt="
|
|
11
|
+
<a href="#配置"><img alt="可选 ComfyUI" src="https://img.shields.io/badge/ComfyUI-optional-ff6f00?style=flat-square"></a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
@@ -39,9 +39,13 @@ audio/sound.mp3 → <audio controls>
|
|
|
39
39
|
| --- | --- |
|
|
40
40
|
| 内联渲染 | 在提及媒体的聊天消息下方直接显示图像、视频和音频。 |
|
|
41
41
|
| 工作区安全读取 | 使用 `realpath` 解析本地路径,并拒绝目录穿越、工作区外路径和符号链接逃逸。 |
|
|
42
|
-
| ComfyUI 代理 | 由服务端从配置的源站获取识别到的 ComfyUI 媒体 URL,使远程用户和 HTTPS 页面也能正常查看。 |
|
|
42
|
+
| 可选 ComfyUI 代理 | 由服务端从配置的源站获取识别到的 ComfyUI 媒体 URL,使远程用户和 HTTPS 页面也能正常查看。 |
|
|
43
43
|
| 资源限制 | 每个文件或响应最大 48 MiB,远程请求最长 20 秒。 |
|
|
44
|
-
| 用户控制 |
|
|
44
|
+
| 用户控制 | 提供自动渲染、每条消息的媒体数量、媒体高度和可选的 ComfyUI 源站设置。 |
|
|
45
|
+
|
|
46
|
+
> [!NOTE]
|
|
47
|
+
> ComfyUI 不是必需依赖。即使没有安装或运行 ComfyUI,工作区文件和普通 HTTP(S)
|
|
48
|
+
> 媒体 URL 仍可正常使用;只有识别为 ComfyUI 的 URL 才会启用代理。
|
|
45
49
|
|
|
46
50
|
## 支持的媒体格式
|
|
47
51
|
|
|
@@ -102,12 +106,13 @@ dsh plugin --profile web add @wisdoverse/dsh-inline-media-viewer
|
|
|
102
106
|
| 自动渲染检测到的媒体 | 开启 | 开启 / 关闭 |
|
|
103
107
|
| 每条消息的最大媒体数量 | `12` | `1`–`30` |
|
|
104
108
|
| 媒体最大高度 | `380 px` | `160`–`1200 px` |
|
|
105
|
-
| ComfyUI
|
|
109
|
+
| ComfyUI 源站(可选) | 留空 | `http(s)://host[:port]` |
|
|
106
110
|
|
|
107
111
|
设置值保存在 DSH 设置文档中。只有回环连接可以写入;远程浏览器可以读取设置,但不能持久化修改。
|
|
108
112
|
|
|
109
113
|
### ComfyUI 源站
|
|
110
114
|
|
|
115
|
+
- 不使用 ComfyUI 时无需配置此项。
|
|
111
116
|
- 留空时使用 `http://127.0.0.1:8188`。
|
|
112
117
|
- 支持 `http://host[:port]`、`https://host[:port]` 和不带协议的
|
|
113
118
|
`host[:port]`(默认使用 `http`)。
|
package/client/client.js
CHANGED
|
@@ -197,6 +197,11 @@ window.__ModuleLoader__.load({
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
function mediaTransport(source, comfyUrl) {
|
|
201
|
+
if (!/^https?:\/\//i.test(source)) return "workspace";
|
|
202
|
+
return isComfySource(source, comfyUrl) ? "comfy-proxy" : "direct";
|
|
203
|
+
}
|
|
204
|
+
|
|
200
205
|
function basename(source) {
|
|
201
206
|
try {
|
|
202
207
|
const url = new URL(source);
|
|
@@ -209,7 +214,7 @@ window.__ModuleLoader__.load({
|
|
|
209
214
|
}
|
|
210
215
|
|
|
211
216
|
function MediaCard({ candidate, connection, sessionId, imageMaxPx, comfyUrl }) {
|
|
212
|
-
const proxied =
|
|
217
|
+
const proxied = mediaTransport(candidate.source, comfyUrl) !== "direct";
|
|
213
218
|
const [state, setState] = useState(() => proxied
|
|
214
219
|
? { status: "loading", src: "" }
|
|
215
220
|
: { status: "ready", src: candidate.source });
|
|
@@ -385,8 +390,8 @@ window.__ModuleLoader__.load({
|
|
|
385
390
|
displayCapHint: "1–30",
|
|
386
391
|
imageMaxPx: "媒体最大高度 (px)",
|
|
387
392
|
imageMaxPxHint: "160–1200",
|
|
388
|
-
comfyUrl: "ComfyUI
|
|
389
|
-
comfyUrlHint: "
|
|
393
|
+
comfyUrl: "ComfyUI 地址(可选)",
|
|
394
|
+
comfyUrlHint: "仅用于 ComfyUI 链接;不使用 ComfyUI 可保持为空,本地文件和普通网络 URL 不受影响。",
|
|
390
395
|
comfyUrlError: "地址无效,请使用 http://host:8188 这类格式。",
|
|
391
396
|
reset: "恢复默认",
|
|
392
397
|
writable: "当前连接不可回写:设置仅临时保存在本会话,刷新后恢复默认。",
|
|
@@ -400,8 +405,8 @@ window.__ModuleLoader__.load({
|
|
|
400
405
|
displayCapHint: "1–30",
|
|
401
406
|
imageMaxPx: "Max media height (px)",
|
|
402
407
|
imageMaxPxHint: "160–1200",
|
|
403
|
-
comfyUrl: "ComfyUI address",
|
|
404
|
-
comfyUrlHint: "
|
|
408
|
+
comfyUrl: "ComfyUI address (optional)",
|
|
409
|
+
comfyUrlHint: "Used only for ComfyUI links. Leave empty when not using ComfyUI; local files and regular web URLs work independently.",
|
|
405
410
|
comfyUrlError: "Invalid address; use the http://host:8188 form.",
|
|
406
411
|
reset: "Reset to defaults",
|
|
407
412
|
writable: "This connection cannot write settings: values are session-local until a loopback connection is used.",
|
|
@@ -550,6 +555,7 @@ window.__ModuleLoader__.load({
|
|
|
550
555
|
exports.apply = apply;
|
|
551
556
|
exports.inject = inject;
|
|
552
557
|
exports.name = name;
|
|
558
|
+
exports.testing = Object.freeze({ mediaTransport });
|
|
553
559
|
return module.exports;
|
|
554
560
|
},
|
|
555
561
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisdoverse/dsh-inline-media-viewer",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Persistent inline image, video, and audio previews for DeepSeek Harness Web conversations, with workspace-confined local reads and
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Persistent inline image, video, and audio previews for DeepSeek Harness Web conversations, with workspace-confined local reads and an optional ComfyUI proxy.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Wisdoverse/dsh-inline-media-viewer-plugin.git"
|