# kyanowo1107/astrbot_plugin_codex_radar_info architecture

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

- Interactive diagram: https://gitdiagram.com/kyanowo1107/astrbot_plugin_codex_radar_info
- Repository: https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info

## Overview

Codex Radar Info is a read-only AstrBot plugin for querying daily model metrics, community ratings, radar summaries, and site extras, then returning reports and images in QQ merged-forward messages. A command handler coordinates the fetches and image generation; the client parses remote data into domain models, while formatters prepare report sections. Browser automation captures the efficiency chart and exports the distributed report. The README documents these capabilities and remote sources; relationships for unsampled subsystems are limited to those documented there.

Main entry points: [`main.py`](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/main.py) (Command handler), [`codexradar_info/client.py`](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/client.py) (Radar client), [`codexradar_info/browser.py`](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/browser.py) (Image service), [`codexradar_info/models.py`](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/models.py) (Report models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_command["Command and delivery"]
  node_plugin["Command handler<br/>[main.py]"]
  node_qq["QQ OneBot adapter"]
end

subgraph group_data["Radar data"]
  node_client["Radar client<br/>[client.py]"]
  node_radar_site["Codex Radar"]
  node_distributed_site["Distributed Radar"]
  node_parsers["Payload parsers<br/>[parsers.py]"]
  node_models["Report models<br/>[models.py]"]
end

subgraph group_presentation["Report presentation"]
  node_formatters["Report formatters<br/>[formatters.py]"]
end

subgraph group_images["Image generation"]
  node_browser["Image service<br/>[browser.py]"]
  node_image_cache[("Cached images<br/>[browser.py]")]
end

node_requester(("Requester"))

node_requester -->|"invokes command"| node_plugin
node_plugin -->|"fetches reports"| node_client
node_plugin -->|"generates images"| node_browser
node_plugin -->|"formats sections"| node_formatters
node_plugin -->|"sends merged forward"| node_qq
node_qq -.->|"delivers report"| node_requester
node_client -->|"requests public data"| node_radar_site
node_client -->|"parses responses"| node_parsers
node_parsers -->|"creates report models"| node_models
node_client -->|"returns typed reports"| node_models
node_formatters -->|"formats report data"| node_models
node_browser -->|"captures chart"| node_radar_site
node_browser -->|"exports report PNG"| node_distributed_site
node_browser -->|"reads and writes"| node_image_cache
node_plugin -->|"attaches generated images"| node_image_cache

click node_plugin "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/main.py"
click node_client "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/client.py"
click node_parsers "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/parsers.py"
click node_models "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/models.py"
click node_formatters "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/formatters.py"
click node_browser "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/browser.py"
click node_image_cache "https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/browser.py"

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_plugin,node_qq toneBlue
class node_client,node_radar_site,node_distributed_site,node_parsers,node_models toneAmber
class node_formatters,node_requester toneMint
class node_browser,node_image_cache toneRose
```

## Components

### Command and delivery

- [Command handler](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/main.py): `main.py`
- **QQ OneBot adapter**

### Radar data

- [Radar client](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/client.py): `codexradar_info/client.py`
- **Codex Radar**
- **Distributed Radar**
- [Payload parsers](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/parsers.py): `codexradar_info/parsers.py`
- [Report models](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/models.py): `codexradar_info/models.py`

### Report presentation

- [Report formatters](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/formatters.py): `codexradar_info/formatters.py`

### Image generation

- [Image service](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/browser.py): `codexradar_info/browser.py`
- [Cached images](https://github.com/kyanowo1107/astrbot_plugin_codex_radar_info/blob/master/codexradar_info/browser.py): `codexradar_info/browser.py`

### Other components

- **Requester**

## Connections

- Requester → Command handler: invokes command (evidence: `main.py`)
- Command handler → Radar client: fetches reports (evidence: `main.py`)
- Command handler → Image service: generates images (evidence: `main.py`)
- Command handler → Report formatters: formats sections (evidence: `main.py`)
- Command handler → QQ OneBot adapter: sends merged forward (evidence: `main.py`)
- QQ OneBot adapter → Requester: delivers report (evidence: `README.md`)
- Radar client → Codex Radar: requests public data (evidence: `codexradar_info/client.py`)
- Radar client → Payload parsers: parses responses (evidence: `codexradar_info/client.py`)
- Payload parsers → Report models: creates report models (evidence: `codexradar_info/parsers.py`)
- Radar client → Report models: returns typed reports (evidence: `codexradar_info/client.py`)
- Report formatters → Report models: formats report data (evidence: `codexradar_info/formatters.py`)
- Image service → Codex Radar: captures chart (evidence: `codexradar_info/browser.py`)
- Image service → Distributed Radar: exports report PNG (evidence: `codexradar_info/browser.py`)
- Image service → Cached images: reads and writes (evidence: `README.md`)
- Command handler → Cached images: attaches generated images (evidence: `main.py`)
