Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1,248 Commits

Repository files navigation

trios 🔱

Trinity Git Orchestrator — Dual-MCP + Vision bridge for AI agents to control Git & GitButler through BrowserOS

CI

What is trios?

trios is a dual-layer MCP system that allows AI agents (BrowserOS, Claude Code, Cursor) to control Git repositories and GitButler virtual branches through natural language + vision.

Two Layers

LayerStackPortPurpose
trios-server (Rust)Axum + git2-rs + but CLI9005Core git operations, stable & fast
trios-mcp-bridge (TypeScript)Bun + Hono + MCP SDK9200Vision + high-level GitButler workflows

The agent can use either or both:

  • Rust server for pure git operations (no UI needed)
  • TypeScript bridge for vision-enhanced workflows (sees GitButler UI, understands context)

Architecture

╔══════════════════════════════════════════════════════════════╗
║ TRIOS DUAL-MCP + VISION ║
╚══════════════════════════════════════════════════════════════╝
┌────────────────────────────────────┐
│ BrowserOS (Chromium fork) │
│ + Agent Extension (React + Vision)│
└──────────────────┬─────────────────┘
│
MCP + Vision (screenshots, DOM)
▼
┌───────────────────────────────────────────────────┐
│ trios-mcp-bridge (Bun/Hono) :9200 │
│ • MCP client → BrowserOS MCP (screenshots) │
│ • MCP client → GitButler MCP (`but mcp`) │
│ • 10 high-level tools: │
│ gitbutler_analyze_ui() │
│ gitbutler_commit_visible() │
│ gitbutler_create_branch() │
│ gitbutler_push_stack() │
└──────────────────┬────────────────────────────────┘
│
┌───────────────────┼───────────────────────┐
│ │ │
┌──────▼──────┐ ┌─────────▼──────────┐ ┌────────▼─────────┐
│ BrowserOS │ │ trios-server │ │ GitButler MCP │
│ MCP Server │ │ (Rust/Axum) :9005 │ │ (`but mcp`) │
│ (CDP) │ │ git2-rs + but CLI │ │ virtual branches │
│ screenshots │ │ stage, commit, │ │ stacks, absorb │
│ snapshots │ │ branch, push, pull │ │ undo │
└─────────────┘ └────────────────────┘ └──────────────────┘
│ │
└───────┬───────────────┘
▼
.git/ + GitButler state
(UI updates automatically)

Quick Start

Rust Server (core git ops)

# Clone
git clone https://github.com/gHashTag/trios
cd trios
# Build & Run
cargo build
cargo run -p trios-server
# Server starts at http://localhost:9005# Test
cargo test

TypeScript Bridge (vision + workflows)

# Located at: packages/browseros-agent/apps/trios-mcp-bridge/cd packages/browseros-agent/apps/trios-mcp-bridge
# Install & Run
bun install
bun run src/index.ts
# Bridge starts at http://localhost:9200# With options
bun run src/index.ts --port 9200 --browseros-url http://127.0.0.1:9105/mcp --working-dir /path/to/repo

MCP Tools

Rust Server (trios-server :9005) — 7 Core Tools

ToolCrateDescription
git_statustrios-gitList changed files
git_stage_filestrios-gitStage files for commit
git_committrios-gitCreate a commit
git_branch_listtrios-gitList branches
git_branch_createtrios-gitCreate a branch
git_pushtrios-gitPush to remote
git_pulltrios-gitPull from remote

TypeScript Bridge (trios-mcp-bridge :9200) — 10 Vision + Workflow Tools

Vision & Analysis

ToolDescription
gitbutler_analyze_uiScreenshot GitButler UI + analyze state (branch, files, stacks)
gitbutler_screenshotRaw screenshot of GitButler tab
gitbutler_workspace_statusDetailed file/branch status from CLI
gitbutler_bridge_healthHealth check for all connections

Git Operations

ToolDescription
gitbutler_commit_visibleCommit changed files with a message
gitbutler_create_branchCreate a new virtual branch
gitbutler_push_stackPush current stack/branch to remote
gitbutler_stageStage specific files
gitbutler_absorbSmart absorb changes into appropriate commits
gitbutler_pullPull latest changes

MCP API Examples

Rust Server (port 9005)

# Stage files
curl -X POST http://localhost:9005/mcp/tools/call \
-H 'Content-Type: application/json' \
-d '{"name": "git_stage_files", "input": {"repo_path": "/path/to/repo", "paths": ["src/main.rs"]}}'# Commit
curl -X POST http://localhost:9005/mcp/tools/call \
-H 'Content-Type: application/json' \
-d '{"name": "git_commit", "input": {"repo_path": "/path/to/repo", "message": "feat: add feature"}}'

