Sovereign AI Runtime — Owned by No Corporation
A custom-built shell replacing the Claude Code CLI dependency. 8 packages, 47 TypeScript source files, zero build errors. Built with precision. Deployed with sovereignty.
Each package has a single responsibility. Contracts flow through @gayatri/core.
The runtime orchestrates everything — built by Codex.
Event-sourced state machine. Every state transition is recorded. The runtime never loses a task — it either completes, fails, or waits for input.
Each package is self-contained yet interoperable. Contracts are defined in core, implemented in services, orchestrated by the runtime.
Types, interfaces, and constants. The contract every other package codes against. Single source of truth for the entire shell.
SQLite with WAL mode for concurrent reads. Session, message, and task repositories. Migration runner for schema evolution.
MCP client manager. Connection registry, stdio and SSE transports, tool normalization, and permission policy engine.
Model driver with provider adapters. Vercel AI SDK unified interface over Anthropic, OpenAI, and Ollama backends.
Conversation loop and task execution. Event-sourced state machine, streamText loop, and tool orchestration core.
Fastify HTTP server. REST API endpoints, WebSocket for real-time streaming, and graceful shutdown handling.
Ink React terminal interface. Chat view, tool call cards, model switcher, and status bar — all in the terminal.
React + Vite PWA. Mobile-first dark theme, WebSocket streaming, service worker for offline capability.
A complete conversation turn flows through every layer — from user input to streamed response, with tool calls routed through the MCP manager.
A rigorous evaluation of the leading open-source TypeScript agent framework — and why sovereignty matters.
Mastra provides an impressive set of primitives: agent loops, tool integration, evaluation runners, and deployment tooling. It is the closest open-source equivalent to what Gayatri Shell does.
Decision: Use Mastra as inspiration and a library for channels, evals, and observability patterns — but keep the runtime sovereign. Gayatri Shell is not a wrapper; it is a runtime.
| Capability | Mastra.ai | Gayatri Shell |
|---|---|---|
| Agent Loop | Built-in, configurable | Custom event-sourced loop |
| Tool Execution | Managed internally | MCP-native, multi-transport |
| Model Routing | Single provider focus | Trust-scored multi-provider |
| State Machine | Implicit | Explicit, event-sourced |
| Evals & Observability | Built-in (strong) | Planned — inspired by Mastra |
| Deployment | Managed cloud | Cloudflare Pages + own infra |
| License / Ownership | Apache 2.0 (open, not ours) | Sovereign — owned by Gayatri |