dsh-menu: Adds a Functional Right-Click Menu to the DSH Workspace File Tree

Introduction

In the DeepSeek Harness (DSH) Web client, the sidebar’s “Workspace Files” tree is the primary entry point for daily code editing and directory browsing. The browser’s built-in context menu typically only offers copy and inspect options, making it impossible to directly create folders, rename files, or hand paths off to a local editor within the workspace. You either need to switch to a terminal or file explorer, or write your own script to call the Host API—both of which interrupt your workflow.

dsh-menu is a client plugin published by maintainer tangu2023 that attaches a custom context menu to this tree, bringing common file operations into the sidebar. It is implemented as a pure front-end UI with Host routing, with no third-party dependencies and no build step. It is suitable for developers already running the DSH Web GUI who want to reduce window switching.

What Is This

dsh-menu (npm package name dsh-menu, repository tangu2023/dsh-menu) targets the “Workspace Files” tree in the DSH Web client sidebar: when you right-click on a file or folder row, it intercepts the browser’s default menu and displays the plugin’s custom-drawn menu instead. The Host half handles filesystem operations such as rename, create directory, delete, open, and download; the Client half only sends JSON requests and displays interactions. The current public version is 1.0.2, licensed under MIT. The plugin index can be found at the SkillHub directory page; the community plugin directory has no official affiliation with DeepSeek or High-Flyer, so it is recommended to review the source code and license yourself before installing.

Core Features

After right-clicking any [data-files-entry] tree row, the menu item order matches the README, with eight items total:

  1. New Folder: Inline input; if clicked on a directory row, the folder is created inside it; if clicked on a file row, it is created in the parent directory.
  2. Rename: Inline editing of the current name (rename only, no move).
  3. Reveal in File Manager: Calls the official remote.session.openWorkspacePath({ action: "reveal" }) to locate the item in the system file explorer.
  4. Open in Browser: Files are returned as-is; directories are rendered as a browsable HTML list (HTML responses include CSP sandbox).
  5. Open in VS Code: Locates local VS Code and opens the file or directory (Windows is the primary tested platform; macOS/Linux have candidate path fallbacks).
  6. Copy File Path: Writes the workspace path to the clipboard.
  7. Download Folder / Download File: Directories are streamed as a ZIP archive; single files are downloaded directly.
  8. Delete: The menu item uses a danger style, and clicking it triggers a secondary confirmation before executing recursive deletion.

For interactions, rename and new folder share an inline form that supports Chinese input method composition, Enter to submit, and Esc to cancel; operation results are shown via toast notifications; clicking outside, scrolling, or resizing the window closes the menu. Text switches between zh/en based on the interface language.

Host-side routes are uniformly mounted under the /api/workspace-files-menu/* namespace. For example, rename, create directory, and delete are POST; browser open and download are GET. All operations first validate the session workspace root path, returning 403 for out-of-bounds access; deletion of the workspace root directory is always refused.

Installation and Activation

Prerequisites: DeepSeek Harness (including the Web GUI) must be deployed and running; the host process must be able to run Node.js and pnpm.

Installation from npm is recommended (original README command):

dsh plugin --profile web add dsh-menu

You can also install from GitHub or a local directory (for the latter, select the absolute repository path in plugin management; no build is needed). The GitHub method example:

dsh plugin --profile web add github:tangu2023/dsh-menu

After installation via any of the three methods, the steps are the same:

  1. Restart the DSH host process so the Host half (index.js) is reloaded; simply enabling/disabling via the plugin manager will not reload cached modules.
  2. Hard refresh the browser (e.g., Ctrl+Shift+R) to load the Client half (client.js).

Uninstall example:

dsh plugin --profile web remove dsh-menu

cordis.patch.yml is written to the profile by the plugin manager; do not manually modify package.json / cordis.patch.yml under the profile. If pnpm has minimumReleaseAge protection for new packages, dsh plugin add will automatically add dsh-menu to the exclusion list.

Typical Usage

After installation, restart, and hard refresh, simply right-click any file or folder row in the sidebar’s “Workspace Files” tree. No additional configuration is required.

  • “New Folder / Rename”: Enter the name in the inline box next to the tree row and confirm.
  • “Delete”: First enter the confirmation panel, then click confirm to call the Host for deletion.
  • Other items execute on click, with toast notifications for success or failure.

If you need to directly verify Host routes (requires replacing the real sessionId and path), the README provides a smoke test example:

curl -X POST http://127.0.0.1:12012/api/workspace-files-menu/rename \
  -H "Content-Type: application/json" \
  -d '{"sessionId":"<session-id>","path":"D:/workspace/a.txt","name":"b.txt"}'

If right-clicking still shows the browser’s default menu, first hard refresh and confirm that the shell.overlay slot has an occupant with id workspace-files-menu; if Host routes return 404/500 while the plugin is enabled, prioritize restarting the host process.

Use Cases and Notes

Who it’s for: Developers who regularly browse and rename files through the “Workspace Files” tree in the DSH Web client; those who want to create directories, copy paths, download ZIPs, and open files in VS Code from the sidebar without repeatedly switching to a terminal or file explorer.

Architecture notes: The Client handles contextmenu during the capture phase and only takes over when hitting workspace file tree rows; other areas continue to use the browser’s default menu. The plugin does not patch host modules; style class names use the wfm- prefix. It does not conflict with most plugins’ routes or overlay slots. The only caveat is that if another plugin also intercepts the context menu on the same tree row, two menus may appear (the README states no such plugin has been found at present).

Security and permissions: All file operations execute under the current DSH host process’s permissions, with paths strictly limited to the session workspace. Before installing the plugin, you should read index.js / client.js and the MIT license to confirm it aligns with your deployment policy. The Host uses only Node built-in modules and has no npm runtime dependencies; the installation process still relies on the host being able to locate pnpm (if not found, you can install pnpm globally or use a shim).

Platform support: The VS Code open path is more complete on Windows; VS Code and other routes on macOS/Linux are described in the documentation as cross-platform, but apart from Windows, individual items are not explicitly verified on real machines in the README.

Conclusion

dsh-menu extends the “Workspace Files” tree from being merely viewable and reliant on the browser menu to a set of context operations with inline editing and boundary validation. It has zero dependencies, and after installation, simply restarting the host and hard refreshing the browser makes it ready to use. For details on menu items, the route table, and security design, refer to the repository README.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye