dsh-media-card
其他 活跃维护

dsh-media-card

YangRuiYangDan/dsh-media-card

在对话界面中自动将主机端图片、视频与文档转为卡片形式呈现,无需切换窗口即可预览与查看媒体内容,适配高速远程工作流,让文件浏览直观顺手。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
21 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:YangRuiYangDan/dsh-media-card
git clone https://github.com/YangRuiYangDan/dsh-media-card.git
git clone git@github.com:YangRuiYangDan/dsh-media-card.git
README.md main

dsh-media-card

Show a local image or short video in the current DeepSeek Harness conversation card, with one-click download. Works on local and remote connections.

简体中文 · MIT · Tutorial

Community plugin for DeepSeek Harness. Not an official DeepSeek AI product.

Conversation markdown still will not render a local file:// or Windows path. Official read_image remains the model-vision path. This plugin is for the human sitting at the card — preview and download.

Features

Tool dsh_show_media · one argument file_path
Images PNG, JPEG, WebP, GIF
Videos MP4, WebM, MOV, M4V, MKV · 64MiB cap
Display inline original-file preview (not the official attachment downsample)
Download every card carries a ⬇ Download link saving the original file
Preview click the image (or the video frame) · Esc / backdrop / × closes
Remote works over a GET preview endpoint, so it is usable over LAN / tunnel / public hub remote connections
Scope this conversation card only · does not occupy shell.overlay

Compared to 0.1.0: switched to a GET inline/download endpoint so remote connections work; fixed host and browser dependency resolution (inject); removed the flaky POST RPC channel and internal diagnostics.

Relative paths resolve against the session workspace.

{ "file_path": "C:\\path\\to\\photo.webp" }

Install

From npm (published):

dsh plugin --profile web add dsh-media-card

From GitHub (no build step — lib/ is the source):

dsh plugin --profile web add github:YangRuiYangDan/dsh-media-card

Or a local checkout:

dsh plugin --profile web add /path/to/dsh-media-card

Restart web, then ask the agent to show a local file.

What it does

  • The agent calls dsh_show_media; the card inlines the original media and offers a download link.
  • Images follow the deployment's attachment limit; videos cap at 64MiB (DEFAULT_VIDEO_CAP).
  • Click the image or the video frame to open a larger preview.

Security

  • The server trusts loopback plus the deployment's configured trusted hosts (the same principle as dsh's own /api) — so it does not depend on any specific remote-access plugin, and works with any setup that can reach dsh.
  • Only image/video extensions are accepted, and reads are size-capped.
  • This is not an auth layer; protect remote access with whatever protects your dsh deployment (rdsh gateway pairing/login, reverse-proxy auth, tailscale, etc.).

What this is not

  • Not a replacement for read_image (model vision still uses the official path).
  • Not a process-wide floating overlay.
  • Not a second gallery. It only customizes the dsh_show_media tool card.

Development

Host: lib/index.js (defineTool + GET preview/download endpoint).
Client: lib/client.js (window.__ModuleLoader__, keyed tool.call.toolview).
Shared: lib/media.js.

node --check lib/index.js && node --check lib/client.js && node --check lib/media.js

License

MIT