dsh-folder-attach: Referencing folders in the DSH web composer

Preface

DeepSeek Harness (DSH)’s input box supports using @path to attach files or directories into conversations. On the desktop client, Electron injects __DSH_HOST_PATHS__, so dragging in a folder maps to a real path; in a pure browser environment it is rejected with the message “Adding folders is only supported on desktop; in the browser please add individual files”. However, @deepseek-ai/dsh has not yet released a standalone desktop client, and dsh web remains the entry point most people use.

Below we introduce the community plugin dsh-folder-attach (maintainer sixzjd): without modifying DSH’s core logic, it leverages the host machine’s Node host for directory selection and file indexing, implementing @directory/ references equivalent to the desktop client right in the browser.

What Is This

dsh-folder-attach is a client-side (web profile) plugin for DSH, categorized as a client extension. It provides three entry points on the web composer — a “Add Folder” button on the left, the slash command /folder, and dragging or pasting a folder — all of which ultimately insert a standard @path mention, consistent with the desktop drag-and-drop behavior regarding workspace-relative paths, absolute paths outside the workspace, and quoting rules for paths containing spaces.

The plugin does not bypass the browser’s security model (the browser still cannot provide the absolute path of a dragged folder); instead, it switches to host-side capabilities: the system folder dialog returns the real path; dragging/pasting resolves by name within the workspace via the host’s fileReferences/list.

Runtime requirements: dsh >= 0.2.0-rc.2 (the engines.dsh in package.json matches dsh.compatibility). Current repository version 0.1.4, license MIT.

Background and Principles

The DSH web interface consists of two parts: the browser client inside the sandbox, and the Node host on the local machine. The official input box has a hardcoded check for directories: when globalThis.__DSH_HOST_PATHS__ is absent and what is dragged in is a directory, it directly uses the attachment.directoryDesktopOnly message.

This plugin leverages existing public extension seams of DSH, such as host directory selection (mentioned in the README as dsh-host-directory-picker-auto; on macOS with loopback binding it can resolve to the native backend, executing an “select folder” operation similar to osascript and returning a POSIX path), as well as ctx.remote.fileReferences.list behind @ autocomplete. Therefore the desktop-only “folders supported only on desktop” check is not mis-triggered, and what appears in the composer is @directory/ text that can participate in the context.

Core Features

Entry Point Behavior
“Add Folder” button on the left of the input box Opens the system folder dialog on the host machine; inserts @directory/ after selection
/folder command Same as above
Drag / paste a folder Resolves by name within the workspace and inserts @directory/; regular files in the same batch still go through the original upload channel

The insertion result is a standard @path mention. When a drag cannot be resolved, it reports an error explicitly and prompts the user to use the dialog instead — it never guesses the path.

Installation and Activation

The plugin executes directory selection and index queries on the host machine using the current dsh process permissions; before installing, it is recommended to review the source code and MIT license at the GitHub repository, and confirm that your profile and dsh version meet the requirements.

Installing by plugin name (web profile) is recommended:

dsh plugin --profile web add dsh-folder-attach

You can also specify a GitHub source (pinned to a specific tag):

dsh plugin --profile web add github:sixzjd/dsh-folder-attach

Or fill in the above address in the sidebar under Plugins → Add Plugin. Refresh the browser page after installation completes.

Uninstallation:

dsh plugin --profile web remove dsh-folder-attach

Or toggle the switch off on the plugin page. The README explains that the plugin only registers composer slots, one slash command, and two event listeners inside the browser, without writing to global objects, so nothing should remain after uninstallation.

Typical Usage

  1. After installing and refreshing the DSH web page, click “Add Folder” on the left side of the conversation input box, select a directory in the system dialog, and @some-directory/ will appear in the input box.
  2. Type /folder in the composer and execute it — the effect is the same as the button.
  3. Drag a single folder from the file manager into the input area, or paste a folder; the plugin resolves it within the workspace by folder name and inserts @directory/. If there are also regular files in the same operation, the files are still handled via DSH’s original attachment flow.

Paths within the workspace are written into the mention in relative form; paths outside the workspace retain their absolute form.

Use Cases and Notes

Who it is for: People who mainly use dsh web but need to hand an entire project directory or subdirectory to the model via @path — for example, asking questions with reference to repository structure, or letting an agent scan a certain subtree, without wanting to install an unreleased desktop shell just for dragging folders.

Known limitations (excerpted from the upstream README):

  • Dragged/pasted folders can only be resolved by name within the workspace; the browser does not provide absolute paths, so when resolution fails you need to switch to the dialog.
  • Dragging produces a plain-text @directory/ mention, not the desktop client’s folder chip with an icon; functionally equivalent, but visually different.
  • Index queries have a return limit; in extreme cases, folders with the same name may not appear in the candidates.
  • If the profile resolves directory selection to the browse backend (remote / SSH), the system dialog is unavailable and pick will refuse with a prompt; in this case, drag-and-drop resolution still works.
  • With mixed drags (folder + images), the plugin replicates the composer’s quantity/size pre-check for the images dragged this time; this may differ slightly from the host-side validation criteria for the entire message, but does not affect the final validation.
  • The plugin page’s display name depends on locale/en.json existing (only then will zh.json be read).

Upgrades and compatibility: The plugin only uses the extension points named in the documentation (e.g., conversation.input.left injection, ctx.commandUi.register, ctx.remote.directoryPicker.pick, ctx.remote.fileReferences.list), without monkeypatching official code. If DSH renames these seams in the future, the behavior would be silent non-appearance rather than crashing the entire DSH.

Conclusion

dsh-folder-attach transforms the problem of “the web version cannot drag folders” into “ask the host machine for paths, ask the index for names”: the dialog and /folder provide definite paths, drag/paste provides workspace-internal name resolution, and the output is unified as @path mentions. The DSH ecosystem emphasizes “everything is a plugin”; the community directory SkillHub plugin page and the upstream repository are independent of each other, and are not an official DeepSeek / High-Flyer app store.

  • Directory page: https://www.skillhub.cn/plugins/sixzjd/dsh-folder-attach
  • GitHub: https://github.com/sixzjd/dsh-folder-attach
羽毛球分组比赛记分
小程序二维码

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

Xiaoye