# pc2005-cloud/dsh-pet architecture

> Architecture diagram of the GitHub repository pc2005-cloud/dsh-pet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pc2005-cloud/dsh-pet
- Repository: https://github.com/pc2005-cloud/dsh-pet

## Overview

dsh-pet is a DeepSeek Harness desktop-pet plugin with browser overlay and optional Electron windows. The user configures pet instances, then the client renders animations and interactions; host services provide configuration, balance, chat, whisper, work-status, and notification data. The README documents major capabilities beyond the sampled excerpts, including animation packs, multi-display movement, and session-linked states. Dashed edges mark desktop renderer wiring not directly shown in the excerpts; other links cite source or README evidence.

Main entry points: [`dsh-pet/src/host/index.ts`](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/index.ts) (Host routes), [`dsh-pet/src/client/pet.ts`](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/pet.ts) (Pet overlay), [`dsh-pet/src/client/app.ts`](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/app.ts) (Plugin assembly), [`dsh-pet/src/host/chat.ts`](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/chat.ts) (Chat service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_client_app["Plugin assembly<br/>[app.ts]"]
  node_pet_ui["Pet overlay<br/>[pet.ts]"]
  node_settings["Pet settings<br/>[settings.ts]"]
  node_bubble["Bubble display<br/>[bubble.ts]"]
  node_notifications["System notifications<br/>[notify.ts]"]
end

subgraph group_shared["Shared behavior"]
  node_shared_config["Config model<br/>[config.ts]"]
  node_shared_physics["Pet physics<br/>[physics.ts]"]
  node_shared_menu["Action menu<br/>[menu.ts]"]
  node_shared_balance["Balance logic<br/>[balance.ts]"]
  node_shared_chat["Chat logic<br/>[chat.ts]"]
  node_shared_whisper["Whisper logic<br/>[whisper.ts]"]
  node_score_popup["Score effects<br/>[score-popup.ts]"]
end

subgraph group_host["Host services"]
  node_host_routes["Host routes<br/>[index.ts]"]
  node_host_config["Config merge<br/>[config.ts]"]
  node_host_balance["Balance providers<br/>[balance.ts]"]
  node_host_chat["Chat service<br/>[chat.ts]"]
  node_host_reasoning["Model reasoning<br/>[llm-reasoning.ts]"]
  node_host_memes["Meme assets<br/>[memes.ts]"]
  node_host_whisper["Whisper service<br/>[whisper.ts]"]
  node_host_work["Work status<br/>[work-status.ts]"]
  node_host_notify["Event notifications<br/>[notify-events.ts]"]
  node_host_helper["Electron manager<br/>[helper-process.ts]"]
end

subgraph group_desktop["Desktop runtime"]
  node_desktop_main["Electron main<br/>[main.js]"]
  node_desktop_renderer["Pet renderer<br/>[renderer.js]"]
  node_desktop_sprite["Sprite runtime<br/>[sprite.js]"]
  node_desktop_events["Window events<br/>[events.js]"]
end

node_user(("User"))
node_dsh["DSH host"]

node_user -->|"uses plugin"| node_client_app
node_dsh -->|"loads plugin"| node_client_app
node_client_app -->|"assembles"| node_pet_ui
node_client_app -->|"registers"| node_settings
node_client_app -->|"starts"| node_notifications
node_user -->|"configures pets"| node_settings
node_settings -->|"saves config"| node_host_routes
node_pet_ui -->|"fetches pet data"| node_host_routes
node_pet_ui -->|"shows bubbles"| node_bubble
node_pet_ui -->|"reads config"| node_shared_config
node_pet_ui -->|"uses physics"| node_shared_physics
node_pet_ui -->|"mounts menu"| node_shared_menu
node_pet_ui -->|"gets balance view"| node_shared_balance
node_pet_ui -->|"gets whisper state"| node_shared_whisper
node_pet_ui -->|"supports chat"| node_shared_chat
node_pet_ui -->|"uses effects"| node_score_popup
node_notifications -->|"polls notices"| node_host_routes
node_host_routes -->|"reads config"| node_host_config
node_host_routes -->|"serves balance"| node_host_balance
node_host_routes -->|"serves chat"| node_host_chat
node_host_routes -->|"serves whispers"| node_host_whisper
node_host_routes -->|"tracks sessions"| node_host_work
node_host_routes -->|"routes events"| node_host_notify
node_host_routes -->|"manages desktop"| node_host_helper
node_host_chat -->|"checks model"| node_host_reasoning
node_host_chat -->|"uses images"| node_host_memes
node_host_whisper -->|"checks model"| node_host_reasoning
node_host_helper -->|"launches helper"| node_desktop_main
node_desktop_main -->|"loads window"| node_desktop_renderer
node_desktop_renderer -.->|"renders pet"| node_desktop_sprite
node_desktop_renderer -.->|"handles input"| node_desktop_events
node_desktop_main -->|"bridges requests"| node_host_routes

click node_client_app "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/app.ts"
click node_pet_ui "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/pet.ts"
click node_settings "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/settings.ts"
click node_bubble "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/bubble.ts"
click node_notifications "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/notify.ts"
click node_shared_config "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/config.ts"
click node_shared_physics "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/physics.ts"
click node_shared_menu "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/menu.ts"
click node_shared_balance "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/balance.ts"
click node_shared_chat "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/chat.ts"
click node_shared_whisper "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/whisper.ts"
click node_score_popup "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/score-popup.ts"
click node_host_routes "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/index.ts"
click node_host_config "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/config.ts"
click node_host_balance "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/balance.ts"
click node_host_chat "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/chat.ts"
click node_host_reasoning "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/llm-reasoning.ts"
click node_host_memes "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/memes.ts"
click node_host_whisper "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/whisper.ts"
click node_host_work "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/work-status.ts"
click node_host_notify "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/notify-events.ts"
click node_host_helper "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/helper-process.ts"
click node_desktop_main "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/main.js"
click node_desktop_renderer "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/renderer.js"
click node_desktop_sprite "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/sprite.js"
click node_desktop_events "https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/events.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_app,node_pet_ui,node_settings,node_bubble,node_notifications,node_user toneBlue
class node_shared_config,node_shared_physics,node_shared_menu,node_shared_balance,node_shared_chat,node_shared_whisper,node_score_popup toneAmber
class node_host_routes,node_host_config,node_host_balance,node_host_chat,node_host_reasoning,node_host_memes,node_host_whisper,node_host_work,node_host_notify,node_host_helper toneMint
class node_desktop_main,node_desktop_renderer,node_desktop_sprite,node_desktop_events toneRose
class node_dsh toneIndigo
```

## Components

### Client experience

- [Plugin assembly](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/app.ts): `dsh-pet/src/client/app.ts`
- [Pet overlay](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/pet.ts): `dsh-pet/src/client/pet.ts`
- [Pet settings](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/settings.ts): `dsh-pet/src/client/settings.ts`
- [Bubble display](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/bubble.ts): `dsh-pet/src/client/bubble.ts`
- [System notifications](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/client/notify.ts): `dsh-pet/src/client/notify.ts`

### Shared behavior

- [Config model](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/config.ts): `dsh-pet/src/shared/config.ts`
- [Pet physics](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/physics.ts): `dsh-pet/src/shared/physics.ts`
- [Action menu](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/menu.ts): `dsh-pet/src/shared/menu.ts`
- [Balance logic](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/balance.ts): `dsh-pet/src/shared/balance.ts`
- [Chat logic](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/chat.ts): `dsh-pet/src/shared/chat.ts`
- [Whisper logic](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/whisper.ts): `dsh-pet/src/shared/whisper.ts`
- [Score effects](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/shared/score-popup.ts): `dsh-pet/src/shared/score-popup.ts`

### Host services

- [Host routes](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/index.ts): `dsh-pet/src/host/index.ts`
- [Config merge](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/config.ts): `dsh-pet/src/host/config.ts`
- [Balance providers](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/balance.ts): `dsh-pet/src/host/balance.ts`
- [Chat service](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/chat.ts): `dsh-pet/src/host/chat.ts`
- [Model reasoning](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/llm-reasoning.ts): `dsh-pet/src/host/llm-reasoning.ts`
- [Meme assets](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/memes.ts): `dsh-pet/src/host/memes.ts`
- [Whisper service](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/whisper.ts): `dsh-pet/src/host/whisper.ts`
- [Work status](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/work-status.ts): `dsh-pet/src/host/work-status.ts`
- [Event notifications](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/notify-events.ts): `dsh-pet/src/host/notify-events.ts`
- [Electron manager](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/src/host/helper-process.ts): `dsh-pet/src/host/helper-process.ts`

### Desktop runtime

- [Electron main](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/main.js): `dsh-pet/runtime/electron-helper/main.js`
- [Pet renderer](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/renderer.js): `dsh-pet/runtime/electron-helper/renderer.js`
- [Sprite runtime](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/sprite.js): `dsh-pet/runtime/electron-helper/sprite.js`
- [Window events](https://github.com/pc2005-cloud/dsh-pet/blob/main/dsh-pet/runtime/electron-helper/events.js): `dsh-pet/runtime/electron-helper/events.js`

### Other components

- **User**
- **DSH host**

## Connections

- User → Plugin assembly: uses plugin
- DSH host → Plugin assembly: loads plugin (evidence: `dsh-pet/src/client/app.ts`)
- Plugin assembly → Pet overlay: assembles (evidence: `dsh-pet/src/client/app.ts`)
- Plugin assembly → Pet settings: registers (evidence: `dsh-pet/src/client/app.ts`)
- Plugin assembly → System notifications: starts (evidence: `dsh-pet/src/client/app.ts`)
- User → Pet settings: configures pets
- Pet settings → Host routes: saves config (evidence: `dsh-pet/src/client/settings.ts`)
- Pet overlay → Host routes: fetches pet data (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Bubble display: shows bubbles (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Config model: reads config (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Pet physics: uses physics (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Action menu: mounts menu (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Balance logic: gets balance view (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Whisper logic: gets whisper state (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Chat logic: supports chat (evidence: `dsh-pet/src/client/pet.ts`)
- Pet overlay → Score effects: uses effects (evidence: `dsh-pet/src/client/pet.ts`)
- System notifications → Host routes: polls notices
- Host routes → Config merge: reads config (evidence: `dsh-pet/src/host/index.ts`)
- Host routes → Balance providers: serves balance (evidence: `dsh-pet/src/host/index.ts`)
- Host routes → Chat service: serves chat (evidence: `dsh-pet/src/host/index.ts`)
- Host routes → Whisper service: serves whispers (evidence: `dsh-pet/src/host/index.ts`)
- Host routes → Work status: tracks sessions (evidence: `dsh-pet/src/host/index.ts`)
- Host routes → Event notifications: routes events (evidence: `dsh-pet/src/host/index.ts`)
- Host routes → Electron manager: manages desktop (evidence: `dsh-pet/src/host/index.ts`)
- Chat service → Model reasoning: checks model (evidence: `dsh-pet/src/host/chat.ts`)
- Chat service → Meme assets: uses images (evidence: `dsh-pet/src/host/chat.ts`)
- Whisper service → Model reasoning: checks model (evidence: `dsh-pet/src/host/whisper.ts`)
- Electron manager → Electron main: launches helper
- Electron main → Pet renderer: loads window (evidence: `dsh-pet/runtime/electron-helper/main.js`)
- Pet renderer → Sprite runtime: renders pet
- Pet renderer → Window events: handles input
- Electron main → Host routes: bridges requests (evidence: `dsh-pet/runtime/electron-helper/main.js`)
