Skip to main content

ProtoAgent Monorepo

ProtoAgent is a local-first agent ecosystem for autonomous coding. The repo is organized around one core idea: keep the agent brain in the Python core, keep frontends thin, and let ProtoLink own the runtime contracts for agents, events, state, actions, and approvals.

The current monorepo has three main product surfaces:

SurfacePathStatusResponsibility
Rust CLI and TUIcli/ActiveTerminal UX, project selection, model setup, live progress, approvals, cancellation, traces, sessions.
Python corecore/protoagent_core/ActiveProtoLink agent deck, model/provider wiring, Context Loom, config, history, tools, runtime bridge.
ACP serveracp/PlannedEditor-facing Agent Client Protocol server. Current docs mark implementation details as TBD.

The rest of the repo supports those surfaces:

PathPurpose
whitepaper.mdArchitecture thesis for local-first Agent-to-Agent orchestration.
playground/Small sample apps used as coding-agent targets and integration sandboxes.
misc/assets/Images and CLI demos used by README and docs.

Design Principles

ProtoAgent is not a single giant prompt wrapped in a terminal. The system is split into small, inspectable components:

  1. Frontends stay product-specific. The CLI owns terminal interaction, panels, modal flows, input history, and approval UX.
  2. The Python core owns app logic. Provider discovery, config, Context Loom, runtime startup, and the agent deck live under core/protoagent_core/.
  3. ProtoLink owns runtime semantics. Runs use RunContext, RunBudget, RunEvent, RunReport, typed actions, capability policies, state APIs, streaming task channels, and cancellation requests.
  4. Context is visible. Context Loom builds a deterministic, source-cited evidence pack before the model reasons.
  5. Writes are approval-gated. Coder prepares RunAction objects with text/x-diff preview artifacts. The Rust application decides whether the action can execute.

How These Docs Are Organized

These docs are intentionally modular. A future change should usually require updating one page, not rewriting a manual.

If you change...Update...
A shell command or slash commandCLI / Commands
A TUI panel, modal, scrolling rule, or input behaviorCLI / Fullscreen TUI
Project config, sessions, or file taggingCLI / Projects and Sessions
Provider discovery, API keys, or model selectionCLI / Models and Config and Core / Config and Models
Context Loom scoring, index schema, or prompt formatCLI / Context Loom and Core / Context Loom
Runtime transport, budgets, streaming, tracing, or cancellationCore / Runtime and Reference / Environment
Agent prompts, tools, or policiesCore / Agent Deck and Core / Safety and Tools
Contributor tooling, linting, type-checking, or formattingContributing / Development Workflow and Reference / Verification
ACP implementationACP / Plan

Source Of Truth

The docs describe the code currently checked into this repo. When there is a conflict, prefer the implementation and update the relevant doc page in the same change.

Useful source entrypoints:

CodeWhat to inspect
cli/src/main.rsShell command routing, PyO3 calls, context commands, config paths.
cli/src/terminal_ui.rsFullscreen TUI command dispatcher and task loop.
cli/src/terminal_ui/Focused TUI modules for render, modals, project picker, model picker, approvals, diff review.
cli/src/progress.rsLive JSONL progress tailing, approval decision files, context meter samples.
cli/src/timeline.rsNormalized RunEvent trace and timeline formatting.
cli/src/sessions.rsRust UI session ledger.
core/protoagent_core/agent_engine.pyPyO3-facing functions called by Rust.
core/protoagent_core/runtime.pyProtoLink runtime mesh startup and streaming execution.
core/protoagent_core/agents/Architect, Explorer, Coder, and deck assembly.
core/protoagent_core/context/Context Loom index, SQLite store, pack builder, schemas.
core/protoagent_core/history.pyProtoLink state describe, compact, reset, and persistence helpers.
core/protoagent_core/tools.pyWorkspace-safe read, search, diff preview, and writes.
pyproject.tomlRuff and ty configuration for the Python surface.
rustfmt.tomlRust formatting configuration for the CLI crate.
CONTRIBUTING.mdGitHub-facing contributor setup and pull request workflow.