v0.1.0 — MVP Complete

Gayatri Shell

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.

Explore the Architecture

Package Dependency Graph

Each package has a single responsibility. Contracts flow through @gayatri/core. The runtime orchestrates everything — built by Codex.

Gayatri Shell Package Dependency Graph

Task Lifecycle

Event-sourced state machine. Every state transition is recorded. The runtime never loses a task — it either completes, fails, or waits for input.

Task Lifecycle State Machine

8 Packages, One Shell

Each package is self-contained yet interoperable. Contracts are defined in core, implemented in services, orchestrated by the runtime.

@gayatri/core

Types, interfaces, and constants. The contract every other package codes against. Single source of truth for the entire shell.

Gayatri TypeScript
types.ts · interfaces.ts · constants.ts · index.ts
@gayatri/database

SQLite with WAL mode for concurrent reads. Session, message, and task repositories. Migration runner for schema evolution.

Gayatri SQLite · better-sqlite3
repositories/ · migrations/ · connection.ts
@gayatri/mcp

MCP client manager. Connection registry, stdio and SSE transports, tool normalization, and permission policy engine.

Gayatri MCP SDK · SSE
registry.ts · transports/ · policy.ts · normalizer.ts
@gayatri/models

Model driver with provider adapters. Vercel AI SDK unified interface over Anthropic, OpenAI, and Ollama backends.

Gayatri Vercel AI SDK · Anthropic · Ollama
driver.ts · adapters/ · types.ts · stream.ts
@gayatri/runtime

Conversation loop and task execution. Event-sourced state machine, streamText loop, and tool orchestration core.

Built by Codex XState · RxJS
loop.ts · state-machine.ts · orchestrator.ts · events.ts
@gayatri/server

Fastify HTTP server. REST API endpoints, WebSocket for real-time streaming, and graceful shutdown handling.

Gayatri Fastify · WS
app.ts · routes/ · websocket.ts · shutdown.ts
@gayatri/cli

Ink React terminal interface. Chat view, tool call cards, model switcher, and status bar — all in the terminal.

Gayatri Ink · React
app.tsx · components/ · hooks/ · commands.ts
@gayatri/web

React + Vite PWA. Mobile-first dark theme, WebSocket streaming, service worker for offline capability.

Gayatri React · Vite · PWA
App.tsx · components/ · hooks/ · sw.js

Request-to-Response Pipeline

A complete conversation turn flows through every layer — from user input to streamed response, with tool calls routed through the MCP manager.

Request-to-Response Pipeline

Mastra.ai Assessment

A rigorous evaluation of the leading open-source TypeScript agent framework — and why sovereignty matters.

Mastra.ai — Apache 2.0 TypeScript Agent Framework

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