Hub#
In scion, the Hub is the central control plane of the hosted (distributed) architecture. It coordinates state across multiple users, groves, and runtime-brokers.
Responsibilities#
- Identity & Auth: Manages user identities via OAuth, issues tokens for brokers and agents
- State Persistence: Stores definitive state of agents, groves, and templates in a central database (SQLite)
- Orchestration: Dispatches agent lifecycle commands to appropriate runtime-brokers
- Collaboration: Provides shared view via Web Dashboard and Hub API
Communication with Brokers#
- Direct HTTP: When broker has a reachable endpoint
- Control Channel (WebSocket tunnel): When broker is behind NAT/firewall
Agent Creation Flow (Hosted)#
- CLI syncs grove with Hub
POST /api/v1/groves/{groveId}/agents- Hub selects a runtime-broker
- Merges environment variables and secrets from all scopes (user → grove → broker)
- Resolves template with content hash for broker-side caching
- Dispatches to broker
- Broker provisions and starts agent
- Status reported back via heartbeats