deepseek-harness-pet-plugin
deepseek harness pet plugin(桌面宠物插件)
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 18, 2026
- Updated
- Aug 18, 2026
Introduction
🐾 deepseek-harness-pet-plugin
English · 中文
A tiny desktop pet that lives in your DeepSeek Harness web chat — it listens when you type, vibes while the AI thinks, celebrates when the reply lands, and naps when you step away.
Pure inline SVG + CSS. Zero runtime dependencies. No core-source changes.
✨ Why you'll like it
- It reacts to your chat, not just sits there — 5 states (idle / listening / thinking / happy / sleeping) driven by real DOM signals, with matching animations and expressions.
- Zero dependencies, zero build step — the pet is an inline SVG drawn with CSS variables; no third-party libraries, no external images, no
npm install. - Never touches harness internals — a Cordis overlay plugin: no core source is modified, everything lives in its own folder.
- Plays well with the host UI — menus/bubbles/toggle reuse the page's
--dsw-alias-*theme tokens (with built-in fallbacks), so it looks native in both dark and light mode. - 6 switchable characters — cat, DeepSeek whale, panda, dog, rabbit, and NiuLai the bull; each with day/night palettes.
- HMR-friendly — edit the source while
dsh webis running and the pet hot-reloads.
🎭 Characters
| 🐱 Cat (default) | 🐳 DeepSeek Whale | 🐼 Panda |
| Orange cat — tail, ears, whiskers, forehead marking | DeepSeek blue — tail fin, side fins, blowhole spout | Black & white — eye patches, round ears, bamboo leaf |
| 🐶 Dog | 🐰 Rabbit | 🐂 Bull (NiuLai) |
| Golden brown — floppy ears, head spot | Cream white — pink ears, little flower | Orange calf from the film Niú Lái — small horns, short legs |
Every character shares the same animation contract (.pet-tail / .pet-ear / .pet-eye* / .pet-mouth-*), so the state animations just work. Add a new character by adding one SVG template to CHARACTERS in pet_main.js plus a palette in the CSS.
🧠 Reacts to chat state
| State | Trigger | Behavior |
|---|---|---|
| Idle | default | breathing float, blinking, ear twitch, slow tail wag |
| Listening | composer focused / typing | slight head tilt, perked ear, wide eyes |
| Thinking | AI reply generating | busy shake, fast tail wag, dashed loading ring, "…" bubble |
| Happy | reply finished | two jumps + ❤️/⭐/✨ particles, then back to idle |
| Sleeping | 30 s without activity | eyes closed, droopy head, drifting "Zzz"; any click/key wakes it |
Tip:
http://127.0.0.1:3080/?pet_idleMs=5000shortens the idle threshold to 5 s for testing.
🎮 Interactions
- Drag it anywhere — the position is saved to
localStorage(pet_pos) and restored next time. - Double-click — a random easter-egg animation (roll / bounce / wiggle / flip / pulse / squash / jump / rainbow), a random face (star eyes / heart eyes / wow / tongue-out happy), and a random quip (14 built-in).
- Right-click — a minimal menu:
- Switch character — cycle through the six characters (choice is remembered via
pet_char). - Day/night theme — per-character palettes; follows the page theme automatically until you pick one.
- Reset position — back to the default bottom-right spot.
- Hide pet — same as the top-right toggle (one single on/off state); a 🐾 restore button appears at the pet's default spot, and the toggle also brings it back.
- Switch character — cycle through the six characters (choice is remembered via
- Top-right 🐾 toggle — enable/disable the pet (remembered via
pet_enabled).
📦 Install
Prerequisites: a local clone of deepseek-harness with pnpm install done and pnpm dsh web working.
This is a Cordis overlay plugin: it never modifies deepseek-harness core source, has zero runtime dependencies, and needs no npm install or build step.
Method 1 — install script (recommended): writes the plugin into dsh's profile user layer (~/.dsh/profiles/web/cordis.patch.yml, the auto-load layer):
cd /path/to/deepseek-harness-pet-plugin
./scripts/pet_install.sh
cd /path/to/deepseek-harness
pnpm dsh web
- If the server is already running, HMR hot-loads the patch — just refresh the browser page.
- The script is idempotent: re-running only refreshes the plugin source path.
- Optional:
--homeinstalls into$DSH_HOME/cordis.patch.yml(all profiles).
Method 2 — trial run: mount the overlay explicitly at startup:
pnpm dsh web --patch /path/to/deepseek-harness-pet-plugin/pet_cordis.yml
pet_cordis.ymlholds an absolute path to the plugin server; update it if your clone lives elsewhere, or just use the install script (it computes the path for you).
🗑️ Uninstall
cd /path/to/deepseek-harness-pet-plugin
./scripts/pet_uninstall.sh
The script removes the plugin block from the profile user layer; a running instance hot-unloads via HMR, and the pet disappears on refresh. If you used --patch before, simply drop the flag.
🧱 Project structure
deepseek-harness-pet-plugin/
├── README.md # this file
├── README.zh.md # 中文说明
├── pet_cordis.yml # Cordis overlay patch (for pnpm dsh web --patch)
├── scripts/
│ ├── pet_install.sh # install: insert into the dsh profile user layer (idempotent)
│ └── pet_uninstall.sh # uninstall: remove from the profile user layer
├── src/
│ └── pet_server.ts # server Cordis plugin: /pet/ static route + index.html injection
└── public/
├── pet_main.js # client logic: state machine, drag, eggs, menu, toggle
└── pet_style.css # visuals: inline SVG + CSS variables + all state animations
🔧 How it works
- Server (
pet_server.ts): zero runtime dependencies — only Node built-ins plus thewebServerservice. Serves exactlypet_main.js/pet_style.cssunder/pet/(everything else 404s) and injects the<link>/<script>intoindex.htmlwith an idempotency marker so HMR never double-injects. - Client (
pet_main.js): the whole pet lives in a Shadow DOM, fully isolated from the host app. State detection relies only on stable DOM signals ([data-composer-card], the send/stop button'saria-label) — no reach into harness internals. All timers and events are boundary-guarded; the console stays clean. - Visuals (
pet_style.css): inline SVG colored entirely with CSS variables, animated withtransform/opacityonly (respectsprefers-reduced-motion); day/night themes switch via:host(.pet-night)variables. - Scripts: idempotent; handle the empty-patch edge case (a leftover blank patch file is rewritten as a legal
[]so dsh still boots). - Persisted keys:
pet_pos/pet_enabled/pet_theme/pet_char(localStorage).
❓ FAQ
- Pet doesn't appear? Make sure
public/pet_main.jsandpublic/pet_style.cssexist. If the server was already running, wait a few seconds for HMR and refresh. Check that the# >>> deepseek-harness-pet-pluginblock in~/.dsh/profiles/web/cordis.patch.ymlis intact. - Broken after moving/cloning elsewhere?
pet_cordis.ymland the patch use absolute paths; re-runscripts/pet_install.shto refresh them. - Will re-installing duplicate the plugin? No — the script is idempotent and only refreshes the path when the marker block exists.
- dsh fails to parse the patch after uninstall? Shouldn't happen — the uninstaller rewrites an empty patch file to
[]. If you manually emptied it, set its content to[]. - Conflicts with other plugins? None — this plugin registers no tools, subscribes to no model events, writes no session logs, and never joins the agent loop.
/pet/only serves its own two file names.
📄 License
MIT © 2026 raydez