Introduction¶
In a dsh web session, handing over screenshots or local files to the model for processing can feel fragmented if done by manually saving, manually entering paths, and then going back to download history files. paste-to-workspace handles these operations by saving images or arbitrary files pasted or dragged into the chat box as session workspace files. Once sent, it provides the model with the corresponding path text.
What is this¶
paste-to-workspace is a dsh web plugin, package name @dsh-user/paste-to-workspace, with the repository source github:LQ-1123/paste-to-workspace. The available documentation does not provide a separate maintainer field, so the repository path is not explicitly cited as official maintainer information.
It addresses the issue of supporting image pasting and arbitrary file drag-and-drop in dsh web, saving the content to the session workspace .dsh-paste/.
Core Features¶
- Arbitrary file drag-and-drop: Drag any type of file from Finder / WeChat / QQ / Web to any position in the window; it will be saved to the workspace
.dsh-paste/and enter the pending send preview bar. - Image paste: Use
Cmd/Ctrl+Vto paste screenshots or images into the pending list. - Type icon rendering: Images show thumbnails; other files show RemixIcon line icons, original filenames, and sizes; unknown formats default to the code icon.
- Click to download: Clicking the file card triggers the browser “Save As” dialog, preserving the original filename.
- Pure file sending: Send without typing text; one call equals one turn.
- One turn, two bubbles: Text stays in the original bubble, image/file card moves to a separate user row; the model side always has one message.
- Theme adaptation: Card background, border, text, and icons follow the host design tokens, automatically switching between light and dark themes.
- Tooltip rewrite: Rewrites the host’s image drag prompt to a file drag prompt during drag-and-drop; this rewrite only applies while dragging.
- 30-day auto cleanup: Plugin paste files exceeding 30 days are automatically cleaned up.
Installation and Enablement¶
Before installation, ensure: DSH is installed and dsh web runs normally; dsh plugin is available and depends on pnpm.
Execute the installation command:
dsh plugin --profile web add "github:LQ-1123/paste-to-workspace"
Restart dsh web after installation for changes to take effect.
To disable, set in Profile patch or overlay:
- id: paste-to-workspace
disabled: true
Typical Usage¶
- Drag
.txt/.md/.pdf/.doc/.zipor other arbitrary files, or paste an image; a preview bar appears above the input box. - Send using
Enteror the send button; you can send without typing any text. - The model side receives
[Image: source: <absolute path>]or[File: source: <absolute path>]text. - Files are saved in the session workspace
.dsh-paste/; file cards in historical messages can be clicked to re-download.
Suitable Scenarios and Notes¶
Suitable for scenarios where screenshots, documents, archives, etc., need to be handed to the model for processing in dsh web. Note the following before use:
- Paste (
Cmd+V) only intercepts images within the chat input box; use drag-and-drop for files. - Folders are not supported; zip them before dragging.
- Single file limit is approximately
24 MB; base64 encoding results in a32 MBJSON body. - Sent files are retained in
.dsh-paste/for 30 days before automatic cleanup; clicking to download in historical cards may result in a 404. - Pending files are a global list: switching sessions before sending will move the file with the next send.
- The host provides
POST /save,GET /file,DELETE /fileroutes; path validation is strict, resulting in 403 for cross-site requests. - The plugin runs with the current
dshprocess permissions; check source code and license before installing. - License is
MIT; file icons come fromRemixIcon, which is licensed underApache-2.0.
Reference Links¶
The links provided in the materials are as follows:
- Directory page: https://www.skillhub.cn/plugins/LQ-1123/paste-to-workspace
- GitHub: https://github.com/LQ-1123/paste-to-workspace