# rea-githu/rea architecture

> Architecture diagram of the GitHub repository rea-githu/rea, 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/rea-githu/rea
- Repository: https://github.com/rea-githu/rea

## Overview

REA is a local MCP tool for evidence-based inspection of built applications, including native binaries, JavaScript, and Electron apps. Its documented user workflow is to install or launch the CLI, configure agent access, then ask the agent to inspect an app; optional reverse-engineering tools include Hopper, Ghidra, and IDA. The tree separates CLI, agent, JavaScript, native-tool, and Windows-host code, but the sampled source excerpts contain only filenames, so internal calls and routing cannot be verified. .NET support is documented, but no corresponding source path appears in the tree.

Main entry points: [`agent/Prompt.cpp`](https://github.com/rea-githu/rea/blob/main/agent/Prompt.cpp) (Agent prompts), [`cli/Setup.cpp`](https://github.com/rea-githu/rea/blob/main/cli/Setup.cpp) (CLI setup), [`js/Electron.cpp`](https://github.com/rea-githu/rea/blob/main/js/Electron.cpp) (Electron inspection), [`js/Pad.cpp`](https://github.com/rea-githu/rea/blob/main/js/Pad.cpp) (JS runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["CLI and setup"]
  node_cli_setup["CLI setup<br/>[Setup.cpp]"]
  node_cli_json["JSON handling<br/>[Json.cpp]"]
  node_cli_pad["CLI runtime<br/>[Pad.cpp]"]
end

subgraph group_agent["Agent interface"]
  node_agent_prompt["Agent prompts<br/>[Prompt.cpp]"]
  node_agent_skill["Agent skills<br/>[Skill.cpp]"]
  node_agent_pad["Agent runtime<br/>[Pad.cpp]"]
end

subgraph group_js["JavaScript analysis"]
  node_js_bundle["JS bundles<br/>[Bundle.h]"]
  node_js_electron["Electron inspection<br/>[Electron.cpp]"]
  node_js_web["Web inspection<br/>[Web.cpp]"]
  node_js_pad["JS runtime<br/>[Pad.cpp]"]
end

subgraph group_native["Native analysis"]
  node_ghidra["Ghidra adapter<br/>[Ghidra.cpp]"]
  node_hopper["Hopper adapter<br/>[Hopper.h]"]
  node_ida["IDA adapter<br/>[Ida.cpp]"]
  node_native_pad["Native runtime<br/>[Pad.cpp]"]
end

subgraph group_windows["Windows host"]
  node_host["Host integration<br/>[Host.cpp]"]
  node_win_pad["Windows runtime<br/>[Pad.cpp]"]
  node_win_path["Path handling<br/>[Path.cpp]"]
end

node_user(("Engineer"))
node_npx["npx installer"]
node_mcp["Local MCP"]
node_reverse_tools["Hopper / Ghidra / IDA"]

node_user -->|"runs setup"| node_npx
node_npx -.->|"starts setup"| node_cli_setup
node_user -->|"requests inspection"| node_agent_prompt
node_agent_prompt -.->|"inspects apps"| node_mcp
node_mcp -->|"supports binaries"| node_native_pad
node_mcp -->|"supports JavaScript"| node_js_pad
node_mcp -->|"supports Electron"| node_js_electron
node_reverse_tools -.->|"optional integration"| node_ghidra
node_reverse_tools -.->|"optional integration"| node_hopper
node_reverse_tools -.->|"optional integration"| node_ida

click node_cli_setup "https://github.com/rea-githu/rea/blob/main/cli/Setup.cpp"
click node_cli_json "https://github.com/rea-githu/rea/blob/main/cli/Json.cpp"
click node_cli_pad "https://github.com/rea-githu/rea/blob/main/cli/Pad.cpp"
click node_agent_prompt "https://github.com/rea-githu/rea/blob/main/agent/Prompt.cpp"
click node_agent_skill "https://github.com/rea-githu/rea/blob/main/agent/Skill.cpp"
click node_agent_pad "https://github.com/rea-githu/rea/blob/main/agent/Pad.cpp"
click node_js_bundle "https://github.com/rea-githu/rea/blob/main/js/Bundle.h"
click node_js_electron "https://github.com/rea-githu/rea/blob/main/js/Electron.cpp"
click node_js_web "https://github.com/rea-githu/rea/blob/main/js/Web.cpp"
click node_js_pad "https://github.com/rea-githu/rea/blob/main/js/Pad.cpp"
click node_ghidra "https://github.com/rea-githu/rea/blob/main/native/Ghidra.cpp"
click node_hopper "https://github.com/rea-githu/rea/blob/main/native/Hopper.h"
click node_ida "https://github.com/rea-githu/rea/blob/main/native/Ida.cpp"
click node_native_pad "https://github.com/rea-githu/rea/blob/main/native/Pad.cpp"
click node_host "https://github.com/rea-githu/rea/blob/main/win/Host.cpp"
click node_win_pad "https://github.com/rea-githu/rea/blob/main/win/Pad.cpp"
click node_win_path "https://github.com/rea-githu/rea/blob/main/win/Path.cpp"

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_setup,node_cli_json,node_cli_pad toneBlue
class node_agent_prompt,node_agent_skill,node_agent_pad toneAmber
class node_js_bundle,node_js_electron,node_js_web,node_js_pad toneMint
class node_ghidra,node_hopper,node_ida,node_native_pad toneRose
class node_host,node_win_pad,node_win_path,node_user,node_npx,node_mcp,node_reverse_tools toneIndigo
```

## Components

### CLI and setup

- [CLI setup](https://github.com/rea-githu/rea/blob/main/cli/Setup.cpp): `cli/Setup.cpp`
- [JSON handling](https://github.com/rea-githu/rea/blob/main/cli/Json.cpp): `cli/Json.cpp`
- [CLI runtime](https://github.com/rea-githu/rea/blob/main/cli/Pad.cpp): `cli/Pad.cpp`

### Agent interface

- [Agent prompts](https://github.com/rea-githu/rea/blob/main/agent/Prompt.cpp): `agent/Prompt.cpp`
- [Agent skills](https://github.com/rea-githu/rea/blob/main/agent/Skill.cpp): `agent/Skill.cpp`
- [Agent runtime](https://github.com/rea-githu/rea/blob/main/agent/Pad.cpp): `agent/Pad.cpp`

### JavaScript analysis

- [JS bundles](https://github.com/rea-githu/rea/blob/main/js/Bundle.h): `js/Bundle.h`
- [Electron inspection](https://github.com/rea-githu/rea/blob/main/js/Electron.cpp): `js/Electron.cpp`
- [Web inspection](https://github.com/rea-githu/rea/blob/main/js/Web.cpp): `js/Web.cpp`
- [JS runtime](https://github.com/rea-githu/rea/blob/main/js/Pad.cpp): `js/Pad.cpp`

### Native analysis

- [Ghidra adapter](https://github.com/rea-githu/rea/blob/main/native/Ghidra.cpp): `native/Ghidra.cpp`
- [Hopper adapter](https://github.com/rea-githu/rea/blob/main/native/Hopper.h): `native/Hopper.h`
- [IDA adapter](https://github.com/rea-githu/rea/blob/main/native/Ida.cpp): `native/Ida.cpp`
- [Native runtime](https://github.com/rea-githu/rea/blob/main/native/Pad.cpp): `native/Pad.cpp`

### Windows host

- [Host integration](https://github.com/rea-githu/rea/blob/main/win/Host.cpp): `win/Host.cpp`
- [Windows runtime](https://github.com/rea-githu/rea/blob/main/win/Pad.cpp): `win/Pad.cpp`
- [Path handling](https://github.com/rea-githu/rea/blob/main/win/Path.cpp): `win/Path.cpp`

### Other components

- **Engineer**
- **npx installer**
- **Local MCP**
- **Hopper / Ghidra / IDA**

## Connections

- Engineer → npx installer: runs setup (evidence: `README.md`)
- npx installer → CLI setup: starts setup
- Engineer → Agent prompts: requests inspection (evidence: `README.md`)
- Agent prompts → Local MCP: inspects apps
- Local MCP → Native runtime: supports binaries (evidence: `README.md`)
- Local MCP → JS runtime: supports JavaScript (evidence: `README.md`)
- Local MCP → Electron inspection: supports Electron (evidence: `README.md`)
- Hopper / Ghidra / IDA → Ghidra adapter: optional integration (evidence: `README.md`)
- Hopper / Ghidra / IDA → Hopper adapter: optional integration (evidence: `README.md`)
- Hopper / Ghidra / IDA → IDA adapter: optional integration (evidence: `README.md`)
