dsh-download-button: Add Download button to deliverable file cards

Preface

In the DeepSeek Harness (dsh) Web interface, after an agent generates a file, a “Deliverable” (交付物) card is rendered. By default, it only offers “Open” and “Open in sidebar” actions. If you run dsh web on a server without a desktop environment, “Open” relies on host desktop integration and often fails immediately; “Open in sidebar” only prompts that preview is unavailable for non-text files like docx, xlsx, pdf, or zip. The result: the file exists in the workspace, but there is no path to save it from the browser to the local disk.

The community plugin dsh-download-button (Maintainer: maxesisnclaw, Category: Client-side) addresses this. It appends a Download link to every deliverable card, reusing the built-in dsh authenticated file interface to save the byte stream to the local machine.

What is this

dsh-download-button is a client-side plugin for the dsh Web UI. It does not modify node_modules or add new server-side routes. Instead, it injects a small script into the server-rendered index page to add a download entry point to deliverable cards and hides invalid prompts related to desktop integration in headless environments.

Default Card Behavior & Gaps

The actions provided by dsh for deliverable cards are roughly as follows:

Action Behavior Common Shortcoming
Open Asks the host OS to open the file with the default application Unavailable on headless servers
Open in sidebar Text preview Cannot preview non-text files

The plugin aims to present a card action area resembling:

[ Download ] [ Open ▾ ]

When Download is clicked, the browser fetches the file via a request carrying the session cookie and triggers a save.

Core Features

Download Button

  • Appends a Download link to every deliverable file card.
  • Reuses the built-in route GET /api/file?path=<absolute path> (with correct Content-Type and cookie authentication); the HTML download attribute provides the filename.
  • The absolute path is derived from the card’s existing title attribute (currently, dsh writes the resolved workspace path there).

Styling & Upgrade-Friendliness

  • The button’s className is copied from existing action buttons on the same card rather than hardcoding bundled class names, making it easier to keep up with theme changes.
  • Does not modify vendor code; only taps into the server-rendered index page to inject the script.

UI Adjustments on Headless Hosts

When a headless environment is detected, prompts such as “No desktop available on this host, cannot open files or folders” are hidden. The detection rule matches dsh’s behavior on Linux: checking for the existence of DISPLAY or WAYLAND_DISPLAY; prompts are not hidden on macOS / Windows desktop modes.

Installation & Enablement

Official Recommendation (Web profile):

dsh plugin --profile web add github:maxesisnclaw/dsh-download-button

Manual Installation:

  1. Copy the plugin directory to <dsh-install>/plugins/dsh-download-button/.
  2. Append to $DSH_HOME/cordis.patch.yml:
    - insert:
        - id: download-button
          name: /absolute/path/to/dsh-download-button/index.js
  1. Restart the service: systemctl restart dsh (or restart your dsh web process).

If the package appears in the profile’s dsh.profile.bundles, the bundled cordis.patch.yml automatically performs the same insert.

Verification

  1. Open the Web UI, have the agent generate any non-text file (docx, xlsx, pdf, etc.). You should see Download on the file card; clicking it should save the file locally.
  2. The underlying route can be verified independently on the server (replace session cookie and path):
    curl -b "<your session cookie>" \
      "http://127.0.0.1:3080/api/file?path=/absolute/path/to/file.docx" -o out.docx
    # out.docx should be byte-for-byte identical to the source file
  1. Unit tests within the plugin repository: npm test (checks that index page injection happens only once and is idempotent).

Use Cases & Notes

Who it is for: Developers or Ops who self-host dsh web, frequently receive deliverables like docx / pdf / archives via the browser, and may run on headless Linux hosts.

Limitations (from the README):

  • Depends on the current dsh behavior of exposing the absolute path via the title attribute on deliverable cards; if the markup changes in the future, the selectors in the injected script need to be updated.
  • Only affects deliverable file cards; other interfaces like sidebar text previews remain unchanged.

Security & Permissions: The plugin runs with the current dsh process permissions, and the download path goes through the authenticated /api/file. Please read the GitHub repository source code and the MIT license before installation to ensure it complies with your deployment strategy.

The DSH ecosystem emphasizes “Everything is a plugin”; the community directory SkillHub Plugin Page has no official affiliation with DeepSeek / High-Flyer. This article is merely a description of a third-party plugin.

Conclusion

Without making major changes to dsh, dsh-download-button supplements the deliverable card with a direct browser Download button and reduces invalid Open prompts in headless environments. For installation commands and details, please refer to the repository README:

  • Directory Page: https://www.skillhub.cn/plugins/maxesisnclaw/dsh-download-button
  • GitHub: https://github.com/maxesisnclaw/dsh-download-button
羽毛球分组比赛记分
小程序二维码

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

Xiaoye