rea-agents 4.0.0 → 4.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 (416) hide show
  1. package/README.md +93 -30
  2. package/bridge/ghidra/ReaGhidraBridge.java +358 -15
  3. package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
  4. package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
  5. package/dist/android/AndroidTargetSnapshot.js +34 -0
  6. package/dist/android/JadxAnalysis.js +191 -0
  7. package/dist/android/JadxConfiguration.js +41 -0
  8. package/dist/android/JadxMcpTransport.js +145 -0
  9. package/dist/android/JadxProtocol.js +101 -0
  10. package/dist/android/JadxProvider.js +170 -0
  11. package/dist/android/JadxRelease.js +19 -0
  12. package/dist/android/JadxSession.js +97 -0
  13. package/dist/application/AnalysisContextQueries.js +2 -1
  14. package/dist/application/AnalysisProviderEvaluation.js +5 -3
  15. package/dist/application/AnalysisProviderRegistry.js +2 -1
  16. package/dist/application/AnalysisSnapshotCache.js +4 -1
  17. package/dist/application/AnalysisSnapshotFiles.js +1 -1
  18. package/dist/application/AndroidAnalysisPort.js +1 -0
  19. package/dist/application/AndroidAnalysisService.js +37 -0
  20. package/dist/application/ArtifactExtraction.js +7 -4
  21. package/dist/application/ArtifactGraphConstruction.js +10 -17
  22. package/dist/application/ArtifactInventory/scanCanonical.js +8 -7
  23. package/dist/application/BinarySession.js +16 -3
  24. package/dist/application/BinarySessionExecution.js +4 -1
  25. package/dist/application/BinarySessionOpen.js +3 -2
  26. package/dist/application/BinarySessionRecords.js +9 -3
  27. package/dist/application/BinaryTargetResolver.js +25 -6
  28. package/dist/application/BrowserObservationService.js +2 -1
  29. package/dist/application/BrowserScenarioCaptureService.js +2 -1
  30. package/dist/application/BrowserScenarioEvidence.js +2 -2
  31. package/dist/application/CallPathTracing.js +2 -1
  32. package/dist/application/CapabilityInventory.js +18 -0
  33. package/dist/application/ClientConfigPath.js +3 -1
  34. package/dist/application/ClientConfigurationDocument.js +11 -1
  35. package/dist/application/ClientRegistrationStatus.js +8 -1
  36. package/dist/application/CompositeProvider.js +1 -1
  37. package/dist/application/DirectAnalysis.js +23 -7
  38. package/dist/application/DirectAnalysisStatus.js +3 -3
  39. package/dist/application/Doctor.js +48 -8
  40. package/dist/application/DoctorDiagnostics.js +7 -5
  41. package/dist/application/DoctorScope.js +1 -1
  42. package/dist/application/ElectronActiveEvidence.js +2 -2
  43. package/dist/application/ElectronActiveObservationService.js +2 -1
  44. package/dist/application/ElectronBoundaryAnalysis.js +1 -1
  45. package/dist/application/ElectronObservationService.js +2 -1
  46. package/dist/application/EnhancedLiteralTracing.js +2 -1
  47. package/dist/application/EnhancedToolTypes.js +2 -1
  48. package/dist/application/EnhancedTools.js +3 -1
  49. package/dist/application/EvidenceBundleCommands.js +2 -1
  50. package/dist/application/EvidenceBundleFiles.js +1 -1
  51. package/dist/application/EvidenceInputResolver.js +30 -0
  52. package/dist/application/EvidenceLedger.js +2 -1
  53. package/dist/application/FirmwareAnalysisPort.js +1 -0
  54. package/dist/application/FirmwareAnalysisService.js +35 -0
  55. package/dist/application/FunctionAnalysisEvidence.js +32 -0
  56. package/dist/application/InventoryProjectionEvidence.js +2 -1
  57. package/dist/application/JavaScriptApplicationService.js +50 -3
  58. package/dist/application/JavaScriptApplicationWorkflowService.js +2 -1
  59. package/dist/application/JavaScriptArtifactAnalysis.js +4 -2
  60. package/dist/application/JavaScriptArtifactFiles.js +4 -2
  61. package/dist/application/JavaScriptArtifactPathResolution.js +6 -2
  62. package/dist/application/JavaScriptJsonModules.js +3 -2
  63. package/dist/application/JavaScriptModuleRelationships.js +4 -2
  64. package/dist/application/JavaScriptRuntimeObservationService.js +2 -1
  65. package/dist/application/JavaScriptRuntimeReconciliationService.js +2 -1
  66. package/dist/application/JavaScriptSemanticGraphProjection.js +1 -1
  67. package/dist/application/JavaScriptSemanticTraceService.js +2 -1
  68. package/dist/application/JsonFiles.js +1 -1
  69. package/dist/application/LazyAnalysisProvider.js +3 -1
  70. package/dist/application/LinuxHopper.js +12 -4
  71. package/dist/application/MacHopper.js +20 -7
  72. package/dist/application/ManagedApplicationGraphService.js +2 -1
  73. package/dist/application/ManagedMemberComparisonService.js +3 -1
  74. package/dist/application/ManagedNativeVerificationService.js +2 -1
  75. package/dist/application/ManagedReconstructionService.js +2 -1
  76. package/dist/application/NativeCallRoutes.js +1 -1
  77. package/dist/application/NativeDispatchMetadataInspection.js +1 -1
  78. package/dist/application/NativeUiActionTrace.js +2 -1
  79. package/dist/application/NativeValueTrace.js +1 -1
  80. package/dist/application/ProcessCaptureError.js +1 -1
  81. package/dist/application/ProcessCaptureJournal.js +3 -1
  82. package/dist/application/ProcessCaptureLifecycle.js +6 -3
  83. package/dist/application/ProcessCli.js +9 -5
  84. package/dist/application/ProcessEvidence.js +2 -6
  85. package/dist/application/ProcessHarness.js +3 -2
  86. package/dist/application/ProcessNormalization.js +12 -5
  87. package/dist/application/ProcessSampling.js +3 -1
  88. package/dist/application/ReconstructionCoverageService.js +2 -1
  89. package/dist/application/ReconstructionObligationLedgerService.js +2 -1
  90. package/dist/application/ReferenceSourceImportEntries.js +2 -0
  91. package/dist/application/ReferenceSourceImportPolicy.js +4 -2
  92. package/dist/application/ReferenceSourceVcsAdapter.js +35 -4
  93. package/dist/application/SessionProviderRouter.js +4 -1
  94. package/dist/application/Setup.js +1 -128
  95. package/dist/application/SetupClientConfiguration.js +17 -6
  96. package/dist/application/SetupHost.js +111 -0
  97. package/dist/application/SetupRegistrationEnvironment.js +1 -2
  98. package/dist/application/SetupSkill.js +9 -3
  99. package/dist/application/SetupTypes.js +17 -0
  100. package/dist/application/StoreFileLock.js +7 -2
  101. package/dist/application/SupportedClients.js +8 -0
  102. package/dist/application/Uninstall.js +9 -4
  103. package/dist/application/UpdateRuntime.js +5 -2
  104. package/dist/application/WindowsCapabilities.js +7 -7
  105. package/dist/application/runtime.js +3 -1
  106. package/dist/artifacts/ArtifactProvider.js +3 -1
  107. package/dist/artifacts/DirectoryArtifactReader.js +2 -0
  108. package/dist/artifacts/NativeDmgArtifactReader.js +10 -3
  109. package/dist/artifacts/NibArchive.js +4 -2
  110. package/dist/artifacts/SafeOutputTree.js +26 -10
  111. package/dist/artifacts/ZipArtifactReader.js +1 -0
  112. package/dist/browser/BrowserProcessStartup.js +3 -1
  113. package/dist/browser/CdpAuthorizedMainFrame.js +1 -1
  114. package/dist/browser/CdpBrowserProvider.js +4 -1
  115. package/dist/browser/CdpCaptureDocuments.js +3 -1
  116. package/dist/browser/CdpCaptureEventHandlers.js +6 -2
  117. package/dist/browser/CdpCaptureStorageFingerprints.js +1 -1
  118. package/dist/browser/CdpCaptureValues.js +6 -2
  119. package/dist/browser/CdpConnection.js +8 -6
  120. package/dist/browser/CdpElectronInspection.js +3 -3
  121. package/dist/browser/CdpElectronProvider.js +4 -1
  122. package/dist/browser/CdpElectronScripts.js +2 -2
  123. package/dist/browser/CdpEndpoint.js +22 -10
  124. package/dist/browser/CdpObservationSession.js +2 -1
  125. package/dist/browser/CdpOptionalCommand.js +1 -1
  126. package/dist/browser/CdpPageCapture.js +2 -1
  127. package/dist/browser/CdpSafeMetadata.js +53 -8
  128. package/dist/browser/CdpScreenshot.js +1 -1
  129. package/dist/browser/CdpTargetSession.js +8 -5
  130. package/dist/browser/CdpWebMcpDiscovery.js +1 -1
  131. package/dist/browser/ElectronFileScope.js +9 -3
  132. package/dist/browser/JavaScriptRuntimeScope.js +3 -1
  133. package/dist/browser/PlaywrightBrowserScenarioProvider.js +3 -1
  134. package/dist/browser/PlaywrightElectronActiveActions.js +1 -1
  135. package/dist/browser/PlaywrightElectronActiveProvider.js +6 -2
  136. package/dist/browser/PlaywrightExecutionBoundary.js +1 -1
  137. package/dist/browser/PlaywrightScenarioArtifacts.js +10 -5
  138. package/dist/browser/PlaywrightScenarioBrowser.js +3 -1
  139. package/dist/browser/PlaywrightScenarioEvents.js +6 -2
  140. package/dist/browser/PlaywrightScenarioSession.js +5 -2
  141. package/dist/browser/V8InspectorEndpoint.js +2 -1
  142. package/dist/browser/V8InspectorProvider.js +6 -1
  143. package/dist/browser/WebSourceMapFetcher.js +24 -11
  144. package/dist/cli/androidCommands.js +81 -0
  145. package/dist/{cliApplicationCommands.js → cli/applicationCommands.js} +18 -16
  146. package/dist/{cliBrowserAdvancedCommands.js → cli/browserAdvancedCommands.js} +13 -16
  147. package/dist/{cliBrowserCommands.js → cli/browserCommands.js} +9 -9
  148. package/dist/cli/commandCancellation.js +24 -0
  149. package/dist/cli/coreAnalysisCommands.js +110 -17
  150. package/dist/{cliElectronCommands.js → cli/electronCommands.js} +14 -13
  151. package/dist/cli/firmwareCommands.js +75 -0
  152. package/dist/{cliSetup.js → cli/interactiveSetup.js} +1 -1
  153. package/dist/cli/javascriptApplicationAnalysis.js +1 -1
  154. package/dist/cli/managedCommands.js +1 -1
  155. package/dist/cli/managedProjectGraphCommand.js +1 -1
  156. package/dist/cli/options.js +7 -1
  157. package/dist/{cliProcessCommands.js → cli/processCommands.js} +3 -3
  158. package/dist/cli/referenceSourceImportStatus.js +10 -0
  159. package/dist/cli/setupCommands.js +4 -2
  160. package/dist/cli/utilityCommands.js +3 -2
  161. package/dist/cli.js +10 -15
  162. package/dist/cliBrowserContext.js +1 -1
  163. package/dist/cliBrowserScenarioCommands.js +2 -1
  164. package/dist/cliCommandNames.js +11 -2
  165. package/dist/cliEvidenceCommands.js +2 -1
  166. package/dist/cliJavaScriptRuntimeCommands.js +2 -1
  167. package/dist/cliJsonInput.js +26 -11
  168. package/dist/cliLogging.js +2 -1
  169. package/dist/cliOutput.js +15 -16
  170. package/dist/config/environment.js +11 -1
  171. package/dist/config/parseConfig.js +7 -1
  172. package/dist/config/parsers.js +1 -1
  173. package/dist/contracts/androidToolContracts.js +77 -0
  174. package/dist/contracts/applicationToolContracts.js +32 -5
  175. package/dist/contracts/applicationWorkflowInputContracts.js +13 -13
  176. package/dist/contracts/artifactComparisonExample.js +7 -14
  177. package/dist/contracts/enhancedToolContracts.js +31 -0
  178. package/dist/contracts/errorSchemas.js +4 -2
  179. package/dist/contracts/evidenceInputContracts.js +13 -0
  180. package/dist/contracts/firmwareToolContracts.js +38 -0
  181. package/dist/contracts/officialToolContracts.js +66 -0
  182. package/dist/contracts/promptContracts.js +1 -1
  183. package/dist/contracts/sessionLifecycleInputs.js +4 -0
  184. package/dist/contracts/sessionToolContracts.js +43 -0
  185. package/dist/contracts/sessionToolSchemas.js +1 -1
  186. package/dist/contracts/toolContractExamples.js +5 -0
  187. package/dist/contracts/toolContractTypes.js +2 -0
  188. package/dist/contracts/toolContracts.js +7 -130
  189. package/dist/contracts/toolEffects.js +43 -0
  190. package/dist/contracts/toolOutputSchemaGroups.js +4 -0
  191. package/dist/contracts/toolOutputSchemaPrimitives.js +1 -0
  192. package/dist/doctorRuntime.js +5 -1
  193. package/dist/domain/analysisErrorBase.js +33 -0
  194. package/dist/domain/analysisErrorCore.js +60 -0
  195. package/dist/domain/analysisErrorPresentation.js +22 -2
  196. package/dist/domain/analysisErrorProjection.js +24 -3
  197. package/dist/domain/analysisSnapshot.js +1 -0
  198. package/dist/domain/androidAnalysis.js +141 -0
  199. package/dist/domain/appleAssetCatalog.js +1 -1
  200. package/dist/domain/artifactGraph.js +1 -0
  201. package/dist/domain/artifactInspection.js +19 -17
  202. package/dist/domain/artifactInventoryEvidence.js +20 -25
  203. package/dist/domain/artifactOperationError.js +16 -0
  204. package/dist/domain/browserObservation.js +12 -4
  205. package/dist/domain/browserObservationError.js +23 -0
  206. package/dist/domain/browserScenario.js +1 -1
  207. package/dist/domain/browserScenarioCapture.js +1 -1
  208. package/dist/domain/browserScenarioDiff.js +1 -1
  209. package/dist/domain/browserScenarioNormalization.js +6 -11
  210. package/dist/domain/browserScenarioValues.js +3 -1
  211. package/dist/domain/callPath.js +47 -7
  212. package/dist/domain/canonicalDigest.js +65 -0
  213. package/dist/domain/canonicalOrdering.js +11 -0
  214. package/dist/domain/changedBehavior.js +8 -7
  215. package/dist/domain/comparisonSemantics.js +2 -4
  216. package/dist/domain/configurationErrors.js +25 -0
  217. package/dist/domain/dosCom.js +8 -0
  218. package/dist/domain/electronActiveObservation.js +3 -1
  219. package/dist/domain/electronStaticAnalysisBrowser.js +13 -23
  220. package/dist/domain/electronStaticAnalysisNative.js +2 -1
  221. package/dist/domain/electronStaticAnalysisValues.js +23 -3
  222. package/dist/domain/evidence.js +3 -11
  223. package/dist/domain/evidenceErrors.js +30 -0
  224. package/dist/domain/firmwareAnalysis.js +121 -0
  225. package/dist/domain/functionComparison.js +4 -2
  226. package/dist/domain/functionComparisonDimensions.js +6 -4
  227. package/dist/domain/functionComparisonNormalization.js +8 -1
  228. package/dist/domain/functionComparisonResults.js +1 -4
  229. package/dist/domain/hopperErrors.js +78 -0
  230. package/dist/domain/hopperValues.js +2 -1
  231. package/dist/domain/interfaceBuilderGraph.js +3 -1
  232. package/dist/domain/javascriptApplicationChangeGraph.js +2 -2
  233. package/dist/domain/javascriptApplicationGraph.js +13 -22
  234. package/dist/domain/javascriptApplicationVersionComparison.js +3 -11
  235. package/dist/domain/javascriptApplicationVersionItems.js +3 -3
  236. package/dist/domain/javascriptApplicationVersionKeys.js +1 -1
  237. package/dist/domain/javascriptAstFingerprint.js +1 -1
  238. package/dist/domain/javascriptExportShapeComparison.js +1 -2
  239. package/dist/domain/javascriptExportShapeSelection.js +1 -1
  240. package/dist/domain/javascriptExportShapeVariants.js +7 -3
  241. package/dist/domain/javascriptFeatureSeed.js +29 -9
  242. package/dist/domain/javascriptFeatureTrace.js +9 -13
  243. package/dist/domain/javascriptFeatureTraversal.js +2 -1
  244. package/dist/domain/javascriptNativeHandoff.js +2 -1
  245. package/dist/domain/javascriptRuntimeLoadState.js +2 -2
  246. package/dist/domain/javascriptRuntimeReconciliationActive.js +3 -10
  247. package/dist/domain/javascriptRuntimeReconciliationGraph.js +2 -2
  248. package/dist/domain/javascriptRuntimeReconciliationMatching.js +4 -3
  249. package/dist/domain/javascriptRuntimeReconciliationParsing.js +8 -14
  250. package/dist/domain/javascriptRuntimeReconciliationResult.js +4 -4
  251. package/dist/domain/javascriptRuntimeReconciliationSchemas.js +5 -2
  252. package/dist/domain/javascriptRuntimeStaticCandidates.js +8 -4
  253. package/dist/domain/javascriptSemanticAnalysis.js +40 -3
  254. package/dist/domain/javascriptSemanticCallResolution.js +2 -1
  255. package/dist/domain/javascriptSemanticChildProcesses.js +2 -1
  256. package/dist/domain/javascriptSemanticDataEffects.js +2 -1
  257. package/dist/domain/javascriptSemanticFingerprints.js +1 -1
  258. package/dist/domain/javascriptSemanticGraph.js +23 -28
  259. package/dist/domain/javascriptSemanticPrimitives.js +9 -2
  260. package/dist/domain/javascriptSemanticProjection.js +2 -1
  261. package/dist/domain/javascriptSemanticPromises.js +2 -1
  262. package/dist/domain/javascriptSemanticProvenance.js +1 -1
  263. package/dist/domain/javascriptSemanticQuery.js +7 -8
  264. package/dist/domain/javascriptSemanticQueryAssessment.js +1 -2
  265. package/dist/domain/javascriptSemanticQueryIdentity.js +1 -2
  266. package/dist/domain/javascriptSemanticReturns.js +2 -1
  267. package/dist/domain/javascriptSemanticValues.js +50 -16
  268. package/dist/domain/javascriptSourceParser.js +4 -2
  269. package/dist/domain/javascriptStaticAnalysis.js +1 -1
  270. package/dist/domain/javascriptStaticAnalysisBundler.js +2 -1
  271. package/dist/domain/javascriptStaticAnalysisCalls.js +14 -6
  272. package/dist/domain/javascriptStaticAnalysisHelpers.js +31 -4
  273. package/dist/domain/jsonShape.js +6 -2
  274. package/dist/domain/managedMemberComparison.js +1 -0
  275. package/dist/domain/managedMemberComparisonItems.js +2 -0
  276. package/dist/domain/managedNativeVerificationMatch.js +5 -3
  277. package/dist/domain/nativeDataType.js +2 -0
  278. package/dist/domain/nativeFunctionAnnotations.js +43 -0
  279. package/dist/domain/nativeLoadImage.js +95 -0
  280. package/dist/domain/nativeMetadataRecovery.js +55 -0
  281. package/dist/domain/processCapture.js +0 -1
  282. package/dist/domain/processEvidenceProvider.js +11 -0
  283. package/dist/domain/processTraceComparison.js +1 -1
  284. package/dist/domain/providerAdapterError.js +17 -0
  285. package/dist/domain/providerCleanupError.js +1 -1
  286. package/dist/domain/providerSelectionError.js +44 -0
  287. package/dist/domain/reconstructionUnknowns.js +1 -1
  288. package/dist/domain/reconstructionVerification.js +22 -8
  289. package/dist/domain/referenceSourceClassification.js +5 -6
  290. package/dist/domain/referenceSourceGraph.js +9 -17
  291. package/dist/domain/referenceSourceImportParsing.js +38 -23
  292. package/dist/domain/runtimeIdentification.js +1 -1
  293. package/dist/domain/runtimeVersion.js +4 -7
  294. package/dist/domain/safeJson.js +13 -0
  295. package/dist/domain/sourceToBundleComparison.js +5 -7
  296. package/dist/domain/sourceToBundleSignals.js +6 -6
  297. package/dist/domain/staticRuntimeCorrelation.js +9 -7
  298. package/dist/domain/unknownRegistryError.js +10 -0
  299. package/dist/domain/webBundleAnalyzerAst.js +22 -5
  300. package/dist/domain/webBundleAnalyzerInspection.js +20 -14
  301. package/dist/dotnet/ManagedMemberRows.js +1 -1
  302. package/dist/dotnet/ManagedMetadataHeaps.js +3 -2
  303. package/dist/dotnet/ManagedMetadataInventoryRows.js +4 -2
  304. package/dist/dotnet/ManagedMethodBodyReader.js +8 -1
  305. package/dist/dotnet/ManagedStaticProvider.js +3 -1
  306. package/dist/firmware/FirmwareCommand.js +163 -0
  307. package/dist/firmware/FirmwareFiles.js +190 -0
  308. package/dist/firmware/FirmwareProvider.js +258 -0
  309. package/dist/firmware/FirmwarePublication.js +84 -0
  310. package/dist/firmware/FirmwareRelease.js +32 -0
  311. package/dist/firmware/FirmwareReports.js +223 -0
  312. package/dist/generatedMcpToolCatalog.js +1 -1
  313. package/dist/generatedPackageMetadata.js +5 -5
  314. package/dist/ghidra/GhidraAnalysisProfile.js +37 -8
  315. package/dist/ghidra/GhidraClient.js +52 -6
  316. package/dist/ghidra/GhidraDiagnostics.js +3 -0
  317. package/dist/ghidra/GhidraDoctor.js +38 -14
  318. package/dist/ghidra/GhidraFunctionValues.js +10 -4
  319. package/dist/ghidra/GhidraInstallation.js +10 -4
  320. package/dist/ghidra/GhidraInventoryValues.js +39 -2
  321. package/dist/ghidra/GhidraLauncher.js +91 -26
  322. package/dist/ghidra/GhidraLoadImageValues.js +199 -0
  323. package/dist/ghidra/GhidraProvider.js +129 -13
  324. package/dist/ghidra/GhidraProviderCapabilities.js +52 -15
  325. package/dist/ghidra/GhidraRequestQueue.js +2 -2
  326. package/dist/ghidra/GhidraSessionError.js +31 -4
  327. package/dist/ghidra/GhidraSessionValues.js +10 -7
  328. package/dist/ghidra/GhidraTargetSnapshot.js +16 -2
  329. package/dist/ghidra/GhidraTransport.js +12 -0
  330. package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
  331. package/dist/ghidra/extensions/GhidraExtensions.js +170 -0
  332. package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +21 -0
  333. package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +84 -0
  334. package/dist/hopper/BridgeLauncher.js +4 -2
  335. package/dist/hopper/HopperAnalysisProfile.js +7 -2
  336. package/dist/hopper/HopperCleanup.js +55 -9
  337. package/dist/hopper/HopperClient.js +14 -4
  338. package/dist/hopper/HopperProcessDiagnostic.js +1 -1
  339. package/dist/hopper/HopperProvider.js +8 -4
  340. package/dist/hopper/HopperRequestQueue.js +7 -3
  341. package/dist/hopper/HopperSessionValues.js +1 -1
  342. package/dist/hopper/HopperSocketConnection.js +1 -1
  343. package/dist/hopper/HopperTargetLease.js +23 -15
  344. package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +7 -8
  345. package/dist/hopper/LinuxPrivateDisplayProbe.js +6 -2
  346. package/dist/hopper/protocol.js +8 -8
  347. package/dist/ida/IdaConfiguration.js +56 -0
  348. package/dist/ida/IdaDoctor.js +53 -0
  349. package/dist/ida/IdaInput.js +62 -0
  350. package/dist/ida/IdaMcpConnection.js +111 -0
  351. package/dist/ida/IdaOperationRunner.js +299 -0
  352. package/dist/ida/IdaProtocolValues.js +178 -0
  353. package/dist/ida/IdaProvider.js +126 -0
  354. package/dist/ida/IdaProviderCapabilities.js +60 -0
  355. package/dist/ida/IdaSessionClient.js +306 -0
  356. package/dist/ida/IdaWorkspace.js +54 -0
  357. package/dist/main/shutdown.js +21 -1
  358. package/dist/main/startup.js +1 -1
  359. package/dist/main/transport.js +8 -4
  360. package/dist/main.js +5 -2
  361. package/dist/native/AppleDispatchMetadata.js +31 -10
  362. package/dist/native/NativeMacOSProvider.js +87 -15
  363. package/dist/native/NativeMachoInspection.js +42 -12
  364. package/dist/native/NativeUiHelperRuntime.js +7 -1
  365. package/dist/native/NativeUiObservation.js +6 -2
  366. package/dist/native/parsers/demangle.js +1 -1
  367. package/dist/native/parsers/dyldInfo.js +3 -3
  368. package/dist/native/parsers/otool.js +4 -1
  369. package/dist/native/parsers/plist.js +11 -3
  370. package/dist/process/PrivateRuntimeRoot.js +13 -3
  371. package/dist/process/ProcessOwnership.js +5 -73
  372. package/dist/process/ProcessOwnershipObservation.js +62 -2
  373. package/dist/process/ProcessOwnershipProcessTree.js +13 -0
  374. package/dist/process/ProviderProcess.js +24 -7
  375. package/dist/process/ProviderRunLineage.js +1 -1
  376. package/dist/process/WindowsAuthority.js +20 -1
  377. package/dist/reference/ReferenceSourceReaderEntries.js +5 -1
  378. package/dist/reference/ReferenceSourceReaderFile.js +1 -0
  379. package/dist/server/createServer.js +25 -2
  380. package/dist/server/mcpProgress.js +2 -1
  381. package/dist/server/promptCompletion.js +3 -3
  382. package/dist/server/registerAndroidTools.js +30 -0
  383. package/dist/server/registerApplicationTools/compareExportShapes.js +5 -1
  384. package/dist/server/registerApplicationTools/compareSourceToBundle.js +7 -2
  385. package/dist/server/registerApplicationTools/compareVersions.js +5 -1
  386. package/dist/server/registerApplicationTools/traceFeature.js +7 -2
  387. package/dist/server/registerApplicationTools/traceSemantics.js +7 -2
  388. package/dist/server/registerEnhancedTools.js +28 -1
  389. package/dist/server/registerFirmwareTools.js +22 -0
  390. package/dist/server/registerFunctionComparisonTool.js +1 -1
  391. package/dist/server/registerInvestigationTools/helpers.js +2 -1
  392. package/dist/server/registerManagedTools.js +1 -1
  393. package/dist/server/registerManagedWorkflowTools/evidence.js +1 -1
  394. package/dist/server/registerOfficialTools.js +4 -1
  395. package/dist/server/registerProcessComparisonTool.js +5 -2
  396. package/dist/server/registerSessionTools.js +3 -1
  397. package/dist/server/runDerivedOperation.js +1 -1
  398. package/dist/server/sessionAvailabilityPolicy.js +3 -0
  399. package/dist/server/sessionEvidence.js +1 -1
  400. package/dist/server/toolResult.js +2 -1
  401. package/dist/windows/WindowsNativeLoader.js +108 -0
  402. package/dist/windows/WindowsOwnedProcess.js +168 -0
  403. package/dist/windows/WindowsPrivateRuntime.js +137 -0
  404. package/install.sh +4 -6
  405. package/native/windows/README.md +102 -0
  406. package/native/windows/build/manifest.json +9 -0
  407. package/native/windows/build/rea-windows-x64.node +0 -0
  408. package/package.json +38 -24
  409. package/scripts/rea.mjs +1 -1
  410. package/scripts/verify-windows-native-artifact.mjs +39 -0
  411. package/skills/reverse-engineer-anything/SKILL.md +92 -24
  412. package/skills/reverse-engineer-anything/references/android-applications.md +31 -0
  413. package/skills/reverse-engineer-anything/references/javascript-applications.md +19 -2
  414. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +52 -4
  415. package/dist/browser/CdpCanonicalJsonDigest.js +0 -9
  416. package/dist/domain/errors.js +0 -324
