Introduction¶
DeepSeek Harness (DSH) exposes session and task state as structured events, which plugins can leverage to build custom UIs and status announcements. However, existing approaches either focus solely on functional extensions or turn plugins into chat assistants—both of which consume attention and distract from the main workflow. A more useful approach would be placing a read-only, desktop pet companion alongside the session that doesn’t read message content but simply lets developers and users see the task rhythm at a glance.
What It Is¶
cn-zhangpeng/dsh-shanhai-pet (Shanhai Pet) is a desktop pet plugin for DeepSeek Harness, maintained by cn-zhangpeng and categorized as “Fun Skins.” It doesn’t read conversation content—only the structured state of DSH sessions: whether the current turn is in reasoning, editing code, running commands, or wrapping up. Based on that state, it switches to the corresponding pose and displays a plain-language description in a speech bubble above its head.
Core Features¶
-
State-driven poses and dialogue: The plugin subscribes to
session/eventtypes (turn/start/step/start/tool/call/tool/result/turn/end/todo/write) andagent/assistant-streamchunk types, mapping events to phase states. Phases and tool action frames correspond to 8 phase tracks + 6 tool family tracks (tool:ink/tool:wind/tool:sniff/tool:gaze/tool:chess/tool:split). Phases includeidle(zoning out),listening(listening to you),thinking(pondering),tool(tool action),review(drafting a reply),done(finished),failed(something went wrong), andwaiting(awaiting your approval). When a session has a todo list, she announces “Step N:” at the start of each step (with a secondary line showing “X of Y completed”); she also has a line for finishing, hitting a blocker, or waiting for approval. For tasks without a todo list, she only changes pose without extra chatter. -
Idle greetings and companionship stats: When DSH opens, she greets you based on the time of day (Good morning / Good afternoon / Good evening / It’s late, get some rest), with a secondary line reading “Day N of our time together · X minutes today” (presence time accumulates and resets daily; Day N counts from the day the plugin was installed). After roughly 30 minutes of inactivity, she greets you again. This can be toggled via the “Idle Greetings” switch on the settings page.
-
Click interaction and info card: Clicking her plays one of four random lines, each paired with an action frame (blink / listen to the wind / curl tail / gaze at you). Hovering the mouse over her head pops up a small card showing the time-of-day greeting, days together and today’s companionship, current state and skin, plus actions: “Return to position / Do a thing / Bubble / Nap / Hide” (on mobile, long-press the avatar to open the same card).
-
Custom skins: The plugin supports custom skins. Prepare a skin folder and upload it from the settings page—changes take effect immediately, and any missing frames automatically fall back to the built-in Ranran. The skin directory structure is:
MySkin/
pet.json # Frame manifest + optional displayName / author / license / lines
frames/ # Character sheet PNGs (names must match the frame names referenced in pet.json tracks)
anim/ # Optional: loop animation webp for multi-frame tracks
Optional fields in pet.json include displayName (display name), author / license (author and asset license shown on the preview card), and lines (skin-specific dialogue pool, supporting poke / greet / done / failed; falls back to built-in text if absent). On the settings page → Assets → Upload skin folder (select the entire folder); it auto-enables after upload. You can also drop the folder directly into $DSH_HOME/shanhai-pet/skins/—the settings page will detect it. Skins are listed as preview cards: first-frame thumbnail, name, author/license, and line count. Upload validation checks structure: missing tracks, durations not matching frame count, or incorrect lines type will trigger an immediate error message with the reason. Upload limits: single file ≤ 8 MB, per skin ≤ 120 files. Switching: click “Enable” on the card; select “Ranran” to switch back to the built-in. Deleting a skin: manually remove the corresponding folder under skins/.
-
Settings: The settings page is divided into three groups: Appearance / Motion / Interaction. The Appearance group includes visibility, size, position, blinking, floating, idle micro-actions, speech bubble, announcements, greetings, and click behavior. The top of the Appearance group shows today’s companionship duration. Settings are written back to
$DSH_HOME/shanhai-pet/settings.jsonand synced across multiple windows. Specific toggles include “Progress Announcements” (controls task progress dialogue), “Idle Greetings” (controls inactivity greetings), “Speech Bubble” (controls bubble display), “Idle Micro-Actions” (randomly waves, checks phone, or paces when idle), and “Floating” (breathing float and tilt). The “Reduce Motion” toggle can follow the system setting; when enabled, it stops breathing float, tilt, and idle micro-actions, leaving only static frames. -
Nap and summon: After napping, she shrinks to the corner, becomes semi-transparent, shows
z zabove her head, and stops micro-actions and speech bubbles. Click to wake her. She only auto-wakes when real work begins (listening / thinking / working / drafting a reply); after finishing or encountering an error, she keeps sleeping. When truly hidden, a small button appears at the screen edge—click it to summon her back. -
Small-screen adaptation and click pass-through: The character sheet height scales with the viewport (width ≤ 30vw, height ≤ 38vh), so on phones she no longer takes up half the screen. Only the avatar area of the overlay is clickable; input fields, send buttons, and toolbars underneath the character sheet remain fully clickable.
-
Data and permission boundaries: The plugin runs with DSH process permissions. File writes are limited to
$DSH_HOME/shanhai-pet/:settings.json(appearance settings),company.json(companionship duration and first-meeting date),skins/**(user-uploaded custom skins)—all using atomic tmp + rename writes. Reads are limited to the plugin’s bundled assets, locale files, and the data files above. Data read boundaries: only structured fields are read—subscribed session event types, tool names, whitelisted tool parameter fields (file_path/path/pattern/query/url/command), todo list items, and turn-end reasons. Message body content is never read; step text in announcement lines is truncated to 24 characters. Network capability: same-origin local API only. The Host side registers read-only/api/shanhai-pet/*routes on DSH’swebServer; the Client side reads via same-originfetch. No external domains or third-party services are accessed. Commands, credentials, external services, and failure boundaries: no subprocesses or shell commands; no reading of credential files or model API keys; the only environment variable read isDSH_HOME(to locate settings files); all routes are read-only and do not block DSH startup or other plugins.
Compatibility¶
| Item | Range | Notes |
|---|---|---|
| DSH | >=0.2.0 <0.3.0 (package.json engines.dsh) |
Validation baseline: DSH 0.2.2-rc.3 (desktop) |
| Node.js | >=24.9.0 (package.json engines.node) |
Matches DSH runtime requirement |
| Third-party runtime deps | None | Uses only DSH-injected webServer and event bus |
engines.dsh is enforced by the DSH installer and profile startup check: if the running DSH doesn’t satisfy the range, installation or startup is rejected.
Installation & Activation¶
Method 1: npm (Recommended)¶
dsh plugin --profile web add dsh-shanhai-pet
Pinned version install (safer, recommended for production):
dsh plugin --profile web add dsh-shanhai-pet@1.3.3
You can also install directly from GitHub (branches/commits not published to npm):
dsh plugin --profile web add github:cn-zhangpeng/dsh-shanhai-pet
Update / uninstall:
dsh plugin --profile web update dsh-shanhai-pet
dsh plugin --profile web remove dsh-shanhai-pet
After installation, open DSH—Ranran will appear in the bottom-right corner. Adjust display and interaction settings under Settings → Shanhai Pet.
Method 2: Manual deployment / local debugging (desktop profile)¶
The desktop profile lives at ~/.dsh/profiles/desktop/ (DSH_HOME=~/.dsh):
- Register this plugin as a local link dependency in the profile directory (using DSH’s bundled pnpm runtime):
cd ~/.dsh/profiles/desktop
pnpm add link:<absolute path to this repo>
- Confirm the profile’s
package.jsondsh.profile.bundlesarray contains"dsh-shanhai-pet"; - Restart DSH to activate.
link:dependencies point to the source directory, so after code changes, simply restart the desktop app (Host routes are registered at startup).
You can also run
plugin_manager install_bundleinside DSH, with the target pointing to the absolute path of this directory.
Typical Usage¶
- After opening DSH, Ranran appears in the bottom-right corner. Based on the current session state (reasoning, editing files, running commands, etc.), she automatically switches poses and displays the corresponding status text in her speech bubble.
- If the session has a todo list, she announces “Step N:
” at the start of each step (with a secondary line showing “X of Y completed”); she also has a line for finishing, hitting a blocker, or waiting for approval. For tasks without a todo list, she only changes pose without extra chatter. - After roughly 30 minutes of inactivity, she greets you again. Click her or hover the mouse to view the info card, trigger a random line, or perform an action (Return to position / Do a thing / Bubble / Nap / Hide).
- Adjust appearance, size, position, blinking, floating, idle micro-actions, speech bubble, announcements, greetings, and click options on the settings page. Settings are written back to
$DSH_HOME/shanhai-pet/settings.jsonand synced across multiple windows.
Use Cases & Notes¶
- Ideal for developers or users who want to add a status visualization to their DSH sessions, especially in scenarios where seeing the task rhythm clearly matters (reasoning, editing code, running commands, organizing lists, etc.).
- The plugin runs with the current DSH process permissions. Review the source code and license (MIT) before installing.
- The plugin does not read or cache any message body content. It only utilizes structured events and whitelisted tool parameter fields, keeping the privacy boundary clear.
Closing¶
Shanhai Pet drives poses and dialogue through structured events, making task rhythm visible at a glance. After installation, you can fine-tune appearance and interaction on the settings page, and enjoy custom skins and nap/summon features. For more information, visit the directory page or the GitHub repository.