graph TD
subgraph "Entry Points"
CLI["src/cli.ts
One-shot CLI adapter
setup, diagnostics, analysis, decompilation"]
MAIN["src/main.ts
MCP stdio server adapter
config, session, process lifetime"]
DISPATCH["scripts/rea.mjs
Executable dispatcher
routes mcp / one-shot"]
end
subgraph "Adapters"
SERVER["src/server/
MCP request translation
createServer, tool registration, toolResult"]
HOPPER_BRIDGE["bridge/hopper_bridge.py
Runs inside Hopper
adapts operations to Hopper Python API"]
GHIDRA_BRIDGE["bridge/ghidra/ReaGhidraBridge.java
Packaged HeadlessScript
inventory, decompiler, references, CFG"]
INSTALL["Host installation adapters
macOS: verified vendor DMG to ~/Applications
Linux: verified vendor package + apt/dnf/pacman"]
end
subgraph "Application Layer"
APP["src/application/
Shared CLI/MCP workflows
enhanced analysis and investigations"]
SESSION["SessionProviderRouter + BinarySession
one immutable deep binding per target
disjoint auxiliary routing"]
REGISTRY["AnalysisProviderRegistry
sorted deep candidates
deterministic selection, no fallback"]
WORKSPACE["Investigation workspace store
approved roots, canonical JSON
atomic CAS revisions and locks"]
JS_RECON["JavaScript artifact reconstruction
bounded directory/ASAR reads
AST-only bundle projection"]
end
subgraph "Provider Layers"
HOPPER["src/hopper/
Hopper launch & Unix-socket protocol
BridgeLauncher, HopperClient, protocol"]
GHIDRA["src/ghidra/
Ghidra discovery, profile & function analysis
snapshot, Unix/Windows transport, bounded lifecycle"]
AUX["src/artifacts/ + src/native/
disjoint artifact and native capabilities"]
BROWSER["src/browser/
Loopback CDP transport
exact-origin passive observation"]
REPLAY["src/replay/
Disposable JavaScript worker
Bubblewrap, seccomp, cgroup limits"]
end
subgraph "Provider Process Foundation"
PROCESS["src/process/
owned process groups, private roots
deadlines, bounded diagnostics, cleanup"]
end
subgraph "Contracts Layer"
CONTRACTS["src/contracts/
Caller-visible schemas for analysis, managed, browser, Electron, application, and session tools"]
end
subgraph "Domain Layer"
DOMAIN["src/domain/
Pure side-effect-free modules
evidence, comparisons, application graphs, workspace commitments"]
end
subgraph "Configuration"
CONFIG["src/config.ts
Zod-validated env parsing
provider settings, origins, and approved roots"]
end
subgraph "Tests"
TESTS["tests/
Vitest suite
fixtures/ holds fake launcher, bridge, and CDP seams"]
end
DISPATCH --> CLI
DISPATCH --> MAIN
MAIN --> CONFIG
MAIN --> SERVER
MAIN --> APP
CLI --> APP
APP --> SESSION
SESSION --> REGISTRY
REGISTRY --> HOPPER
REGISTRY --> GHIDRA
SESSION --> AUX
APP --> WORKSPACE
APP --> JS_RECON
APP --> INSTALL
SERVER --> CONTRACTS
SERVER --> APP
APP --> BROWSER
APP --> REPLAY
HOPPER --> HOPPER_BRIDGE
GHIDRA --> GHIDRA_BRIDGE
HOPPER --> PROCESS
GHIDRA --> PROCESS
APP --> PROCESS
APP --> DOMAIN
JS_RECON --> AUX
JS_RECON --> DOMAIN
CONTRACTS --> DOMAIN
HOPPER --> DOMAIN
GHIDRA --> DOMAIN
AUX --> DOMAIN
BROWSER --> DOMAIN
REPLAY --> DOMAIN
PROCESS --> DOMAIN
TESTS -.-> MAIN
TESTS -.-> HOPPER
TESTS -.-> GHIDRA
TESTS -.-> PROCESS
TESTS -.-> BROWSER
TESTS -.-> REPLAY