Introduction¶
In DSH Web, the common way to reference another session or workspace file is to use @ or / in the input box to open the picker and select the target. However, as the number of sessions grows and paths become longer, switching repeatedly between the sidebar and the input area breaks the flow of thought. DeepSeek Harness’s plugin model allows behavior patches to be mounted on the Web client; dsh-drag utilizes HTML5 drag-and-drop to complete the “drop” side of the existing drag capability for session rows in the sidebar. Furthermore, it self-activates drag sources for the right-side file panel, which was originally undraggable. Upon release, it follows the same insertReference channel as the @ picker, inserting a genuine reference chip rather than raw text.
The following sections introduce the plugin’s positioning, the two types of drag sources, installation steps, and boundaries to be aware of during use.
What is this¶
dsh-drag is a DSH Web client plugin (dsh.client.platform: web) released by the maintainer ttmouse. The current package version is 0.1.2, licensed under MIT.
In short: drag a session row from the sidebar session list, or a file/folder from the right-side file panel, into the chat record area and release. A canonical reference will enter the current input draft as a chip—sessions appear as @[Title](dsh-session:…) mentions; files appear as @path (or @"path" if the path contains spaces) according to the host grammar, identical in form to selecting a file via @ in the input box.
Directory page: skillhub.cn/plugins/ttmouse/dsh-drag
Source code: github.com/ttmouse/dsh-drag
Core Features¶
Two Draggable Sources¶
| Source | Drag Provider | Result after Drop |
|---|---|---|
| Sidebar Session Row | Host ui-workspace’s SessionNodeItem (writes text/plain on dragstart, row may have data-row-key="session:<id>") |
Session reference chip (appearance: 'session') |
| Right-side File Panel Row | Activated by plugin on pointerdown (draggable) (host panel originally has no drag) |
File/Folder reference chip (appearance: 'file' / 'folder') |
Workspace group rows, file panel “Other” placeholder rows, plain text, and other drag sources will not be treated as valid sources by the plugin.
How the Drop Side Integrates with the Editor¶
The plugin listens for dragover / drop at the document capture phase and calls stopPropagation(). The reason is that the chat input is based on Lexical; a drop on the editor root would paste text/plain (e.g., a raw session id) into the draft as normal text. Intercepting only at the bubbling phase would be too late.
Upon release, the plugin calculates the drop target on the fly: resolves the current session in the main panel → sessions.scope(id) → conversation.input.for(actx), then calls insertReference using caretSpan() and snapshot.draftRev. This follows the same span-CAS path as the @// picker.
File reference text is constructed according to the host’s dsh-file-reference/grammar formatFileMention; if the path contains quotes or control characters, insertion is rejected with a prompt to avoid constructing tokens that might be misinterpreted.
Deliberately Retained Host Behaviors¶
- Dragging back to the sidebar (any row inside
[role="tree"]) is not intercepted, allowing the official inline reordering to work as usual. - The chat column (
[data-conversation-content]) prioritizes accepting drops;role="tree"elements inside the chat column (such as in the trajectory view) will not be mistakenly identified as the sidebar and rejected. - Dropping the current session itself will trigger a prompt: “The current session does not need to reference itself.”
- The plugin does not draw custom overlays; visual feedback relies solely on the browser’s native drag shadow and the “Copy” corner badge.
Installation and Activation¶
Host version declaration (engines.dsh in package.json):
>=0.1.5-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.3.0-0
The Web side is covered within the above range starting from 0.1.5-rc.2, and the desktop built-in Web line from 0.2.0-rc.2. The installer currently does not enforce validation of this field, but an overly old version may cause drag-and-drop to be invalid or semantically drift (e.g., 0.2.0-rc.2 once removed SessionListState.current, causing older plugins to silently fail to insert; the current version has achieved compatibility with both list forms via methods like retainedBy.mainView).
Install from GitHub (this source is also used after inclusion in dsh-market):
dsh plugin --profile web add github:ttmouse/dsh-drag
dsh plugin add will write dsh-drag into the profile’s dsh.profile.bundles. The repository has committed build artifacts in lib/, so installation is possible without a local build. Upon completion, restart dsh web and perform a hard refresh in the browser to load the new bundle.
For local development, you can link to the source directory (replace the example path with your machine’s path):
cd ~/.dsh/profiles/web && pnpm add "dsh-drag@link:/path/to/dsh-drag"
After modifying the bundle, routing is based on content hash, so generally a hard refresh is sufficient; you do not need to restart dsh web every time.
Typical Usage¶
- Open the target conversation in DSH Web and ensure there is an editable input box (composer) in the main panel.
- Reference another session: Press and hold a session row in the left workspace tree, drag it into the central chat record area. A droppable “Copy” corner badge should appear when the pointer enters the area; upon release, a reference chip for that session appears in the draft. You can verify the title and link form before sending.
- Reference a file or directory: Press and hold a file or folder row (not the “Other” placeholder) in the right-side Files panel, and similarly drag it into the chat area and release. Files become
@path, directories become@path/and are displayed as a folder style chip; if the path contains spaces, the quoted@"…"form is used. - If you want to reorder sessions within the sidebar, please drag and drop within the tree, and do not release in the chat area—the plugin deliberately allows drops within the sidebar tree.
If insertion fails, you may see prompts such as “Session reference insertion failed” or “File reference insertion failed”; if there is no conversation in the main panel, the drop will be silently ignored, and there may be a [dsh-drag] drop ignored: … warning in the console.
Use Cases and Notes¶
Who it is for
- DSH Web users who frequently switch between multiple sessions and wish to
@reference historical sessions in the current conversation. - Developers who are accustomed to clicking paths from the right-side file tree but prefer to drag a path into the draft rather than typing or repeatedly opening the
@picker.
Permissions and Security
The plugin runs as a client bundle under the DSH Web profile, with a capability boundary consistent with the current dsh web process and other installed plugins. Before installation, it is recommended to read the source repository and the MIT license; the community directory skillhub.cn has no official affiliation with DeepSeek / High-Flyer and is merely a community collection site.
Compatibility and Implementation Details (Optional Reading)
- File rows must set
draggable="true"atpointerdown(document capture); setting it indragstartwill fail to initiate dragging in a real Chrome environment (the repository usesscripts/browser-drag.mjsas a regression gate). - Session ID recognition uses
/^[A-Za-z0-9_-]{1,128}$/, deliberately excluding workspace payloads likeworkspace:<id>to avoid incorrectly inserting session references. - Node development environment requirements (if you intend to modify the plugin):
^22.19.0 || >=24.0.0(seeengines.nodeinpackage.json).
Conclusion¶
dsh-drag uses a minimal UI surface to complete the “list to draft” drag-and-drop path in DSH Web: session dependencies rely on existing host drag sources, the file panel source is activated by the plugin, and drops uniformly go through insertReference. If you need to quickly attach other sessions or repository files while writing prompts, you can install it via the command above and try it out after a hard refresh in the Web client.
- Directory Page: https://www.skillhub.cn/plugins/ttmouse/dsh-drag
- GitHub: https://github.com/ttmouse/dsh-drag