How githao3/dsh-pet-desktop works
dsh-pet-desktop is an independent Windows desktop-pet application built from the dsh-pet plugin. Its main user flow is launching the standalone Electron app, loading pet configuration and animation assets, then rendering interactive pets; configuration and animation behavior are shared with the browser/plugin client. The README also documents optional conversation, notification, status, and balance features, plus a reproducible video-to-animation content pipeline. Some runtime wiring and several documented subsystems were not sampled, so uncertain links are omitted.
Main entry points: index.ts Host routes · main.js Electron main · pet.ts Pet interaction · app.ts Client assembly
Components 29
Desktop runtime
- Electron main
dsh-pet/runtime/electron-helper/main.js - Mini host
dsh-pet/runtime/electron-helper/mini-host.js - Window renderer
dsh-pet/runtime/electron-helper/renderer.js
Pet experience
- Pet sprite view
dsh-pet/runtime/electron-helper/sprite.js - Client assembly
dsh-pet/src/client/app.ts - Pet interaction
dsh-pet/src/client/pet.ts - Pet settings
dsh-pet/src/client/settings.ts - Pet animation assets
Host services
- Standalone host
dsh-pet/src/host/standalone-entry.ts - Host routes
dsh-pet/src/host/index.ts - Config loading
dsh-pet/src/host/config.ts - User storage
dsh-pet/src/host/storage-paths.ts - Electron management
dsh-pet/src/host/helper-process.ts - Chat and memes
dsh-pet/src/host/chat.ts - Model reasoning
dsh-pet/src/host/llm-reasoning.ts - Whisper service
dsh-pet/src/host/whisper.ts - Work status
dsh-pet/src/host/work-status.ts - Balance service
dsh-pet/src/host/balance.ts - Notification events
dsh-pet/src/host/notify-events.ts
Shared behavior
- Motion physics
dsh-pet/src/shared/physics.ts - Action menus
dsh-pet/src/shared/menu.ts - Balance display
dsh-pet/src/shared/balance.ts - Pet configuration model
dsh-pet/src/shared/types.ts
Animation pipeline
- Source video
- Watermark masking
scripts/watermark_step01.py - Green-screen keying
scripts/chroma_step02.py - Frame normalization
scripts/normalize_step03.py - WebM encoding
dsh-pet/src/client/pet.ts
Other components
- Desktop user
Connections 29
- Desktop user → Electron main: launches
- Electron main → Window renderer: opens windows
dsh-pet/runtime/electron-helper/main.js - Electron main → Mini host: bridges host
dsh-pet/runtime/electron-helper/main.js - Window renderer → Pet sprite view: renders pet
- Electron main → Standalone host: starts standalone
- Standalone host → Host routes: starts routes
- Host routes → Config loading: loads config
dsh-pet/src/host/index.ts - Host routes → User storage: uses paths
dsh-pet/src/host/storage-paths.ts - Host routes → Electron management: manages Electron
dsh-pet/src/host/index.ts - Host routes → Chat and memes: routes chat
dsh-pet/src/host/index.ts - Chat and memes → Model reasoning: checks model
dsh-pet/src/host/chat.ts - Host routes → Whisper service: routes whispers
dsh-pet/src/host/index.ts - Host routes → Work status: routes status
dsh-pet/src/host/index.ts - Host routes → Balance service: routes balance
dsh-pet/src/host/index.ts - Host routes → Notification events: routes events
dsh-pet/src/host/index.ts - Client assembly → Pet interaction: assembles UI
dsh-pet/src/client/app.ts - Client assembly → Pet settings: registers settings
dsh-pet/src/client/app.ts - Pet interaction → Motion physics: uses motion
dsh-pet/src/client/pet.ts - Pet interaction → Action menus: uses menus
dsh-pet/src/client/pet.ts - Pet interaction → Balance display: fetches balance
dsh-pet/src/client/pet.ts - Pet settings → Host routes: saves config
dsh-pet/src/client/settings.ts - Host routes → Client assembly: serves client
- Config loading → Pet configuration model: uses model
- Source video → Watermark masking: masks source
- Watermark masking → Green-screen keying: keys frames
- Green-screen keying → Frame normalization: normalizes frames
- Frame normalization → WebM encoding: encodes variants
- WebM encoding → Pet animation assets: produces animation
- Pet animation assets → Pet sprite view: plays assets