rea-agents 1.7.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/README.md +112 -59
  2. package/bridge/ghidra/ReaGhidraBridge.java +96 -11
  3. package/dist/application/ArtifactExtraction.js +1 -1
  4. package/dist/application/ArtifactInventory/classify.js +42 -0
  5. package/dist/application/ArtifactInventory/hash.js +43 -0
  6. package/dist/application/ArtifactInventory/reader.js +41 -0
  7. package/dist/application/ArtifactInventory/scanCanonical.js +155 -0
  8. package/dist/application/ArtifactInventory/scanReader.js +124 -0
  9. package/dist/application/ArtifactInventory/types.js +10 -0
  10. package/dist/application/ArtifactInventory.js +9 -351
  11. package/dist/application/AuthorizedArtifactInventory.js +2 -2
  12. package/dist/application/BinarySession.js +47 -270
  13. package/dist/application/BinarySessionExecution.js +28 -0
  14. package/dist/application/BinarySessionOpen.js +39 -0
  15. package/dist/application/BinarySessionRecords.js +149 -0
  16. package/dist/application/BinarySessionStatus.js +75 -0
  17. package/dist/application/CapabilityInventory.js +42 -2
  18. package/dist/application/ClientRegistrationStatus.js +1 -1
  19. package/dist/application/CrossVersionInventory.js +8 -2
  20. package/dist/application/CrossVersionInvestigation.js +11 -29
  21. package/dist/application/CrossVersionInvestigationCollections.js +23 -0
  22. package/dist/application/DirectAnalysis.js +47 -44
  23. package/dist/application/Doctor.js +165 -197
  24. package/dist/application/DoctorDiagnostics.js +180 -0
  25. package/dist/application/ElectronBoundaryAnalysis.js +112 -0
  26. package/dist/application/ElectronBoundaryGraph.js +9 -0
  27. package/dist/application/ElectronBoundaryGraphContext.js +62 -0
  28. package/dist/application/ElectronBoundaryGraphIpc.js +242 -0
  29. package/dist/application/ElectronBoundaryGraphNative.js +86 -0
  30. package/dist/application/ElectronBoundaryGraphWindows.js +223 -0
  31. package/dist/application/EnhancedToolPagination.js +22 -0
  32. package/dist/application/EnhancedToolTypes.js +4 -0
  33. package/dist/application/EnhancedTools.js +58 -50
  34. package/dist/application/InstrumentedJavaScriptReplayHost.js +36 -0
  35. package/dist/application/InvestigationProviders.js +30 -0
  36. package/dist/application/InvestigationWorkspaceStore.js +24 -10
  37. package/dist/application/JavaScriptApplicationEvidence.js +26 -0
  38. package/dist/application/JavaScriptApplicationEvidenceGraph.js +89 -0
  39. package/dist/application/JavaScriptApplicationService.js +74 -0
  40. package/dist/application/JavaScriptApplicationWorkflowEvidence.js +29 -0
  41. package/dist/application/JavaScriptApplicationWorkflowService.js +90 -0
  42. package/dist/application/JavaScriptArtifactAnalysis.js +52 -7
  43. package/dist/application/JavaScriptArtifactFiles.js +6 -2
  44. package/dist/application/JavaScriptArtifactGraphBuilder.js +82 -17
  45. package/dist/application/JavaScriptArtifactGraphBundlers.js +225 -0
  46. package/dist/application/JavaScriptArtifactGraphContext.js +37 -36
  47. package/dist/application/JavaScriptArtifactGraphDocuments.js +27 -4
  48. package/dist/application/JavaScriptArtifactGraphEvidence.js +24 -14
  49. package/dist/application/JavaScriptArtifactGraphFindings.js +54 -8
  50. package/dist/application/JavaScriptArtifactGraphStructure.js +29 -101
  51. package/dist/application/JavaScriptArtifactPathResolution.js +269 -0
  52. package/dist/application/JavaScriptArtifactReconstruction.js +4 -1
  53. package/dist/application/JavaScriptArtifactReconstructionInput.js +2 -83
  54. package/dist/application/JavaScriptJsonModules.js +39 -0
  55. package/dist/application/JavaScriptModuleRelationships.js +262 -0
  56. package/dist/application/JavaScriptReplayPermission.js +16 -0
  57. package/dist/application/JavaScriptReplayPlanning.js +201 -0
  58. package/dist/application/JavaScriptReplayService.js +292 -0
  59. package/dist/application/JavaScriptRuntimeReconciliationEvidence.js +25 -0
  60. package/dist/application/JavaScriptRuntimeReconciliationService.js +27 -0
  61. package/dist/application/LinuxHopper.js +10 -0
  62. package/dist/application/MacHopper.js +22 -11
  63. package/dist/application/ManagedApplicationGraphService.js +55 -0
  64. package/dist/application/ManagedMemberComparisonService.js +122 -0
  65. package/dist/application/ManagedNativeVerificationService.js +39 -0
  66. package/dist/application/ManagedReconstructionService.js +58 -0
  67. package/dist/application/ManagedRuntimeCorrelationService.js +103 -0
  68. package/dist/application/NodeRuntimeCharacterizationService.js +196 -0
  69. package/dist/application/PermissionAuthority.js +106 -63
  70. package/dist/application/ProcessCaptureCapability.js +1 -1
  71. package/dist/application/ProcessCapturePermission.js +13 -0
  72. package/dist/application/ProcessCli.js +2 -12
  73. package/dist/application/ProcessHarness.js +1 -1
  74. package/dist/application/ProcessSampling.js +15 -11
  75. package/dist/application/ProjectPermissionStore.js +49 -9
  76. package/dist/application/RealHopperAssertions.js +76 -0
  77. package/dist/application/ReconstructionCoverageService.js +69 -0
  78. package/dist/application/ReconstructionCoverageWorkspaceStore.js +31 -0
  79. package/dist/application/RuntimeExecutableDiagnostics.js +172 -0
  80. package/dist/application/Setup.js +147 -259
  81. package/dist/application/SetupClientConfiguration.js +220 -0
  82. package/dist/application/SetupClients.js +24 -2
  83. package/dist/application/SetupPlan.js +123 -12
  84. package/dist/application/SetupSkill.js +26 -12
  85. package/dist/application/SupportedClients.js +1 -0
  86. package/dist/application/Uninstall.js +6 -3
  87. package/dist/application/WindowsCapabilities.js +86 -0
  88. package/dist/application/runtime.js +2 -0
  89. package/dist/artifacts/AsarArtifactReader.js +11 -0
  90. package/dist/browser/BrowserProcessStartup.js +88 -0
  91. package/dist/browser/CdpCaptureDocuments.js +12 -8
  92. package/dist/browser/CdpCaptureEventBodyShapes.js +75 -0
  93. package/dist/browser/CdpCaptureEventHandlers.js +336 -0
  94. package/dist/browser/CdpCaptureEventHelpers.js +71 -0
  95. package/dist/browser/CdpCaptureEventState.js +1 -0
  96. package/dist/browser/CdpCaptureEventTypes.js +1 -0
  97. package/dist/browser/CdpCaptureEvents.js +46 -464
  98. package/dist/browser/CdpElectronInspection.js +106 -162
  99. package/dist/browser/CdpElectronProvider.js +5 -1
  100. package/dist/browser/CdpElectronScriptEvents.js +69 -0
  101. package/dist/browser/CdpElectronScripts.js +94 -0
  102. package/dist/browser/CdpElectronWorkers.js +56 -0
  103. package/dist/browser/CdpObservationSession.js +51 -8
  104. package/dist/browser/CdpPageCapture.js +12 -129
  105. package/dist/browser/CdpPageCaptureScripts.js +97 -0
  106. package/dist/browser/CdpPageCaptureWorkers.js +46 -0
  107. package/dist/browser/CdpWebMcpDiscovery.js +38 -14
  108. package/dist/browser/PngVisualDiff.js +9 -2
  109. package/dist/catalogIdentity.js +8 -1
  110. package/dist/cli/artifactCommands.js +82 -0
  111. package/dist/cli/coreAnalysisCommands.js +232 -0
  112. package/dist/cli/managedCommands.js +397 -0
  113. package/dist/cli/managedProjectGraphCommand.js +24 -0
  114. package/dist/cli/options.js +9 -0
  115. package/dist/cli/setupCommands.js +108 -0
  116. package/dist/cli/types.js +1 -0
  117. package/dist/cli/utilityCommands.js +122 -0
  118. package/dist/cli.js +13 -383
  119. package/dist/cliApplicationCommands.js +176 -0
  120. package/dist/cliBrowserAdvancedCommands.js +73 -16
  121. package/dist/cliBrowserCommands.js +39 -115
  122. package/dist/cliCommandNames.js +17 -0
  123. package/dist/cliElectronCommands.js +100 -27
  124. package/dist/cliEvidenceCommands.js +13 -2
  125. package/dist/cliInvestigationCommands.js +53 -10
  126. package/dist/cliJsonInput.js +54 -0
  127. package/dist/cliObservationOptions.js +137 -0
  128. package/dist/cliPolicyCommands.js +80 -46
  129. package/dist/cliSetup.js +289 -0
  130. package/dist/config/environment.js +107 -0
  131. package/dist/config/parseConfig.js +228 -0
  132. package/dist/config/parsers.js +68 -0
  133. package/dist/config/permissions.js +30 -0
  134. package/dist/config/types.js +1 -0
  135. package/dist/config.js +1 -292
  136. package/dist/contracts/applicationToolContracts.js +225 -0
  137. package/dist/contracts/artifactToolContracts.js +5 -9
  138. package/dist/contracts/browserToolContracts.js +14 -62
  139. package/dist/contracts/electronToolContracts.js +45 -19
  140. package/dist/contracts/errorSchemas.js +1 -0
  141. package/dist/contracts/investigationExamples.js +0 -6
  142. package/dist/contracts/javascriptApplicationWorkflowExamples.js +46 -0
  143. package/dist/contracts/javascriptRuntimeReconciliationExample.js +208 -0
  144. package/dist/contracts/managedToolContracts.js +153 -0
  145. package/dist/contracts/managedWorkflowExamples.js +346 -0
  146. package/dist/contracts/managedWorkflowToolContracts.js +203 -0
  147. package/dist/contracts/nativeToolContracts.js +2 -6
  148. package/dist/contracts/promptContracts.js +18 -2
  149. package/dist/contracts/providerSelection.js +2 -0
  150. package/dist/contracts/toolContractExamples.js +10 -25
  151. package/dist/contracts/toolContracts.js +49 -47
  152. package/dist/contracts/toolEffects.js +174 -0
  153. package/dist/contracts/toolOutputSchemaGroups.js +232 -0
  154. package/dist/contracts/toolOutputSchemaPrimitives.js +327 -0
  155. package/dist/contracts/toolOutputSchemas.js +2 -535
  156. package/dist/doctorRuntime.js +42 -1
  157. package/dist/domain/analysisErrorPresentation.js +234 -0
  158. package/dist/domain/analysisErrorProjection.js +284 -0
  159. package/dist/domain/artifactComparison.js +37 -19
  160. package/dist/domain/binaryTarget.js +87 -37
  161. package/dist/domain/browserObservation.js +1 -282
  162. package/dist/domain/browserObservationSchemas.js +286 -0
  163. package/dist/domain/bundleComparison.js +4 -4
  164. package/dist/domain/electronObservation.js +13 -0
  165. package/dist/domain/electronStaticAnalysis.js +9 -0
  166. package/dist/domain/electronStaticAnalysisBrowser.js +206 -0
  167. package/dist/domain/electronStaticAnalysisIpc.js +171 -0
  168. package/dist/domain/electronStaticAnalysisNative.js +164 -0
  169. package/dist/domain/electronStaticAnalysisTypes.js +1 -0
  170. package/dist/domain/electronStaticAnalysisValues.js +103 -0
  171. package/dist/domain/errors.js +32 -448
  172. package/dist/domain/functionComparison.js +4 -165
  173. package/dist/domain/functionComparisonDimensions.js +164 -0
  174. package/dist/domain/functionComparisonSchemas.js +3 -8
  175. package/dist/domain/inputIssueProjection.js +52 -0
  176. package/dist/domain/javascriptApplicationAnalysis.js +155 -0
  177. package/dist/domain/javascriptApplicationChangeGraph.js +231 -0
  178. package/dist/domain/javascriptApplicationEvidenceSchemas.js +18 -0
  179. package/dist/domain/javascriptApplicationGraph.js +2 -1
  180. package/dist/domain/javascriptApplicationGraphSchemas.js +7 -0
  181. package/dist/domain/javascriptApplicationVersionComparison.js +116 -0
  182. package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +139 -0
  183. package/dist/domain/javascriptApplicationVersionItems.js +233 -0
  184. package/dist/domain/javascriptApplicationVersionKeys.js +170 -0
  185. package/dist/domain/javascriptExportInstrumentation.js +97 -0
  186. package/dist/domain/javascriptFeatureSeed.js +140 -0
  187. package/dist/domain/javascriptFeatureTrace.js +232 -0
  188. package/dist/domain/javascriptFeatureTraceSchemas.js +136 -0
  189. package/dist/domain/javascriptFeatureTraversal.js +100 -0
  190. package/dist/domain/javascriptNativeHandoff.js +85 -0
  191. package/dist/domain/javascriptReplay.js +361 -0
  192. package/dist/domain/javascriptRuntimeLoadState.js +106 -0
  193. package/dist/domain/javascriptRuntimeReconciliation.js +42 -0
  194. package/dist/domain/javascriptRuntimeReconciliationGraph.js +169 -0
  195. package/dist/domain/javascriptRuntimeReconciliationMatching.js +247 -0
  196. package/dist/domain/javascriptRuntimeReconciliationParsing.js +160 -0
  197. package/dist/domain/javascriptRuntimeReconciliationResult.js +119 -0
  198. package/dist/domain/javascriptRuntimeReconciliationRuntime.js +316 -0
  199. package/dist/domain/javascriptRuntimeReconciliationSchemas.js +245 -0
  200. package/dist/domain/javascriptRuntimeStaticCandidates.js +193 -0
  201. package/dist/domain/javascriptSemanticAnalysis.js +386 -0
  202. package/dist/domain/javascriptSemanticIr.js +30 -0
  203. package/dist/domain/javascriptSemanticProjection.js +366 -0
  204. package/dist/domain/javascriptSemanticState.js +40 -0
  205. package/dist/domain/javascriptSemanticTraversal.js +22 -0
  206. package/dist/domain/javascriptSemanticValues.js +352 -0
  207. package/dist/domain/javascriptStaticAnalysis.js +26 -254
  208. package/dist/domain/javascriptStaticAnalysisBundler.js +209 -0
  209. package/dist/domain/javascriptStaticAnalysisCalls.js +180 -0
  210. package/dist/domain/javascriptStaticAnalysisFindings.js +39 -0
  211. package/dist/domain/javascriptStaticAnalysisHelpers.js +81 -2
  212. package/dist/domain/javascriptStaticAnalysisState.js +6 -0
  213. package/dist/domain/knownPageCoverage.js +21 -0
  214. package/dist/domain/managedApplicationGraph.js +206 -0
  215. package/dist/domain/managedApplicationGraphCoverage.js +170 -0
  216. package/dist/domain/managedApplicationGraphNodeCoverage.js +6 -0
  217. package/dist/domain/managedApplicationGraphNodes.js +336 -0
  218. package/dist/domain/managedArtifact.js +452 -0
  219. package/dist/domain/managedMemberComparison.js +211 -0
  220. package/dist/domain/managedMemberComparisonCoverage.js +72 -0
  221. package/dist/domain/managedMemberComparisonMatch.js +356 -0
  222. package/dist/domain/managedNativeVerification.js +46 -0
  223. package/dist/domain/managedNativeVerificationMatch.js +272 -0
  224. package/dist/domain/managedNativeVerificationSchemas.js +141 -0
  225. package/dist/domain/managedReconstruction.js +196 -0
  226. package/dist/domain/managedRuntimeCorrelation.js +184 -0
  227. package/dist/domain/nodeRuntimeCharacterization.js +66 -0
  228. package/dist/domain/permissionPolicy.js +2 -0
  229. package/dist/domain/reconstructionCoverage.js +387 -0
  230. package/dist/domain/reconstructionCoverageEvaluation.js +212 -0
  231. package/dist/domain/reconstructionVerificationSchemas.js +9 -3
  232. package/dist/domain/runtimeCharacterization.js +85 -0
  233. package/dist/domain/webBundleAnalyzer.js +3 -409
  234. package/dist/domain/webBundleAnalyzerAst.js +77 -0
  235. package/dist/domain/webBundleAnalyzerInspection.js +307 -0
  236. package/dist/domain/webBundleAnalyzerResult.js +120 -0
  237. package/dist/dotnet/ManagedArtifactInspector.js +339 -0
  238. package/dist/dotnet/ManagedMemberInspector.js +153 -0
  239. package/dist/dotnet/ManagedMemberInspectorCore.js +297 -0
  240. package/dist/dotnet/ManagedMemberInstructionDecoder.js +427 -0
  241. package/dist/dotnet/ManagedMemberRows.js +120 -0
  242. package/dist/dotnet/ManagedMetadataHeaps.js +131 -0
  243. package/dist/dotnet/ManagedMetadataInventory.js +104 -0
  244. package/dist/dotnet/ManagedMetadataInventoryRows.js +292 -0
  245. package/dist/dotnet/ManagedMetadataLayout.js +259 -0
  246. package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
  247. package/dist/dotnet/ManagedMethodBodyReader.js +143 -0
  248. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +311 -0
  249. package/dist/dotnet/ManagedNativeBoundaryInspector.js +143 -0
  250. package/dist/dotnet/ManagedPeReader.js +188 -0
  251. package/dist/dotnet/ManagedReaderFailure.js +10 -0
  252. package/dist/dotnet/ManagedStaticProvider.js +203 -0
  253. package/dist/generatedPackageMetadata.js +2 -2
  254. package/dist/ghidra/GhidraClient.js +76 -91
  255. package/dist/ghidra/GhidraClientStartup.js +29 -0
  256. package/dist/ghidra/GhidraClientWire.js +34 -0
  257. package/dist/ghidra/GhidraDefaults.js +1 -1
  258. package/dist/ghidra/GhidraDiagnostics.js +6 -1
  259. package/dist/ghidra/GhidraInstallation.js +20 -15
  260. package/dist/ghidra/GhidraLauncher.js +93 -29
  261. package/dist/ghidra/GhidraProvider.js +67 -161
  262. package/dist/ghidra/GhidraProviderCapabilities.js +173 -0
  263. package/dist/ghidra/GhidraSessionValues.js +2 -0
  264. package/dist/ghidra/GhidraSocketConnection.js +44 -7
  265. package/dist/ghidra/GhidraTargetSnapshot.js +30 -0
  266. package/dist/ghidra/GhidraTransport.js +71 -0
  267. package/dist/identity.js +3 -2
  268. package/dist/main/messages.js +5 -0
  269. package/dist/main/reload.js +49 -0
  270. package/dist/main/shutdown.js +25 -0
  271. package/dist/main/startup.js +14 -0
  272. package/dist/main/state.js +26 -0
  273. package/dist/main/transport.js +61 -0
  274. package/dist/main/types.js +1 -0
  275. package/dist/main.js +35 -132
  276. package/dist/process/PrivateRuntimeRoot.js +3 -2
  277. package/dist/process/ProcessOwnership.js +35 -0
  278. package/dist/process/ProviderProcess.js +2 -0
  279. package/dist/replay/JavaScriptReplayWorker.js +300 -0
  280. package/dist/replay/LinuxJavaScriptReplayRunner.js +217 -0
  281. package/dist/replay/LinuxJavaScriptReplaySandbox.js +140 -0
  282. package/dist/replay/LinuxRuntimeClosure.js +46 -0
  283. package/dist/replay/LinuxSeccompPolicy.js +40 -0
  284. package/dist/replay/ReplayOutcome.js +95 -0
  285. package/dist/replay/ReplayProcessLifecycle.js +71 -0
  286. package/dist/replay/ReplayWorkerProtocol.js +55 -0
  287. package/dist/replay/SystemJavaScriptReplayHost.js +182 -0
  288. package/dist/server/ProcessCaptureElicitation.js +157 -0
  289. package/dist/server/createServer.js +158 -41
  290. package/dist/server/registerApplicationTools/characterization.js +57 -0
  291. package/dist/server/registerApplicationTools/compareVersions.js +34 -0
  292. package/dist/server/registerApplicationTools/controlledReplay.js +38 -0
  293. package/dist/server/registerApplicationTools/coverage.js +84 -0
  294. package/dist/server/registerApplicationTools/helpers.js +42 -0
  295. package/dist/server/registerApplicationTools/traceFeature.js +26 -0
  296. package/dist/server/registerApplicationTools/types.js +1 -0
  297. package/dist/server/registerApplicationTools.js +13 -0
  298. package/dist/server/registerArtifactComparisonTool.js +16 -9
  299. package/dist/server/registerBrowserTools.js +61 -60
  300. package/dist/server/registerBundleComparisonTool.js +17 -20
  301. package/dist/server/registerElectronTools.js +39 -12
  302. package/dist/server/registerEnhancedTools.js +52 -15
  303. package/dist/server/registerEvidenceResources.js +54 -0
  304. package/dist/server/registerEvidenceTools.js +5 -1
  305. package/dist/server/registerFunctionComparisonTool.js +14 -7
  306. package/dist/server/registerInvestigationTools/helpers.js +74 -0
  307. package/dist/server/registerInvestigationTools/types.js +1 -0
  308. package/dist/server/registerInvestigationTools.js +103 -132
  309. package/dist/server/registerManagedTools.js +6 -0
  310. package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +65 -0
  311. package/dist/server/registerManagedWorkflowTools/contract.js +8 -0
  312. package/dist/server/registerManagedWorkflowTools/evidence.js +43 -0
  313. package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +39 -0
  314. package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +39 -0
  315. package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +52 -0
  316. package/dist/server/registerManagedWorkflowTools/types.js +1 -0
  317. package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +75 -0
  318. package/dist/server/registerManagedWorkflowTools.js +13 -0
  319. package/dist/server/registerOfficialTools.js +81 -67
  320. package/dist/server/registerProcessComparisonTool.js +25 -47
  321. package/dist/server/registerSessionRecordTools.js +137 -0
  322. package/dist/server/registerSessionStatusTool.js +9 -8
  323. package/dist/server/registerSessionTools.js +77 -216
  324. package/dist/server/sessionAvailabilityPolicy.js +10 -0
  325. package/dist/server/sessionEvidence.js +14 -19
  326. package/dist/server/toolInputValidation.js +77 -0
  327. package/dist/server/toolRegistrationOptions.js +177 -2
  328. package/dist/server/toolResult.js +30 -17
  329. package/package.json +21 -14
  330. package/scripts/rea.mjs +1 -1
  331. package/skills/{rea-analysis → reverse-engineer-anything}/SKILL.md +75 -6
  332. package/scripts/prepare-node-pty.mjs +0 -35
  333. package/scripts/rebuild-native.mjs +0 -22
