Introduction¶
In the DSH workflow, files and messages are often used together: referencing a path in a message, viewing an image during a chat, making temporary code changes, or moving, copying, or renaming files from the local workspace. If these operations require leaving DSH Web, the workflow would be frequently interrupted.
dsh-plugin-workbench solves this problem: it adds a VS Code-style workspace to the DSH web interface, including a file tree, editable code preview, right-click file operations, and inline image preview. Once installed, DSH Web can be used as a lightweight code editor.
What is this¶
dsh-plugin-workbench is maintained by Pasumao and is licensed under MIT.
It is positioned as a file workspace plugin for DSH Web, primarily providing:
- Left sidebar file tree
- Editable code preview
- Tabs, line number bar, syntax highlighting
- Right-click file operations
- Inline image preview
- Markdown rendering
@referencing workspace files in messages- Dragging files into the chat input box
- Workspace-independent undo history and preference states
The verified version is 0.0.15, and Node requires >=18.
Core Capabilities¶
File Tree and Editor View¶
- The file tree sidebar supports lazy loading and has an automatic refresh every
2seconds. - File tree expansion states are saved independently per workspace.
- Tabs support opening multiple files, drag-and-drop sorting, and collapsing/expanding.
- Light and dark themes can be switched with one click.
- The editor has a line number bar on the left displaying logical line numbers, aligned with text scrolling lock.
The editable code preview uses a transparent textarea overlaid with syntax highlighting, supporting Ctrl/Cmd+S to save.
Syntax highlighting uses highlight.js, and the verified data lists supported languages as:
JS/TS
Python
JSON
HTML
CSS
Shell
Auto-wrap preferences are persisted, allowing switching between soft wrapping and horizontal scrolling for long lines.
File Operations¶
The right-click menu provides VS Code-style file operations, including:
- New File
- New Folder
- Rename
- Delete
- Copy Path
- Copy
- Cut
- Paste
- Refresh
- Open in System
- Open in Explorer
Copy, cut, and paste support Ctrl/Cmd+C/X/V and also support right-click menus and cross-workspace pasting. When copying to a target with the same name, it will ask whether to overwrite.
Batch operations support multi-selection, bulk deletion, and drag-and-drop moving of entire groups.
Operations can be undone:
Ctrl+Zor undo in the top-right corner- Independent per workspace
- Limit of
30entries - Deletion is an undoable delete
Regarding disk change synchronization, when an open file is modified externally, clean tabs will automatically reload; tabs with unsaved edits will show a reload badge.
Preview, Reference, and Session Insertion¶
Image preview supports:
png
jpg
gif
webp
avif
svg
Inline rendering of images is limited to 20MB and uses the same-origin route:
/dsh-plugin-files/raw/<path>
This route only responds to image extensions.
Markdown rendering uses markdown-it; raw HTML is escaped, and relative path images are displayed inline via the same-origin route.
When @ referencing a file, you can select “@ Reference in Message” on the file to insert @relative-workspace-path into the chat input box; after sending, the relative path in the message will render as a clickable link.
When dragging a file into a session, drag the file from the left column to any position in the chat area, and the path text will be inserted at the cursor position in the input box.
Installation and Enablement¶
Environment and Configuration Requirements¶
Node requirements:
>=18
The plugin requires no environment variables or configuration files, and has no external configuration options.
Behavior preferences are persisted per workspace, including:
- Auto-wrap
- Light/Dark theme
- Tab layout
- File tree expansion state
Installation Commands¶
Verified data provides two installation commands.
npm installation:
dsh plugin --profile web add dsh-plugin-workbench
GitHub installation:
dsh plugin --profile web add github:Pasumao/dsh-plugin-workbench
Restart DSH Web after installation.
Starting from 0.0.9, layout patches are automatically detected and reapplied; starting from 0.0.15, npm and DSH Desktop build artifacts are automatically recognized, and DSH Desktop works out of the box.
If automatic reapplication fails, for example due to invalid anchors, you can execute:
node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs
Then restart dsh web.
Uninstallation¶
Uninstall command:
dsh plugin --profile web remove dsh-plugin-workbench
And restore the layout bundle.
Typical Usage¶
The following introduces a few common operations.
- After opening the workspace, locate the file in the left file tree.
- Right-click the file, select “@ Reference in Message”, and insert
@relative-workspace-pathinto the chat input box. - Drag the file from the left column to any position in the chat area, and the path text will be inserted at the cursor position in the input box.
- Modify the code in the editor and use:
Ctrl/Cmd+S
to save.
- Perform file-level copy, cut, and paste using:
Ctrl/Cmd+C
Ctrl/Cmd+X
Ctrl/Cmd+V
You can also use the right-click menu.
- When needing to undo recent operations, use:
Ctrl+Z
or the undo button in the top-right corner.
Suitable Scenarios and Notes¶
Suitable scenarios for using dsh-plugin-workbench include:
- Viewing and editing workspace files in DSH Web
- Quickly referencing workspace file paths in chat
- Previewing images, Markdown, and code
- Performing simple file copy, move, rename, and delete operations
- Needing lightweight file operations and undo capabilities
Pre-installation notes:
- File operation channel is limited to
loopback RPC /dsh-plugin-files - Write operations are explicitly executed with
danger-full-access - The plugin runs with the permissions of the current
dshprocess; before installing, check the source code and license, and verify that the currentdshprocess can access the target workspace DSHupgrades will overwrite the layout bundle; the plugin automatically detects and reapplies patches on startup- Anchors need to be updated when invalid:
scripts/patch-layout.mjs
- This repository does not contain
DSHcompiled artifacts - Some source code and documentation are AI-assisted (DeepSeek Harness), reviewed manually and verified on real machines
- Permission-related logic has been reviewed according to the principle of least privilege
Resources¶
GitHub repository:
https://github.com/Pasumao/dsh-plugin-workbench
Current verified data does not provide a verifiable directory page URL; if needed, it is recommended to refer to the GitHub repository.