@@ -0,0 +1,102 @@
1
+ # Windows native controls
2
+
3
+ REA ships one Windows x64 Node-API 8 addon. Users do not compile it or install
4
+ another runtime. Ghidra and a full JDK remain bring-your-own prerequisites.
5
+ The addon uses Windows 10+ APIs and admits fixed local NTFS volumes only.
6
+
7
+ The package owns the artifact path. The loader checks the package version,
8
+ ABI, Node-API compatibility, PE architecture, and SHA-256 before loading it.
9
+ There is no environment override for loading an arbitrary native module.
10
+
11
+ ## Build
12
+
13
+ The artifact lane requires Linux, MinGW-w64 `x86_64-w64-mingw32-g++`,
14
+ `x86_64-w64-mingw32-dlltool`, and `tar`. It never installs these commands.
15
+ Node-API headers are reused from the build cache or downloaded from the
16
+ pinned official Node release with its published SHA-256 checked.
17
+
18
+ ```sh
19
+ npm run build:windows-native
20
+ npm run verify:windows-native:artifact
21
+ npm pack
22
+ ```
23
+
24
+ `build/` is ignored by Git. The npm file inventory includes only the addon and
25
+ its manifest. Release CI builds both, and `prepublishOnly` rejects a missing,
26
+ stale, mismatched, or wrong-architecture artifact. A development tarball built
27
+ without this lane reports Windows native controls as unavailable.
28
+
29
+ ## Boundaries
30
+
31
+ - Opaque Node objects carry a native type tag, resource kind, and closed state.
32
+ A pathname, serialized object, or forged handle cannot grant authority.
33
+ - Input admission opens every component with `OPEN_REPARSE_POINT`, verifies
34
+ the actual NTFS object, and retains handles that deny replacement and source
35
+ writing. An admitted child keeps each ancestor nonempty; ancestor handles
36
+ permit unrelated writes while NTFS rejects in-place reparse conversion. Volume serial, 128-bit file ID, final handle path,
37
+ requested path, size, and digest observations are preserved separately.
38
+ - New runtime roots and private child objects are created relative to admitted
39
+ parent handles with `NtCreateFile`. A protected DACL and current-user owner
40
+ are installed at creation. Readback permits exactly the current user and SYSTEM. Child
41
+ files inherit this boundary; private files are also checked by handle.
42
+ - Snapshots stream through a 64 KiB buffer on a Node async worker. Cancellation
43
+ is checked between reads, cleanup waits for settlement, and the digest
44
+ commits to the bytes written. Descriptor and snapshot handles remain held
45
+ until runtime cleanup.
46
+ Snapshot ownership is single-flight per runtime: an overlapping request fails
47
+ with `ERROR_BUSY` before acquiring cancellation ownership. The TypeScript owner
48
+ records only the accepted promise and abort listener; aborting a rejected copy
49
+ must not cancel the active copy.
50
+ - `PROC_THREAD_ATTRIBUTE_JOB_LIST` assigns a suspended child atomically to an
51
+ unnamed, non-inherited Job Object. Membership and kill-on-close policy are
52
+ checked before resume. Breakaway is disabled, and cleanup waits for all
53
+ job members and captured output, including detached descendants.
54
+ - Only the suspended child's default file owner is normalized. Caller token
55
+ privileges and ownership remain unchanged. Caller CPU affinity and process
56
+ priority are preserved in the child. Environment names are sorted and
57
+ deduplicated using Windows ordinal comparison, preserving their native Unicode
58
+ semantics and caller-selected values.
59
+ - Cleanup walks locked directory objects, removes files by handle, and unlinks
60
+ reparse entries without traversing their targets. Normal close, cancellation,
61
+ startup failure, and timeout release provider resources. Abrupt owner death
62
+ kills the owned job; it can leave private runtime files for later operator
63
+ cleanup and does not claim transactional deletion after a crash.
64
+
65
+ Windows failures retain their constraint, requested coordinate, Win32 code,
66
+ and system message. Unsupported filesystems and reparse paths are distinct
67
+ from OS access denial and missing packaged controls.
68
+
69
+ The bearer-token descriptor remains under its immutable private lease until
70
+ `runtime_close` on Windows; POSIX removes the descriptor after the bridge reads
71
+ it. Job ownership guarantees process termination on owner death, not deletion
72
+ of private files after a crash. SUBST drive aliases and changing DOS-device
73
+ namespaces are outside the verified P0 scope and are not detected as a separate
74
+ alias policy. Mounted-folder paths that report a reparse tag are rejected by
75
+ component admission; broader namespace variants remain unverified. Preserve
76
+ requested and final handle coordinates rather than treating them as one identity.
77
+
78
+ ## Real verification
79
+
80
+ ```powershell
81
+ npm run verify:windows-native
82
+ npm run verify:ghidra:windows
83
+ ```
84
+
85
+ The native lane checks DACL readback independently, source write/replacement
86
+ rejection, unrelated sibling renames, reparse rejection, immutable snapshots,
87
+ asynchronous cancellation, cleanup containment,
88
+ descendant termination, unrelated-process preservation, normal exit, owner
89
+ close, and forced owner exit. An optional independently built
90
+ `tests/fixtures/windows/processBoundary.cc` executable adds breakaway and
91
+ caller/child token observations and an in-place ancestor reparse attempt:
92
+
93
+ ```powershell
94
+ node scripts/verify-windows-native.mjs . C:\fixtures\process-boundary.exe
95
+ ```
96
+
97
+ `nonAdminRunner.cc` is a test-only launcher for an elevated development shell.
98
+ It duplicates an existing non-elevated Explorer token belonging to the same
99
+ user, creates private temporary window-station objects, and launches the test
100
+ inside a kill-on-close fixture job. It does not create accounts, modify host
101
+ policy, or change the caller's token. A real-provider claim must additionally
102
+ verify the packaged CLI and MCP on that ordinary-user token.
@@ -0,0 +1,9 @@
1
+ {
2
+ "packageVersion": "4.1.0",
3
+ "platform": "win32",
4
+ "architecture": "x64",
5
+ "abiVersion": 1,
6
+ "nodeApiVersion": 8,
7
+ "artifact": "rea-windows-x64.node",
8
+ "artifactSha256": "47a8d4d03d1cd764c68e8881aecb9cda63c8bdbc00f770e5b428f31debc83b90"
9
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rea-agents",
3
3
  "mcpName": "io.github.morluto/rea",
4
- "version": "4.0.0",
4
+ "version": "4.1.0",
5
5
  "description": "Reverse engineer anything from your terminal or agent with one CLI and MCP server.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "rea-agents": "scripts/rea.mjs"
36
36
  },
