Introduction¶
In DSH Web sessions, the platform natively only provides an image channel for plugins. Regular files often require manually typing paths or finding workarounds. When attaching logs, configurations, screenshots, and code snippets to conversations, the input box and sending pipeline are not unified, and they easily conflict with the platform’s built-in image handling.
Below introduces the community plugin dsh-file-attach (repository RCYD857/857-dsh-file-attach, maintainer RCYD857). It adds a scrollable row of “chips” inside the Web composer’s input box: after dragging or pasting files, folders, or images, chips appear above the text; when sending, non-image files are expanded into @path references that the model can open, while images continue to use the platform’s existing image pipeline.
What Is This¶
dsh-file-attach is a plugin for the DSH Web client (--profile web), with current package version 0.6.1 and license MIT. It doesn’t transform the input box into a “path editor”: the text box still contains what you type, with attachments as chips attached to the input area; when sending, the plugin-wrapped conversation.sendSession converts ready chips into @path (or @"path" when the path contains spaces). Sent messages with @path will also render as file reference chips.
Core Features¶
Input and Chip Row¶
| Action | Result |
|---|---|
| Drag files anywhere on the page | Full-screen prompt; on release, chips appear inside the input box above the text |
| Paste files in the input box | Same as above |
| Drag or paste images | Enter platform image pipeline and display in the same chip row |
| Click a chip | Preview: full image, first 200 KiB of text or code, or file metadata |
| Click × in the chip’s top-right corner | Chip fades out, not included when sending |
| More chips than one row width | Inline paginated scrolling; obscured endpoints show floating arrows, obscured chips fade out on the card |
| Send | Each ready chip expands to the corresponding @path |
| Drag folders | Resolve to folder path, shown as @folder/ in the prompt, model can list and read within the directory |
Each message supports up to 20 attachments. Chips display badges, filenames, and extension · size (or current step, like “Locating…”, “Uploading…”). Files with the same name but different content will prompt you to choose before sending. If attachment fails, click Attach failed, try again to retry locating or staging; if chips are still parsing or awaiting selection when you press Enter, the prompt will name the attachment and reason, keeping the chip.
How Images and Non-Images Reach the Model¶
DSH plugins don’t have a universal file attachment API. The plugin splits responsibilities:
- Images (
image/*): Validated and registered viaconversation.createDraftImages(files), then submitted using the session cover’saddImages(ids); must use platform-issued IDs, directly passing File objects to the facade will be dropped in the next render. - Other types: Exist as cards in the input box; when sending, expanded to
@pathat the unifiedsendSessionexit. Draft text is not rewritten; if sending fails, cards remain and can be sent again.
Pasted bitmaps (like WeChat or Snipping Tool screenshots) are processed as regular image attachments per platform methods; media type is determined by the file itself first, then extension, then file header.
Where Paths Come From (By Priority)¶
- Drag payload includes path: e.g.,
text/uri-listprovided by the file explorer, does not copy the file. - Fingerprint of pasted files: When no path exists, the browser calculates SHA-256 for content up to 64 MiB. The host uses
POST /file-attach/locateto match “the one the user handed over” among candidates with the same name. If no match or too large to hash, proceeds to subsequent rules. - Host bounded search: Search root order: current workspace → other workspaces →
inbox/input/inputs/dropsunder each workspace →Desktop/Documents/Downloads→ historical hit directories (recorded in<DSH_HOME>/file-attach-roots.json, max 24). Breadth-first, depth 5, total search ~3 seconds, max 20,000 entries and 20 candidates; folders can also match. If still cannot uniquely locate and content genuinely differs, a selector appears. - Staging copy:
POST /file-attach/stage, bytes written to<workspace>/.dsh-attachments/<name>; directory includes.gitignore(content*), single file limit 256 MiB. Fallback when browser doesn’t expose drag source; same name with different content goes toname-2.extetc., distinguished by bytes to avoid silent overwrite.
Folders outside the workspace that cannot be resolved will prompt to drag files within the folder instead.
Installation and Activation¶
The plugin has no build step and doesn’t require allowBuilds approval. Official installation command:
dsh plugin --profile web add github:RCYD857/857-dsh-file-attach
After installation, restart DSH and hard refresh the Web page. Uninstall:
dsh plugin --profile web remove dsh-file-attach
For local development, link the source directory:
dsh plugin --profile web add link:/path/to/dsh-file-attach
Documentation states development and validation on DSH Desktop for Windows; requires a DSH profile with Web client.
Typical Usage¶
- Open the composer in the Web session page, drag local files to the page or input box, or copy from the file explorer and paste in the input box.
- Check the name, size, or status on chips; click chips to preview when needed, use × to remove unnecessary ones.
- Type description text and send; ready non-image attachments enter the prompt as
@path, images enter the model as visual input. - For full directory context, drag folders; after successful resolution, send as
@folder/, letting the model operate within the directory.
Use Cases and Notes¶
Suitable for: Developers who frequently combine local files, screenshots, and small directories with agents in DSH Web, and want interactions similar to Doubao-style “chip row in input box”.
Notes:
- Only Web profile; other profiles are not in this plugin’s declared scope.
- Plugin permissions match the current dsh process; host-side locate/stage will read/write search paths in the workspace and user directory; review the GitHub source and MIT license before installation.
- Large files, pastes that cannot be hashed, or search timeouts may go to staging or require manual file selection; unready attachments won’t be silently discarded, with explanations when sending.
- Community catalog SkillHub plugin page has no official affiliation with DeepSeek/Hunyuan; DSH ecosystem follows “everything is a plugin” direction, this plugin is community-maintained.
Conclusion¶
dsh-file-attach connects drag-drop, paste, and send in the Web composer into one pipeline: images go through the platform pipeline, other files are managed as chips in the input box, and become @path when sending. If you mainly do file-accompanied conversations in DSH Web, you can install via the commands above and validate in the Windows Desktop environment.
- Catalog page: https://www.skillhub.cn/plugins/RCYD857/857-dsh-file-attach
- Repository: https://github.com/RCYD857/857-dsh-file-attach