How yyhssr/desktop-pet works
Desktop-Pet is a Windows desktop companion built with PySide6, transparent WebM animation, and interactive physics. The primary workflow starts with the user launching or interacting with the pet: the app creates the pet window, which renders a selected character and handles gestures, menus, and settings; dragging can feed motion into collision simulation and produce a bounce. The repository also contains optional chat, music-lyrics, reminders, and DSH agent-link features. The graph follows README-described capabilities and the sampled call sites; some subsystem wiring is therefore left out where source was not sampled.
Main entry points: app.py App Shell · window.py Pet Window · widgets.py Chat UI · music_lyric_controller.py Music Lyrics
Components 29
App Runtime
- App Shell
pet/app.py - Configuration
pet/config.py - Character Catalog
pet/catalog.py
Pet Interaction
- Pet Window
pet/window.py - WebM Animation
pet/webm_clip.py - Frame Cache
pet/frame_cache.py - Context Menus
pet/context_menus/modern.py - Settings Panel
pet/modern_settings_dialog.py
Motion Physics
- Movement
pet/movement.py - Collision Client
pet/collision_client.py - Collision IPC
pet/collision_ipc.py - Native Loader
pet/native/loader.py - C++ Collision Core
C++-Python/src/collision.cpp
Optional Features
- Chat UI
pet/chat/widgets.py - Chat Service
pet/chat/service.py - Chat Sessions
pet/chat/session_store.py - Music Lyrics
pet/music_lyric_controller.py - Voice Chimes
pet/voice_chime_service.py - Festival Reminders
pet/festival_service.py - DSH Agent Link
pet/agent_link.py - Agent Event Protocol
pet/agent_event_protocol.py
External Integrations
- Chat Provider
pet/chat/providers.py - Music Players
pet/music_players.py - Lyric Fetch
pet/music_lyric.py - DSH Bridge
integrations/dsh-pet-bridge/index.js - Shared Event Files
- Chat API
- Desktop Media
Other components
- User
Connections 29
- User → App Shell: launches
- App Shell → Configuration: loads settings
- App Shell → Character Catalog: selects character
- App Shell → Pet Window: creates window
- Pet Window → WebM Animation: plays clips
- WebM Animation → Frame Cache: uses cache
- User → Pet Window: gestures
- Pet Window → Context Menus: opens menu
- Context Menus → Settings Panel: opens settings
- Pet Window → Movement: updates motion
- Movement → Collision Client: submits motion
- Collision Client → Collision IPC: exchanges state
- Collision IPC → Native Loader: dispatches solve
- Native Loader → C++ Collision Core: calls ABI
- App Shell → Chat UI: hosts optional chat
- Chat UI → Chat Service: sends messages
- Chat Service → Chat Provider: streams response
- Chat Provider → Chat API: requests completion
- Chat UI → Chat Sessions: stores conversations
- App Shell → Music Lyrics: installs optional controller
- Music Lyrics → Music Players: samples playback
- Music Lyrics → Lyric Fetch: fetches lyrics
- Music Players → Desktop Media: reads playback
- App Shell → Voice Chimes: starts optional service
- App Shell → Festival Reminders: starts optional service
- App Shell → DSH Agent Link: starts when enabled
- DSH Agent Link → Agent Event Protocol: normalizes events
- DSH Bridge → Shared Event Files: appends events
- DSH Agent Link → Shared Event Files: tails events