37
37
  "engines": {
38
- "node": "^22.19.0 || >=24.11.0"
38
+ "node": "^22.19.0 || ^24.11.0 || >=26.0.0"
39
39
  },
40
40
  "packageManager": "npm@11.16.0",
41
41
  "files": [
@@ -44,6 +44,8 @@
44
44
  "bridge/hopper_bridge.py",
45
45
  "bridge/native/ReaNativeUI.swift",
46
46
  "bridge/ghidra/ReaGhidraBridge.java",
47
+ "bridge/ghidra/ReaGhidraExtensions.java",
48
+ "bridge/ghidra/ReaGhidraPrepareCom.java",
47
49
  "scripts/rea.mjs",
48
50
  "scripts/electron-active-hook.cjs",
49
51
  "scripts/electron-active-hook-boundaries.cjs",
@@ -52,7 +54,10 @@
52
54
  "scripts/prepare.mjs",
53
55
  "skills",
54
56
  "README.md",
55
- "LICENSE"
57
+ "LICENSE",
58
+ "native/windows/build/manifest.json",
59
+ "native/windows/build/rea-windows-x64.node",
60
+ "scripts/verify-windows-native-artifact.mjs"
56
61
  ],
57
62
  "scripts": {
58
63
  "deps:check": "node scripts/check-dependency-install.mjs",
@@ -73,7 +78,7 @@
73
78
  "precheck:test": "npm run deps:check",
74
79
  "check:test": "turbo run typecheck lint format:check knip metadata:check test:run",
75
80
  "precheck:pr": "npm run deps:check",
76
- "check:pr": "turbo run typecheck lint format:check knip metadata:check test:run && npm run docs:check",
81
+ "check:pr": "turbo run typecheck lint format:check knip metadata:check test:run && npm run docs:check && npm run jscpd && npm run scan:todos",
77
82
  "precheck:ci": "npm run deps:check",
78
83
  "check:ci": "turbo run typecheck lint format:check knip metadata:check jscpd scan:todos",
79
84
  "build:cached": "turbo run build",
@@ -82,7 +87,6 @@
82
87
  "lint": "oxlint",
83
88
  "lint:fix": "oxlint --fix",
84
89
  "knip": "knip",
85
- "lint:dead": "knip",
86
90
  "jscpd": "jscpd src/ tests/",
87
91
  "scan:todos": "node scripts/scan-todos.mjs",
88
92
  "start": "node scripts/rea.mjs mcp",
@@ -119,8 +123,10 @@
119
123
  "verify:native-ui": "npm run build:cached && node scripts/verify-native-ui.mjs",
120
124
  "verify:keyed-archive": "npm run build:cached && node scripts/verify-keyed-archive.mjs",
121
125
  "verify:ghidra": "npm run build:cached && node scripts/verify-real-ghidra.mjs",
126
+ "verify:ida": "npm run build:cached && node scripts/verify-real-ida.mjs",
122
127
  "verify:ghidra:switch": "npm run build:cached && node scripts/verify-real-ghidra-switch.mjs",
123
128
  "verify:ghidra:dos": "npm run build:cached && node scripts/verify-real-ghidra-dos.mjs",
129
+ "verify:ghidra:com": "npm run build:cached && node scripts/verify-real-ghidra-com.mjs",
124
130
  "verify:ghidra:aarch64-jump-table": "npm run build:cached && node scripts/verify-real-ghidra.mjs --aarch64-jump-table",
125
131
  "verify:interface-builder": "npm run build:cached && node scripts/verify-interface-builder.mjs",
126
132
  "verify:ghidra:cross-format": "npm run build:cached && node scripts/verify-real-ghidra.mjs --cross-format",
@@ -129,8 +135,13 @@
129
135
  "verify:electron": "npm run build:cached && node scripts/verify-real-electron.mjs",
130
136
  "verify:inspector": "npm run build:cached && node scripts/verify-real-javascript-runtime-observation.mjs",
131
137
  "verify:javascript-runtime": "npm run build:cached && node scripts/verify-local-javascript-runtime.mjs",
138
+ "verify:javascript:digests": "npm run build:cached && node scripts/verify-large-javascript-digests.mjs",
132
139
  "verify:application-workflows": "npm run build:cached && node scripts/verify-local-application-workflows.mjs",
133
140
  "verify:managed": "npm run build:cached && node scripts/verify-managed-conformance.mjs",
141
+ "verify:firmware": "npm run build:cached && node scripts/verify-real-firmware.mjs",
142
+ "fixtures:firmware": "node scripts/generate-firmware-fixtures.mjs",
143
+ "verify:android": "npm run build:cached && node scripts/verify-real-android.mjs",
144
+ "fixtures:android": "node scripts/fetch-android-fixtures.mjs",
134
145
  "verify:agent": "npm run build:cached && node scripts/verify-agent-experience.mjs",
135
146
  "verify:hopper:linux": "npm run verify:fixtures && npm run build:cached && node scripts/verify-real-hopper-linux.mjs",
136
147
  "verify:setup:linux": "npm run build:cached && node scripts/verify-linux-setup-e2e.mjs",
@@ -145,8 +156,6 @@
145
156
  "config:print": "node scripts/print-mcp-config.mjs",
146
157
  "evidence:generate": "npm run build:cached && node scripts/generate-completion-ledger.mjs",
147
158
  "evidence:check": "npm run build:cached && node scripts/generate-completion-ledger.mjs --check",
148
- "docs:api": "typedoc",
149
- "docs:api:cached": "turbo run docs:api",
150
159
  "docs:generate": "node scripts/run-exclusive.mjs docs npm run docs:generate:unlocked",
151
160
  "docs:generate:unlocked": "npm run metadata:generate && npm run build:cached && node scripts/generate-mcp-tool-catalog.mjs && node scripts/generate-skill-metadata.mjs && node scripts/generate-product-catalog.mjs && node scripts/generate-completion-ledger.mjs && node scripts/generate-error-schema.mjs",
152
161
  "docs:check": "node scripts/run-exclusive.mjs docs turbo run docs:check:built",
@@ -156,7 +165,15 @@
156
165
  "prepare": "node scripts/prepare.mjs",
157
166
  "verify:asset-catalog": "npm run build:cached && node scripts/verify-asset-catalog.mjs",
158
167
  "verify:native-ui:permissions": "npm run build:cached && node scripts/verify-native-ui.mjs --allow-permission-denial",
159
- "test:focused": "node scripts/run-development-tests.mjs focused"
168
+ "test:focused": "node scripts/run-development-tests.mjs focused",
169
+ "build:windows-native": "node scripts/build-windows-native.mjs",
170
+ "verify:windows-native:artifact": "node scripts/verify-windows-native-artifact.mjs",
171
+ "prepublishOnly": "npm run verify:windows-native:artifact",
172
+ "verify:windows-native": "node scripts/verify-windows-native.mjs",
173
+ "verify:ghidra:windows:package": "node scripts/verify-packaged-ghidra-windows.mjs",
174
+ "build:ghidra:nativeaot": "node scripts/build-ghidra-nativeaot.mjs",
175
+ "build:fixtures:nativeaot": "node scripts/generate-nativeaot-fixtures.mjs",
176
+ "verify:ghidra:nativeaot": "npm run build:cached && node scripts/verify-real-ghidra-nativeaot.mjs"
160
177
  },
