# xinglingsuiyue/waves-plugin architecture

> Architecture diagram of the GitHub repository xinglingsuiyue/waves-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xinglingsuiyue/waves-plugin
- Repository: https://github.com/xinglingsuiyue/waves-plugin

## Overview

WAVES-PLUGIN is a Yunzai bot plugin for Wuthering Waves account access, game-data queries, and related tools. Users issue bot commands; the plugin exposes command handlers, which provide results such as account cards, daily status, exploration and challenge data, gacha history, guides, and damage calculations. The damage-calculation layer parses player panels, loads character/equipment/enemy definitions, and computes results. The README documents additional capabilities not tied to sampled source; those are represented by their apparent app modules where the tree supports a path. Handler-to-service wiring is omitted where source excerpts do not establish it.

Main entry points: [`index.js`](https://github.com/xinglingsuiyue/waves-plugin/blob/main/index.js) (App loader), [`apps/Bind.js`](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Bind.js) (Login), [`apps/CharacterScore.js`](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/CharacterScore.js) (Echo scoring), [`apps/User.js`](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/User.js) (Player profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin entry"]
  node_loader["App loader<br/>[index.js]"]
end

subgraph group_account["Accounts and data"]
  node_login["Login<br/>[Bind.js]"]
  node_profile["Player profile<br/>[User.js]"]
  node_daily["Daily status<br/>[Sanity.js]"]
  node_checkin["Check-in<br/>[SignIn.js]"]
  node_explore["Exploration<br/>[Explore.js]"]
  node_challenge["Challenges<br/>[Challenge.js]"]
  node_gacha["Gacha history<br/>[Gacha.js]"]
end

subgraph group_reference["Game reference"]
  node_guide["Item guide<br/>[Guide.js]"]
  node_calendar["Event calendar<br/>[Calendar.js]"]
  node_news["Game news<br/>[News.js]"]
  node_strategy["Character guides<br/>[Strategy.js]"]
  node_community["Community guides<br/>[CommunityGuide.js]"]
end

subgraph group_tools["Analysis tools"]
  node_score["Echo scoring<br/>[CharacterScore.js]"]
  node_damage["Damage calculation<br/>[engine.js]"]
  node_parser["Panel parsing<br/>[parser.js]"]
  node_definitions["Combat definitions<br/>[达妮娅.js]"]
  node_simulation["Gacha simulator<br/>[Simulator.js]"]
end

subgraph group_runtime["Shared runtime"]
  node_render["Card rendering<br/>[Render.js]"]
  node_config["Configuration<br/>[Config.js]"]
  node_server["Login web service<br/>[Server.js]"]
end

node_player(("Bot user"))
node_game_api{{"Game services"}}
node_guide_api{{"Guide service"}}
node_ocr{{"OCR provider"}}

node_loader -->|"loads handlers"| node_login
node_loader -->|"loads handlers"| node_profile
node_loader -->|"loads handlers"| node_daily
node_loader -->|"loads handlers"| node_checkin
node_loader -->|"loads handlers"| node_explore
node_loader -->|"loads handlers"| node_challenge
node_loader -->|"loads handlers"| node_gacha
node_loader -->|"loads handlers"| node_guide
node_loader -->|"loads handlers"| node_calendar
node_loader -->|"loads handlers"| node_news
node_loader -->|"loads handlers"| node_strategy
node_loader -->|"loads handlers"| node_score
node_loader -->|"loads handlers"| node_simulation
node_player -->|"requests login"| node_login
node_player -->|"requests profile"| node_profile
node_player -->|"requests status"| node_daily
node_player -->|"requests check-in"| node_checkin
node_player -->|"requests exploration"| node_explore
node_player -->|"requests challenges"| node_challenge
node_player -->|"requests history"| node_gacha
node_player -->|"requests guide"| node_guide
node_player -->|"requests calendar"| node_calendar
node_player -->|"requests news"| node_news
node_player -->|"requests strategy"| node_strategy
node_player -->|"requests score"| node_score
node_player -->|"requests simulation"| node_simulation
node_strategy -->|"gets guides"| node_community
node_community -->|"fetches guide data"| node_guide_api
node_score -.->|"reads image"| node_ocr
node_score -->|"renders result"| node_render
node_damage -->|"parses panel"| node_parser
node_damage -->|"loads definitions"| node_definitions
node_login -->|"supports web login"| node_server
node_server -->|"reads settings"| node_config
node_login -.->|"authenticates account"| node_game_api
node_profile -.->|"queries game data"| node_game_api
node_daily -.->|"queries game data"| node_game_api
node_checkin -.->|"submits check-in"| node_game_api
node_explore -.->|"queries game data"| node_game_api
node_challenge -.->|"queries game data"| node_game_api
node_gacha -.->|"queries history"| node_game_api

click node_loader "https://github.com/xinglingsuiyue/waves-plugin/blob/main/index.js"
click node_login "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Bind.js"
click node_profile "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/User.js"
click node_daily "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Sanity.js"
click node_checkin "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/SignIn.js"
click node_explore "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Explore.js"
click node_challenge "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Challenge.js"
click node_gacha "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Gacha.js"
click node_guide "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Guide.js"
click node_calendar "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Calendar.js"
click node_news "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/News.js"
click node_strategy "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Strategy.js"
click node_community "https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/CommunityGuide.js"
click node_score "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/CharacterScore.js"
click node_damage "https://github.com/xinglingsuiyue/waves-plugin/blob/main/utils/damage/engine.js"
click node_parser "https://github.com/xinglingsuiyue/waves-plugin/blob/main/utils/damage/parser.js"
click node_definitions "https://github.com/xinglingsuiyue/waves-plugin/blob/main/resources/Shanghai/characters/%E8%BE%BE%E5%A6%AE%E5%A8%85.js"
click node_simulation "https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Simulator.js"
click node_render "https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/Render.js"
click node_config "https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/Config.js"
click node_server "https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/Server.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_loader,node_player toneBlue
class node_login,node_profile,node_daily,node_checkin,node_explore,node_challenge,node_gacha toneAmber
class node_guide,node_calendar,node_news,node_strategy,node_community toneMint
class node_score,node_damage,node_parser,node_definitions,node_simulation toneRose
class node_render,node_config,node_server,node_game_api,node_guide_api,node_ocr toneIndigo
```

## Components

### Plugin entry

- [App loader](https://github.com/xinglingsuiyue/waves-plugin/blob/main/index.js): `index.js`

### Accounts and data

- [Login](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Bind.js): `apps/Bind.js`
- [Player profile](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/User.js): `apps/User.js`
- [Daily status](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Sanity.js): `apps/Sanity.js`
- [Check-in](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/SignIn.js): `apps/SignIn.js`
- [Exploration](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Explore.js): `apps/Explore.js`
- [Challenges](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Challenge.js): `apps/Challenge.js`
- [Gacha history](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Gacha.js): `apps/Gacha.js`

### Game reference

- [Item guide](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Guide.js): `apps/Guide.js`
- [Event calendar](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Calendar.js): `apps/Calendar.js`
- [Game news](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/News.js): `apps/News.js`
- [Character guides](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Strategy.js): `apps/Strategy.js`
- [Community guides](https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/CommunityGuide.js): `components/CommunityGuide.js`

### Analysis tools

- [Echo scoring](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/CharacterScore.js): `apps/CharacterScore.js`
- [Damage calculation](https://github.com/xinglingsuiyue/waves-plugin/blob/main/utils/damage/engine.js): `utils/damage/engine.js`
- [Panel parsing](https://github.com/xinglingsuiyue/waves-plugin/blob/main/utils/damage/parser.js): `utils/damage/parser.js`
- [Combat definitions](https://github.com/xinglingsuiyue/waves-plugin/blob/main/resources/Shanghai/characters/%E8%BE%BE%E5%A6%AE%E5%A8%85.js): `resources/Shanghai/characters/达妮娅.js`
- [Gacha simulator](https://github.com/xinglingsuiyue/waves-plugin/blob/main/apps/Simulator.js): `apps/Simulator.js`

### Shared runtime

- [Card rendering](https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/Render.js): `components/Render.js`
- [Configuration](https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/Config.js): `components/Config.js`
- [Login web service](https://github.com/xinglingsuiyue/waves-plugin/blob/main/components/Server.js): `components/Server.js`

### Other components

- **Bot user**
- **Game services**
- **Guide service**
- **OCR provider**

## Connections

- App loader → Login: loads handlers
- App loader → Player profile: loads handlers
- App loader → Daily status: loads handlers
- App loader → Check-in: loads handlers
- App loader → Exploration: loads handlers
- App loader → Challenges: loads handlers
- App loader → Gacha history: loads handlers
- App loader → Item guide: loads handlers
- App loader → Event calendar: loads handlers
- App loader → Game news: loads handlers
- App loader → Character guides: loads handlers
- App loader → Echo scoring: loads handlers
- App loader → Gacha simulator: loads handlers
- Bot user → Login: requests login
- Bot user → Player profile: requests profile
- Bot user → Daily status: requests status
- Bot user → Check-in: requests check-in
- Bot user → Exploration: requests exploration
- Bot user → Challenges: requests challenges
- Bot user → Gacha history: requests history
- Bot user → Item guide: requests guide
- Bot user → Event calendar: requests calendar
- Bot user → Game news: requests news
- Bot user → Character guides: requests strategy
- Bot user → Echo scoring: requests score
- Bot user → Gacha simulator: requests simulation
- Character guides → Community guides: gets guides
- Community guides → Guide service: fetches guide data
- Echo scoring → OCR provider: reads image
- Echo scoring → Card rendering: renders result
- Damage calculation → Panel parsing: parses panel
- Damage calculation → Combat definitions: loads definitions
- Login → Login web service: supports web login
- Login web service → Configuration: reads settings
- Login → Game services: authenticates account
- Player profile → Game services: queries game data
- Daily status → Game services: queries game data
- Check-in → Game services: submits check-in
- Exploration → Game services: queries game data
- Challenges → Game services: queries game data
- Gacha history → Game services: queries history
