Publishes the desktop shell's file-path bridge as the host-path seam the composer reads, so files and folders dropped into the composer become @path references instead of uploaded copies (images still upload through the native image channel).
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:SereneJi/dsh-host-paths
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
Drop a file into DSH Desktop and get an @path reference in the composer — not an uploaded copy.
dsh-host-paths does exactly one thing: it republishes the Desktop shell's
file-path bridge (window.__DSH_DESKTOP_FILE_PATH__) as the host-path seam the composer already
reads (globalThis.__DSH_HOST_PATHS__). Once that seam answers, the stock composer turns dropped
files into @path chips on its own — no event hijacking, and no plugin reading your files.
The problem
The composer has two mutually exclusive landing paths for a drop
(addFiles in dsh-client-ui-conversation):
path = hostPathBridge()?.pathFor(file) ?? ""
path === "" || image → upload (file draft, materialized into the session attachment store)
otherwise → @path reference chip (nothing uploaded)
Nothing in DSH Desktop ever writes __DSH_HOST_PATHS__: the shell only exposes
__DSH_DESKTOP_FILE_PATH__ (Electron's webUtils.getPathForFile). The second branch is therefore
dead code in practice, and every drop uploads — even though Electron knows the real path.
This plugin is the one line that connects the two names.
What changes
| You do this | Result |
|---|---|
| Drop a non-image file (docx / xlsx / pdf / zip…) | an @absolute-path chip appears, zero upload, zero copy; relative to the workspace cwd when the file is inside it |
| Drop a folder | a @path/ folder chip |
| Drop an image | still uploads through the native image channel (by design: thumbnails, dimension probe, per-message limits) |
| Drop a path containing spaces | quoted automatically as @"a path with spaces.docx" |
| The shell cannot answer (OneDrive placeholders, files dragged out of archives, a plain browser) | falls back to the stock upload; nothing errors |
It does not read file contents, copy, move, delete, or touch the network, registers no host service, and never overwrites a seam that is already installed (a future DSH that wires it itself wins automatically).
Install
# from GitHub (pin a commit)
dsh plugin --profile desktop add github:384124694/dsh-host-paths#<sha>
# from a local checkout
git clone https://github.com/384124694/dsh-host-paths.git
dsh plugin --profile desktop add link:$HOME/dsh-host-paths
Use the profile you actually run (desktop for DSH Desktop, web for a standalone dsh web).
Restart DSH Desktop (or dsh web) and refresh the page — the browser half is compiled into
__DSH_BOOT__ at startup. The build output (lib/) is committed; there is no build step.
Verify
In the DevTools console:
window.__DSH_HOST_PATHS__ // { pathFor: ƒ } once installed
typeof window.__DSH_DESKTOP_FILE_PATH__?.getPathForFile // "function"
Then drop a non-image file: an @path chip should appear in the composer and no file card
(that would be an upload) above it.
Uninstall
dsh plugin --profile desktop remove dsh-host-paths
After a restart the seam is gone and drops return to stock behaviour.
Development
npm test # node --test: 7 behaviour tests, no DSH server needed
lib/client.js is a hand-written classic script (window.__ModuleLoader__.load({ id, factory }))
with no build step: edit it and restart the profile. lib/index.js is an empty host half, present
only so the bundle has a loader entry and the client half is discovered.
Known limits
- Desktop-only by nature. A plain browser has no path bridge, so the seam is never installed and drops keep uploading. The plugin does not pretend otherwise.
- Images still upload, by the composer's own design.
- Reference paths are relative to the workspace cwd when they point inside it, absolute otherwise.
- If a future DSH defines
__DSH_HOST_PATHS__itself, this plugin detects the existing value and leaves it alone.
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10703
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★ 10703
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★ 8557
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7523
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★ 5405
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1091
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.