161
178
  "lint-staged": {
162
179
  "*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}": [
@@ -172,48 +189,45 @@
172
189
  "@electron/asar": "4.2.0",
173
190
  "@jridgewell/trace-mapping": "0.3.31",
174
191
  "@lydell/node-pty": "1.1.0",
175
- "@modelcontextprotocol/client": "2.0.0",
176
- "@modelcontextprotocol/server": "2.0.0",
192
+ "@modelcontextprotocol/client": "2.3.1",
193
+ "@modelcontextprotocol/server": "2.3.1",
177
194
  "@xterm/addon-serialize": "0.14.0",
178
195
  "@xterm/headless": "6.0.0",
179
196
  "@zip.js/zip.js": "2.8.26",
180
197
  "canonicalize": "3.0.0",
181
198
  "cross-spawn": "7.0.6",
182
199
  "diff": "9.0.0",
183
- "graphology": "0.26.0",
184
- "graphology-shortest-path": "2.1.0",
185
200
  "ignore": "7.0.6",
186
- "incur": "0.4.13",
201
+ "incur": "0.6.1",
187
202
  "isomorphic-git": "1.38.7",
188
203
  "jsonc-parser": "3.3.1",
189
- "pino": "9.14.0",
204
+ "pino": "10.4.0",
190
205
  "playwright-core": "1.58.2",
191
206
  "plist": "5.0.0",
192
207
  "semver": "7.8.5",
193
- "smol-toml": "^1.7.0",
208
+ "smol-toml": "1.7.0",
194
209
  "write-file-atomic": "7.0.0",
195
210
  "ws": "8.21.0",
196
211
  "zod": "4.4.3"
197
212
  },
198
213
  "devDependencies": {
199
- "@fast-check/vitest": "0.4.1",
214
+ "@fast-check/vitest": "0.5.0",
200
215
  "@types/cross-spawn": "6.0.6",
201
- "@types/node": "24.10.1",
216
+ "@types/node": "26.6.4",
202
217
  "@types/semver": "7.7.1",
203
218
  "@types/write-file-atomic": "4.0.3",
204
219
  "@types/ws": "8.18.1",
205
- "@vitest/coverage-v8": "4.1.10",
220
+ "@vitest/coverage-v8": "5.0.3",
206
221
  "ajv": "8.20.0",
207
222
  "husky": "9.1.7",
208
223
  "jscpd": "5.0.12",
209
- "knip": "6.26.0",
224
+ "knip": "6.39.0",
210
225
  "lint-staged": "16.4.0",
211
226
  "oxfmt": "0.72.0",
212
- "oxlint": "1.73.0",
213
- "turbo": "2.10.5",
214
- "typedoc": "0.28.20",
215
- "typescript": "5.9.3",
216
- "vitest": "4.1.10",
227
+ "oxlint": "1.87.0",
228
+ "turbo": "2.11.7",
229
+ "typescript": "7.0.2",
230
+ "vitest": "5.0.3",
217
231
  "yaml": "2.9.0"
218
232
  }
219
233
  }
