dsh-at-file
FSMargoo/dsh-at-fileCodex 风格的 `@file` 文件引用,输入框里直接搜索并引用工作区文件。
为 dsh 网页添加 VS Code 风格工作区文件浏览器:文件树、可编辑预览(语法高亮、标签页、行号)、右键文件操作与图片内联预览。
中文 | English
⛔ This plugin is no longer maintained (2026-09-11)
As of DSH
0.1.5, the official build ships a workspace file tree and document preview out of the box (built-in bundles@deepseek-ai/dsh-client-ui-sidebar-files: right-sidebar file tree with lazy directory listing;@deepseek-ai/dsh-client-ui-sidebar-documentpreview: Markdown / highlighted code / image / PDF / HTML / plain-text previews), which covers this plugin's core capabilities as a first-party implementation — no layout patch, no reliance on unofficial host APIs, upgraded automatically with dsh. This plugin is therefore discontinued: no further maintenance or releases. Existing users are advised to uninstall it and use the built-in features:dsh plugin --profile web remove dsh-plugin-workbench # Optional: restore the layout bundle to the pristine official version node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs --restore # Restart dsh web to take effectPublished versions remain installable (tested against DSH
0.1.5-rc.1), but bugs will not be fixed and newer dsh versions will not be adapted. Thanks to every user and every star ⭐.
A VS Code-style workbench that edits files directly — not a read-only preview: file tree + editable code preview (syntax highlighting, tabs, line-number gutter) + right-click file operations (new / rename / delete / copy / cut / paste / open in system / reveal in file explorer) + inline image preview, with state saved independently per workspace. Once installed, the DSH web GUI becomes a lightweight code editor.
✅ Works out of the box: since 0.0.9 the layout patch is fully automated — it takes effect right after install and restart; if a DSH upgrade overwrites the bundle, the plugin patches it back automatically, with no manual steps required (manual action is only needed if the anchors break, see the "Configuration" section). Since 0.0.15 both build flavors — the npm build and the DSH Desktop bundled build — are detected automatically, so DSH Desktop works out of the box too.
What you'll see after installing:
@relative-path mentions in messages turn into clickable links that open a preview in the workbench;Real Web GUI screenshot.
Ctrl+S/Cmd+S;
Markdown renders a preview by default (one-click switch between source and rendered view); prose formats like
.txt and very large code files automatically fall back to plain-text editing — fast to load, no UI jankexplorer / macOS open, automatically translated under WSL)@workspace-relative-path into the chat input box; once sent, @relative-path mentions in the message render as
hyperlinks (click to open a preview in the workbench). The syntax is @ + a workspace-relative path; any other
@text is always displayed as-is and has no special meaning.dsh-trash, no bytes
copied)reveal endpoint of
the loopback RPC/dsh-plugin-files/raw/<path>fs.watch (watching the parent directory, surviving atomic renames);
changes are pushed over SSE at /dsh-plugin-files/events, and clean tabs sync automaticallyNo environment variables or config files needed; the layout patch is fully automated (the plugin automatically detects
and re-runs scripts/patch-layout.mjs at startup — idempotent, non-blocking; since 0.0.15 both build flavors of the
same version are detected automatically — the npm build and the DSH Desktop bundled build; anchors are byte-coupled to
the compiled output, so a DSH upgrade that breaks them requires anchor updates):
/dsh-plugin-files; write operations are executed explicitly under
danger-full-access, with no external configuration options.Layout-patch anchors are byte-coupled to the DSH compiled output; a DSH upgrade that breaks them requires anchor updates. Since 0.0.15 both build flavors (npm / DSH Desktop) are detected automatically and the patch re-applies at startup (see the "Configuration" section for details).
# npm (recommended)
dsh plugin --profile web add dsh-plugin-workbench
# or GitHub
dsh plugin --profile web add github:Pasumao/dsh-plugin-workbench
Install from source (local development / debugging):
git clone https://github.com/Pasumao/dsh-plugin-workbench.git
cd dsh-plugin-workbench
pnpm install
pnpm run build # produces lib/index.js and lib/client.js
# mount into the profile via link:
After installing, apply the layout patch and restart:
node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs
# restart dsh web
Since 0.0.9 the plugin automatically detects and re-applies the layout patch at startup — no need to run it manually after DSH upgrades; run the command above manually only if the automatic re-patching fails (broken anchors).
pnpm install
pnpm run build # produces lib/index.js (host) and lib/client.js (browser)
pnpm run typecheck
dsh plugin --profile web remove dsh-plugin-workbench
# optional but recommended: restore the layout bundle to the stock dsh file
node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs --restore
# restart dsh web
Skipping
--restoreis fine too: since 0.0.18 the layout patch is adaptive — the explorer column auto-collapses (width 0) whenever no plugin contributes to theexplorer/explorer.previewslots, so an uninstall leaves no empty column behind.--restoresimply returns the bundle to its pristine, unpatched state. The script has two safety guards: it refuses to restore when the target already looks like a newer pristine bundle (just-upgraded dsh) or when the backup belongs to an older dsh version (--forceoverrides).
/dsh-plugin-files RPC channel is loopback-only; write operations are executed explicitly under
danger-full-access; the context menu's create/rename/delete go through the same channel too (loopback trust,
same as saving in the editor); all HTTP routes mounted by this plugin (RPC / raw images / SSE) uniformly pass the
connection-layer auth fence (connection.requestRejection, Host/Origin + browser auth checks)/dsh-plugin-files/raw/<path>: it only responds to image
extensions, resolves the path via ctx.fs.resolve → stat first (sandbox-consistent path resolution) before reading
bytes, with a 20MB limitscripts/patch-layout.mjs must be updated
(since 0.0.15 the anchor table carries two build variants auto-detected per target — npm and desktop-ci, the latter
stored in scripts/layout-anchors.desktop-ci.json)See CONTRIBUTING and CODE_OF_CONDUCT; the changelog is in CHANGELOG.
0.1.2-rc.1 (since 0.0.16 the layout patch anchors are adapted to that
version: the detailsCol border style changed from 1px/--dsw-alias-border-l2 to
.5px/--dsw-alias-border-l3, and the DetailsColumn children gained a SessionProvider
wrapper); for 0.1.1-rc.2 and earlier, use the 0.0.15 anchor table.ui-layout patch exited 1 — upgrading this plugin fixes it.This plugin is part of Pasumao's dsh plugin ecosystem; the published plugins in the same series can be used alongside it:
| Plugin (npm) | GitHub | Description |
|---|---|---|
| dsh-notify | GitHub repo | Native Windows notifications + system tray |
| dsh-plugin-choice-refresh | GitHub repo | Choice enhancements: regenerate options / more options |
| dsh-plugin-dev-kb | GitHub repo | Plugin development knowledge base (full mirror of the official docs + skill) |
| dsh-plugin-image-tools | GitHub repo | Image choice cards + inline images in replies + image intake for text-only models |
| dsh-plugin-table-zoom | GitHub repo | Floating window for long chat tables + one-click Markdown copy |
| dsh-plugin-windows-guard | GitHub repo | Windows environment safeguards: guideline skills + mojibake detection / dangerous-write interception / encoding diagnosis & repair |
| dsh-plugin-context-trim | GitHub repo | Per-session injection gate: trim skills / tools / prompt sections per session |
| dsh-plugin-workbench | GitHub repo | This plugin: VS Code-style workspace file tree + editable preview, turning the web page into a lightweight code editor |
For the remaining plugins in the series, see Pasumao · dsh plugins; if you find them useful, a ⭐ on GitHub is always welcome.
Part of the source code and documentation was generated with AI assistance (DeepSeek Harness) and has been human-reviewed and verified on a live system; permission-related logic has been re-reviewed against the principle of least privilege.