dsh-file-viewer
精選清單收錄已封存liguobao/dsh-file-viewer
DeepSeek Harness 通用只读文件预览插件,支持图片、PDF、CSV、Markdown、JSON、YAML、源码及大文件。
該倉庫已封存 —— 唯讀且不再維護,安裝前請仔細審查程式碼。
$ dsh plugin add dsh-file-viewer5
星數
0
Fork
TypeScript
語言
MIT
授權條款
2026-08-19
建立於
2026-09-22
最近推送
README
DSH File Viewer
English | 中文
⚠️ Archived — this project is no longer maintained.
Development has stopped: no further releases, bug fixes, or compatibility updates will be published. It was verified against DeepSeek Harness through
dsh-v0.1.5-rc.1, so later Harness versions may break it — in particular the workspace "…" menu patch (scripts/patch-workspace-menu.mjs). Issues and pull requests will not be reviewed. The source stays available under the MIT license; please fork it if you want to carry the work forward.
Online: dsh.r2049.cn
A universal, read-only file preview layer for DeepSeek Harness: open and inspect files right inside the web UI — no external application needed.
Preview ≠ Execute. The viewer is strictly read-only: previewing a file never runs shell commands, scripts, macros, or HTML. SVG is rendered through
<img>, and Markdown is sanitized before display.
Supported file types
| Type | Renderer |
|---|---|
| PNG / JPG / GIF / WEBP / SVG / BMP | Image (fit, zoom, pan, dimensions) |
| PDF.js (page nav, page input, zoom, fit width/page) | |
| CSV / TSV | Data table (delimiter auto-detect, sticky header, row numbers, search, sort, column resize, windowed rows, chunked loading) |
| TXT / LOG / OUT / INI / CONF | Text (line numbers, wrap, search, font size, chunk navigation) |
| JS / TS / Python / Go / Rust / Java / C/C++ / C# / Shell / HTML / CSS / SQL / … | Code (highlight.js, read-only) |
| Markdown | Preview (sanitized) + Source |
| JSON / JSONL | Tree (expand/collapse, copy value/path) + Source |
| YAML | Source + parsed Tree |
| anything else | Fallback (metadata + Open externally / Reveal / Copy path / optional Open as text) |
How it works
- Host half (
dist/index.js) registers the/fileviewerauthenticated RPC channel and exposes both afileViewerContentprovider registry and afileViewerHostbounded service for trusted transport plugins. The viewer does not assume content lives in a local folder: other host plugins can register readers for locators such asartifact://run/report.json, object storage, generated output, or remote APIs. A boundary-checkedctx.fsprovider is installed only when that service is available; on the DSH v0.1.2+ package graph it discovers workspace roots fromctx.workspaceRegistry, live session cwd values fromctx.sessions, and native open support fromctx.sessionController. - Client half (
dist/client.js) provides thefileViewerservice (ctx.get('fileViewer')→openFile(path, { line, renderer })) and renders the viewer as aconversation.viewtab beside Chat and Trajectory. It opens from:- produced-file chips in the conversation (
conversation.chat.turnTail, priority -1 — clicking an agent-generated file previews it in-app), or - the "浏览文件 / Browse files" entry added to each workspace row's "…" menu (see the compatibility patch below).
- produced-file chips in the conversation (
- Workspace "…" menu patch (
scripts/patch-workspace-menu.mjs): the workspace browser renders its row menu from a hardcoded list with no slot hook, so this script applies guarded, idempotent edits either to adeepseek-harnesssource checkout (verified throughdsh-v0.1.5-rc.1) or to an installed@deepseek-ai/dsh-client-ui-workspaceclient bundle. It adds abrowseFilesmenu item (zh/en labels), anonSelectbranch callingwindow.__dsfvBrowseWorkspace(workspaceId), and the dictionary keys. It aborts loudly on version drift and can be re-run safely after Harness updates (DSH_HARNESS_SOURCE=/path/to/deepseek-harness node scripts/patch-workspace-menu.mjs). - Large-file strategy:
< 5 MBwhole-file,5–50 MBchunked streaming,> 50 MBhead-only with explicit "Load more / Go to end" navigation. Range reads are capped (8 MiB per call) and text/CSV rows are windowed, so a 500 MB log never lands in browser memory. - Theming: styles use
--dsw-alias-*tokens and match Harness's details panel proportions, so light/dark follow the Harness theme automatically.
Compatibility
dsh-file-viewer v0.3.4 and later support DSH v0.1.1-rc.2 plus the breaking
v0.1.2+ package graph, verified through dsh-v0.1.5-rc.1. On rc2 the host RPC
channel is registered with an explicit loopback authority and workspace
discovery uses the legacy apiProxy fallback. On v0.1.2+ the viewer
additionally uses ctx.workspaceRegistry, ctx.sessions, and
ctx.sessionController. The client metadata depends only on packages shared by
the supported graphs; their transitive dependencies provide the
generation-specific runtime services. On v0.1.2+ the viewer also accepts the
conversation.view focus request and treats its opaque focus value as a file
locator.
DSH and React packages are host-provided optional peer dependencies for this
plugin. This is required by v0.1.2+ profiles, which keep peer auto-install
disabled (autoInstallPeers: false): installing the plugin must not add or
require a second copy of the in-box platform packages. Because npm semver does
not match later prereleases such as 0.1.5-rc.1 through
>=0.1.2-alpha.1 <0.2.0, the peer ranges explicitly include
>=0.1.5-rc.1 <0.2.0.
The Workspace row Browse entry remains a compatibility patch because upstream
@deepseek-ai/dsh-client-ui-workspace has no third-party menu slot. Re-run
scripts/patch-workspace-menu.mjs after updating Harness; the script is
idempotent and aborts on version drift.
Public API
// client side, any web plugin:
const fileViewer = ctx.get('fileViewer')
fileViewer.openFile('/workspace/output/report.csv')
fileViewer.openFile('artifact://run-42/report.csv')
fileViewer.openFile('/workspace/src/main.ts', { line: 125 })
fileViewer.openFile('/workspace/data.bin', { renderer: 'text' }) // force a renderer
Provide content from another host plugin
更多「介面與體驗」外掛
dsh-tui
作者 ccch1mneyyy
DSH's officially top-recommended TUI plugin — high performance, low overhead, cute pixel whale, smooth mouse interaction. One-command install via npm. / DSH 官方首推的 TUI 插件,高性能低占用,可爱像素鲸鱼,流畅鼠标交互,npm 一键安装
baoyu-design
作者 jimliu
将 Claude Design 作为本地 Agent Skill 运行,为 Cursor、Codex 和 DeepSeek Harness 生成 UI 原型、线框图和演示文稿 HTML。
dsh-better-sidebar
作者 omdsh-dev
开放的侧边栏底座,支持三方拓展注册新侧边栏页面。内置文件渲染编辑/终端/侧边对话/Git/子代理页面 | Open sidebar foundation, supports third-party extensions to register new sidebar pages. Built-in file rendering/editing, terminal, side chat, Git, and sub-agent pages.
dsh-claude-style
作者 nwflower
Claude Code Desktop theme for DeepSeek Harness| 为 DeepSeek Harness 复刻 Claude Code Desktop 风格与交互体验的主题插件