package/scripts/rea.mjs CHANGED
@@ -23,7 +23,7 @@ const runtimeFiles = isMcpMode
23
23
 
24
24
  if (!(await compiledRuntimeExists(runtimeFiles))) {
25
25
  process.stderr.write(
26
- `REA's compiled runtime is missing. Run \`npm ci\` in ${packageRoot} to install dependencies and build REA, then restart it. If this is an installed package, reinstall rea-agents.\n`,
26
+ `REA's compiled runtime is missing. Run \`npm ci && npm run build:cached\` in ${packageRoot} to install dependencies and build REA, then restart it. If this is an installed package, reinstall rea-agents.\n`,
27
27
  );
28
28
  process.exitCode = 1;
29
29
  } else if (isMcpMode) {
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createHash } from "node:crypto";
4
+ import { readFile } from "node:fs/promises";
5
+
6
+ const root = new URL("../", import.meta.url);
7
+ const packageJson = JSON.parse(
8
+ await readFile(new URL("package.json", root), "utf8"),
9
+ );
10
+ const manifest = JSON.parse(
11
+ await readFile(new URL("native/windows/build/manifest.json", root), "utf8"),
12
+ );
13
+ const bytes = await readFile(
14
+ new URL("native/windows/build/rea-windows-x64.node", root),
15
+ );
16
+ if (
17
+ manifest.packageVersion !== packageJson.version ||
18
+ manifest.platform !== "win32" ||
19
+ manifest.architecture !== "x64" ||
20
+ manifest.abiVersion !== 1 ||
21
+ manifest.nodeApiVersion !== 8 ||
22
+ manifest.artifact !== "rea-windows-x64.node" ||
23
+ createHash("sha256").update(bytes).digest("hex") !== manifest.artifactSha256
24
+ )
25
+ throw new Error(
26
+ "Windows native artifact metadata or SHA-256 does not match this package; run the Windows native build lane.",
27
+ );
28
+ const offset = bytes.length >= 64 ? bytes.readUInt32LE(0x3c) : bytes.length;
29
+ if (
30
+ bytes.toString("ascii", 0, 2) !== "MZ" ||
31
+ offset > bytes.length - 26 ||
32
+ bytes.toString("ascii", offset, offset + 4) !== "PE\0\0" ||
33
+ bytes.readUInt16LE(offset + 4) !== 0x8664 ||
34
+ bytes.readUInt16LE(offset + 24) !== 0x20b
35
+ )
36
+ throw new Error("Windows native artifact must be a Windows x64 PE32+ image.");
37
+ process.stdout.write(
38
+ `${JSON.stringify({ ok: true, ...manifest, artifactBytes: bytes.length })}\n`,
39
+ );
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: reverse-engineer-anything
3
- description: Reverse engineer native, managed, Electron/JavaScript, packaged, and browser applications with REA. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.
3
+ description: Reverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.
4
4
  metadata:
