dsh-pet-plugin
DSH 窗口里的超写实桌宠:五个形象各有五张表情立绘,跳舞、撩发、走路三套动作以 24fps VP9 alpha 视频片段播放,另有一条「走到中间跳完再走回」的 10 秒单镜头片段、全程不切镜;按活跃时段主动说话(可选 edge-tts 神经音色),带泼墨、撒花、乌云、起雾、炸弹特效、右键菜单与 /dsh-pet 斜杠命令,旁边的小输入框通过一次性宿主模型调用回话、不写进你的会话。界面文案内置中、英、西、葡、印五语。
安装
dsh plugin --profile web add dsh-pet-plugin
沙箱测试结果
| 阶段 | 结果 |
|---|---|
| 1 安装 | ✓ |
| 2 列装 | ✓ |
| 3 挂载 | ✓ |
| 4 启动 | — |
四阶段在隔离沙箱里跑:安装(有网)→ 列装 → 挂载 → 启动(后三步断网)。
README
dsh-pet
A little companion that lives in the bottom-right corner of the DSH web UI: it stays
around or drops in at random, talks (with voice), walks, dances, gets shy or annoyed, and
carries a tiny input box you can chat with. Five photo-realistic personas, each with its
own temper.
Scope: the pet only lives inside the DSH window (it mounts into the framework's overlay
slot). It cannot float above other applications — that would need a separate Electron
shell rather than a plugin.
At a glance
- Languages: UI chrome, persona taglines and the chat system prompt follow the browser
interface language — shipped for en / zh / es / pt / hi (locale/*.json, namespace
pet; slots register with locale: 'pet' per the DSH slot contract). Each persona also
ships an English line pack, so a non-Chinese UI hears English lines.
- Mount points:
shell.overlay(the pet itself, a click-through layer) and
conversation.input.right (the entry button next to the composer).
- Private chat: what you type in the small box never enters your session. The host
half exposes POST /dsh-pet/chat and answers with a one-shot ctx.llm.stream() call
(no session, no session log). Defaults: deepseek-account / deepseek-flash; provider,
model, maxTokens and temperature are plugin config.
- Icon:
icon.svg(the rose silhouette) and the composer button share the same path. - Settings panel: grouped (look / voice / display / actions / effects), custom dropdowns
(native <select> popups are system-white and unreadable in dark themes) and custom
switches; it is placed relative to the pet (above her, or to her left when there is no
room) and clamped into the viewport under the header.
- Five personas (photo-realistic, same lighting; all five ship 5 expressions
each: default / happy / shy / angry / sleepy): 薇 (violet), 绯 (crimson), 靛 (indigo),
雪 (silver), plus 鲸鱼娘 (azure) — a whale-fin maid whose expression set was added in
1.23.0, with its own walk / dance / hair clips. Expression changes cross-fade (180 ms)
instead of hard-cutting.
- Action sequences: a persona may declare `actions: { dance: [...], hair: [...],
walk: [...] }`; each set is 3–6 frames (3-frame sets step at 340 ms, 6-frame at 230 ms;
azure ships clips only, no frame sets). All four originals have
dance / hair-flip / walk, each stylised to the character; newer personas may instead ship
video clips (VP9 + alpha), and a clip's own length decides how long the action lives.
- Adding artwork: drop transparent PNGs into
assets/and reference them from
PERSONAS (image, or images: { mood: 'file.png' }). Served by /dsh-pet/assets/
(image and webm video extensions only, basename only). tools/make-pet-image.py removes a green-screen
background (preferred) and falls back to a gradient key.
Behavior
Capability · How
Always-on / random · Toggle in the panel; random mode rolls a per-hour probability inside the active window
Active hours · Start/end time, supports crossing midnight (22:00 → 03:00)
Proactive lines · Per-mood line packs, bubble + speech
Voice · Optional: if the host has any python with edge-tts, /dsh-pet/tts synthesises (cached) and /dsh-pet/tts/status probes it; otherwise it falls back to the system speechSynthesis. The plugin itself has zero runtime dependencies
Small input box · Hidden by default; slides out when you hover the character (since 1.22.0, and moving from the character onto the box does not dismiss it). Turn off "Only on hover" in settings to pin it. Messages go to the pet only; one-shot model call, nothing is written to any DSH session
Moods · idle / walk / dance / shy / angry / sleep / talk / happy
Dragging · 60% chance of a drag line once you drop it; all five personas have them (completed in 1.24.0), five languages
Inner voice · A low-frequency (7%) grey aside — a thought, never spoken; only for personas that declare lines.aside; all five have them (1.24.0)
Gaze · Pupils follow the mouse (CSS variables only, no re-render)
Effects · Ink / confetti / cloud / fog (wipable) / bomb + cracked screen
Event hooks · Confetti after a turn longer than 4 s; a cloud appears after a failed tool call
Temper · Per-persona weight table decides what it does more of
Hide · "Hide for 1 h" in the panel
Install (local, no registry)
Published as dsh-pet-plugin on npm; it also installs straight from a folder.
# from the registry (after publish) dsh plugin --profile desktop add dsh-pet-plugin
# from a local checkout: quit DSH first, then powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 # or double-click install.cmd
Quit DSH first (the profile's package.json is HMR-watched). The script adds
"dsh-pet-plugin": "file:<this dir>" to the profile, registers the bundle, runs
pnpm install, then reads back all four facts. update.cmd only refreshes files and is
safe while DSH is running. For the sweeter neural voice:
pip install edge-tts # any python the host can find export DSH_PET_PYTHON=/path/to/python # only if auto-discovery misses it
Verify
node --check client.js node tests/smoke.mjs # fake window + React stub, renders every persona/mood # host routes need the harness packages, so run them from the installed copy: cd <profile>/node_modules/dsh-pet-plugin && node --test tests/host.test.mjs node <dsh-plugin-guide>/bin/dsh-plugin-dev.js check --cwd . --strict node <dsh-plugin-guide>/bin/dsh-plugin-dev.js verify --cwd .
Customize
- The client bundle is generated: edit
src/*.jsand runnode build.mjs, which
concatenates the parts into client.js (the only file DSH loads). Never edit
client.js by hand — npm test rebuilds and then runs the smoke test.
- Personas, lines and tempers:
pets/<id>/pack.json
…(truncated)
以上内容来自 npm 上的 README,我们只做格式化,不改内容。
版本
npm 上共发布:42,最后更新 2026-10-31