DSH Hub

liguobao/dsh-file-viewer

dsh-file-viewer

UIWeb UI3 GitHub stars· updated 2026-08-21

dsh-file-viewer is a community DeepSeek Harness plugin. Read the repository README before installing.

Install

npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-file-viewer

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-file-viewer DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-file-viewer.svg)](https://dshhub.dev/plugins/dsh-file-viewer)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from liguobao/dsh-file-viewer, cleaned of badges and images.

DSH File Viewer

English | 中文

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

TypeRenderer
PNG / JPG / GIF / WEBP / SVG / BMPImage (fit, zoom, pan, dimensions)
PDFPDF.js (page nav, page input, zoom, fit width/page)
CSV / TSVData table (delimiter auto-detect, sticky header, row numbers, search, sort, column resize, windowed rows, chunked loading)
TXT / LOG / OUT / INI / CONFText (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)
MarkdownPreview (sanitized) + Source
JSON / JSONLTree (expand/collapse, copy value/path) + Source
YAMLSource + parsed Tree
anything elseFallback (metadata + Open externally / Reveal / Copy path / optional Open as text)

How it works

  • Host half (dist/index.js) registers the /fileviewer loopback RPC channel and exposes both a fileViewerContent provider registry and a fileViewerHost bounded 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 as artifact://run/report.json, object storage, generated output, or remote APIs. A boundary-checked ctx.fs provider is installed only when that service is available, preserving local-file compatibility without making it a hard dependency.
  • Client half (dist/client.js) provides the fileViewer service (ctx.get('fileViewer')openFile(path, { line, renderer })) and renders a right-docked viewer column (styled like the Harness details panel) through the shell.overlay slot. 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).
  • 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 three guarded, idempotent edits to the installed @deepseek-ai/dsh-client-ui-workspace client bundle: a browseFiles menu item (zh/en labels), an onSelect branch calling window.__dsfvBrowseWorkspace(workspaceId), and the two dictionary keys. It aborts loudly on version drift and can be re-run safely after Harness updates (node scripts/patch-workspace-menu.mjs).
  • Large-file strategy: < 5 MB whole-file, 5–50 MB chunked streaming, > 50 MB head-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.

Public API

Related plugins