5
- version: "24"
6
- tool_count: 116
7
- catalog_digest: "5bb3f994a3c4d0c87a34ff5aab4e28141b5fa6f3a98b5ae7e95686d85d9d983e"
5
+ version: "26"
6
+ tool_count: 125
7
+ catalog_digest: "ed9c36900e9223561d38ba30a44921f4ff101d5eca989920f9edc9dc91df470b"
8
8
  ---
9
9
 
10
10
  # REA
@@ -15,32 +15,110 @@ behavior not established by available source. For ordinary analysis of a
15
15
  complete source repository, use normal repository tools and do not run REA
16
16
  readiness or provider commands.
17
17
 
18
+ ## Connect only when needed
19
+
20
+ Installing this skill supplies instructions; it does not register the REA MCP
21
+ server, install analysis engines, or add tools to an already-running agent.
22
+
23
+ If REA tools are available and their registration is not known to be stale,
24
+ proceed directly to the target. Do not run diagnostics or setup before every
25
+ investigation. Use the connected server's actual tool list and input schemas;
26
+ a skill installed from repository main may describe capabilities absent from
27
+ an older npm release. Keep complete inline Evidence when that server does not
28
+ advertise retained references.
29
+
30
+ When tools are absent or registration is stale:
31
+
32
+ 1. Diagnose without changing files. For Codex, run
33
+ `npx -y rea-agents@latest doctor --client codex --json`. Substitute the current
34
+ supported client: `claude_code`, `claude_desktop`, `codex`, `cursor`,
35
+ `gemini_cli`, `windsurf`, `devin`, `opencode`, `antigravity`, `copilot_cli`,
36
+ `commandcode`, or `vscode`. If the client is unknown, use `doctor --json` and
37
+ inspect its registration results before choosing a setup scope.
38
+ 2. Distinguish the reason. Missing, malformed, or stale registration needs a
39
+ scoped configuration repair. An aligned registration with no tools in the
40
+ active session needs a restart/reconnection; doctor cannot prove that the
41
+ current agent has connected. A missing provider affects only tasks requiring
42
+ that provider: static JavaScript inspection needs neither Hopper nor Ghidra,
43
+ and Android inspection has separate bring-your-own JADX/Java prerequisites.
44
+ 3. For a configuration repair, prepare the read-only plan:
45
+ `npx -y rea-agents@latest setup --client codex --dry-run --json`.
46
+ Use the current client's ID, show its exact proposed paths, backups, and
47
+ changes, and obtain approval before setup writes configuration or installs
48
+ Hopper. Setup normally installs the matching bundled skill too; include that
49
+ replacement in the reviewed plan. After approval, apply the same scope with
50
+ `npx -y rea-agents@latest setup --client codex --yes`. Add `--install-hopper`
51
+ only if that separate installation was needed and explicitly approved.
52
+ 4. Restart/reconnect the affected agent. Verify that REA tools actually appear
53
+ in the session, then resume the original investigation. If they remain
54
+ absent, inspect the client's MCP launch error rather than repeating setup.
55
+
56
+ REA setup never installs or upgrades Node.js, npm, Homebrew, Java, Ghidra, IDA,
57
+ JADX, Binwalk, or Unblob. Use existing prerequisites; do not install unrelated
58
+ software to repair
59
+ MCP registration. For an unsupported client, use manual stdio registration
60
+ with a version-pinned `rea-agents` package or continue through the CLI.
61
+
62
+ A concrete CLI fallback for an operator-supplied JavaScript tree or ASAR is:
63
+
64
+ ```bash
65
+ npx -y rea-agents@latest analyze-javascript-application /absolute/path/to/app --json
66
+ ```
67
+
68
+ No MCP registration or native engine is required. Read the returned Evidence,
69
+ graph, limitations, and unknowns with the same care as an MCP result; the CLI
70
+ returns the Evidence record directly. This fallback does not establish that
71
+ MCP is configured. Native CLI tasks still require their selected engine.
72
+
18
73
  ## Route the target first
