Introduction¶
The DSH sidebar is session-oriented by default. When you have multiple workspaces open and want to browse project Markdown documentation and images without modifying code, repeatedly opening the terminal to run ls, cat, or less is awkward. @vfvrpq/dsh-file-explorer is designed to fill this gap: it adds an icon entry to the left sidebar. Clicking it opens a file tree along with a preview area within a panel, supporting text, Markdown, and images. Below is an introduction to its capabilities, installation, and configuration.
What is this¶
- Plugin Name:
@vfvrpq/dsh-file-explorer - Maintainer:
439436269-ctrl - Repository: https://github.com/439436269-ctrl/dsh-file-explorer
- Category: Client (Host-side loads with the Host, Client-side loads with the page)
- License: MIT
- Positioning: Adds a VSCode-style “Folder + File Previewer” to DeepSeek Harness, adding an icon entry in the left sidebar. Clicking it shows the main area’s file tree, open tabs, and text/Markdown/Image preview.
It should be noted that there is also an dsh-file-explorer without a scope on npm, created by another author. This package uses the @vfvrpq/ scope to distinguish itself; the two do not conflict and can coexist.
Core Features¶
After installation, you mainly gain the following capabilities.
The sidebar entry is registered in the sidebar.panellist slot. The ID is the same as the main panel key: file-explorer. Clicking the icon switches to the panel.
The file tree supports lazy loading (listing directories only when expanded), folder-priority sorting, type badges colored by suffix, a toggle for hidden files, and a draggable tree width.
Clicking a file previews it within the panel: the left side is the tree, the right side is an independent preview card with tabs, breadcrumbs, line numbers, or rendered Markdown. The status bar displays the byte count, line count, and whether it is truncated, and it does not navigate away. Expanded folders are remembered per root; the tree remains in place after refresh.
Besides panel preview, there are two outbound actions:
- The “Open in Right Panel” next to breadcrumbs sends the current file to the session’s right-side document preview (built-in renderers support code/PDF/Office, etc.). Since the right sidebar belongs to the session, this action brings the session back and yields to the panel. To always do this, set
openInRightPaneltotrue. - The “Open with Default Program” button hands the current file to the system’s default program (Windows
start/ macOSopen/ Linuxxdg-open), POSTing to the auth route?op=open.
Preview capabilities are categorized as follows:
- Text: Monospace font, line numbers, auto-wrap toggle. Single file defaults to max 1 MiB, max 4000 lines rendered.
- Markdown: Headings / Lists / Blockquotes / Code Blocks / Links / Images. Relative images use the raw byte route, allowing a one-click switch back to source code.
- Images: png / jpg / gif / webp / avif / bmp / ico / svg.
- Other binaries: Only displays type and size, does not load content.
Search recursively by filename within the current root directory, constrained by a triple budget of directory count, match count, and time.
Installation and Enablement¶
The plugin is a standard bundle, includes dsh.bundle.patch inside, adapted for DSH 0.2 preview. When installed into a profile, it writes to both dependencies and dsh.profile.bundles:
dsh plugin --profile desktop add @vfvrpq/dsh-file-explorer@0.1.0
Or manually write it into the profile’s package.json:
{
"dependencies": { "@vfvrpq/dsh-file-explorer": "0.1.0" },
"dsh": { "profile": { "bundles": [ ..., "@vfvrpq/dsh-file-explorer" ] } }
}
You can also just hang a line in the profile’s cordis.patch.yml. Do not use both methods simultaneously, as insert does not deduplicate by ID and will mount twice:
- insert:
- id: file-explorer
name: "@vfvrpq/dsh-file-explorer"
config:
enabled: true
After installation, restart DSH (or let the Loader reload). The “File Browser” icon will appear in the sidebar.
Here is a common pitfall: do not use link: / directory junctions for installation. @deepseek-ai/schemastery is resolved by the host inside the profile’s node_modules. Symlinks are resolved by Node to the real source path; from there, the host package cannot be found upwards, and the plugin will silently fail to activate with “failed to import”. Use npm install or a file: tarball (actual copy).
Configuration¶
The configuration layer is under config in cordis.patch.yml. Fields and default values are as follows:
| Field | Default Value | Description |
|---|---|---|
enabled |
true |
When disabled, the route no longer responds, but the sidebar entry remains |
routePath |
/api/file-explorer |
Auth route, must start with /api/ to consume the connection layer’s auth fence |
extraRoots |
[] |
Additional absolute directories to browse (besides workspace, default directory, process directory, home directory) |
includeHome |
true |
Whether to include the user’s home directory as a root |
ignored |
[] |
Filenames hidden from lists and search, e.g., node_modules |
maxTextBytes |
1048576 |
Text preview limit (truncated and marked if exceeded) |
maxRawBytes |
33554432 |
Raw byte route limit (for image preview) |
defaultShowHidden |
false |
Whether the file tree initially shows dot files |
openInRightPanel |
false |
When set to true, clicking a file sends it to the right sidebar document preview; otherwise, it stays in the panel for preview |
allowOpenWithDefaultApp |
true |
Whether to show the “Open with Default Program” button; when disabled, ?op=open returns 403 directly |
blockedOpenExtensions |
exe,com,bat,cmd,msi,scr,pif,vbs,vbe,ps1,reg,sh,command,app,desktop |
Suffixes the launcher refuses to hand to the system; an empty array means no blocking |
Permission Model¶
This plugin is read-only and does not accept arbitrary paths:
- Browseable roots = Registered workspaces + Default working directory + Process directory + Home directory +
extraRoots. After deduplication, only real directories are kept. - Every request’s
pathis resolved into a stable target usingctx.fs.resolve, then proven to fall within a root usingctx.fs.contains(root, target). Otherwise, return 403. - The route is mounted under
/api/, inheriting the connection layer’s Host/Origin verification and session cookie authentication. - The raw byte route only inlines image types (with
nosniff+ CSP sandbox), others are always sent as attachments. ?op=openonly acceptsPOST(allGETrequests return 405), only accepts ordinary files and rejects executable suffixes. The launch command is determined by the platform, no shell strings are concatenated.
Applicable Scenarios and Notes¶
Suitable for developers who want to browse project structure, read documentation, and view images directly within the DSH interface, especially when maintaining multiple workspaces and frequently flipping through Markdown and screenshots.
Note a few points:
- The plugin runs under the current dsh process permissions. Before installing, you should check the source code and license (MIT) yourself; do not treat it as an unvetted trust boundary.
- Read-only: Does not provide save, rename, or delete functions. One purpose is to avoid clashing with the session’s write permissions and approval policies.
- No syntax highlighting, only line numbers and type coloring.
- Single file rendering limit is 4000 lines, text reading limit is 1 MiB, both are configurable.
- Search is filename substring matching, not content retrieval; maximum 400 directories opened per time, 4-second budget.
- Binary files do not have a download button; the raw route only serves image inlining.
Conclusion¶
It fills the gap outside the default DSH session sidebar with an independent, read-only file browsing and preview area. The installation method is the standard profile bundle, and configuration items revolve around root directories, size limits, and open behavior.
- Directory page: https://www.skillhub.cn/plugins/439436269-ctrl/dsh-file-explorer
- GitHub: https://github.com/439436269-ctrl/dsh-file-explorer