前言¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, with the sidebar serving as its core interaction area. In DSH version 0.1.6-alpha.2, the third-party sidebar plugin dsh-better-sidebar has a silent failure issue with file line clicks (no new tab opens, no notification appears after clicking). Fixing third-party compiled artifacts poses version override risks, so dsh-file-tree was developed from scratch based on official extension points, providing functionality through native tab registration without taking over any layout.
核心功能¶
- Workspace File Tree & Built-in Editor: Provides a VS Code web experience based on
code-server4.138.0, supporting multi-file editing, integrated terminal, and Git. The plugin bundles approximately 640MB of binaries with the package, requiring no additional downloads. - Inline Preview & Search: Supports inline preview for text and images. Images/SVGs are automatically rendered using
<img>, while text uses official syntax highlighting. Supports searching by filename, with results displaying directory and file size. - One-click @file Reference: Click the
@icon on the right side of a file row or the reference button in the preview header to insert the workspace-relative path into the input box. Supports reference syntax for paths containing spaces (e.g.,@"my file.txt"). - Ctrl/Cmd + Click Navigation: Supports jumping to module paths, identifiers, and methods. Supports multi-level navigation for barrel files (e.g.,
components/index.ts).
安装¶
Install using the official CLI:
dsh plugin --profile web add github:jackchen13755/dsh-file-tree
After installation, hard refresh the browser (Cmd/Ctrl+Shift+R) to activate.
配置¶
Add the file-tree configuration item in cordis.patch.yml. Here are the main configurable options:
- insert:
- id: file-tree
name: 'dsh-file-tree'
config:
readLimitBytes: 524288 # Text preview limit (1KB–8MB)
imageLimitBytes: 3145728 # Image preview limit (0–16MB)
listLimit: 2000 # Maximum entries per directory
searchLimit: 200 # Maximum search hits
Additional configurable items include codeServerEnabled, codeServerPath, codeServerSearchPaths, codeServerDataDir, codeServerArgs, codeServerStartTimeoutSeconds, and codeServerIdleMinutes.
使用方法¶
- Open Editor: Session → Right Sidebar → “+ New Tab” → Select “Editor”. This tab opens a complete workspace environment based on
code-server. - Browse & Preview: Session → Right Sidebar → “+ New Tab” → Select “File Panel”. In this panel, you can browse files in read-only mode. Clicking a file row automatically routes: text files open in native tabs (with syntax highlighting), while images/SVGs display inline within this panel.
- Inline Preview: Click the inline
▤button to preview any file within this panel. Clicking a file row also triggers this behavior. - Navigation: In the file panel or official preview tabs, hold Ctrl/Cmd and click on symbols (e.g., method names, variable names) to automatically jump to their definitions. Supports relative paths, alias mapping, and barrel file navigation.
安全与依赖¶
- DSH Version: Requires DSH >=0.1.5-rc.1, tested and compatible with 0.1.6-alpha.2.
- Security Model: The code-server process only listens on localhost (127.0.0.1). The plugin performs inclusive validation on request paths, rejecting
../, absolute paths, and symbolic links pointing outside the workspace. Only accepts JSON POST requests, all operations are read-only. - Process Management: Pools code-server processes by workspace, reclaiming them after 120 minutes of idle time. Processes are not started when the sidebar is not visible or the tab is not in the foreground.
总结¶
dsh-file-tree resolves the interaction failure issue of the old sidebar plugin by reusing DSH’s native preview and sidebar capabilities, while providing a complete code editing environment. For more details, refer to the GitHub repository.