Drag folders into the DSH web composer instead of hitting 'only the desktop app supports folders': a host folder dialog, a /folder command, and drag/paste into @path mentions. Works in both the browser and the desktop app.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-folder-attach
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:sixzjd/dsh-folder-attach
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Drag a folder into the DeepSeek Harness web composer and it refuses: "folders can only be added in the desktop app".
This plugin adds folder drag, /folder, and a host folder dialog, inserting standard @path references.
It works in a plain browser and in the desktop app alike — there is no separate desktop-only client here. What that message calls "desktop" is really Electron's injected __DSH_HOST_PATHS__ path bridge; this plugin supplies an alternative path source for environments without that bridge. With the bridge present (Electron) it prefers the real dropped path; without it (plain browser) it falls back to a host dialog or name resolution.
中文 · requires dsh
>= 0.2.0-rc.2
The problem
The DSH composer refuses folders in a browser:
const bridge = globalThis.__DSH_HOST_PATHS__;
if (bridge === void 0 && directory) return t("attachment.directoryDesktopOnly");
// → "Folders can only be added in the desktop app; add individual files in the browser"
A browser never reveals the absolute path of a dropped folder, so only Electron (which injects __DSH_HOST_PATHS__) can map a File back to a real path. This plugin doesn't work around that check. It changes where the answer comes from: ask the host, not the browser.
The web GUI is the same interface in both cases — inside the desktop app it runs on an embedded Node host, and dsh web runs on a standalone host. "Desktop vs browser" here is only about whether that path bridge exists, not about two different clients.
How it works
The web GUI is two halves — a browser client and a Node host on your machine. The browser is sandboxed; the host is not.
DSH already ships a host-side directory chooser (dsh-host-directory-picker-auto). On macOS with a loopback bind it resolves to the native backend, which runs on the host:
osascript -e 'choose folder' -e 'POSIX path of selectedFolder'
That returns a real absolute path. The plugin wires it to the composer, so the desktop-only branch is never entered.
Dropped folders are resolved by name through fileReferences/list — the same indexed fuzzy lookup that backs the @ completion menu. One call, and the index already excludes node_modules and friends.
Features
| Entry point | Behavior |
|---|---|
| "Add folder" button, left of the composer | Opens the OS folder dialog on the host, inserts @dir/ |
/folder command |
Same |
| Drag / paste a folder | Resolves the name inside the workspace and inserts @dir/; non-folder members keep the normal upload path |
What gets inserted is a standard @path mention, the same form the @ completion menu produces: workspace-relative inside the workspace, absolute outside it, quoted when the path contains whitespace.
DSH only recognizes a reference when @ sits at the start of a line or after whitespace. When the composer already ends in a non-whitespace character, the plugin inserts a leading space first so the mention renders as a blue folder reference instead of plain text.
Install
dsh plugin --profile web add dsh-folder-attach
Or pin it to a tag straight from GitHub (same source):
dsh plugin --profile web add github:sixzjd/dsh-folder-attach#v0.1.6
You can also paste either form into Plugins → Add in the sidebar. Reload the browser page afterwards.
git clone https://github.com/sixzjd/dsh-folder-attach.git
cd ~/.dsh/profiles/web # or your profile directory
dsh plugin --profile web add ./dsh-folder-attach
Uninstall
dsh plugin --profile web remove dsh-folder-attach
Or flip the switch on the Plugins page. The plugin registers one composer slot, one slash command, and two event listeners — it writes no globals, so removal leaves nothing behind.
Development
npm test # both regression suites
npm run check # syntax check + tests
There is no build step: dsh-client-modules serves lib/client.js to the browser byte-for-byte verbatim, so it is hand-written in the window.__ModuleLoader__.load format.
| File | Role |
|---|---|
lib/index.js |
Empty host apply, making the package a Loader entry so it gets scanned |
lib/client.js |
All behavior |
cordis.patch.yml |
The composition layer contributed while the bundle is enabled |
locale/{en,zh}.json |
Plugin-page display name (en.json must exist, or zh.json is never read) |
Public seams used
Only extension points the official docs declare — no patched or monkeypatched upstream code:
ctx.slots.inject("conversation.input.left", …)— the documented composer slot- Its standard props:
sessionId,inputActions,t ctx.commandUi.register({ name: "folder", ui: { kind: "action" } })ctx.remote.directoryPicker.pick()— host OS dialog, returns an absolute pathctx.remote.fileReferences.list(sessionId, query)— the index behind the@menu
Known limitations
- Without the path bridge (plain browser), dropped/pasted folders can only be resolved by name inside the workspace. With the bridge (Electron), the real path of the dropped item is used, which is more precise. When a name cannot be located the plugin says so and points at the dialog rather than guessing a path.
- A drop yields a standard
@dir/mention, rendered as a folder reference in both the composer and sent messages. DSH folder references are intentionally non-clickable / non-navigable — the same is true for folders picked from the official@menu; only file references open a preview. This plugin does not alter upstream rendering, so behavior stays consistent. - The indexed lookup is bounded, so in extreme cases a same-named folder may be absent from the candidates and is then treated as unresolved.
- If your profile resolves the directory picker to the
browsebackend (remote / SSH access), the OS dialog is unavailable andpickrefuses with a message; drag resolution still works. - On a mixed drop (folder + images) the plugin mirrors the composer's image count/size pre-check, but counts only the images in that drop: already-attached images are not readable through any public face. The Host's
validateImageBatchstill enforces the full per-message limit, so this is an earlier and looser notice, not a hole. - Plugin-page display names require
locale/en.jsonto be present.
Why it survives dsh updates
The compatibility gate only checks @deepseek-ai/dsh* prefixes in peerDependencies, and this plugin declares none, so an update never causes the bundle to be skipped. The real risk is one of the seams above being renamed — in which case the plugin fails silent (it just doesn't appear) rather than breaking DSH.
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10696
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10696
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8484
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7509
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5395
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1082
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.