Skip to content

Architecture

IO is built as a TypeScript ESM monorepo with three packages, published as a single npm package (heyio).

System Diagram

┌─────────────────────────────────────────────────────────┐
│                    Web Dashboard                         │
│  React 18 + Vite + Tailwind 4 + Radix UI + Recharts    │
└────────────────────┬────────────────────────────────────┘
                     │ HTTP / WebSocket
┌────────────────────▼────────────────────────────────────┐
│                     IO Daemon                            │
│                                                          │
│  ┌──────────────────────────────────────────────┐       │
│  │  Io (Orchestrator)                           │       │
│  │  • Persistent Copilot SDK session            │       │
│  │  • Smart model routing                       │       │
│  │  • Full tool set + squad delegation          │       │
│  │  • Rolling window reset + wiki episodes      │       │
│  └──────────┬───────────────────────────────────┘       │
│             │                                            │
│  ┌──────────▼───────────────────────────────────┐       │
│  │  Squad System (1 squad per repo)             │       │
│  │  Team Lead → Tasks → Agents → QA → PR       │       │
│  └──────────────────────────────────────────────┘       │
│                                                          │
│  ┌─────────┐ ┌──────┐ ┌────────┐ ┌──────────┐         │
│  │  Store  │ │ Wiki │ │ Skills │ │Scheduler │         │
│  │(libSQL) │ │(~/io)│ │(SKILL) │ │ (cron)   │         │
│  └─────────┘ └──────┘ └────────┘ └──────────┘         │
│                                                          │
│  ┌──────────┐ ┌──────────┐ ┌────────────────┐          │
│  │Event Bus │ │ Telegram │ │ Notifications  │          │
│  └──────────┘ └──────────┘ └────────────────┘          │
└─────────────────────────────────────────────────────────┘

Package Structure

packages/
├── shared/    — Types, constants (imported by daemon + web)
├── daemon/    — Core daemon: orchestrator, squads, API, store
└── web/       — React SPA dashboard

Shared (packages/shared/)

Exports TypeScript types and constants used by both daemon and web:

  • Squad, conversation, store, API, and event types
  • Application constants (ports, models, paths, event names)

Daemon (packages/daemon/)

The heart of IO. Key subsystems:

SubsystemPurpose
copilot/Copilot SDK integration, session management, model routing
orchestrator/Io's brain — system prompt, tools, message processing
squad/Squad lifecycle, hiring, model selection
execution/Full pipeline: plan → tasks → agents → review → QA → PR
store/libSQL database, all CRUD operations
wiki/Markdown knowledge base
skills/SKILL.md loader and manager
scheduler/Cron engine
api/Express server, REST routes, WebSocket
telegram/Grammy bot
logging/Pino logger factory

Web (packages/web/)

React SPA served by the daemon's Express server:

  • Chat, Squads, Feed (inbox), Wiki, Skills, Schedules, Usage, Settings views
  • Real-time updates via WebSocket
  • Optional Supabase authentication

Data Flow

User Message → API/Telegram/WS
  → Orchestrator (model routing → system prompt → Copilot SDK)
    → Direct response OR delegate to squad
      → Squad: Team Lead plans → agents execute → QA gate → PR
        → Event bus → WebSocket/Telegram notification

Technology Choices

LayerTechnologyRationale
LLM@github/copilot-sdkSingle provider, handles auth and streaming
DatabaselibSQLAsync-friendly, Turso-compatible, embedded
HTTPExpress 5Mature, middleware ecosystem
WebSocketwsLightweight, native Node.js
LoggingPinoFast structured logging, child loggers
TelegramgrammYModern, TypeScript-first bot framework
BuildesbuildFast bundling to single ESM output
WebVite + ReactFast dev server, optimized production build
TestVitestFast, TypeScript-native, compatible API
LintBiomeAll-in-one formatter + linter

Data Storage

All data lives in ~/.io/:

PathFormatPurpose
io.dbSQLite (libSQL)Squads, conversations, tokens, schedules, inbox
wiki/Markdown + YAMLKnowledge base
skills/SKILL.mdInstalled capabilities
config.jsonJSONConfiguration
logs/io.logJSON (Pino)Structured logs

Released under the MIT License.