# rennerdo30/agent-bridge architecture

> Architecture diagram of the GitHub repository rennerdo30/agent-bridge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rennerdo30/agent-bridge
- Repository: https://github.com/rennerdo30/agent-bridge

## Overview

agent-bridge coordinates supported coding-agent CLIs through a local broker: agents exchange messages, delegate jobs, ask the owner questions, and retain searchable history. The main workflow runs from an agent’s MCP tools over a local pipe to the broker, which dispatches work and persists state; the dashboard presents that state, while paired PCs add TLS networking and file/job transfer. The repository also includes a mobile dashboard and storage-preservation workflows. Several subsystems are represented from README or index evidence; their internal links are omitted where source excerpts do not establish them.

Main entry points: [`src/core/node.ts`](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/node.ts) (Broker daemon), [`src/network/link.ts`](https://github.com/rennerdo30/agent-bridge/blob/main/src/network/link.ts) (TLS pairing and links), [`src/mcp/server.ts`](https://github.com/rennerdo30/agent-bridge/blob/main/src/mcp/server.ts) (MCP tools), [`src/cli/main.ts`](https://github.com/rennerdo30/agent-bridge/blob/main/src/cli/main.ts) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent interfaces"]
  node_mcp["MCP tools<br/>[server.ts]"]
  node_plugins["CLI plugins and hooks"]
end

subgraph group_runtime["Broker runtime"]
  node_broker["Broker daemon<br/>[node.ts]"]
  node_wire["Local pipe protocol<br/>[protocol.ts]"]
  node_messages["Messaging and decisions<br/>[messages.ts]"]
  node_jobs["Delegated jobs<br/>[jobs.ts]"]
  node_questions["Owner questions<br/>[owner-questions.ts]"]
  node_cli["CLI commands<br/>[main.ts]"]
end

subgraph group_network["Paired networking"]
  node_pairing["TLS pairing and links<br/>[link.ts]"]
  node_remote_jobs["Remote jobs<br/>[remote-jobs.ts]"]
  node_file_transfer["File transfers<br/>[transfers.ts]"]
end

subgraph group_client["Dashboards"]
  node_dashboard["Local dashboard<br/>[dashboard.ts]"]
  node_mobile_gateway["Mobile gateway<br/>[gateway.ts]"]
  node_mobile_app["Mobile app<br/>[App.tsx]"]
end

subgraph group_storage["State and history"]
  node_history[("Searchable history<br/>[history-store.ts]")]
  node_storage_migration["Storage migration"]
  node_preservation["Storage preservation"]
  node_audit["Storage audit<br/>[storage-audit.ts]"]
end

node_developer(("Developer"))
node_agent_cli(("Coding agent CLIs"))
node_paired_pc(("Paired PC"))

node_agent_cli -->|"uses tools"| node_mcp
node_mcp -->|"communicates over"| node_wire
node_wire -->|"routes requests"| node_broker
node_plugins -->|"exposes tools"| node_mcp
node_broker -.->|"handles messages"| node_messages
node_broker -.->|"dispatches jobs"| node_jobs
node_broker -.->|"routes questions"| node_questions
node_developer -->|"views status"| node_dashboard
node_broker -->|"serves dashboard"| node_dashboard
node_developer -.->|"uses app"| node_mobile_app
node_mobile_app -.->|"requests data"| node_mobile_gateway
node_paired_pc -->|"pairs over TLS"| node_pairing
node_pairing -->|"dispatches streams"| node_file_transfer
node_pairing -->|"supports remote jobs"| node_remote_jobs
node_broker -->|"persists state"| node_history
node_history -.->|"migrates data"| node_storage_migration
node_storage_migration -->|"preserves originals"| node_preservation
node_cli -->|"runs audit"| node_audit
node_cli -.->|"starts or manages"| node_broker

click node_mcp "https://github.com/rennerdo30/agent-bridge/blob/main/src/mcp/server.ts"
click node_plugins "https://github.com/rennerdo30/agent-bridge/tree/main/plugins"
click node_broker "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/node.ts"
click node_wire "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/protocol.ts"
click node_messages "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/messages.ts"
click node_jobs "https://github.com/rennerdo30/agent-bridge/blob/main/src/mcp/jobs.ts"
click node_questions "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/owner-questions.ts"
click node_cli "https://github.com/rennerdo30/agent-bridge/blob/main/src/cli/main.ts"
click node_dashboard "https://github.com/rennerdo30/agent-bridge/blob/main/src/cli/dashboard.ts"
click node_mobile_gateway "https://github.com/rennerdo30/agent-bridge/blob/main/src/mobile/gateway.ts"
click node_mobile_app "https://github.com/rennerdo30/agent-bridge/blob/main/apps/mobile/App.tsx"
click node_pairing "https://github.com/rennerdo30/agent-bridge/blob/main/src/network/link.ts"
click node_remote_jobs "https://github.com/rennerdo30/agent-bridge/blob/main/src/network/remote-jobs.ts"
click node_file_transfer "https://github.com/rennerdo30/agent-bridge/blob/main/src/network/transfers.ts"
click node_history "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/history-store.ts"
click node_storage_migration "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/history-migration.ts"
click node_preservation "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/storage-preservation.ts"
click node_audit "https://github.com/rennerdo30/agent-bridge/blob/main/src/core/storage-audit.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp,node_plugins toneBlue
class node_broker,node_wire,node_messages,node_jobs,node_questions,node_cli toneAmber
class node_pairing,node_remote_jobs,node_file_transfer toneMint
class node_dashboard,node_mobile_gateway,node_mobile_app toneRose
class node_history,node_storage_migration,node_preservation,node_audit,node_developer,node_agent_cli,node_paired_pc toneIndigo
```

## Components

### Agent interfaces

- [MCP tools](https://github.com/rennerdo30/agent-bridge/blob/main/src/mcp/server.ts): `src/mcp/server.ts`
- [CLI plugins and hooks](https://github.com/rennerdo30/agent-bridge/tree/main/plugins): `plugins`

### Broker runtime

- [Broker daemon](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/node.ts): `src/core/node.ts`
- [Local pipe protocol](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/protocol.ts): `src/core/protocol.ts`
- [Messaging and decisions](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/messages.ts): `src/core/messages.ts`
- [Delegated jobs](https://github.com/rennerdo30/agent-bridge/blob/main/src/mcp/jobs.ts): `src/mcp/jobs.ts`
- [Owner questions](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/owner-questions.ts): `src/core/owner-questions.ts`
- [CLI commands](https://github.com/rennerdo30/agent-bridge/blob/main/src/cli/main.ts): `src/cli/main.ts`

### Paired networking

- [TLS pairing and links](https://github.com/rennerdo30/agent-bridge/blob/main/src/network/link.ts): `src/network/link.ts`
- [Remote jobs](https://github.com/rennerdo30/agent-bridge/blob/main/src/network/remote-jobs.ts): `src/network/remote-jobs.ts`
- [File transfers](https://github.com/rennerdo30/agent-bridge/blob/main/src/network/transfers.ts): `src/network/transfers.ts`

### Dashboards

- [Local dashboard](https://github.com/rennerdo30/agent-bridge/blob/main/src/cli/dashboard.ts): `src/cli/dashboard.ts`
- [Mobile gateway](https://github.com/rennerdo30/agent-bridge/blob/main/src/mobile/gateway.ts): `src/mobile/gateway.ts`
- [Mobile app](https://github.com/rennerdo30/agent-bridge/blob/main/apps/mobile/App.tsx): `apps/mobile/App.tsx`

### State and history

- [Searchable history](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/history-store.ts): `src/core/history-store.ts`
- [Storage migration](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/history-migration.ts): `src/core/history-migration.ts`
- [Storage preservation](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/storage-preservation.ts): `src/core/storage-preservation.ts`
- [Storage audit](https://github.com/rennerdo30/agent-bridge/blob/main/src/core/storage-audit.ts): `src/core/storage-audit.ts`

### Other components

- **Developer**
- **Coding agent CLIs**
- **Paired PC**

## Connections

- Coding agent CLIs → MCP tools: uses tools (evidence: `README.md`)
- MCP tools → Local pipe protocol: communicates over (evidence: `README.md`)
- Local pipe protocol → Broker daemon: routes requests (evidence: `README.md`)
- CLI plugins and hooks → MCP tools: exposes tools (evidence: `README.md`)
- Broker daemon → Messaging and decisions: handles messages
- Broker daemon → Delegated jobs: dispatches jobs (evidence: `src/core/node.ts`)
- Broker daemon → Owner questions: routes questions (evidence: `src/core/node.ts`)
- Developer → Local dashboard: views status (evidence: `README.md`)
- Broker daemon → Local dashboard: serves dashboard (evidence: `README.md`)
- Developer → Mobile app: uses app
- Mobile app → Mobile gateway: requests data
- Paired PC → TLS pairing and links: pairs over TLS (evidence: `README.md`)
- TLS pairing and links → File transfers: dispatches streams (evidence: `src/network/link.ts`)
- TLS pairing and links → Remote jobs: supports remote jobs (evidence: `README.md`)
- Broker daemon → Searchable history: persists state (evidence: `README.md`)
- Searchable history → Storage migration: migrates data (evidence: `src/core/history-store.ts`)
- Storage migration → Storage preservation: preserves originals (evidence: `src/core/finalize-proof.ts`)
- CLI commands → Storage audit: runs audit
- CLI commands → Broker daemon: starts or manages (evidence: `src/cli/main.ts`)
