cyberhunter775/dsh-plugin-file-download

dsh-plugin-file-download: Add a Download Button to Files in DSH Conversations

Resources are sufficient (README is complete). The directory page is JS-rendered and the main body was not retrieved, but this does not affect the final article. If there are no stars or categories, they will not be written.

call write_result_md + write_meta_json

Introduction

When running agents in DSH Web conversations, the model often uses the present tool to render generated files (reports, export results, scripts) to the user. The file card displays the filename and a content summary, but when users want to obtain the file itself, they still have to log in to the server, browse the workspace directory, and find the path with the hash. This problem is particularly obvious when letting non-technical colleagues use the conversation: they don’t know how to open a terminal and have no concept of paths.

The plugin dsh-plugin-file-download introduced below (maintainer: CyberHunter775) is specifically designed to solve this problem: placing a “Download” button directly on the file card so that clicking it in the browser saves the file locally.

What Is This

One-sentence positioning: A plugin that adds a download button to files presented in DSH Web conversations, turning “finding a file on the server” into “click to save locally.”

  • Maintainer: CyberHunter775
  • Version: 1.0.0 (from repository package.json)
  • License: MIT
  • Implementation: Pure JavaScript, zero dependencies, no build required
  • Technical background: DSH’s philosophy is “everything is a plugin.” Plugins are divided into a host side (server-side routes) and a client side (Web client UI). This plugin modifies both sides.

It solves friction in the delivery phase, does not change how files are generated, nor does it handle file management; it does only one thing: allows files that have appeared in the conversation to be downloaded directly.

Core Features

Explained item by item according to the capabilities listed in the README. The following capabilities have been verified without modification.

  1. The download button appears on file cards in the conversation. It covers two types of cards: deliverables cards and deliverables.review file cards. The button position is implemented by injecting two slots: deliverables.file.actions and deliverables.review.file.actions, without overriding the plugin’s original card rendering.
  2. Streaming transmission in 1 MiB chunks. This ensures that a single large file is not loaded into memory all at once, keeping the download process’s pressure on the server manageable.
  3. File names are preserved in full, supporting Chinese characters. This is implemented via RFC 5987 encoding of Content-Disposition. Chinese filenames, filenames with spaces, and special characters are all correctly saved locally.
  4. Styles follow the DSH native theme. The button is a ghost button that automatically adapts to light/dark themes.
  5. Chinese and English interface. Copy follows DSH’s language settings, corresponding to the two variants “下载” / “Download”, with entries placed in locale/zh.json and locale/en.json.
  6. Authentication reuses the current session Cookie. The download route only allows access to files that have appeared in the current session logs; it cannot download other files in the workspace via guessed addresses. The security boundary here is “current logged-in user + files that have been presented.”

Installation and Enablement

The installation method provided in the README is to add it as a dependency in the DSH profile, supporting local paths or GitHub repositories:

# Install from a local path
dsh plugin install file:/path/to/dsh-plugin-file-download

The repository instructions also mention adding it to the profile via pnpm link or git dependencies, but do not provide a unified dsh plugin add github:... command. If using the GitHub method, follow the git dependency configuration of the profile’s package manager; do not treat the local path example as a universal command.

After installation, a download button will appear on the file card when the model presents a file using the present tool in a conversation. The plugin declares dsh.client.immediately: true and the injection target @deepseek-ai/dsh-client-ui-conversation in package.json, so the client UI automatically injects it during loading; no additional toggle is needed.

Typical Usage

The README does not provide an end-to-end example script. Below is a reproducible minimal workflow; all commands come from the plugin’s own identifiers without extra concatenation.

  1. Prepare a DSH profile and add the plugin directory to dependencies:
dsh plugin install file:/path/to/dsh-plugin-file-download

This step registers the plugin in the current profile; the host side will load index.js and the client side will load client.js.

  1. Start the DSH Web service (you can use your existing profile’s startup method; the plugin itself has no extra startup parameters).

  2. In the Web conversation, let the model generate and present a file (e.g., writing an analysis result to a file and presenting it). Once the file card is rendered, a “Download” button will appear on the right.

  3. Click the button, and the browser will save the file by filename. Chinese filenames and files larger than 1 MiB are handled as described in the Features section above.

The corresponding file structure is also simple; you can locate it by file name if you need to modify the source code:

index.js        # Host plugin: server-side routes
client.js       # Web client plugin: UI buttons
cordis.patch.yml  # Cordis plugin registration
locale/zh.json, locale/en.json  # Interface text

How It Works

Understanding it from both sides is clearer, and the README is described in this structure.

The Host side (index.js) registers the GET /plugins/file-download route. Upon receiving a request, it parses the sessionId + seq + index into the file path in the workspace via the session log interface sessionQuery.readEvent. Here, seq and index refer to the occurrence position of the file in the conversation event stream. Therefore, the downloaded file is not “an arbitrary file in the workspace” but “the file presented in that message.” After parsing, it performs authentication first, then streams the content back as an attachment in 1 MiB chunks.

The Client side (client.js) is responsible for the UI. It injects the two slots mentioned above into the conversation rendering layer, so when the file card renders, the download button is attached to the slot location. Button styles, copy, and interaction are all completed on the client. Upon clicking, it initiates a same-origin request to its own DSH domain, naturally carrying the session Cookie.

Suitable Scenarios and Notes

Suitable for:

  • Users who use DSH Web conversations for delivery and need to give non-technical colleagues files. This is the most valuable scenario, saving the step of “opening a terminal to find a path.”
  • People who batch generate reports, tables, and scripts on the Web and want to download them immediately after generation.
  • Plugin developers who want to add custom actions to DSH deliverable cards, who can refer to its slot injection method.

Points to note:

  1. The plugin runs with the permissions of the current dsh process. The download route can read files presented in the session workspace, which means if the process can access it, the plugin can access it. Please check the source code and license (MIT, allows copying and modifying provided you comply with the declaration) before installing.
  2. The security boundary relies on session authentication and the path parsing of sessionId + seq + index. Do not treat it as an independent file safe; when exposing the DSH service externally, you must still ensure access control is in place at the deployment layer.
  3. The scope of functionality is limited to “files presented in the conversation.” There is currently no interface to list or search for unpresented files in the workspace. If you need to list all artifacts, this plugin does not solve that.
  4. The plugin version is 1.0.0, and no future roadmap is listed in the README. Pay attention to repository commits before upgrading.

Conclusion

The value of this plugin is focused: it does not change the atmosphere or invent concepts; it just incorporates the last manual step in the DSH delivery process (finding a path, opening a terminal, retrieving a file) into a single click. For teams already using DSH Web conversations for delivery, it is a low-cost addition; for plugin writers, it can serve as a compact example of host routes + client slot injection.

  • Community Directory: https://www.skillhub.cn/plugins/CyberHunter775/dsh-plugin-file-download
  • Code Repository: https://github.com/CyberHunter775/dsh-plugin-file-download
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye