Introduction¶
When developing agents with DeepSeek Harness (dsh), you frequently encounter the “workspace mismatch” problem: the current working directory (cwd) in the chat window and your local code or data folders are not in the same context, so commands like ls, cat, and cd appear to work normally but actually operate on the wrong directory. dsh itself provides an architecture that separates sessions from workspaces, but it lacks a built-in shortcut for “drag a folder to switch workspace.”
Below is a purely client-side plugin that does the following: drag a folder from your file manager into the dsh window, and it will automatically create a new conversation with that folder as the workspace.
Plugin Overview¶
- Name: dsh-folder-drop-session
- Maintainer: yang313760940
- Type: Pure client-side plugin (does not modify the Electron host, no host patches)
- License: MIT
- Compatible host: DeepSeek Harness (dsh)
0.2.2-rc.3
Core Features¶
Drag-and-drop behavior reference:
| Dropped Item | Behavior |
|---|---|
| A single folder | Registers the folder as a Workspace (reuses it if it already exists) → creates a new conversation and selects it → the new conversation’s cwd is that folder |
| Multiple folders in one drop | Only the first one is processed; the notification explains the rest were ignored |
| A single file / image | Not triggered; handed back to dsh’s standard attachment handling |
| A folder without read permission | Reports a read/list failure, does not create a conversation, does not crash |
| A non-desktop web window | Reports that the native path bridge is missing, does not create a conversation |
Installation & Activation¶
Method A: Marketplace Index (Recommended)¶
- Open dsh Settings → Plugins → Experimental Plugins → More → Custom Plugin Marketplace, and enable the option.
- Go to the “Discover” page → Add Index Source, and paste:
https://yang313760940.github.io/dsh-folder-drop-session/index.json
- Click Install on “Create Conversation from Dropped Folder,” then fully quit and reopen dsh.
Method B: Command Line¶
# First, fully quit the dsh desktop app
dsh plugin --profile desktop add "git+https://github.com/yang313760940/dsh-folder-drop-session.git"
Method C: Local tgz¶
npm pack
dsh plugin --profile desktop add ".\dsh-folder-drop-session-1.0.0.tgz"
Typical Usage¶
After installing and restarting, drag a folder from Explorer or Finder into any part of the dsh window:
- A notification “Creating a new session for folder” will appear in the bottom-right corner.
- Upon completion, the view will automatically switch to the new conversation, whose cwd is the dropped folder.
Implementation Details¶
The plugin interacts with the host via the following interfaces (developed against the real APIs):
- Directory detection:
DataTransferItem.webkitGetAsEntry().isDirectory— does not rely on file extensions or empty files. - Native path: Desktop bridge
window.__DSH_HOST_PATHS__.pathFor(file)(electron.webUtils.getPathForFile); the path is snapshotted within the synchronousdropcall stack to avoid becoming stale after async operations. - Permission pre-check:
FileSystemDirectoryReader.readEntriesfor the initial batch read; on failure, reports an error without calling the host. - Registration & session creation:
workspaces.create({ path })→sessions.create({ workspaceId })→uiWorkspace.openSession(sessionId); on failure, completed steps are preserved and recoverable information is provided. - No custom RPC, no cross-session cwd modification, does not read folder contents.
For interface evidence and boundaries, see docs/HOST-INTERFACES.md in the repository.
Use Cases & Notes¶
- Ideal for quickly switching workspaces in a local desktop scenario: drag a folder from Explorer or Finder into dsh, and you can immediately start a conversation rooted in that directory.
- The plugin runs with the current dsh process permissions. It is recommended to review the source code and license (MIT) before installation.
- Currently verified on dsh
0.2.2-rc.3. After upgrading the host, please runnpm testand perform manual drag-and-drop acceptance testing first.
In Short¶
This plugin introduces no extra dependencies and does not modify host code. It interacts solely through the drag-and-drop interface with dsh’s Workspace, Session, and UI modules, freeing the high-frequency “switch directory” operation out of the command line or menus.
Directory page: https://www.skillhub.cn/plugins/yang313760940/dsh-folder-drop-session
GitHub: https://github.com/yang313760940/dsh-folder-drop-session