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
contextPressureprojection within DSH (containing real window and prompt-side usage), falling back torequest/contextevents andcontextWindowFallback. Displays the percentage on the HUD. - F2 Awaiting Approval: Listens for
approval/askedandapproval/decidedevents, mapping them tonotificationstatus without affecting DSH’s native approval bubbles. - F3 Sub-agents / Team: Listens for
subagent/descriptor,team/*, anddelegationDepth > 0, mapping the status tojuggling. - F4 Context Compaction: Listens for
compaction/start(status changes tosweeping) andcompaction/end(status reverts toidle). - 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. Pushesnotificationwhen below the threshold anderrorwhen below half. - F6 Remote DSH (SSH Mode): Supports connection via reverse tunnels on SSH hosts. Relies on
clawd-remote.jsonwritten during Clawd deployment and thex-clawd-routing-nonceheader 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.
- Clone the repository:
git clone https://github.com/HarveyZed/clawd-whale-girl.git
cd clawd-whale-girl
- Remove the official bridge and add this plugin (
bundleis only composed at startup; a restart ofdsh webis required after adding):
dsh plugin --profile web remove @dsh-external/dsh-clawd-bridge
dsh plugin --profile web add "$PWD"
- 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-bridgemust 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
worktreeevent, makingcarryingunmappable; DSH only has sub-agent creation events but no termination events, causing sub-agent sessions to remain in thejugglingstate 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 + DSH0.1.2-rc.1. Other versions have not undergone cross-platform verification.