Back to systems

System Deep Dive

Snapshot: March 2026

IOSTUI, a full multi-agent IDE from your iPhone browser.

A web-based terminal multiplexer and IDE that runs Claude Code, Codex, Gemini, and Qwen simultaneously from any browser. Built in two days. No native app. No build step on the client. A Rust agent daemon for session management, AI-powered task routing via local Ollama, and a bidirectional federation bridge so agents collaborate across system boundaries.

  • 2 days to build
  • 178 commits
  • 15.9k lines of code
  • 4 concurrent agents
Abstract systems diagram for IOSTUI

Architecture

Three layers: client, server, and a Rust daemon.

The client is zero-build vanilla JS with xterm.js. The server is Node.js with WebSocket PTY management. The daemon is Rust with Unix domain sockets and 120KB scrollback per session.

Client (vanilla JS)
  • xterm.js terminal with WebSocket I/O
  • Mobile: tab-based layout with iOS PWA optimizations, haptics, swipe nav
  • Desktop: 2x2 multipane grid with all 4 agents visible simultaneously
  • Team chat with SSE, noise suppression, and per-agent filtering
  • Zero build step — no bundler, no framework, no transpilation
Server (Node.js, port 7683)
  • PTY manager with node-pty and zellij backend support
  • Federation bridge — bidirectional sync to DI Federation notes DBs
  • Output scanner with 35+ noise patterns for clean team chat
  • Agent bootstrap with per-agent warmup, auth detection, context injection
  • Observatory API for health, memory services, and federation status
Agent daemon (Rust)
  • portable-pty for cross-platform PTY management
  • 120KB scrollback buffer per session
  • Unix domain socket protocol (10 commands)
  • Session persistence — auto-restore on restart
  • Systemd integration with built-in healthcheck

Intelligence

AI task routing and auto-recovery.

Task routing
  • Local Ollama (qwen3.5:4b) analyzes incoming relay messages
  • Scores agent capacity and routes tasks to best-fit agent
  • SQLite persistence for routing decisions and history
  • MCP relay server so agents can read and write the team relay natively
Auto-recovery
  • Detects agent crashes via shell prompt pattern matching
  • Auto-restarts with resume hints, up to 3 retries with race guards
  • Hourly wakeup scheduler nudges agents to check in and collaborate
  • Session persistence survives full server restarts

Deployment

Systemd, Docker, Cloudflare tunnels.

Services
  • 4 systemd units: main server, agent daemon, watchdog, and timer
  • Docker build from node:20-slim, runs as non-root user
  • Cloudflare tunnel, Tailscale, or SSH tunnel for remote access
Security
  • HttpOnly + SameSite=Strict cookie auth
  • Symlink-aware path traversal protection
  • PTY injection sanitization (strips ANSI/OSC/DCS/CSI escapes)
  • Security headers and localhost-only relay by default
Testing
  • Node.js built-in test runner (zero test dependencies)
  • Playwright end-to-end tests
  • GitHub Actions CI with Node 20+22 matrix
  • c8 coverage reporting

Stack

Built in 48 hours. Runs in production.

  • Node.js
  • Express
  • xterm.js
  • WebSocket
  • SQLite
  • SSE
  • Rust
  • portable-pty
  • Ollama
  • MCP
  • Zellij
  • Playwright

Need a multi-agent interface that works from anywhere?

That is a systems problem — terminals, sessions, routing, and recovery all need design.

Email Rarity Index