In the development workflow of DeepSeek Harness (DSH), viewing and editing local project files directly in the Web frontend usually requires relying on the terminal or external tools. The dsh-ws-files plugin integrates a file tree, search, and an online editor directly into DSH’s layout system, and supports opening tabs at the same level as conversation/trace for editing. This plugin is maintained by zhangxiang1993621 and is released under the MIT License.

Core Features

  • Layout Integration: The panel is registered in the layout.left or layout.right area (with id ws-files) and renders in coordination with dsh-layout.
  • Tree Browsing: Supports lazy-loaded directories, bold folder names, and displays file sizes.
  • Search: Supports searching by filename (case-insensitive) for quick location.
  • File Operations: Click a file to open it with the system’s default program; open it in a tab at the same level as conversation/trace, and supports closing.
  • Online Editing:
    • Automatically enters editing mode.
    • Real-time highlighting: supports coloring keywords, comments, strings, and numbers (layered highlighting without interrupting input).
    • Smart indentation: Enter automatically indents; Tab/Shift+Tab outdents.
    • Auto-save: debounced automatic writing, with save status shown in the status bar; supports Ctrl+S to save immediately.
    • Undo/Redo: Ctrl+Z / Ctrl+Y.
  • IDE-like Preview: Preview mode includes line numbers, code folding, and indentation width settings by file type.
  • Multiple Workspaces: Supports switching among workspaces registered in workspaceRegistry.

Installation and Activation

Execute the following commands in the deepseek-harness repository directory. Use file:/ to install a released version; use link:/ during development for hot updates.

# 安装发布版本
node --import tsx/esm apps/cli/src/bin.ts plugin --profile web add file:/绝对/路径/dsh-ws-files
# 开发期使用 link(修改源码后刷新页面即生效)
node --import tsx/esm apps/cli/src/bin.ts plugin --profile web add link:/绝对/路径/dsh-ws-files

After installation, the DSH Web service must be restarted.

Architecture and Implementation

The plugin consists of Host and Client parts.

  • Host side (lib/index.js): Injects webServer, fs, and workspaceRegistry via the Cordis plugin line, and provides the /ws-files JSON route.
  • Client side (lib/client.js): Loaded through the manually maintained __ModuleLoader__ protocol, and registers the layout panel and file tab slot.

Security and Cautions

The plugin strictly limits file read and write operations:

  • Path Fencing: All read and write operations are confined within the workspace root directories registered in workspaceRegistry; out-of-bound access returns 403.
  • Write Sandbox: Writes explicitly carry the workspace-write sandbox policy, with dual enforcement by the host’s fs policy layer.
  • Write Confirmation: A confirmation dialog appears in the browser before saving; no delete endpoint is provided.
  • Read-Only First: By default, list/read/stat/search/open are available; write must be actively triggered by the user.

Summary

dsh-ws-files provides DSH with a lightweight, security-sandboxed file browser and editor. It is suitable for developers who need to frequently view and modify workspace code in the Web interface. For more details, consult the plugin directory or source code.