UndeadSheep/dsh-file-preview--packages-dsh-file-preview0

@undeadsheep/dsh-file-preview

Workspace file tree listing and text preview/editing backed by a Host Remote for the DeepSeek Harness (distributable bundle: host service + client UI)

AI 分析

核心用途是提供完整的工作区文件树浏览与读写服务。适合需要让DSH具备列出目录、读取和保存文本/图片文件能力的开发者。

パッケージ
@undeadsheep/dsh-file-preview
バージョン
0.1.1
ライセンス
MIT
最終更新
2026/08/16

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:UndeadSheep/dsh-file-preview#c92b1da836e68643c8017ca20d71eb4288acf941&path:packages/dsh-file-preview

ドキュメント

README 全文を読む ↗

@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.

Remote surface

MethodRequestResult
listDir{ sessionId, path }Ok | Rejected
readFile{ sessionId, path }Ok | Rejected
readImage{ sessionId, path }Ok | Rejected
writeFile{ sessionId, path, content }Ok | Rejected
readTheme{ sessionId }Ok
readConfig{ sessionId }Ok

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, …); dir nodes carry empty children, which the browser half fills lazily by calling listDir again when a directory is expanded.

Config

KeyDefaultMeaning
maxFileBytes2097152Maximum UTF-8 byte length the preview will read
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; binary or oversized files return not-text / too-large.
  • Syntax highlighting is a lightweight hand-written tokenizer (not highlight.js / TextMate), and a prettier engine cannot be embedded.
  • Auto-refresh is polling (pollInterval), not a real file watcher.