# super-mortal/astrbot_plugin_group_digest architecture

> Architecture diagram of the GitHub repository super-mortal/astrbot_plugin_group_digest, 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/super-mortal/astrbot_plugin_group_digest
- Repository: https://github.com/super-mortal/astrbot_plugin_group_digest

## Overview

群聊总结 is an AstrBot plugin for cross-platform group-chat analysis, report generation, and optional comic creation, with an embedded WebUI for operations. The primary workflow is a user or scheduled trigger, message collection, statistical and LLM analysis, report rendering, and delivery. Separate product branches cover comics, incremental/checkpointed runs, configuration and template management, and operational observability. The README documents these capabilities; sampled source confirms pipeline checkpoints, trace/task handling, history persistence, and dashboard trace retrieval, but does not expose every service call.

Main entry points: [`src/application/services/analysis_application_service.py`](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/analysis_application_service.py) (Analysis Service), [`main.py`](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/main.py) (Plugin Lifecycle), [`src/application/handlers/analysis_command_handler.py`](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/handlers/analysis_command_handler.py) (Command Handlers), [`src/infrastructure/webui/routes`](https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/webui/routes) (WebUI Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin Entry"]
  node_main["Plugin Lifecycle<br/>[main.py]"]
  node_commands["Command Handlers"]
  node_remote["Remote Commands"]
  node_scheduler["Auto Scheduler<br/>[auto_scheduler.py]"]
end

subgraph group_analysis["Analysis Workflow"]
  node_analysis_service["Analysis Service"]
  node_messages["Message Repository"]
  node_platform["Platform Adapters"]
  node_domain_analysis["Domain Analysis"]
  node_analyzers["Analysis Modules"]
  node_pipeline["Stage and Checkpoint Context"]
  node_incremental["Incremental Analysis"]
end

subgraph group_outputs["Reports and Comics"]
  node_report["Report Generation<br/>[generators.py]"]
  node_comic["Comic Generation"]
  node_drawing["Image Drawing<br/>[drawing_client.py]"]
  node_delivery["Report Delivery<br/>[message_sender.py]"]
end

subgraph group_operations["Operations Data"]
  node_history[("Report History<br/>[history_manager.py]")]
  node_trace[("Trace Store")]
  node_active_tasks["Active Tasks"]
  node_config["Configuration<br/>[config_manager.py]"]
end

subgraph group_console["Web Console"]
  node_routes["WebUI Routes"]
  node_bridge["Dashboard Bridge"]
  node_dashboard["Management Dashboard<br/>[App.tsx]"]
  node_trace_ui["Trace Insights"]
end

node_user(("Chat User"))
node_astrbot(("AstrBot Runtime"))
node_llm(("LLM Service"))

node_user -->|"issues commands"| node_commands
node_user -->|"manages plugin"| node_dashboard
node_astrbot -->|"loads plugin"| node_main
node_main -->|"sets schedules"| node_scheduler
node_commands -->|"triggers analysis"| node_analysis_service
node_remote -->|"triggers analysis"| node_analysis_service
node_scheduler -->|"triggers analysis"| node_analysis_service
node_analysis_service -->|"retrieves messages"| node_messages
node_messages -->|"accesses chat data"| node_platform
node_analysis_service -->|"analyzes input"| node_domain_analysis
node_domain_analysis -->|"runs modules"| node_analyzers
node_analyzers -->|"requests analysis"| node_llm
node_analysis_service -->|"records stages"| node_pipeline
node_analysis_service -.->|"supports incremental runs"| node_incremental
node_analysis_service -->|"renders report"| node_report
node_analysis_service -.->|"starts comic workflow"| node_comic
node_comic -->|"requests images"| node_drawing
node_analysis_service -->|"delivers results"| node_delivery
node_analysis_service -->|"saves summary"| node_history
node_main -->|"initializes tracing"| node_trace
node_main -->|"starts task tracking"| node_active_tasks
node_active_tasks -->|"persists task status"| node_trace
node_dashboard -->|"requests API data"| node_bridge
node_bridge -->|"calls WebUI API"| node_routes
node_routes -->|"queries traces"| node_trace
node_routes -->|"reads task state"| node_active_tasks
node_trace_ui -->|"fetches trace data"| node_bridge
node_dashboard -->|"shows trace insights"| node_trace_ui
node_commands -->|"reads settings"| node_config
node_main -->|"initializes config"| node_config

click node_main "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/main.py"
click node_commands "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/handlers/analysis_command_handler.py"
click node_remote "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/handlers/remote_command_handler.py"
click node_scheduler "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/scheduler/auto_scheduler.py"
click node_analysis_service "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/analysis_application_service.py"
click node_messages "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/domain/repositories/message_repository.py"
click node_platform "https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/platform/adapters"
click node_domain_analysis "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/domain/services/analysis_domain_service.py"
click node_analyzers "https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/analysis/analyzers"
click node_pipeline "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/pipeline_context.py"
click node_incremental "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/incremental_analysis_service.py"
click node_report "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/reporting/generators.py"
click node_comic "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/comic_application_service.py"
click node_drawing "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/drawing/drawing_client.py"
click node_delivery "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/messaging/message_sender.py"
click node_history "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/persistence/history_manager.py"
click node_trace "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/persistence/trace_sqlite_store.py"
click node_active_tasks "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/webui/active_task_manager.py"
click node_routes "https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/webui/routes"
click node_dashboard "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/dashboard/src/app/App.tsx"
click node_trace_ui "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/dashboard/src/pages/context-insight/model/useContextInsightViewModel.ts"
click node_config "https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/config/config_manager.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_main,node_commands,node_remote,node_scheduler,node_user toneBlue
class node_analysis_service,node_messages,node_platform,node_domain_analysis,node_analyzers,node_pipeline,node_incremental toneAmber
class node_report,node_comic,node_drawing,node_delivery toneMint
class node_history,node_trace,node_active_tasks,node_config toneRose
class node_routes,node_bridge,node_dashboard,node_trace_ui,node_astrbot,node_llm toneIndigo
```

## Components

### Plugin Entry

- [Plugin Lifecycle](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/main.py): `main.py`
- [Command Handlers](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/handlers/analysis_command_handler.py): `src/application/handlers/analysis_command_handler.py`
- [Remote Commands](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/handlers/remote_command_handler.py): `src/application/handlers/remote_command_handler.py`
- [Auto Scheduler](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/scheduler/auto_scheduler.py): `src/infrastructure/scheduler/auto_scheduler.py`

### Analysis Workflow

- [Analysis Service](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/analysis_application_service.py): `src/application/services/analysis_application_service.py`
- [Message Repository](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/domain/repositories/message_repository.py): `src/domain/repositories/message_repository.py`
- [Platform Adapters](https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/platform/adapters): `src/infrastructure/platform/adapters`
- [Domain Analysis](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/domain/services/analysis_domain_service.py): `src/domain/services/analysis_domain_service.py`
- [Analysis Modules](https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/analysis/analyzers): `src/infrastructure/analysis/analyzers`
- [Stage and Checkpoint Context](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/pipeline_context.py): `src/application/services/pipeline_context.py`
- [Incremental Analysis](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/incremental_analysis_service.py): `src/application/services/incremental_analysis_service.py`

### Reports and Comics

- [Report Generation](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/reporting/generators.py): `src/infrastructure/reporting/generators.py`
- [Comic Generation](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/application/services/comic_application_service.py): `src/application/services/comic_application_service.py`
- [Image Drawing](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/drawing/drawing_client.py): `src/infrastructure/drawing/drawing_client.py`
- [Report Delivery](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/messaging/message_sender.py): `src/infrastructure/messaging/message_sender.py`

### Operations Data

- [Report History](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/persistence/history_manager.py): `src/infrastructure/persistence/history_manager.py`
- [Trace Store](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/persistence/trace_sqlite_store.py): `src/infrastructure/persistence/trace_sqlite_store.py`
- [Active Tasks](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/webui/active_task_manager.py): `src/infrastructure/webui/active_task_manager.py`
- [Configuration](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/src/infrastructure/config/config_manager.py): `src/infrastructure/config/config_manager.py`

### Web Console

- [WebUI Routes](https://github.com/super-mortal/astrbot_plugin_group_digest/tree/main/src/infrastructure/webui/routes): `src/infrastructure/webui/routes`
- **Dashboard Bridge**
- [Management Dashboard](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/dashboard/src/app/App.tsx): `dashboard/src/app/App.tsx`
- [Trace Insights](https://github.com/super-mortal/astrbot_plugin_group_digest/blob/main/dashboard/src/pages/context-insight/model/useContextInsightViewModel.ts): `dashboard/src/pages/context-insight/model/useContextInsightViewModel.ts`

### Other components

- **Chat User**
- **AstrBot Runtime**
- **LLM Service**

## Connections

- Chat User → Command Handlers: issues commands
- Chat User → Management Dashboard: manages plugin
- AstrBot Runtime → Plugin Lifecycle: loads plugin
- Plugin Lifecycle → Auto Scheduler: sets schedules
- Command Handlers → Analysis Service: triggers analysis
- Remote Commands → Analysis Service: triggers analysis
- Auto Scheduler → Analysis Service: triggers analysis
- Analysis Service → Message Repository: retrieves messages
- Message Repository → Platform Adapters: accesses chat data
- Analysis Service → Domain Analysis: analyzes input
- Domain Analysis → Analysis Modules: runs modules
- Analysis Modules → LLM Service: requests analysis
- Analysis Service → Stage and Checkpoint Context: records stages
- Analysis Service → Incremental Analysis: supports incremental runs
- Analysis Service → Report Generation: renders report
- Analysis Service → Comic Generation: starts comic workflow
- Comic Generation → Image Drawing: requests images
- Analysis Service → Report Delivery: delivers results
- Analysis Service → Report History: saves summary
- Plugin Lifecycle → Trace Store: initializes tracing
- Plugin Lifecycle → Active Tasks: starts task tracking
- Active Tasks → Trace Store: persists task status
- Management Dashboard → Dashboard Bridge: requests API data
- Dashboard Bridge → WebUI Routes: calls WebUI API
- WebUI Routes → Trace Store: queries traces
- WebUI Routes → Active Tasks: reads task state
- Trace Insights → Dashboard Bridge: fetches trace data
- Management Dashboard → Trace Insights: shows trace insights
- Command Handlers → Configuration: reads settings
- Plugin Lifecycle → Configuration: initializes config
