# continuum-ai-corp/orcareplay architecture

> Architecture diagram of the GitHub repository continuum-ai-corp/orcareplay, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/continuum-ai-corp/orcareplay
- Repository: https://github.com/continuum-ai-corp/orcareplay

## Overview

OrcaReplay records coding-agent runs at process, filesystem, and model-API boundaries, then stores them as traces for offline replay or model forks. The main workflow is record → trace → replay/fork → compare or inspect; other documented capabilities include TLS interception, shell/MCP/filesystem capture, trace scrubbing and sync, and a viewer. The graph keeps those domain stages distinct. Some subsystem links rely on README claims because their implementation files were not sampled.

Main entry points: [`packages/cli/src/commands/record.ts`](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/record.ts) (Record command), [`packages/cli/src/main.ts`](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/main.ts) (Command router), [`packages/proxy/src/server.ts`](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/server.ts) (Model proxy), [`packages/cli/src/commands/replay.ts`](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/replay.ts) (Replay command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_cli["Command router<br/>[main.ts]"]
  node_record["Record command<br/>[record.ts]"]
  node_replay_cmd["Replay command<br/>[replay.ts]"]
  node_compare["Model comparison<br/>[compare.ts]"]
  node_inspect["Inspect runs<br/>[inspect.ts]"]
  node_sync["Trace sync<br/>[sync.ts]"]
end

subgraph group_capture["Run capture"]
  node_proxy["Model proxy<br/>[server.ts]"]
  node_tls["TLS interception<br/>[intercept.ts]"]
  node_adapters["Agent adapters"]
  node_shell["Shell capture<br/>[install.ts]"]
  node_filesystem["Filesystem capture"]
  node_mcp["MCP capture"]
end

subgraph group_trace["Trace data"]
  node_trace_store[("Trace storage")]
  node_redaction["Trace redaction<br/>[redaction.ts]"]
  node_retrieval["Retrieval matching<br/>[retrieval.ts]"]
end

subgraph group_replay["Replay and analysis"]
  node_viewer["Trace viewer<br/>[render.ts]"]
end

subgraph group_extensions["Integrations"]
  node_providers["Provider translation"]
  node_plugins["Plugin API<br/>[plugins.ts]"]
end

node_user(("Engineer"))
node_remote["Gateway service"]
node_agent(("Coding agent"))

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches"| node_record
node_cli -->|"dispatches"| node_replay_cmd
node_cli -->|"dispatches"| node_compare
node_cli -->|"dispatches"| node_inspect
node_cli -->|"dispatches"| node_sync
node_record -->|"launches unmodified"| node_agent
node_record -->|"records exchanges"| node_proxy
node_record -.->|"configures agents"| node_adapters
node_record -->|"captures processes"| node_shell
node_record -->|"captures file changes"| node_filesystem
node_record -->|"tees MCP traffic"| node_mcp
node_record -->|"enables optionally"| node_tls
node_proxy -->|"records exchanges"| node_trace_store
node_proxy -->|"matches retrievals"| node_retrieval
node_proxy -->|"translates replies"| node_providers
node_replay_cmd -->|"reads trace"| node_trace_store
node_replay_cmd -->|"starts replay proxy"| node_proxy
node_replay_cmd -->|"captures fork changes"| node_filesystem
node_compare -->|"forks per model"| node_replay_cmd
node_compare -->|"selects models"| node_providers
node_inspect -->|"reads run data"| node_trace_store
node_inspect -->|"renders run"| node_viewer
node_record -.->|"scrubs trace data"| node_redaction
node_sync -->|"uploads traces"| node_remote
node_plugins -.->|"provides extensions"| node_proxy

click node_cli "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/main.ts"
click node_record "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/record.ts"
click node_replay_cmd "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/replay.ts"
click node_compare "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/compare.ts"
click node_inspect "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/inspect.ts"
click node_sync "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/sync.ts"
click node_proxy "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/server.ts"
click node_tls "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/intercept.ts"
click node_adapters "https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/adapters/src"
click node_shell "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/shell-shim/src/install.ts"
click node_filesystem "https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/fs-capture/src"
click node_mcp "https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/mcp-shim/src"
click node_trace_store "https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/core/src"
click node_redaction "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/core/src/redaction.ts"
click node_retrieval "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/retrieval.ts"
click node_viewer "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/viewer/src/render.ts"
click node_providers "https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/providers/src"
click node_plugins "https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/plugin-api/src/plugins.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_cli,node_record,node_replay_cmd,node_compare,node_inspect,node_sync toneBlue
class node_proxy,node_tls,node_adapters,node_shell,node_filesystem,node_mcp toneAmber
class node_trace_store,node_redaction,node_retrieval toneMint
class node_viewer toneRose
class node_providers,node_plugins,node_user,node_remote,node_agent toneIndigo
```

## Components

### CLI workflows

- [Command router](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/main.ts): `packages/cli/src/main.ts`
- [Record command](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/record.ts): `packages/cli/src/commands/record.ts`
- [Replay command](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/replay.ts): `packages/cli/src/commands/replay.ts`
- [Model comparison](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/compare.ts): `packages/cli/src/commands/compare.ts`
- [Inspect runs](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/inspect.ts): `packages/cli/src/commands/inspect.ts`
- [Trace sync](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/cli/src/commands/sync.ts): `packages/cli/src/commands/sync.ts`

### Run capture

- [Model proxy](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/server.ts): `packages/proxy/src/server.ts`
- [TLS interception](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/intercept.ts): `packages/proxy/src/intercept.ts`
- [Agent adapters](https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/adapters/src): `packages/adapters/src`
- [Shell capture](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/shell-shim/src/install.ts): `packages/shell-shim/src/install.ts`
- [Filesystem capture](https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/fs-capture/src): `packages/fs-capture/src`
- [MCP capture](https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/mcp-shim/src): `packages/mcp-shim/src`

### Trace data

- [Trace storage](https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/core/src): `packages/core/src`
- [Trace redaction](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/core/src/redaction.ts): `packages/core/src/redaction.ts`
- [Retrieval matching](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/proxy/src/retrieval.ts): `packages/proxy/src/retrieval.ts`

### Replay and analysis

- [Trace viewer](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/viewer/src/render.ts): `packages/viewer/src/render.ts`

### Integrations

- [Provider translation](https://github.com/Continuum-AI-Corp/OrcaReplay/tree/main/packages/providers/src): `packages/providers/src`
- [Plugin API](https://github.com/Continuum-AI-Corp/OrcaReplay/blob/main/packages/plugin-api/src/plugins.ts): `packages/plugin-api/src/plugins.ts`

### Other components

- **Engineer**
- **Gateway service**
- **Coding agent**

## Connections

- Engineer → Command router: runs commands (evidence: `README.md`)
- Command router → Record command: dispatches (evidence: `packages/cli/src/main.ts`)
- Command router → Replay command: dispatches (evidence: `packages/cli/src/main.ts`)
- Command router → Model comparison: dispatches (evidence: `packages/cli/src/main.ts`)
- Command router → Inspect runs: dispatches (evidence: `packages/cli/src/main.ts`)
- Command router → Trace sync: dispatches (evidence: `packages/cli/src/main.ts`)
- Record command → Coding agent: launches unmodified (evidence: `README.md`)
- Record command → Model proxy: records exchanges (evidence: `README.md`)
- Record command → Agent adapters: configures agents
- Record command → Shell capture: captures processes (evidence: `README.md`)
- Record command → Filesystem capture: captures file changes (evidence: `README.md`)
- Record command → MCP capture: tees MCP traffic (evidence: `README.md`)
- Record command → TLS interception: enables optionally (evidence: `README.md`)
- Model proxy → Trace storage: records exchanges (evidence: `packages/proxy/src/server.ts`)
- Model proxy → Retrieval matching: matches retrievals (evidence: `packages/proxy/src/server.ts`)
- Model proxy → Provider translation: translates replies (evidence: `packages/proxy/src/server.ts`)
- Replay command → Trace storage: reads trace (evidence: `packages/cli/src/commands/replay.ts`)
- Replay command → Model proxy: starts replay proxy (evidence: `packages/cli/src/commands/replay.ts`)
- Replay command → Filesystem capture: captures fork changes (evidence: `packages/cli/src/commands/replay.ts`)
- Model comparison → Replay command: forks per model (evidence: `packages/cli/src/commands/compare.ts`)
- Model comparison → Provider translation: selects models (evidence: `packages/cli/src/commands/compare.ts`)
- Inspect runs → Trace storage: reads run data (evidence: `packages/cli/src/commands/inspect.ts`)
- Inspect runs → Trace viewer: renders run (evidence: `packages/cli/src/commands/inspect.ts`)
- Record command → Trace redaction: scrubs trace data
- Trace sync → Gateway service: uploads traces (evidence: `packages/cli/src/commands/sync.ts`)
- Plugin API → Model proxy: provides extensions