19
74
 
20
- Choose the first tool from the target the user supplied. Do not call
21
- `open_binary` unless the target is native or an analysis database.
75
+ Choose the first tool from the target the user supplied. Use `open_binary` for
76
+ active-target native or archive workflows; target-free tools take their own
77
+ explicit path or endpoint and do not need it.
22
78
 
23
79
  - ASAR or extracted JavaScript/Electron tree:
24
80
  `analyze_javascript_application`.
25
- - Archive, application package, ZIP/APK/IPA/MSIX/AppX, or DMG:
81
+ - Archive/package member inventory (ZIP/APK/IPA/MSIX/AppX or DMG):
26
82
  `open_binary` with the supplied local path; use `inspect_artifact` when its
27
83
  graph and findings help answer the question.
84
+ - Android APK code, classes, methods, or incoming references:
85
+ `inspect_android_package`, then focused Android tools when advertised.
86
+ Archive member inventory still uses the archive route above.
28
87
  - Managed PE/CLI assembly: `inspect_managed_artifact`.
88
+ - Firmware image: `inspect_firmware_regions` when advertised. Use
89
+ `extract_firmware` when extraction is requested, with a caller-selected new
90
+ absolute output directory. These tools use caller-supplied Binwalk/Unblob on
91
+ Linux; see the [firmware guide](https://github.com/morluto/rea/blob/main/docs/firmware-analysis.md).
92
+ - .NET NativeAOT PE/ELF: native Ghidra analysis. Native code can yield pseudocode;
93
+ consult the NativeAOT workflow in `references/native-and-artifacts.md` for
94
+ optional metadata recovery and its supported host/layout boundary.
29
95
  - User-owned browser page already open: `list_browser_targets`.
30
96
  - User-owned Electron runtime already open: `list_electron_targets`.
31
97
  - Native executable, library, or analysis database: `open_binary`, then
32
98
  use focused analysis tools directly; call `binary_overview` when metadata or
33
- inventory context is useful.
99
+ inventory context is useful and available from the selected provider.
100
+
101
+ For an existing IDA MCP configuration, use `open_binary` with the original
102
+ input binary and `provider_id: "ida"`; do not pass an `.idb` or `.i64` database.
103
+ The legacy attached profile binds the already-open GUI input by SHA-256 and
104
+ leaves its database open. The modern headless profile creates and closes an
105
+ owned private database without saving. Installation and registration reuse
106
+ [mrexodia/ida-pro-mcp](https://github.com/mrexodia/ida-pro-mcp); see the
107
+ [IDA provider guide](https://github.com/morluto/rea/blob/main/docs/ida-provider.md).
108
+ Proceed directly to `analyze_function`, pseudocode, or function/string searches
109
+ after opening; IDA does not supply `binary_overview`. Consult session availability
110
+ when composing broader workflows. Modern direct callers and unsupported dossier
111
+ facets remain unknown; live IDA results are not replayed from snapshots.
34
112
 
35
113
  If the app is missing, ask which app to inspect. Resolve a human-readable app
36
114
  name to one clear installed artifact when possible; ask only when matches are
37
115
  ambiguous. Never choose an example app on the user's behalf.
38
116
 
39
117
  In a target-free session, use `open_binary` to bind any archive/package or
40
- native target whose analysis tool operates on the active target. Do not call a
41
- tool hidden from `tools/list`; inspect `binary_session` with
42
- `detail: "capabilities"` for the exact remediation when a desired capability
43
- is unavailable.
118
+ native target whose analysis tool operates on the active target. Do not call an
119
+ unadvertised tool; inspect `binary_session` with `{}` and its
120
+ `result.tool_availability` for availability reasons and remediation. The tool
121
+ list stays complete; availability depends on the operation, target, and host.
44
122
 
45
123
  ## Work summary-first
46
124
 
@@ -98,23 +176,13 @@ as complete while required questions remain open.
98
176
  [references/native-and-artifacts.md](references/native-and-artifacts.md)
99
177
  - ASARs, extracted JavaScript, feature tracing, and version comparison:
100
178
  [references/javascript-applications.md](references/javascript-applications.md)
179
+ - Android APK declarations, classes, methods, and static references:
180
+ [references/android-applications.md](references/android-applications.md)
101
181
  - Passive browser/Electron observation and static/runtime reconciliation:
102
182
  [references/runtime-observation.md](references/runtime-observation.md)
103
183
  - Evidence paging, comparisons, residual unknowns, and verification:
104
184
  [references/evidence-workflows.md](references/evidence-workflows.md)
105
185
 
106
- ## Readiness and setup
107
-
108
- The readiness rule is conditional: when REA tools are available and their
109
- registration is not known to be stale, proceed directly; do not run `doctor`
110
- before every task. Run `npx -y rea-agents@latest doctor` when the MCP server or
111
- required provider is unavailable, registration is reported stale, or the user
112
- asks for an environment diagnosis. Propose
113
- `npx -y rea-agents@latest setup` only when doctor identifies an alignment or
114
- provider problem. Show the exact plan and obtain approval before setup writes
115
- configuration or installs Hopper. Restart the agent after MCP registration
116
- changes; direct CLI commands remain available immediately.
117
-
118
186
  ## Finish the task
119
187
 
120
188
  Explain findings in plain language and tie them to returned evidence. When the
@@ -0,0 +1,31 @@
1
+ # Android application artifacts
2
+
3
+ Use the connected server's advertised Android tools. Repository main includes
4
+ this family; npm 4.0.1 does not. A skill installation alone cannot add it to an
5
+ older server.
6
+
7
+ Start with `inspect_android_package` on the caller's APK path for package
8
+ identity, manifest declarations, coverage, and inline Evidence. Use
9
+ `search_android_classes` to find candidates, `inspect_android_class` for one
10
+ class's members, `inspect_android_method` for decompilation, and
11
+ `trace_android_references` for incoming static references. Each call takes its
12
+ own APK path and explicit selectors; do not open a native session first.
13
+ Choose an `overload_index` from the class inventory when methods are ambiguous
14
+ instead of guessing.
15
+
16
+ The provider requires a separately supplied headless JADX MCP JAR 0.7.1 and
17
+ Java 17 or newer. `REA_JADX_MCP_JAR` selects the absolute JAR path; `JAVA_HOME`
18
+ can select Java. REA setup does not install or configure that JAR, and doctor
19
+ provider scopes cover Hopper/Ghidra rather than JADX. Use existing tools and
20
+ report missing prerequisites for the Android task specifically.
21
+
22
+ Real verification covers Linux. macOS has the POSIX launch boundary but no
23
+ claimed real-provider verification; Windows is unsupported. Calls use one
24
+ worker, a bounded JVM heap, and provider deadlines. The APK is never launched,
25
+ and no emulator is required.
26
+
27
+ Manifest entries and decompiled text are static observations, not execution or
28
+ policy enforcement. Incoming references are recovered static relationships;
29
+ reflection, dynamic loading, and unresolved calls remain unknown. Preserve
30
+ artifact digests, locations, diagnostics, and incomplete coverage. For archive
31
+ members rather than code analysis, use `open_binary` and `inspect_artifact`.
@@ -15,7 +15,9 @@ registration, defaults, or policy enforcement from static analysis.
15
15
 
16
16
  Use `trace_application_feature` on existing application Evidence for one
17
17
  literal node ID, route, string, API, IPC channel, module, or native export.
18
- Choose a direction and include the complete application Evidence inline. Include
18
+ Choose a direction and reuse the returned application Evidence ID when the
19
+ connected server advertises retained references, or supply complete Evidence
20
+ inline. Include
19
21
  Hopper or Ghidra Evidence only when its artifact digest matches exactly.
20
22
 
21
23
  For version comparison, analyze each version once, then call
@@ -27,10 +29,25 @@ opposite-side coverage; otherwise report unknown.
27
29
  When the question asks how one exact exported callable's returned object shape
28
30
  changed, analyze each version once and then call
29
31
  `compare_javascript_export_shapes` with explicit module paths and export names.
30
- Include the complete Evidence records from both analysis calls. Accept variant
32
+ Use the returned IDs on the same connection, or complete inline Evidence
33
+ records, from both analysis calls. Accept variant
31
34
  pairing only through the tool's unique exact literal discriminant. Cite the
32
35
  comparison Evidence and report JSON Pointer changes; dynamic values, ambiguous
33
36
  variants, and incomplete parent-property coverage stay unknown. This is static
34
37
  inference, not runtime behavior. When runtime semantics are needed, run
35
38
  behavioral probes against the relevant application versions and capture them
36
39
  through the available browser, Electron, or process workflows.
40
+
41
+ ## Reusing application Evidence
42
+
43
+ When advertised by the connected server, application trace and compare tools
44
+ accept complete inline Evidence or
45
+ `{"kind":"retained-evidence","evidence_id":"ev_<64 lowercase hex characters>"}`
46
+ for their application input (`application`, or `left`/`right`). This notation is
47
+ a template: replace it with the actual returned ID. npm 4.0.1 accepts only full
48
+ inline Evidence. Use the exact ID
49
+ returned by the producer on the same MCP connection. Resolution does not run
50
+ analysis or select a provider; findings remain inline. Native observation
51
+ arrays still take full Evidence. `close_binary` clears retained references;
52
+ export a bundle before closing, or supply portable inline Evidence in another
53
+ connection. A missing reference includes its ID and recovery guidance.
@@ -9,10 +9,25 @@ cross-references. Addresses and recovered pseudocode are analysis observations,
9
9
  not original source. Provider unavailability and unsupported metadata remain
10
10
  unknown rather than false.
11
11
 
12
- Use `binary_session` with its default summary to check the open target, selected
13
- provider, alignment, and recommended remediation. Request the capabilities view
14
- with a family filter and page bounds only when choosing a tool. Request the full
15
- view only for an explicit session-diagnostic need.
12
+ Use `binary_session` with no arguments to check the open target, selected
13
+ provider, and alignment. Its default `result.tool_availability` includes the
14
+ complete tool inventory with availability reasons and remediation. When choosing
15
+ a tool, use its entry in that result; `tools/list` retains the complete catalog
16
+ when the target or provider state changes.
17
+
18
+ ## DOS MZ with Ghidra
19
+
20
+ For an admitted DOS MZ target, use `inspect_native_load_image` to check measured
21
+ loaded bytes, file mappings, relocations and the entry against the immutable
22
+ snapshot. Keep `mismatch` and `unsupported` explicit. Verified import covers the
23
+ reported static image, not runtime DOS or PC-98 hardware behavior.
24
+
25
+ Use `read_bytes` for initialized analysis memory and `address_to_file_offset` to
26
+ anchor one observed address to original file bytes. Loader fixups can change a
27
+ word; a source offset does not imply byte equality. Complete function body ranges
28
+ use inclusive ends and can contain gaps. Do not treat the enclosing span as code.
29
+ For packed targets, retain the original and separately derived artifact identities;
30
+ decompiling an unpacking stub does not recover the unpacked program.
16
31
 
17
32
  ## Managed PE/CLI
18
33
 
@@ -22,6 +37,30 @@ assembly. Keep managed/native boundaries and unavailable reconstruction facts
22
37
  explicit. A bring-your-own reconstruction oracle is separate from the canonical
23
38
  parser and must not become an implicit setup dependency.
24
39
 
40
+ ## .NET NativeAOT
41
+
42
+ A NativeAOT PE/ELF contains native code. Absence of PE/CLI metadata does not mean
43
+ analysis must stop at assembly. Use native function analysis for recovered
44
+ pseudocode; it is not reconstructed original C#.
45
+
46
+ With an explicitly configured NativeAOT Ghidra adapter, call
47
+ `inspect_native_load_image` after opening the target. Its optional
48
+ `observations.metadata_recovery` returns the format, positive header evidence,
49
+ coverage, derived-memory identity and type addresses/category paths inline.
50
+ Then inspect a reported type with `inspect_native_data_type`, follow its
51
+ `metadata_recovery.related_type`, interfaces and virtual slot addresses, and use
52
+ `analyze_function` plus string/xref searches for implementation evidence. Keep
53
+ `not_applicable`, partial recovery and unsupported layouts explicit. Generated
54
+ `Class_address` names and inferred System.Object/String identities are not
55
+ original names; custom field layouts remain unknown.
56
+
57
+ Recovery modifies an ephemeral analysis database and may replace loaded metadata
58
+ bytes with derived content. Original executable files remain unchanged. Distinguish
59
+ original file offsets from derived analysis memory. Windows x64 PE **targets**
60
+ can be analyzed on a supported Linux host; Windows **host** P0 does not admit
61
+ this database recovery. See the [NativeAOT guide](https://github.com/morluto/rea/blob/main/docs/ghidra-nativeaot.md)
62
+ for the tested layout and optional bring-your-own adapter build.
63
+
25
64
  ## Packages and extraction
26
65
 
27
66
  Use `inspect_artifact` for application bundles, archives, ZIP/APK/IPA/MSIX/AppX,
@@ -40,3 +79,12 @@ hosts, with an owned temporary mount directory and cleanup. It needs no approval
40
79
  flag. Unsupported hosts or mount failures remain explicit limitations; do not
41
80
  claim child inventory when only root identity is available. Extraction is a
42
81
  separate filesystem-writing operation.
82
+
83
+ For headerless DOS COM, explicitly open with `format: "dos-com"` (CLI
84
+ `--target-format dos-com`). Inspect the load image before trusting function
85
+ analysis: the entry is `0x10100`, file offset zero, with imposed real-mode segment
86
+ context. PSP/stack/device state remains unmodeled. See [DOS guide](https://github.com/morluto/rea/blob/main/docs/ghidra-dos.md).
87
+
88
+ ### Function annotations in Ghidra
89
+
90
+ Use `annotate_native_function` for one function name and/or entry comments, with at least one explicit change. Review its annotation readback and refreshed dossier inline. Changes are atomic and session-scoped; empty comments clear them, omitted fields preserve them. Later MCP calls observe edits until close. CLI `annotate-native-function` returns the updated analysis before discarding the session. Original executable bytes are unchanged; edits invalidate immutable snapshots. Windows P0 does not admit database mutations.
@@ -1,9 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import canonicalize from "canonicalize";
3
- /** Hash a value using the canonical JSON representation. */
4
- export const canonicalJsonDigest = (value) => {
5
- const encoded = canonicalize(value);
6
- if (encoded === undefined)
7
- throw new TypeError("Expected canonical JSON");
8
- return createHash("sha256").update(encoded).digest("hex");
9
- };