Skip to content
Istiyaq-KhanPublic

About

A local-first, cross-platform desktop AI agent runtime with recursive sub-agents, dynamic code sandboxing, stealth browser automation, voice HUD, and multi-channel sync.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

⚑ Krypton

Autonomous Desktop AI Agent Runtime

Local-first β€’ Zero Server Lock-in β€’ Native Desktop Shell β€’ Recursive Actor Model β€’ Stealth Browser β€’ Omni-Channel Gateway

TypeScript Tauri Rust Next.js React License: MIT


🌟 Overview

Krypton is a local-first, cross-platform autonomous desktop AI agent runtime designed to operate with zero server lock-in. It combines a native desktop shell with a recursive background daemon, isolated Git worktree execution, stealth browser automation, and an omni-channel messaging gateway.

Everything Krypton does is stored locally on your machine inside ~/.krypton (%USERPROFILE%\.krypton on Windows, $HOME/.krypton on macOS/Linux).

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        KRYPTON UNIFIED RUNTIME                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     Native Desktop Shell      β”‚        Background Daemon Engine        β”‚
β”‚  β€’ Tauri v2 (Rust) core       β”‚  β€’ Recursive Actor Engine (depth <= 3) β”‚
β”‚  β€’ React 19 / Next.js UI      β”‚  β€’ Task DAG Planner & Dynamic Replannerβ”‚
β”‚  β€’ Krypton Synapse (Voice/STT)β”‚  β€’ Git Worktree Isolation (Krypton-VCS)β”‚
β”‚  β€’ Context-staging Chatbar    β”‚  β€’ Sandboxed Subprocess Runner         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     Terminal CLI Companion    β”‚          Omni-Channel Gateway          β”‚
β”‚  β€’ React + Ink dynamic TUI    β”‚  β€’ Telegram (grammY + inline buttons)  β”‚
β”‚  β€’ Live Task DAG spinners     β”‚  β€’ Discord (Discord.js + ActionRows)   β”‚
β”‚  β€’ Interactive HITL prompts   β”‚  β€’ WhatsApp (@whiskeysockets/baileys)  β”‚
β”‚  β€’ Native single-binary CLI   β”‚  β€’ Slack (Block Kit) & Signal (CLI)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ 1-Step Quickstart Installation

Krypton installs everything into a single, clean directory (~/.krypton) and automatically configures your system PATH. Run the single command for your platform:

Windows (PowerShell)

irm https://raw.githubusercontent.com/Istiyaq-Khan/krypton/master/scripts/install.ps1 | iex

(Or clone this repository and run .\scripts\install.ps1)

macOS & Linux (Bash)

curl -fsSL https://raw.githubusercontent.com/Istiyaq-Khan/krypton/master/scripts/install.sh | bash

(Or clone this repository and run ./scripts/install.sh)

What the 1-Step Installer Does:

  1. Provisions ~/.krypton/ (agents, worktrees, cache, browser profiles).
  2. Places the standalone krypton binary in ~/.krypton/bin/.
  3. Adds ~/.krypton/bin to your user PATH environment variable.
  4. Initializes default agent workspace and configuration.

Now, open any terminal and start using Krypton:

krypton --help

πŸš€ Key Features

1. πŸŽ™οΈ Krypton Synapse & Desktop Chatbar

  • Global Hotkey (Ctrl+Shift+Space or Cmd+Shift+Space) summons an always-on-top, frameless, transparent Krypton Synapse companion.
  • Zero-Latency Audio: Stream audio directly to local Whisper.cpp / Moonshine ONNX speech-to-text with reactive audio waveform visualization.
  • Desktop Chatbar Console: Floating bottom console featuring lexical triggers (/ for dynamic tools, @ for codebase context), smart paste chip staging ($\ge 10$ lines or $\ge 300$ chars), and full keyboard navigation.

2. 🌿 Krypton-VCS: Git Worktree Isolation

  • No Branch Pollution: Agent coding tasks execute strictly in isolated Git worktrees under ~/.krypton/worktrees/<task-id>.
  • Atomic Conventional Commits: Every sub-task step generates an atomic commit (feat(...), fix(...)).
  • Deterministic Rollback: If linters, tests, or compilers fail, Krypton executes a hard rollback (git reset --hard) to the last verified commit.
  • Visual Diff Viewer: Interactive side-by-side diff viewer requiring human approval before merging back into your main branch.

3. 🌐 Stealth Browser Perception (AXTree-First)

  • Blind Navigation: Uses Chrome DevTools Protocol Accessibility Tree (AXTree) with transient numeric IDs ([id=1], [id=2]) for accurate DOM interactions with minimal token usage.
  • Humanized Anti-Bot: Generates cubic BΓ©zier mouse movement curves with micro-jitter and Gaussian keypress delays (60–140ms).
  • Resource Protection: Hard maximum of 2 active browser contexts with automatic idle recycling after 15 minutes.

4. πŸ’¬ Omni-Channel Gateway

Control Krypton from your favorite messaging platform with full Human-in-the-Loop (HITL) prompt resolution:

  • Telegram: grammY bot with inline keyboard buttons for prompt approvals.
  • Discord: Discord.js bot with task-specific threads and ActionRow button components.
  • WhatsApp: Powered by @whiskeysockets/baileys with numbered quick-reply menus for mobile approvals.
  • Slack: Interactive Block Kit buttons and live Task DAG checklist updates.
  • Signal: End-to-end encrypted interaction via signal-cli.

