How aprazdnikov/agent-hub-rs works
agent-hub is a cross-platform desktop app that routes Telegram forum topics to persistent local AI-agent sessions. The main workflow is Telegram update intake, topic/session orchestration, agent execution, and result delivery; settings, projects, approvals, attachments, voice, handoff, snapshots, and outbox handling are additional product capabilities. The graph combines README-documented behavior with sampled source and source-index references; several subsystem links are documented rather than verified from full implementations.
Main entry points: hub.rs Topic hub · channel.rs Agent channel · session.rs Topic session · telegram.rs Bot listener
Components 25
Desktop app
- Settings window
crates/hub-app/src/gui/app.rs - Bot supervisor
crates/hub-app/src/supervisor.rs
Telegram interface
- Telegram Bot API
- Bot listener
crates/hub-telegram/src/telegram.rs - Update conversion
crates/hub-telegram/src/inbound.rs - Delivery policy
crates/hub-telegram/src/sender.rs - Messenger API
crates/hub-telegram/src/messenger.rs - Attachment download
crates/hub-telegram/src/download.rs
Session workflow
- Settings and projects
crates/hub-core/src/settings.rs - Topic hub
crates/hub-telegram/src/hub.rs - Topic session
crates/hub-telegram/src/session.rs
Agent runtimes
- Agent channel
crates/hub-agent/src/channel.rs - Claude runtime
crates/hub-claude/src/session.rs - Codex runtime
crates/hub-codex/src/backend.rs - Qwen runtime
crates/hub-qwen/src/session.rs - Hermes runtime
crates/hub-hermes/src/backend.rs - OpenCode runtime
crates/hub-opencode/src/backend.rs
Workflow capabilities
- Progress reporting
crates/hub-telegram/src/progress.rs - Result delivery
crates/hub-telegram/src/results.rs - History snapshots
crates/hub-telegram/src/snapshots.rs - Agent handoff
crates/hub-telegram/src/handoff.rs - Retry outbox
crates/hub-telegram/src/outbox.rs - Preset actions
crates/hub-telegram/src/actions.rs - Voice transcription
crates/hub-telegram/src/voice.rs
Other components
- Phone user
Connections 26
- Phone user → Telegram Bot API: sends task
- Settings window → Settings and projects: configures
- Settings window → Bot supervisor: controls
crates/hub-app/src/gui/app.rs - Bot supervisor → Topic hub: starts bot
- Telegram Bot API → Bot listener: delivers updates
- Bot listener → Update conversion: converts updates
crates/hub-telegram/src/telegram.rs - Bot listener → Topic hub: routes events
crates/hub-telegram/src/telegram.rs - Topic hub → Topic session: starts session
crates/hub-telegram/src/hub.rs - Topic session → Attachment download: downloads attachments
crates/hub-telegram/src/session.rs - Topic session → Agent channel: runs agent
crates/hub-telegram/src/session.rs - Agent channel → Claude runtime: dispatches
- Agent channel → Codex runtime: dispatches
- Agent channel → Qwen runtime: dispatches
- Agent channel → Hermes runtime: dispatches
- Agent channel → OpenCode runtime: dispatches
- Topic session → Progress reporting: reports events
crates/hub-telegram/src/session.rs - Topic session → Result delivery: relays results
crates/hub-telegram/src/session.rs - Topic hub → Delivery policy: sends responses
crates/hub-telegram/src/hub.rs - Delivery policy → Messenger API: applies policy
crates/hub-telegram/src/sender.rs - Messenger API → Telegram Bot API: sends messages
- Topic hub → History snapshots: saves history
crates/hub-telegram/src/hub.rs - Topic hub → Agent handoff: handles handoff
crates/hub-telegram/src/hub.rs - Topic hub → Retry outbox: manages delivery
crates/hub-telegram/src/hub.rs - Topic hub → Preset actions: runs commands
crates/hub-telegram/src/hub.rs - Topic hub → Voice transcription: handles voice
crates/hub-telegram/src/hub.rs - Settings and projects → Topic hub: configures workflow