package/README.md CHANGED
@@ -10,11 +10,11 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/rea-agents?style=flat-square&color=cb3837)](https://www.npmjs.com/package/rea-agents)
12
12
  [![CI](https://img.shields.io/github/actions/workflow/status/morluto/rea/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/morluto/rea/actions/workflows/ci.yml)
13
- [![78 MCP tools](https://img.shields.io/badge/MCP_tools-78-5c4ee5?style=flat-square)](#78-tools-for-investigation)
13
+ [![MCP tool catalog](https://img.shields.io/badge/MCP-tool_catalog-5c4ee5?style=flat-square)](#tool-catalog-for-investigation)
14
14
  [![Node.js 22+](https://img.shields.io/badge/Node.js-22.19%2B-339933?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
15
15
  [![MIT license](https://img.shields.io/badge/license-MIT-f4c430?style=flat-square)](LICENSE)
16
16
 
17
- [Quick start](#quick-start) · [Current status](#current-status) · [Investigation model](#the-investigation-model) · [78 tools](#78-tools-for-investigation) · [Roadmap](#roadmap) · [How it works](#how-it-works)
17
+ [Quick start](#quick-start) · [Current status](#current-status) · [Investigation model](#the-investigation-model) · [Tool catalog](#tool-catalog-for-investigation) · [Roadmap](#roadmap) · [How it works](#how-it-works)
18
18
 
19
19
  <br />
20
20
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  See a feature in an app that you want in your own product? Give the app to your agent—even without its source code. With REA, the agent can investigate the feature, explain how it works, show its evidence, and build a version adapted to your stack and requirements.
32
32
 
33
- REA gives agents one consistent way to investigate software. Today that includes deep native analysis and function dossiers through Hopper or bring-your-own Ghidra on Linux, reproducible Evidence v2 records, controlled process capture, passive website and Electron observation, bounded JavaScript/source-map reconstruction, and a versioned domain graph for connecting JavaScript application layers without confusing static inference with runtime observation. The longer-term toolkit extends the same agent workflow to APIs, protocols, mobile artifacts, firmware, richer runtime behavior, and differences between versions.
33
+ REA gives agents one consistent way to investigate software. Today that includes deep native analysis and function dossiers through Hopper or bring-your-own Ghidra on Linux, plus an experimental Windows x64 Ghidra P0 for approved native PE applications; execution-free managed PE/CLI triage; reproducible Evidence v2 records; controlled process capture; passive website and Electron observation; bounded JavaScript/source-map reconstruction; and a versioned domain graph for connecting JavaScript application layers without confusing static inference with runtime observation. The longer-term toolkit extends the same agent workflow to APIs, protocols, mobile artifacts, firmware, richer runtime behavior, and differences between versions.
34
34
 
35
35
  Reverse engineering normally makes the operator choose a tool, learn its API, move evidence between programs, and decide what to inspect next. REA gives that work to the agent through commands, skills, structured results, and repeatable investigation workflows.
36
36
 
@@ -85,17 +85,41 @@ REA shows how it reached its conclusions. It does not claim to recover original
85
85
 
86
86
  ## Quick start
87
87
 
88
- ### Install the CLI — recommended
88
+ ### Run setup — recommended
89
89
 
90
90
  ```bash
91
- npm install --global rea-agents
92
- rea setup
91
+ npx rea-agents setup
93
92
  ```
94
93
 
95
- Installing the CLI does not update Homebrew, Node.js, npm, Hopper, or agent configuration. `rea setup` detects what is already present, prints every proposed change, and asks before applying it.
94
+ The npm package-runner prompt, when shown, approves downloading REA for this
95
+ invocation; it does not approve any setup changes. The REA wizard separately
96
+ shows its complete plan and asks before applying it. Setup does not update
97
+ Homebrew, Node.js, or npm. `npx rea-agents setup` opens with the work it
98
+ enables: investigate local apps from an agent, recover evidence through a
99
+ deep-analysis provider, and reuse REA's guided workflow. It summarizes the
100
+ detected agents, then asks which independent capabilities to set up: coding-agent
101
+ access through MCP, the shared investigation skill, and—when needed—the Hopper
102
+ provider. Nothing is preselected. Choosing MCP access opens a second empty
103
+ checklist for the specific detected agents that should receive a registration.
104
+
105
+ REA keeps the journey inline so its history remains in the terminal. Selecting
106
+ a capability does not select every detected target or authorize a change.
107
+ Before anything changes, REA validates existing configuration, prints exact
108
+ paths and external effects, and asks for final approval with **No** as the
109
+ default. The screen keeps the available keys visible while you choose; Ctrl-C
110
+ and declining leave the system unchanged.
96
111
 
97
112
  REA detects Claude Code, Claude Desktop, Codex, Cursor, Gemini CLI, Windsurf, and Devin. It configures the first six when detected; Devin is reported but left unchanged because it has no documented local MCP configuration boundary. Registrations are additive, backup-first, and read back after writing. You can safely rerun setup.
98
113
 
114
+ Use `rea setup --dry-run` to inspect the plan, repeat `--client` to select exact
115
+ agents, and `--accessible` for sequential vertical prompts. Machine output
116
+ remains available through `--json`; prompt UI and progress go to stderr.
117
+
118
+ After a successful setup, REA reports the capabilities now ready to use and a
119
+ concrete next step, such as restarting a configured agent before asking it to
120
+ investigate an application. It does not claim an integration or provider is
121
+ ready unless setup and its final diagnostic check verified it.
122
+
99
123
  An optional curl wrapper installs the same CLI package and starts setup only when a terminal is available:
100
124
 
101
125
  ```bash
@@ -117,9 +141,9 @@ Review the setup plan, approve it if appropriate, then describe the app or featu
117
141
  ### From Terminal — no installation
118
142
 
119
143
  ```bash
120
- npx -y rea-agents setup
121
- npx -y rea-agents doctor
122
- npx -y rea-agents analyze /Applications/Notes.app
144
+ npx rea-agents setup
145
+ npx -y rea-agents@latest doctor
146
+ npx -y rea-agents@latest analyze /Applications/Notes.app
123
147
  ```
124
148
 
125
149
  Review the setup plan before confirming it. Restart a configured agent so it loads REA.
@@ -146,10 +170,16 @@ an unrelated global package.
146
170
 
147
171
  Choose either the no-install commands or the global installation. You do not need both.
148
172
 
173
+ `npm install rea-agents` without `--global` installs `rea` only into the
174
+ current project's `node_modules/.bin`; it does not add `rea` to your shell
175
+ `PATH`. Use the `npx` commands above for one-off runs or `--global` when you
176
+ want a shell-visible `rea` command.
177
+
149
178
  ### Requirements
150
179
 
151
180
  - macOS 12 or newer
152
181
  - Ubuntu 24.04+, Fedora 41+, or 64-bit Arch Linux
182
+ - Windows x64 for the experimental, Ghidra-only native PE P0 boundary
153
183
  - Node.js 22.19+ or 24.11+ (including newer releases)
154
184
  - npm; REA does not require or install a particular npm version
155
185
 
@@ -158,7 +188,7 @@ Deep binary operations use [Hopper](https://www.hopperapp.com/), a separate desk
158
188
  If something is not working, run:
159
189
 
160
190
  ```bash
161
- npx -y rea-agents doctor
191
+ npx -y rea-agents@latest doctor
162
192
  ```
163
193
 
164
194
  `rea doctor --json` is read-only and distinguishes unsupported hosts, missing dependencies, a missing local analysis engine, configuration drift, and healthy checks. Paid-license activation is optional: on Linux, REA runs the supported Hopper demo build on a private Xvfb display and selects Hopper's offered demo mode for each analysis session.
@@ -188,7 +218,7 @@ REA defaults `HOPPER_LAUNCHER_PATH` to `/Applications/Hopper Disassembler.app/Co
188
218
 
189
219
  ### Ghidra read-only analysis provider
190
220
 
191
- The current Ghidra adapter supports the exact official Ghidra 12.1.2 release on Linux x64 with a 64-bit full JDK 21. Download and extract those projects yourself, then configure absolute paths:
221
+ The Ghidra adapter supports the exact official Ghidra 12.1.2 release with a 64-bit full JDK 21 on Linux x64. It also provides an experimental Windows x64 P0 limited to approved native x86-64 PE applications. Download and extract those projects yourself, then configure absolute paths:
192
222
 
193
223
  ```bash
194
224
  export GHIDRA_INSTALL_DIR=/absolute/path/to/ghidra_12.1.2_PUBLIC
@@ -200,7 +230,9 @@ rea providers --json
200
230
 
201
231
  Doctor distinguishes missing configuration, a bad installation root, the wrong Ghidra or Java version, a JRE without `javac`, a missing `support/analyzeHeadless`, and an unsupported platform or architecture. Approved setup only copies the verified non-secret paths into detected MCP registrations; it does not modify the Ghidra installation or install/download Ghidra or Java.
202
232
 
203
- REA loads its packaged Java `HeadlessScript` with `-scriptPath`, imports the target into a mode-0700 temporary project, enables `-readOnly` and `-deleteProject`, caps auto-analysis at 300 seconds with two CPUs and a 2 GiB Java heap, and authenticates every request over a mode-0600 Unix socket. It isolates Ghidra home/cache/config/temp paths and removes the owned project, socket, process group, and runtime root on close, cancellation, timeout, or process exit.
233
+ On Windows, set the same variables in PowerShell and run `rea doctor --json`; automated `rea setup` and Hopper installation remain unavailable. The P0 target boundary rejects DLLs, managed PE files, non-x86-64 images, mutable/hostile inputs, and non-PE formats. See the [Windows Ghidra P0 operations guide](docs/windows-ghidra-p0.md) for registration, exact limitations, CI evidence, and acceptance gates.
234
+
235
+ REA loads its packaged Java `HeadlessScript` with `-scriptPath`, copies and digest-verifies the target in an ephemeral runtime, enables `-readOnly` and `-deleteProject`, caps auto-analysis at 300 seconds with two CPUs and a 2 GiB Java heap, and authenticates every request. Linux uses a mode-0600 Unix socket. Windows P0 uses token-authenticated IPv4 loopback and a token-free endpoint record because Node path-based IPC does not connect to Java AF_UNIX sockets on Windows. The bridge verifies Ghidra's imported-byte SHA-256 before serving any operation.
204
236
 
205
237
  The Ghidra adapter declares 18 direct and enhanced operations. Its ten inventory operations are `list_documents`, `list_procedures`, `list_strings`, `list_names`, `list_segments`, `address_name`, `procedure_address`, `resolve_containing_procedure`, `search_procedures`, and `search_strings`. It also admits `procedure_info`, `procedure_pseudo_code`, `procedure_assembly`, `procedure_callers`, `procedure_callees`, `procedure_references`, `xrefs`, and `analyze_function`. These capabilities enable the shared Swift/Objective-C inventory workflows, `binary_overview`, `batch_decompile`, `get_call_graph`, `find_xrefs_to_name`, `trace_feature`, and complete function dossiers. Default-space addresses are lowercase `0x` hexadecimal. Other spaces, including `EXTERNAL`, use `<percent-encoded-space>:0x<hex>`. Symbol results identify primary, dynamic, external, type, and source facts; procedures distinguish external functions and thunks; strings identify charset, missing-terminator state, byte length, and value truncation; memory-block ends are exclusive and permissions come directly from Ghidra.
206
238
 
@@ -208,6 +240,8 @@ The bridge serves operations only after auto-analysis completes. Each Program ow
208
240
 
209
241
  `npm run verify:ghidra` compiles source-owned x86-64 debug and stripped ELF, AArch64 ELF, x86-64 PE, and x86-64 Mach-O fixtures. Against real Ghidra 12.1.2 it validates every admitted operation, direct and indirect calls, imports/exports/thunks, typed references, strings/xrefs, multi-block CFG, cancellation, deadlines, concurrency, malformed inputs, and complete process/project cleanup. Set `REA_CC`, `REA_CLANG`, or `REA_LLD_LINK` only when the corresponding compiler command is not on `PATH`.
210
242
 
243
+ `npm run verify:ghidra:windows` uses a deterministic source-owned native x86-64 PE application and requires all 18 operations, target/snapshot/import digest linkage, authenticated loopback transport, and cleanup on a controlled Windows x64 Ghidra 12.1.2 runner. This proof does not establish Job Object ownership, private DACLs, or reparse-point-safe authority.
244
+
211
245
  To remove only REA-owned MCP registrations and the managed skill:
212
246
 
213
247
  ```bash
@@ -219,15 +253,16 @@ Uninstall preserves Hopper, Node.js, evidence, captures, external evidence roots
219
253
 
220
254
  ### CLI or agent?
221
255
 
222
- | If you want to… | Use |
223
- | --------------------------------------------------------------- | ------------------------------------------------------------------------- |
224
- | Ask an agent to investigate an app and build a feature | Install the skill, then talk to your agent |
225
- | Inspect or decompile one part of an app from the Terminal | `rea analyze` or `rea decompile` |
226
- | Validate, canonicalize, or compare Evidence v2 bundles | `rea evidence-import`, `rea evidence-export`, or `rea compare` |
227
- | Run or resume a persistent two-version artifact analysis | `rea investigate-versions` |
228
- | Reuse immutable analysis results without relaunching a provider | Pass `--snapshot /approved/path/analysis.json` to a deep-analysis command |
229
- | Import source as historical reference | `rea import-reference-source` |
230
- | Capture or compare controlled process behavior | `rea capture-process` or `rea compare-process-captures` |
256
+ | If you want to… | Use |
257
+ | ---------------------------------------------------------------- | ------------------------------------------------------------------------- |
258
+ | Ask an agent to investigate an app and build a feature | Install the skill, then talk to your agent |
259
+ | Inspect or decompile one part of an app from the Terminal | `rea analyze` or `rea decompile` |
260
+ | Validate, canonicalize, or compare Evidence v2 bundles | `rea evidence-import`, `rea evidence-export`, or `rea compare` |
261
+ | Run or resume a persistent two-version artifact analysis | `rea investigate-versions` |
262
+ | Map a local JavaScript/Electron application without executing it | `rea analyze-javascript-application` |
263
+ | Reuse immutable analysis results without relaunching a provider | Pass `--snapshot /approved/path/analysis.json` to a deep-analysis command |
264
+ | Import source as historical reference | `rea import-reference-source` |
265
+ | Capture or compare controlled process behavior | `rea capture-process` or `rea compare-process-captures` |
231
266
 
232
267
  Filesystem evidence commands and MCP file tools are disabled until the operator approves absolute roots:
233
268
 
@@ -238,6 +273,7 @@ rea evidence-import /absolute/path/to/evidence/bundle.json
238
273
  rea evidence-export /absolute/path/to/evidence/bundle.json /absolute/path/to/evidence/canonical.json
239
274
  rea compare /absolute/path/to/evidence/left.json /absolute/path/to/evidence/right.json
240
275
  rea investigate-versions /absolute/path/to/releases/v1 /absolute/path/to/releases/v2 /absolute/path/to/evidence/releases.json --yes --workspace-name releases
276
+ rea analyze-javascript-application /absolute/path/to/releases/app.asar --approved --json
241
277
  ```
242
278
 
243
279
  `investigate-versions` inventories both versions, checkpoints their observed
@@ -318,30 +354,39 @@ REA handles the app analysis in steps 1–5. The agent performs step 6 with its
318
354
  - Analyze Swift and Objective-C metadata without manually untangling every mangled symbol.
319
355
  - Leave names, comments, and bookmarks in Hopper so human and agent analysis reinforce each other.
320
356
 
321
- ## 78 tools for investigation
357
+ ## Tool catalog for investigation
322
358
 
323
- | Tool family | Count | Examples |
324
- | ------------------------- | ----: | -------------------------------------------------------------------------------------------------------------------------------- |
325
- | Native inspection | 33 | procedures, pseudocode, assembly, strings, names, segments, callers, callees, xrefs, annotations |
326
- | Investigation workflows | 10 | `binary_overview`, `analyze_function`, `batch_decompile`, `trace_feature`, call graphs, Swift and Objective-C discovery |
327
- | Native macOS utilities | 5 | Mach-O metadata, code signatures, plists, architectures, Swift demangling; Hopper-free and provenance-bearing |
328
- | Artifact graph | 2 | deterministic directory, ZIP/APK/IPA, and ASAR inventory; explicitly selected extraction into an absent owned tree |
329
- | Browser observation | 8 | exact-origin CDP capture, bundle and source-map analysis, WebMCP discovery, session timelines, capture diff, and visual evidence |
330
- | Electron observation | 2 | canonical-root-confined file-page discovery and passive DOM, resource, and optionally approved script-source inspection |
331
- | Workspace and observation | 18 | target lifecycle, Evidence v2 bundles, process/artifact/function comparison, evidence-linked residual-unknown lifecycle |
359
+ | Tool family | Count | Examples |
360
+ | ------------------------- | ----: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
361
+ | Native inspection | 33 | procedures, pseudocode, assembly, strings, names, segments, callers, callees, xrefs, annotations |
362
+ | Investigation workflows | 10 | `binary_overview`, `analyze_function`, `batch_decompile`, `trace_feature`, call graphs, Swift and Objective-C discovery |
363
+ | Native macOS utilities | 5 | Mach-O metadata, code signatures, plists, architectures, Swift demangling; Hopper-free and provenance-bearing |
364
+ | Artifact graph | 2 | deterministic directory, ZIP/APK/IPA, and ASAR inventory; explicitly selected extraction into an absent owned tree |
365
+ | Managed PE/CLI | 8 | PE/CLI identity, metadata members, CIL hashes, P/Invoke/native-boundary declarations and verification, application-graph projection, decompiler reconstruction import, token remapping, runtime-correlation plans, and version comparison |
366
+ | Browser observation | 8 | exact-origin CDP capture, bundle and source-map analysis, WebMCP discovery, session timelines, capture diff, and visual evidence |
367
+ | Electron analysis | 4 | passive root-confined observation, bounded static application mapping, and evidence-backed static/runtime reconciliation |
368
+ | Application workflows | 7 | bounded cross-layer traces, unique-only version matching, approved Linux-isolated extracted-module replay, managed-runtime characterization, and reconstruction coverage closure |
369
+ | Workspace and observation | 18 | target lifecycle, Evidence v2 bundles, process/artifact/function comparison, evidence-linked residual-unknown lifecycle |
332
370
 
333
371
  The public interface describes what the agent is trying to learn. Providers decide how to answer. macOS utilities handle common semantic inspection without launching Hopper; Hopper handles deeper native analysis; the process harness implements controlled behavioral capture.
334
372
 
335
373
  ## Current status
336
374
 
337
- REA is already useful for native application, browser, and Electron investigation on supported macOS and Linux hosts:
375
+ REA is already useful for native application, browser, and Electron investigation on supported macOS and Linux hosts, plus the bounded Windows Ghidra P0 described above:
338
376
 
339
377
  - Open Mach-O, ELF, PE, `.app`, ZIP, APK, IPA, ASAR, plist, JavaScript, source-map, and generic analysis-database targets; Hopper remains the only adapter that accepts legacy `.hop` databases.
340
378
  - Discover deep-analysis candidates without starting them, choose deterministically, and retain one immutable provider/profile binding until an explicit switch or close; provider failures never trigger transparent fallback.
341
379
  - Attach to a user-owned Chrome-family browser over a configured loopback CDP endpoint; capture exact-origin web structure, safe metadata, approved value-free payload shapes, bundle/source-map evidence, WebMCP declarations, user-action timelines, capture diffs, and explicitly approved screenshots without navigation or JavaScript evaluation.
342
380
  - Inspect Electron `file://` renderer pages through a separate canonical-root permission boundary without invoking Electron APIs; script contents remain separately approved and byte bounded.
343
381
  - Validate and canonically serialize a provider-neutral [JavaScript Application Graph v1](docs/javascript-application-graph.md) spanning packages, ASAR entries, Electron roles, JavaScript/source-map entities, browser/runtime instances, IPC, endpoints, storage, and native add-ons. This shipped domain contract performs no extraction or I/O by itself.
344
- - Reconstruct bounded static package, entrypoint, Webpack/Rspack module, import, worker, endpoint, storage, source-map, and native-add-on structure from a local directory or ASAR through an AST-only [application service](docs/javascript-artifact-reconstruction.md). The service does not execute bootstrap code and does not add a standalone CLI/MCP tool yet.
382
+ - Reconstruct bounded static package, entrypoint, Webpack/Rspack module, import, worker, endpoint, storage, source-map, BrowserWindow, preload, contextBridge, IPC, utility-process, and native-add-on structure from an approved local directory or ASAR through `analyze_javascript_application` or `rea analyze-javascript-application`. The AST-only [application service](docs/javascript-artifact-reconstruction.md) never executes bootstrap code, pairs only unique exact literal IPC channels, and reports dynamic or ambiguous channels as unresolved.
383
+ - Reconcile that static graph with existing passive web or Electron Evidence through `reconcile_javascript_runtime` or `rea reconcile-javascript-runtime`. Exact captured bytes outrank caller-declared file/URL mappings; target, frame, script, worker, cache, and asset ambiguity stays explicit, source-map authority stays separate, and a module resident in an observed bundle is never reported as executed. See [JavaScript static/runtime reconciliation](docs/javascript-runtime-reconciliation.md).
384
+ - Trace a literal route, string, API, IPC channel, module, or native export through authenticated application Evidence with explicit traversal bounds, then hand exact native artifact digests and requested exports to retained Ghidra or Hopper Evidence without automatic provider switching. Compare application versions using unique-only digest, source-map, structural, and semantic tiers; duplicate, incomplete, and truncated matches stay unknown. See [cross-layer JavaScript application workflows](docs/javascript-application-workflows.md).
385
+ - Classify PE/CLI managed artifacts with `inspect_managed_artifact` / `rea inspect-managed-artifact`, inspect bounded metadata members, signatures, raw CIL hashes, limited decoded-instruction-tuple v1 hashes, separately reported exception regions, call edges, and field-access anchors with `inspect_managed_members` / `rea inspect-managed-members`, inventory declared ModuleRef/ImplMap/PInvoke and non-IL method boundary indicators with `inspect_managed_native_boundaries` / `rea inspect-managed-native-boundaries`, then compare two authenticated member observations with `compare_managed_members` / `rea compare-managed-members`. `verify_managed_native_boundaries` / `rea verify-managed-native-boundaries` checks managed P/Invoke declarations against authenticated native export or function Evidence while keeping verified, inferred, contradicted, and unresolved states distinct. The comparison treats build-local tokens as build-local and uses unique decoded-CIL/signature and structural method-shape tiers, never names alone; the v1 tuple hash does not itself resolve tokens or fully commit control flow. `project_managed_application_graph` / `rea project-managed-application-graph` projects authenticated managed artifact/member/native-boundary Evidence into the existing application graph for cross-layer feature tracing. `import_managed_reconstruction` / `rea import-managed-reconstruction` admits user-supplied decompiler C#/IL/pseudocode as analyst inference only after exact artifact SHA-256, MVID, signature, and the shipped v1 decoded-IL commitment match. Separately, `plan_managed_runtime_correlation` / `rea plan-managed-runtime-correlation` can admit a default-disabled, permission-gated runtime-correlation plan locked to the same build evidence. These paths never load the assembly, resolve CLR dependencies, execute target code, run a decompiler, or translate managed tokens into native addresses; full normalized-CIL v2 semantics, native-body bridge mapping, and an actual runtime executor remain future managed-code contracts.
386
+ - Configure `REA_ILSPY_CMD_PATH=/absolute/path/to/ilspycmd` only when you want
387
+ doctor and `verify:managed` to inspect a bring-your-own ILSpy command as a
388
+ real reconstruction oracle. REA does not install ILSpy and does not treat
389
+ decompiler text as canonical metadata or CIL observation.
345
390
  - Traverse content-addressed artifact graphs without extraction; on macOS, read-only DMG traversal additionally requires `native_mount_approved: true` and `REA_ARTIFACT_NATIVE_MOUNT_ENABLED=true`. Materialize only approved occurrences into absent output roots.
346
391
  - Build bounded function dossiers with pseudocode, assembly, CFG edges, comments, calls, references, strings, and names.
347
392
  - Search and trace features across symbols, strings, metadata, references, and call paths.
@@ -386,24 +431,24 @@ REA is growing into a toolkit for understanding software across static artifacts
386
431
  ### Now
387
432
 
388
433
  1. **Maintain truthful product metadata** — extend the shipped canonical catalog and drift checks whenever versions, tools, providers, schemas, setup clients, or CLI capabilities change.
389
- 2. **Electron boundary extraction and high-level surface** — extend the shipped static artifact projector with contextBridge, IPC, utility-process, and native-export boundaries, then expose one provider-neutral CLI/MCP workflow without widening authority.
390
- 3. **Cross-provider conformance growth** — add source-owned architectures and difficult indirect/thunk cases while preserving semantic comparison and provider-specific text boundaries.
434
+ 2. **Cross-provider conformance growth** — add source-owned architectures and difficult indirect/thunk cases while preserving semantic comparison and provider-specific text boundaries.
391
435
 
392
436
  ### Next
393
437
 
394
- 1. **Cross-layer tracing and version comparison** — trace renderer behavior through preload, IPC, main-process, storage, network, and native boundaries, then compare those paths across application versions.
395
- 2. **Deeper JavaScript and source recovery** — add historical-source matching, rechunked/minified cross-version matching, and stronger static/runtime reconciliation on top of the shipped AST-only Webpack/Rspack reconstruction.
396
- 3. **Deterministic behavior harnesses** — extend process ownership, protocol fixtures, filesystem observation, reconnects, and cross-version behavioral comparison.
438
+ 1. **Controlled replay conformance growth** — extend the shipped Linux extracted-module sandbox with more source-owned hostile fixtures and cross-kernel conformance; browser or Electron interaction remains a different future authority.
439
+ 2. **Broader application graph evidence** — extend authenticated cross-layer traces with additional static extractors and separately approved runtime authorities.
440
+ 3. **Professional managed-code analysis** — extend shipped PE/CLI triage, CIL evidence, managed/native declaration inventory, source-owned conformance, and obfuscation-resistant comparisons toward verified native-provider composition under the accepted [managed-code boundary](docs/managed-code-analysis.md).
441
+ 4. **Deterministic behavior harnesses** — extend process ownership, protocol fixtures, filesystem observation, reconnects, and cross-version behavioral comparison.
397
442
 
398
443
  ### Later
399
444
 
400
- 1. **Controlled interaction and replay** — keep approved JavaScript execution, browser interaction, Electron instrumentation, and fuzzing behind a separate authority from passive observation.
445
+ 1. **Controlled application interaction** — evaluate separately authorized full-application driving without widening passive browser, Electron, or extracted-module replay authority.
401
446
  2. **Native runtime observation** — approval-gated LLDB, Frida, system logs, process/filesystem observers, and native API tracing.
402
447
  3. **Additional providers and targets** — evaluate IDA/Hex-Rays, Binary Ninja, Rizin, LIEF, Windows-native providers, mobile artifacts, firmware, document formats, and other software-defined systems.
403
448
 
404
449
  New providers must produce the same evidence and safety metadata as existing capabilities before they become part of the public workflow. Once REA has multiple optional toolchains, setup can become capability-selective; the consent rules for that future work are recorded in the [installation roadmap](docs/roadmap.md).
405
450
 
406
- See the [static-analysis provider evaluation](docs/provider-evaluation.md) for the shipped Ghidra function-analysis boundary, remaining admission gates, and provider comparison matrix, and [ADR-0001](docs/adr/0001-provider-selection-and-analysis-profiles.md) for the binding, selection, profile, snapshot, and compatibility decisions.
451
+ See the [static-analysis provider evaluation](docs/provider-evaluation.md) for the shipped Ghidra function-analysis boundary, remaining admission gates, and provider comparison matrix; [ADR-0001](docs/adr/0001-provider-selection-and-analysis-profiles.md) for binding, selection, profile, snapshot, and compatibility decisions; the [controlled replay guide](docs/controlled-javascript-replay.md) plus [ADR-0002](docs/adr/0002-controlled-replay-authority-and-sandbox.md) for the shipped JavaScript replay boundary; and [ADR-0003](docs/adr/0003-managed-code-evidence-and-provider-boundary.md) for the managed-code evidence and provider design.
407
452
 
408
453
  ## Using REA with other agents
409
454
 
@@ -416,7 +461,7 @@ Setup detects Claude Code, Claude Desktop, Codex, Cursor, Gemini CLI, Windsurf,
416
461
  "mcpServers": {
417
462
  "rea": {
418
463
  "command": "npx",
419
- "args": ["-y", "rea-agents", "mcp"]
464
+ "args": ["-y", "rea-agents@latest", "mcp"]
420
465
  }
421
466
  }
422
467
  }
@@ -457,20 +502,20 @@ The CLI and MCP server use the same application workflows and evidence contracts
457
502
  The agent workflow above is the easiest way to use REA. For a one-off overview from the Terminal:
458
503
 
459
504
  ```bash
460
- npx -y rea-agents analyze /Applications/Notes.app
461
- npx -y rea-agents inspect /Applications/Notes.app
462
- npx -y rea-agents inspect /Applications/Notes.app --detail detailed --limit 20
463
- npx -y rea-agents search /Applications/Notes.app "offline"
464
- npx -y rea-agents function /Applications/Notes.app 0x1000
465
- npx -y rea-agents xrefs /Applications/Notes.app 0x1000
466
- npx -y rea-agents trace /Applications/Notes.app "offline"
467
- npx -y rea-agents compare /absolute/path/to/left-evidence.json /absolute/path/to/right-evidence.json
468
- npx -y rea-agents investigate-versions /path/to/v1 /path/to/v2 /absolute/path/to/evidence/releases.json --yes
469
- npx -y rea-agents capabilities
470
- npx -y rea-agents providers
505
+ npx -y rea-agents@latest analyze /Applications/Notes.app
506
+ npx -y rea-agents@latest inspect /Applications/Notes.app
507
+ npx -y rea-agents@latest inspect /Applications/Notes.app --detail detailed --limit 20
508
+ npx -y rea-agents@latest search /Applications/Notes.app "offline"
509
+ npx -y rea-agents@latest function /Applications/Notes.app 0x1000
510
+ npx -y rea-agents@latest xrefs /Applications/Notes.app 0x1000
511
+ npx -y rea-agents@latest trace /Applications/Notes.app "offline"
512
+ npx -y rea-agents@latest compare /absolute/path/to/left-evidence.json /absolute/path/to/right-evidence.json
513
+ npx -y rea-agents@latest investigate-versions /path/to/v1 /path/to/v2 /absolute/path/to/evidence/releases.json --yes
514
+ npx -y rea-agents@latest capabilities
515
+ npx -y rea-agents@latest providers
471
516
  ```
472
517
 
473
- Run `npx -y rea-agents --help` for direct decompilation, bounded search and
518
+ Run `npx -y rea-agents@latest --help` for direct decompilation, bounded search and
474
519
  other options. `analyze` and `inspect` share the same overview workflow;
475
520
  `function`, `xrefs`, and `trace` return the same Evidence v2 envelopes as MCP.
476
521
 
@@ -559,6 +604,10 @@ environment allowlist in `REA_PROCESS_ALLOWED_ENV_JSON`. Because the current PTY
559
604
  adapter uses host networking, it also requires
560
605
  `REA_PROCESS_ALLOW_EXTERNAL_NETWORK=true`.
561
606
 
607
+ Set `REA_PROCESS_CAPTURE_AUTO_GRANT=false` to configure those process-capture
608
+ limits as a ceiling without implicitly granting them. This mode remains
609
+ fail-closed until a narrower grant is established.
610
+
562
611
  Capture a scenario or compare two saved Process Capture v4 Evidence records:
563
612
 
564
613
  ```bash
@@ -572,18 +621,22 @@ first terminal, interaction, exit, filesystem, protocol, process, or shim
572
621
  divergence. See [Process Capture v4](docs/process-capture.md) for scenario
573
622
  fields, command-shim replay, checkpoint triggers, limits, and safety behavior.
574
623
 
575
- If the native PTY backend is unavailable, install Xcode command-line tools and
576
- run `npm run rebuild:native`. Linux source builds require Python, `make`, and a
577
- C++ toolchain. Compatible packaged binaries do not require this rebuild.
624
+ REA installs a prebuilt PTY backend for supported macOS, Linux, and Windows
625
+ architectures. If the capability check reports that the backend is unavailable,
626
+ reinstall REA for the current platform and architecture.
578
627
 
579
628
  ASAR inventory verifies Electron integrity metadata for both archive entries
580
629
  and `.asar.unpacked` companion files. Integrity failures identify the logical
581
630
  path, declared and calculated SHA-256 values, and whether the entry was
582
- unpacked; REA does not silently accept the mismatched artifact.
631
+ unpacked; REA does not silently accept the mismatched artifact. If a supplied
632
+ ASAR declares unpacked companion bytes that are absent from the local artifact
633
+ set, REA keeps that occurrence as `unavailable` and continues analyzing the
634
+ embedded JavaScript instead of treating the missing native/resource bytes as
635
+ verified or absent.
583
636
 
584
637
  ## Security model
585
638
 
586
- REA does not provide a hosted analysis service. Hopper and Ghidra bridge communication uses authenticated private local sockets. Dynamic capabilities are disabled by default and require both operator policy and explicit per-call approval. REA is not a security sandbox: providers and launched targets run with the current user's permissions, and each capability reports its side effects and limitations. Report vulnerabilities through the private process in [SECURITY.md](SECURITY.md).
639
+ REA does not provide a hosted analysis service. Hopper and Linux Ghidra bridge communication uses authenticated private local sockets. Windows Ghidra P0 uses authenticated IPv4 loopback but does not claim named-pipe DACL or hostile-local-user isolation. Dynamic capabilities are disabled by default and require both operator policy and explicit per-call approval. Shipped providers, passive observers, and Process Capture are not security sandboxes: providers and launched targets run with the current user's permissions. Extracted JavaScript replay is a distinct Linux-only capability that fails closed unless Bubblewrap namespaces, architecture-checked seccomp, private runtime mounts, and delegated cgroup limits are available; it never inherits browser, Electron, or Process Capture authority. See [ADR-0002](docs/adr/0002-controlled-replay-authority-and-sandbox.md). Report vulnerabilities through the private process in [SECURITY.md](SECURITY.md).
587
640
 
588
641
  ## FAQ
589
642
 
@@ -7,15 +7,20 @@ import java.io.ByteArrayOutputStream;
7
7
  import java.io.IOException;
8
8
  import java.io.Reader;
9
9
  import java.math.BigInteger;
10
+ import java.net.InetAddress;
11
+ import java.net.InetSocketAddress;
10
12
  import java.net.StandardProtocolFamily;
11
13
  import java.net.UnixDomainSocketAddress;
12
14
  import java.nio.channels.Channels;
13
15
  import java.nio.channels.ServerSocketChannel;
14
16
  import java.nio.channels.SocketChannel;
15
17
  import java.nio.charset.StandardCharsets;
18
+ import java.nio.file.AtomicMoveNotSupportedException;
16
19
  import java.nio.file.Files;
17
20
  import java.nio.file.LinkOption;
18
21
  import java.nio.file.Path;
22
+ import java.nio.file.StandardCopyOption;
23
+ import java.nio.file.StandardOpenOption;
19
24
  import java.nio.file.attribute.PosixFilePermissions;
20
25
  import java.security.MessageDigest;
21
26
  import java.util.ArrayList;
@@ -67,7 +72,7 @@ import ghidra.program.model.symbol.Symbol;
67
72
  import ghidra.program.model.symbol.SymbolIterator;
68
73
 
69
74
  public final class ReaGhidraBridge extends HeadlessScript {
70
- private static final int BRIDGE_VERSION = 3;
75
+ private static final int BRIDGE_VERSION = 4;
71
76
  private static final int MAX_DESCRIPTOR_BYTES = 16 * 1024;
72
77
  private static final int MAX_REQUEST_CHARACTERS = 256 * 1024;
73
78
  private static final int MAX_RESPONSE_BYTES = 1024 * 1024;
@@ -85,9 +90,11 @@ public final class ReaGhidraBridge extends HeadlessScript {
85
90
  private static final Gson GSON = new GsonBuilder().serializeNulls().create();
86
91
  private static final Set<String> DESCRIPTOR_KEYS = Set.of(
87
92
  "schema_version",
88
- "socket_path",
93
+ "transport",
94
+ "endpoint_path",
89
95
  "token",
90
96
  "run_id",
97
+ "target_sha256",
91
98
  "provider_version",
92
99
  "profile_digest"
93
100
  );
@@ -143,6 +150,16 @@ public final class ReaGhidraBridge extends HeadlessScript {
143
150
  if (!Application.getApplicationVersion().equals(descriptor.providerVersion)) {
144
151
  throw new IllegalStateException("Ghidra provider version does not match the session");
145
152
  }
153
+ String importedSha256 = currentProgram.getExecutableSHA256();
154
+ if (importedSha256 == null ||
155
+ !constantTimeEquals(
156
+ importedSha256.toLowerCase(Locale.ROOT),
157
+ descriptor.targetSha256
158
+ )) {
159
+ throw new IllegalStateException(
160
+ "Ghidra imported-byte digest does not match the admitted target"
161
+ );
162
+ }
146
163
  try {
147
164
  initializeDecompiler();
148
165
  serve(descriptor);
@@ -156,22 +173,77 @@ public final class ReaGhidraBridge extends HeadlessScript {
156
173
  }
157
174
 
158
175
  private void serve(SessionDescriptor descriptor) throws Exception {
159
- Path socketPath = Path.of(descriptor.socketPath);
176
+ if (descriptor.transport.equals("unix-socket")) {
177
+ serveUnixSocket(descriptor);
178
+ return;
179
+ }
180
+ if (descriptor.transport.equals("authenticated-loopback-tcp")) {
181
+ serveLoopbackTcp(descriptor);
182
+ return;
183
+ }
184
+ throw new IllegalArgumentException("REA bridge transport is invalid");
185
+ }
186
+
187
+ private void serveUnixSocket(SessionDescriptor descriptor) throws Exception {
188
+ Path socketPath = Path.of(descriptor.endpointPath);
160
189
  Files.deleteIfExists(socketPath);
161
190
  try (ServerSocketChannel server = ServerSocketChannel.open(StandardProtocolFamily.UNIX)) {
162
191
  server.bind(UnixDomainSocketAddress.of(socketPath));
163
192
  Files.setPosixFilePermissions(socketPath, PosixFilePermissions.fromString("rw-------"));
164
- try (SocketChannel client = server.accept();
165
- BufferedReader reader = new BufferedReader(Channels.newReader(client, StandardCharsets.UTF_8));
166
- BufferedWriter writer = new BufferedWriter(Channels.newWriter(client, StandardCharsets.UTF_8))) {
167
- serveClient(descriptor, reader, writer);
168
- }
193
+ acceptClient(server, descriptor);
169
194
  }
170
195
  finally {
171
196
  Files.deleteIfExists(socketPath);
172
197
  }
173
198
  }
174
199
 
200
+ private void serveLoopbackTcp(SessionDescriptor descriptor) throws Exception {
201
+ Path endpointPath = Path.of(descriptor.endpointPath);
202
+ Path pendingPath = endpointPath.resolveSibling(endpointPath.getFileName() + ".pending");
203
+ Files.deleteIfExists(endpointPath);
204
+ Files.deleteIfExists(pendingPath);
205
+ try (ServerSocketChannel server = ServerSocketChannel.open()) {
206
+ server.bind(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 0));
207
+ InetSocketAddress address = (InetSocketAddress) server.getLocalAddress();
208
+ JsonObject endpoint = new JsonObject();
209
+ endpoint.addProperty("schema_version", 1);
210
+ endpoint.addProperty("host", "127.0.0.1");
211
+ endpoint.addProperty("port", address.getPort());
212
+ Files.writeString(
213
+ pendingPath,
214
+ GSON.toJson(endpoint) + "\n",
215
+ StandardCharsets.UTF_8,
216
+ StandardOpenOption.CREATE_NEW,
217
+ StandardOpenOption.WRITE
218
+ );
219
+ try {
220
+ Files.move(pendingPath, endpointPath, StandardCopyOption.ATOMIC_MOVE);
221
+ }
222
+ catch (AtomicMoveNotSupportedException exception) {
223
+ Files.move(pendingPath, endpointPath);
224
+ }
225
+ acceptClient(server, descriptor);
226
+ }
227
+ finally {
228
+ Files.deleteIfExists(pendingPath);
229
+ Files.deleteIfExists(endpointPath);
230
+ }
231
+ }
232
+
233
+ private void acceptClient(
234
+ ServerSocketChannel server,
235
+ SessionDescriptor descriptor) throws Exception {
236
+ try (SocketChannel client = server.accept();
237
+ BufferedReader reader = new BufferedReader(
238
+ Channels.newReader(client, StandardCharsets.UTF_8)
239
+ );
240
+ BufferedWriter writer = new BufferedWriter(
241
+ Channels.newWriter(client, StandardCharsets.UTF_8)
242
+ )) {
243
+ serveClient(descriptor, reader, writer);
244
+ }
245
+ }
246
+
175
247
  private void serveClient(
176
248
  SessionDescriptor descriptor,
177
249
  BufferedReader reader,
@@ -270,6 +342,7 @@ public final class ReaGhidraBridge extends HeadlessScript {
270
342
  "default_address_space",
271
343
  currentProgram.getAddressFactory().getDefaultAddressSpace().getName()
272
344
  );
345
+ target.addProperty("sha256", descriptor.targetSha256);
273
346
 
274
347
  JsonObject result = new JsonObject();
275
348
  result.addProperty("name", "REA Ghidra bridge");
@@ -1586,13 +1659,15 @@ public final class ReaGhidraBridge extends HeadlessScript {
1586
1659
  JsonParser.parseString(Files.readString(path, StandardCharsets.UTF_8)),
1587
1660
  DESCRIPTOR_KEYS
1588
1661
  );
1589
- if (requireInteger(object, "schema_version") != 1) {
1662
+ if (requireInteger(object, "schema_version") != 2) {
1590
1663
  throw new IllegalArgumentException("REA session descriptor version is invalid");
1591
1664
  }
1592
1665
  return new SessionDescriptor(
1593
- requireString(object, "socket_path"),
1666
+ requireString(object, "transport"),
1667
+ requireString(object, "endpoint_path"),
1594
1668
  requireString(object, "token"),
1595
1669
  requireString(object, "run_id"),
1670
+ requireSha256(object, "target_sha256"),
1596
1671
  requireString(object, "provider_version"),
1597
1672
  requireString(object, "profile_digest")
1598
1673
  );
@@ -1662,6 +1737,14 @@ public final class ReaGhidraBridge extends HeadlessScript {
1662
1737
  return result;
1663
1738
  }
1664
1739
 
1740
+ private static String requireSha256(JsonObject object, String name) {
1741
+ String value = requireString(object, name);
1742
+ if (!value.matches("[a-f0-9]{64}")) {
1743
+ throw new IllegalArgumentException(name + " must be lowercase SHA-256");
1744
+ }
1745
+ return value;
1746
+ }
1747
+
1665
1748
  private static int requireInteger(JsonObject object, String name) {
1666
1749
  JsonElement value = object.get(name);
1667
1750
  if (value == null || !value.isJsonPrimitive() || !value.getAsJsonPrimitive().isNumber()) {
@@ -1795,9 +1878,11 @@ public final class ReaGhidraBridge extends HeadlessScript {
1795
1878
  private record InstructionScan(List<Instruction> instructions, boolean truncated) {}
1796
1879
  private record TruncatedValue(String value, boolean truncated) {}
1797
1880
  private record SessionDescriptor(
1798
- String socketPath,
1881
+ String transport,
1882
+ String endpointPath,
1799
1883
  String token,
1800
1884
  String runId,
1885
+ String targetSha256,
1801
1886
  String providerVersion,
1802
1887
  String profileDigest
1803
1888
  ) {}
@@ -113,7 +113,7 @@ const createExtractionResult = (input, inventory, selected, extracted) => {
113
113
  });
114
114
  };
115
115
  const loadInventory = async (path, limits, selectedIds, signal) => {
116
- const snapshot = await scanArtifactInventory(path, limits, signal);
116
+ const snapshot = await scanArtifactInventory(path, limits, { signal });
117
117
  const occurrences = new Map();
118
118
  const neededNodes = new Set();
119
119
  collectOccurrences(snapshot.occurrences, selectedIds, occurrences, neededNodes);
@@ -0,0 +1,42 @@
1
+ import { open } from "node:fs/promises";
2
+ import { classifyArtifactPath } from "../ArtifactGraphConstruction.js";
3
+ const classifyContainerExtension = (path) => {
4
+ const lower = path.toLowerCase();
5
+ for (const format of ["asar", "ipa", "apk", "zip", "dmg", "pkg"])
6
+ if (lower.endsWith(`.${format}`))
7
+ return format;
8
+ return undefined;
9
+ };
10
+ export const classifyRoot = async (path, directory) => {
11
+ if (directory)
12
+ return "directory";
13
+ const extensionFormat = classifyContainerExtension(path);
14
+ if (extensionFormat !== undefined)
15
+ return extensionFormat;
16
+ const handle = await open(path, "r");
17
+ try {
18
+ const magic = Buffer.alloc(4);
19
+ const observed = await handle.read(magic, 0, magic.length, 0);
20
+ if (observed.bytesRead === 4 &&
21
+ magic[0] === 0x50 &&
22
+ magic[1] === 0x4b &&
23
+ [0x03, 0x05, 0x07].includes(magic[2] ?? -1) &&
24
+ [0x04, 0x06, 0x08].includes(magic[3] ?? -1))
25
+ return "zip";
26
+ if (observed.bytesRead === 4) {
27
+ const header = magic.readUInt32BE(0);
28
+ if ([0xcafebabe, 0xbebafeca, 0xcafebabf, 0xbfbafeca].includes(header))
29
+ return "mach-o-universal";
30
+ if ([0xfeedface, 0xfeedfacf, 0xcefaedfe, 0xcffaedfe].includes(header))
31
+ return "mach-o";
32
+ if (magic.equals(Buffer.from([0x7f, 0x45, 0x4c, 0x46])))
33
+ return "elf";
34
+ }
35
+ if (observed.bytesRead >= 2 && magic[0] === 0x4d && magic[1] === 0x5a)
36
+ return "pe";
37
+ }
38
+ finally {
39
+ await handle.close();
40
+ }
41
+ return classifyArtifactPath(path).format;
42
+ };