DeepSeek Harness 插件

dsh-file-preview

Web 客户端悬浮文件预览窗:懒加载文件树、CodeMirror 预览与窗内编辑保存、Markdown 与图片预览、Quick Open 搜索,以及点击会话中的路径直接打开。

跳到安装方式

来源信息

GitHub 仓库
UndeadSheep/dsh-file-preview
最近更新
2026年8月18日
分类
界面增强
GitHub stars
0

安装

默认先复制一段 Prompt,让 Agent 读页面和仓库;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读页面和仓库。

请先不要安装。阅读这个 DeepSeek Harness 插件,说明它解决什么问题、会访问哪些文件、网络或密钥,以及如何安装和卸载。

插件页面:https://deepseekplugins.org/zh/plugins/UndeadSheep/dsh-file-preview~23dsh-file-preview
GitHub:https://github.com/UndeadSheep/dsh-file-preview/tree/main/packages/dsh-file-preview
插件名:dsh-file-preview#dsh-file-preview
作者:UndeadSheep
安装命令:dsh plugin --profile web add github:UndeadSheep/dsh-file-preview#path:/packages/dsh-file-preview

确认前不要执行安装命令。

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

@undeadsheep/dsh-file-preview

Workspace file-preview host half: a Typert Remote (filePreview) that lists the workspace tree, reads/writes text files, and resolves the preview theme and config for the browser half.

The browser UI lives in a separate package: [@undeadsheep/dsh-client-ui-file-preview](../dsh-client-ui-file-preview).

Remote surface

| Method | Request | Result | |--------|---------|--------| | listDir | { sessionId, path } | Ok<FileTreeNode[]> \| Rejected | | readFile | { sessionId, path } | Ok<{ path, content }> \| Rejected | | readImage | { sessionId, path } | Ok<{ path, mimeType, data }> \| Rejected | | writeFile | { sessionId, path, content } | Ok<{ path }> \| Rejected | | readTheme | { sessionId } | Ok<{ colors, bg, fg }> | | readConfig | { sessionId } | Ok<{ indentSize, useTabs, pollInterval, fontSize }> |

Business results use the repo's { ok: true, value } | { ok: false, error: { code, ... } }

convention; the generated ./remote face wraps them in the RemoteResult carrier. Wire codecs are generated from the @Remote method types by typert codegen — there is no hand-written schema file.

listDir lists a single directory (path = '' for the workspace root) and skips heavy/noise directories (node_modules, .git, .next, .ssh, …) plus sensitive filenames (.env*, id_rsa*, *.pem, *.key, …). A single listing is capped at 1000 children. Dir nodes carry empty children, which the browser half fills lazily by calling listDir again when a directory is expanded. readFile / readImage / writeFile also refuse those sensitive paths, so typing them in Quick Open does not bypass the tree filter.

Config

KeyDefaultMeaning
maxFileBytes2097152Maximum UTF-8 byte length the preview will read or write
maxImageBytes5242880Maximum byte length of an inline image the preview will read

Workspace config files (read per Session, optional)

  • preview.config.jsonindentSize, useTabs, pollInterval, fontSize

(with .prettierrc / package.json#prettier fallback for indent knobs)

  • preview-theme.jsonkeyword, string, number, comment, tag,

function, type, variable, background, foreground

  • .vscode/settings.jsoneditor.tokenColorCustomizations and

workbench.colorCustomizations are read as a fallback theme

Known limitations

  • Preview is text-only (plus raster png/jpeg/gif/webp); binary, SVG-as-image,

or oversized files return not-text / too-large. A stat with no size is refused rather than reading the whole file into memory. Writes use the same byte cap as text reads.

  • listDir returns at most 1000 children per directory.
  • Symlink following after resolve is the host ctx.fs implementation's

responsibility; this plugin re-resolves search children against workspaceRoot but cannot realpath on its own.

  • Syntax highlighting is a lightweight hand-written tokenizer (not highlight.js /

TextMate), and a prettier engine cannot be embedded.

  • Auto-refresh is polling (pollInterval, clamped 500–60000 ms), not a real file watcher.