How imwoo90/tuner works
Tuner is an asynchronous gateway that accepts agent work through Telegram, webhooks, and scheduled background tasks, runs it through the Antigravity CLI, and returns results to the initiating channel. The README documents the principal lock–session–PTY–log processing flow; source-index references and excerpts support key modules, but several integrations are unsampled, so their internal wiring is omitted. The graph also preserves documented workspace, localization, and webhook capabilities.
Main entry points: handler.rs Telegram bot · lock_pool.rs Lock pool · manager.rs Session manager · server.rs Webhook ingress
Components 24
Ingress and Messaging
- Telegram bot
src/messenger/telegram/handler.rs - Webhook ingress
src/webhook/api/server.rs - API sessions
src/webhook/api/session_loop.rs - Webhook registry
src/webhook/manager.rs
Agent Runtime
- Antigravity driver
src/cli/antigravity/mod.rs - PTY spawner
src/cli/antigravity/pty_spawner.rs
State and Coordination
- Lock pool
src/bus/lock_pool.rs - Message bus
src/bus/bus.rs - Bus adapters
src/bus/adapters.rs - Session keys
src/session/key.rs - Session manager
src/session/manager.rs - Session data
src/session/data.rs
Automation and Workspace
- Cron scheduler
src/cron/scheduler.rs - Cron jobs
src/cron/manager.rs - Heartbeat
src/heartbeat/scheduler.rs - Background observer
src/background/observer.rs - Background models
src/background/models.rs - Workspace paths
src/workspace/paths.rs - Skill helpers
src/workspace/skills_helpers.rs
Service Operations
- Configuration
src/config.rs - Supervisor
src/supervisor.rs - Localization
src/i18n/mod.rs
Other components
- Telegram user
- agy CLI
Connections 27
- Telegram user → Telegram bot: sends requests
README.md - Telegram bot → Lock pool: acquires locks
README.md - Webhook ingress → Lock pool: acquires locks
README.md - Cron scheduler → Lock pool: acquires locks
README.md - Lock pool → Session manager: coordinates sessions
README.md - Session manager → Session data: loads and saves
src/session/manager.rs - Session manager → Session keys: resolves keys
src/session/manager.rs - Lock pool → PTY spawner: coordinates execution
README.md - PTY spawner → agy CLI: runs process
README.md - Antigravity driver → PTY spawner: spawns process
src/cli/antigravity/mod.rs - agy CLI → Background observer: emits activity
- Background observer → Background models: uses models
src/background/observer.rs - Heartbeat → Session manager: reads sessions
src/heartbeat/scheduler.rs - Heartbeat → Antigravity driver: runs agent
src/heartbeat/scheduler.rs - Heartbeat → Message bus: publishes events
src/heartbeat/scheduler.rs - Bus adapters → Background models: adapts events
src/bus/adapters.rs - API sessions → Webhook ingress: handles sessions
- Webhook ingress → Webhook registry: manages hooks
src/webhook/server.rs - Cron scheduler → Cron jobs: loads jobs
src/cron/manager.rs - Antigravity driver → Workspace paths: uses workspace
- Workspace paths → Skill helpers: supports skills
- Telegram bot → Antigravity driver: dispatches requests
src/messenger/telegram/handler.rs - Telegram bot → Session manager: resolves sessions
src/messenger/telegram/handler.rs - Configuration → Telegram bot: configures bot
src/messenger/telegram/handler.rs - Configuration → Webhook ingress: configures API
src/webhook/api/server.rs - Supervisor → Telegram bot: supervises service
- Configuration → Localization: selects language
src/main.rs