DeepSeek Harness Plugin: Enhanced Bridging with Claw Enhancement and Whale Girl Theme

Preface

The official DeepSeek Harness (DSH) Bridge only reports session status and permission approvals. As a desktop intelligent agent, Clawd on Desk receives more signals (such as context usage, compaction status, and sub-agent information), but DSH cannot consume these signals directly. This plugin forks the official bridge to fill in these missing mappings and adds balance alert functionality.

Core Features

This plugin maps signals from the Clawd side to units recognizable by DSH and visualizes them through the desktop pet. Key features include:

  • F1 Context Usage: Prioritizes reading the contextPressure projection within DSH (containing real window and prompt-side usage), falling back to request/context events and contextWindowFallback. Displays the percentage on the HUD.
  • F2 Awaiting Approval: Listens for approval/asked and approval/decided events, mapping them to notification status without affecting DSH’s native approval bubbles.
  • F3 Sub-agents / Team: Listens for subagent/descriptor, team/*, and delegationDepth > 0, mapping the status to juggling.
  • F4 Context Compaction: Listens for compaction/start (status changes to sweeping) and compaction/end (status reverts to idle).
  • F5 Balance Alerts: Polls the balance via the DeepSeek API. Since Clawd lacks a balance field, the plugin creates a virtual session (deepseek-harness:balance-guard-<startup_second>) to express the balance via status animations. Pushes notification when below the threshold and error when below half.
  • F6 Remote DSH (SSH Mode): Supports connection via reverse tunnels on SSH hosts. Relies on clawd-remote.json written during Clawd deployment and the x-clawd-routing-nonce header for identity verification.

Installation and Activation

The installation process relies on DSH’s plugin manager. Because Clawd has a session_id watermark lock (sequence fence) for DSH—meaning there cannot be two reporters for the same session—the official bridge must be removed first.

  1. Clone the repository:
    git clone https://github.com/HarveyZed/clawd-whale-girl.git
    cd clawd-whale-girl
  1. Remove the official bridge and add this plugin (bundle is only composed at startup; a restart of dsh web is required after adding):
    dsh plugin --profile web remove @dsh-external/dsh-clawd-bridge
    dsh plugin --profile web add "$PWD"
  1. Restart the DSH Web service.

This plugin has zero-install dependencies (using only the Node standard library and DSH’s built-in services) and is ready to use immediately after cloning.

Configuration

Configuration is divided into the startup layer (cordis.patch.yml) and the runtime layer (params.json). Runtime configuration supports hot-reloading within 3 seconds; modifications to params.json do not require a restart.

Parameter Description

Main configuration items in params.json:

{
  "contextUsage": true,
  "contextWindowFallback": 1000000,
  "approvalNotification": true,
  "subagentJuggling": true,
  "compactionSweeping": true,
  "permissionBubble": true,
  "permissionTimeoutMs": 600000,
  "debugLogPath": "debug.log",
  "paramsPollMs": 3000,
  "balance": {
    "enabled": true,
    "threshold": 20,
    "currency": "CNY",
    "apiKeyEnv": "DEEPSEEK_API_KEY",
    "baseUrl": "https://api.deepseek.com",
    "endpoint": "/user/balance",
    "refreshMs": 300000,
    "firstRetryMs": 15000,
    "mode": "flash",
    "flashMs": 12000,
    "remindEveryMs": 1800000
  }
}

Settings Page and Live Parameters

Configuration saved via the DSH settings page (Built-in plugins → Clawd Extension) is written to params.json. Directly modifying params.json (refer to params.example.json) also takes effect within 3 seconds.

Theme and Appearance

The plugin includes a Whale Girl desktop pet theme, with assets sourced from vlln/whale-girl (MIT).

Installation methods:
1. Copy the themes/whale-girl/ directory to the Clawd user themes directory (on Windows: %APPDATA%\clawd-on-desk\themes\).
2. Or select themes/whale-girl.zip in “Settings → Themes → Import Theme zip”.

Remote DSH (SSH) Mode Details

In SSH host mode, the desktop side exposes server endpoints via a reverse tunnel. This plugin automatically reads the identity file (~/.claude/hooks/clawd-remote.json or ~/.clawd/clawd-remote.json) for identity resolution.

Tri-State Identity Resolution

The identity resolution logic determines the transport mode:

Status Determination Condition Behavior
absent All candidate paths do not exist, and there is no managed remote marker Proceed with local scan (upstream behavior)
invalid File exists but is unusable, or no file but managed remote marker exists Fail closed: Report clawd-unavailable, do not scan ports
valid Verification passed Punch identity.remotePort + nonce, connect directly

Managed Remote Marker

If the environment variable CLAWD_SSH_REMOTE=1 is set or the file clawd-ssh-secure-v1 exists, it is determined as a managed remote. This prevents the plugin from mistakenly scanning ports in unintended environments (such as when running the desktop Clawd simultaneously).

Troubleshooting Tools

If SSH mode is not working, run the diagnostic script on the remote end:

node test/live-probe.mjs

Outputting nothing is listening indicates the reverse tunnel is not established; outputting 404 indicates the nonce has expired; outputting OK indicates a normal connection.

Known Limitations

  • Incompatible with Official Bridge: @dsh-external/dsh-clawd-bridge must be removed first.
  • Balance Display: Clawd lacks a balance field, so the balance can only be expressed through status animations of a virtual session; specific numbers cannot be displayed.
  • DSH Event Gap: DSH has no worktree event, making carrying unmappable; DSH only has sub-agent creation events but no termination events, causing sub-agent sessions to remain in the juggling state until overwritten by a new event.
  • Verification Scope: The plugin itself has been tested on Windows + DSH 0.2.0-rc.2; the remote side has been tested on Linux + DSH 0.1.2-rc.1. Other versions have not undergone cross-platform verification.
羽毛球分组比赛记分
小程序二维码

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

Xiaoye