TypeScript Bridge (port 9200)

# Health check
curl http://localhost:9200/
# MCP tools via Streamable HTTP
curl -X POST http://localhost:9200/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

Integration

With BrowserOS

Add as a custom MCP server in BrowserOS settings:

{
"name": "trios-mcp-bridge",
"url": "http://127.0.0.1:9200/mcp",
"transport": "streamable-http"
}

With Claude Code / Cursor

{
"mcpServers": {
"trios-bridge": {
"url": "http://127.0.0.1:9200/mcp",
"transport": "streamable-http"
},
"trios-server": {
"url": "http://127.0.0.1:9005/mcp",
"transport": "streamable-http"
}
}
}

Example Workflow

User: "See what's changed in GitButler and commit the auth changes"
Agent:
1. gitbutler_analyze_ui() → Sees: branch "feature/auth", 3 changed files
2. gitbutler_stage(["auth.ts", "auth.test.ts"])
3. gitbutler_commit_visible("feat: add auth validation")
4. gitbutler_push_stack()

Crates (Rust)

CratePurpose
trios-coreTraits, types, shared abstractions
trios-gitGit operations via libgit2
trios-gbGitButler CLI wrapper with fallback
trios-serverAxum MCP HTTP server on port 9005

Project Structure

trios/ # Rust MCP server (this repo)
├── crates/
│ ├── trios-core/ # Shared types & traits
│ ├── trios-git/ # git2-rs operations
│ ├── trios-gb/ # GitButler CLI wrapper
│ └── trios-server/ # Axum MCP server :9005
├── CLAUDE.md # Development laws
└── README.md # This file
BrowserOS/packages/browseros-agent/apps/trios-mcp-bridge/ # TypeScript bridge
├── src/
│ ├── index.ts # Main entry — Hono HTTP server :9200
│ ├── config.ts # Config from env vars + CLI args
│ ├── types.ts # Shared types
│ ├── bridge-server.ts # MCP server with 10 tools
│ └── clients/
│ ├── browseros-client.ts # BrowserOS MCP client (HTTP)
│ └── gitbutler-client.ts # GitButler MCP client (stdio) + CLI fallback
├── package.json
└── README.md

Laws

See CLAUDE.md for full rules. Summary:

  • NO .sh files
  • cargo clippy -- -D warnings = 0
  • cargo test before merge
  • Every PR closes an issue

Environment Variables

VariableDefaultDescription
TRIONS_BRIDGE_PORT9200Bridge server port
TRIONS_BROWSEROS_MCP_URLhttp://127.0.0.1:9105/mcpBrowserOS MCP URL
TRIONS_GITBUTLER_CLIbutGitButler CLI path
TRIONS_GITBUTLER_INTERNALtrueUse GitButler internal MCP tools
TRIONS_WORKING_DIRcwdWorking directory for git
TRIONS_LOG_LEVELinfoLog level

Training: trios-trainer-igla

IGLA RACE training pipeline for pushing language model performance.

CILicense: MITAnchor

Quick Start

git clone https://github.com/gHashTag/trios-trainer-igla.git
cd trios-trainer-igla
cargo run --release --bin trios-train -- \
--config configs/champion.toml --seed 43

ROADMAP

PhaseStatusScope
PR-0✅ doneSkeleton compiles, anchor test passes
PR-1🟡 nextMigrate model + optimizer + tokenizer
PR-2Migrate JEPA + objective; merge trios-igla-trainer::jepa_runner
PR-3Champion-config full run reproduces ≈ 2.2393 ± 0.01
PR-4DELETE phase in gHashTag/trios (consolidation PR)
PR-5Push image to ghcr.io + wire 3-seed Railway deployment

Key Features

  • HybridAttn (L-h2) with INV-13 validation (qk_gain must be φ² or φ³)
  • Multi-objective loss: 0.5NTP + 0.25JEPA + 0.25*NCA
  • Muon optimizer with Newton-Schulz orthogonalization
  • GF16 (Golden Float) quantization
  • Champion baseline: BPB=2.2393 @ 27K steps
  • Target BPB: 1.50 for Gate-2 victory

Invariants

When built with --features trios-integration:

  • INV-8 (φ-LR band): lr ∈ [1e-3, 1e-2]
  • R8 (Gate-2 floor): step ≥ 4000 to emit ledger row
  • embargo: HEAD SHA must not appear in .embargo

Related Training Projects

Related Projects

About

🔱 Trinity Git Orchestrator — MCP server for AI agents to control Git & GitButler via libgit2 + CLI

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages