Introduction

dsh-whale-tools is a satellite plugin that runs on top of dsh-whale-widget. Its core purpose is to solve two specific problems: first, it allows users to replace the little whale widget with any image (with automatic background removal on the server side); second, it provides a “Restart dsh” button in the conversation header and adds browser heartbeat detection.

What It Does

Feature Description
Automatic background removal After selecting an image on the Settings → Appearance page, the server runs a pipeline (crop → remove white background → largest connected component → center and scale to a 610×610 transparent PNG), overwriting the user’s image file
Restart button Adds a button to the conversation header (order: -20) that calls systemctl --user restart
Browser heartbeat Every 30 seconds, GET /dsh-whale-tools/heartbeat is issued; the host side touches the heartbeat file to determine whether the browser is online
Mobile fix Injects CSS to fix mobile drag-and-drop issues for the little whale widget (.dshwv-img touch defects)
Optional patch Disabled by default. Explicitly running the script can apply a patch, but it rewrites files in node_modules

Installation

Install it using the official DSH command:

dsh plugin --profile web add dsh-whale-tools

Usage

Change the replacement image:
Select an image on the DSH Settings → Appearance page. The server will automatically perform background removal, and the result will be written to $DSH_HOME/dsh-whale-widget/image.png.

API calls:
- Heartbeat detection: GET /dsh-whale-tools/heartbeat
- Restart session: POST /dsh-whale-tools/restart

Manual patch:
Explicitly apply a patch to modify the widget source code:

bash tools/dsh-whale-mascot-apply.sh --patch

Notes

  1. Vibe coding artifact: The code was generated through AI conversation and has not been manually audited. It has only been verified against the WSL2 + dsh 0.1.5-rc.1 series.
  2. Dependency check: Requires dsh-whale-widget to be installed, and uses the Node.js library sharp for image processing.
  3. Mobile limitations: The restart button depends on systemctl --user, which is unavailable on mobile devices; mobile devices can only display the little whale widget and cannot change the image or restart dsh.
  4. Patch risk: The patch is disabled by default. Applying the patch rewrites files in node_modules; use --revert to undo the patch.
  5. Security gate: The plugin only allows requests from loopback addresses (127.0.0.1 / ::1 / localhost) and loopback Origins. Access from mobile devices through a gateway will be blocked.
  • GitHub: https://github.com/ArimaKana-Akane/dsh-whale-tools
  • Directory page: https://www.skillhub.cn/plugins/ArimaKana-Akane/dsh-whale-tools