5. πŸ›‘οΈ Failure Mode Defense & Sandboxing

  • Recursion Ceiling: Strict maximum depth of 3 (max_depth <= 3).
  • Concurrency Cap: Maximum of 5 concurrent active sub-agents across the runtime.
  • Subprocess Jail: Scripts executed in OS-constrained subprocesses (Windows Job Objects / POSIX rlimit with 512MB RAM cap).
  • Static AST Linter: Blocks dangerous operations (rm -rf /, child_process, eval(), os.system).
  • Observation Masking: Tool outputs $&gt;1,500$ tokens are offloaded to disk, injecting only a 50-line summary into model context.

⌨️ CLI Command Reference

Krypton includes an interactive terminal companion built with React + Ink:

Command Description
krypton run "<goal>" Starts an autonomous task DAG with dynamic status spinners and interactive HITL prompt handling.
krypton vcs diff Reviews uncommitted changes in the current agent worktree with syntax-colored diffs.
krypton vcs merge <id> Approves and merges an agent worktree branch into your active branch.
krypton agents list Displays configured local agent fleet, assigned models, and tool lists.
krypton agents create <name> Provisions a new agent workspace with archetype templates.
krypton tools list Lists active Model Context Protocol (MCP) and dynamic synthesized tools.
krypton tools install <name> Discovers and installs an MCP tool or runtime extension.

πŸ“ Repository Structure

krypton/
β”œβ”€β”€ apps/
β”‚   └── desktop/                  # Tauri v2 (Rust) shell + Next.js 16 / React 19 frontend
β”‚       β”œβ”€β”€ src-tauri/            # Rust native backend, audio capture, global hotkey & sidecar
β”‚       └── src/                  # Next.js workspace dashboard & Krypton Synapse
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ shared-types/             # Universal TypeScript types, Zod schemas, and IPC contracts
β”‚   β”œβ”€β”€ agent-runtime/            # Core actor engine, MCP host, sandbox, browser, VCS, and channels
β”‚   └── cli/                      # Standalone React + Ink terminal client
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ install.ps1               # 1-step Windows universal installer
β”‚   β”œβ”€β”€ install.sh                # 1-step macOS / Linux universal installer
β”‚   β”œβ”€β”€ build-sidecar.mjs         # Native daemon compiler
β”‚   β”œβ”€β”€ build-cli.mjs             # Standalone CLI compiler
β”‚   └── setup-env.mjs             # Environment prerequisites validator
β”œβ”€β”€ .githooks/                    # Monorepo pre-commit and pre-push verification gates
β”œβ”€β”€ .github/workflows/            # Cross-platform release matrix (Windows, macOS, Linux)
└── pnpm-workspace.yaml           # Monorepo workspace configuration

πŸ› οΈ Building From Source

Prerequisites

  • Node.js: v20+
  • pnpm: v10+
  • Rust & Cargo: stable
  • Git: v2.40+

Validate your environment with:

node scripts/setup-env.mjs

Installation & Development

# 1. Install workspace dependencies
pnpm install

# 2. Build shared contracts and packages
pnpm build

# 3. Run all monorepo test suites (114+ tests)
pnpm test:all

# 4. Start the Desktop Shell in development mode
pnpm --filter desktop dev

# 5. Start the Agent Daemon
pnpm --filter @krypton/agent-runtime dev

# 6. Run the CLI in development
pnpm --filter @krypton/cli dev run "Analyze codebase"

Compiling Standalone Native Binaries

# Compile internal sidecar binaries (daemon & CLI) into apps/desktop/src-tauri/binaries/
pnpm build:binaries

# Build desktop application and collect single unified release package into output/
pnpm build:desktop

🚒 Single-Artifact Release Pipeline

Krypton follows a strict Single-Artifact Distribution Architecture: every release produces EXACTLY ONE self-contained, user-ready application package per supported operating system. Users never have to guess which intermediate binary or installer to download.

All background daemons (krypton-daemon), command-line companions (krypton-cli), and runtime dependencies are compiled and bundled directly inside each single installer package.

Official Release Packages

Operating System Single Download Package Distribution Format Architecture Bundled Components
Windows krypton-windows-x64-setup.exe Self-Contained NSIS Installer x86_64 Desktop UI + Background Daemon + CLI Engine
macOS krypton-macos-universal.dmg Apple Disk Image (DMG) Universal / Apple Silicon & Intel Desktop UI + Background Daemon + CLI Engine
Linux krypton-linux-x86_64.AppImage Universal AppImage x86_64 Desktop UI + Background Daemon + CLI Engine

Each release publishes cryptographic verification hashes in SHA256SUMS.txt.
For technical details on sidecar bundling, runtime path resolution, and CI/CD matrices, see Release Architecture Documentation.

Releases are published automatically to the Releases tab when a version tag (v*) is pushed or manually triggered via workflow_dispatch.


🀝 Contributing

Contributions are warmly welcomed! Please read CONTRIBUTING.md for details on our code of conduct, environment setup, testing standards, and the pull request submission process.


πŸ”’ Security

For vulnerability reporting guidelines, SLA details, and our local-first defense-in-depth security model, please refer to our Security Policy.


πŸ“„ License

This project is licensed under the MIT License.

About

A local-first, cross-platform desktop AI agent runtime with recursive sub-agents, dynamic code sandboxing, stealth browser automation, voice HUD, and multi-channel sync.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages