Skip to main content

ProtoAgent Monorepo

ProtoAgent is a local-first coding agent optimized for inspectable operation with smaller models. The repo is organized around one core idea: keep application logic in the Python core, keep frontends thin, and let ProtoLink own agent discovery, delegation, tools, state, events, actions, approvals, cancellation, transports, and reports.

The current monorepo has three main product surfaces:

SurfacePathVersionStatusResponsibility
Rust CLI and TUIcli/0.3.0ActiveTerminal UX, project selection, model setup, live progress, approvals, cancellation, traces, sessions.
Python corecore/protoagent_core/0.3.0ActiveProtoLink agent deck, model/provider wiring, Context Loom, config, history, tools, runtime bridge.
ACP serveracp/0.0.0-dev.0PlannedEditor-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. State is deliberate. Architect keeps durable conversation memory, while Explorer, Coder, Verifier and enabled optional Tester/Scout/MCP are task-local stateless workers.
  6. Runs have contracts. Write tasks need executed file changes at their current native resource revisions. Approvals cannot satisfy completion.
  7. Writes are approval-gated. Native tools prepare exact diff artifacts. Rust resolves scoped broker requests by ID and action fingerprint.

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
Component version source or release markerReference / Versioning
User-visible release behaviorRoot CHANGELOG.md
Agent prompts, tools, or policiesCore / Agent Deck and Core / Safety and Tools
Optional agent or network capabilityCore / Agent Deck, Core / Safety and Tools, CLI / Commands, and Reference / Environment
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/Required Architect/Explorer/Coder/Verifier, optional Tester/Scout/MCP, and deck assembly.

Optional workers are user-controlled: /agents tester on|off changes test design (default on), while Scout/MCP default off. Disabling Tester removes its model without bypassing required checks. /mcp configures named external tool servers without an LLM. The broker returns one schema and executes approved allowlisted calls through ProtoLink 0.8.1, keeping large catalogs out of small-model prompts. See MCP Broker for setup and effect boundaries. | core/protoagent_core/context/ | Context Loom index, SQLite store, pack builder, schemas. | | core/protoagent_core/history.py | ProtoLink state describe, compact, reset, and persistence helpers. | | core/protoagent_core/tools.py | Workspace-safe read, search, diff preview, and writes. | | pyproject.toml | Ruff and ty configuration for the Python surface. | | core/pyproject.toml | Python core package metadata and core release version. | | VERSIONING.md | Component version policy and source-of-truth map. | | CHANGELOG.md | Dated user-visible release notes. | | rustfmt.toml | Rust formatting configuration for the CLI crate. | | CONTRIBUTING.md | GitHub-facing contributor setup and pull request workflow. |