rea-agents 6.3.0 → 6.4.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 (487) hide show
  1. package/README.md +7 -4
  2. package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
  3. package/bridge/ghidra/ReaGhidraBridge.java +597 -209
  4. package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
  5. package/dist/adb/AdbConfiguration.js +88 -0
  6. package/dist/adb/AdbDeviceOutput.js +186 -0
  7. package/dist/adb/AdbProvider.js +1190 -0
  8. package/dist/adb/AdbShellOutput.js +309 -0
  9. package/dist/android/AndroidTargetSnapshot.js +104 -22
  10. package/dist/android/JadxConfiguration.js +44 -24
  11. package/dist/android/JadxProvider.js +51 -19
  12. package/dist/apktool/ApktoolConfiguration.js +84 -0
  13. package/dist/apktool/ApktoolDecodeOutput.js +59 -0
  14. package/dist/apktool/ApktoolProvider.js +506 -0
  15. package/dist/application/AnalysisProvider.js +8 -2
  16. package/dist/application/AppBundleExecutable.js +27 -22
  17. package/dist/application/BinaryTargetResolver.js +22 -2
  18. package/dist/application/CapabilityInventory.js +11 -1
  19. package/dist/application/ClientConfigurationDocument.js +70 -0
  20. package/dist/application/ClientConfigurationFiles.js +91 -0
  21. package/dist/application/ClientRegistrationEnvironment.js +35 -0
  22. package/dist/application/ClientRegistrationStatus.js +66 -31
  23. package/dist/application/DirectAnalysis.js +2 -2
  24. package/dist/application/DirectAnalysisCleanup.js +1 -1
  25. package/dist/application/DirectAnalysisStatus.js +1 -1
  26. package/dist/application/Doctor.js +5 -3
  27. package/dist/application/DoctorDiagnostics.js +1 -1
  28. package/dist/application/EvidenceBundleCommands.js +6 -12
  29. package/dist/application/GeminiClientSettings.js +139 -0
  30. package/dist/application/HermesClientHome.js +115 -0
  31. package/dist/application/HopperDownload.js +39 -0
  32. package/dist/application/InvestigationProviders.js +6 -0
  33. package/dist/application/JsonFiles.js +6 -5
  34. package/dist/{cliJsonFile.js → application/JsonInputFile.js} +108 -35
  35. package/dist/application/LinuxHopper.js +4 -12
  36. package/dist/application/MacHopper.js +172 -149
  37. package/dist/application/MipsElfAbiFlags.js +140 -0
  38. package/dist/application/ProviderOperationExecution.js +31 -0
  39. package/dist/application/ReconstructionObligationCandidates.js +9 -3
  40. package/dist/application/ReferenceSourceImport.js +76 -29
  41. package/dist/application/ReferenceSourceImportEntries.js +18 -9
  42. package/dist/application/ReferenceSourceImportPolicy.js +99 -23
  43. package/dist/application/ReferenceSourceImportTypes.js +30 -22
  44. package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
  45. package/dist/application/RegularFileRead.js +93 -7
  46. package/dist/application/Setup.js +54 -6
  47. package/dist/application/SetupClientConfiguration.js +116 -16
  48. package/dist/application/SetupHost.js +102 -24
  49. package/dist/application/SetupPlan.js +5 -8
  50. package/dist/application/SetupSkill.js +58 -39
  51. package/dist/application/SupportedClients.js +290 -65
  52. package/dist/application/Uninstall.js +158 -10
  53. package/dist/application/UpdateMaintenance.js +17 -21
  54. package/dist/application/Utf8JsonInput.js +7 -0
  55. package/dist/application/WebScriptExportService.js +131 -65
  56. package/dist/application/WebSourceLocationService.js +3 -0
  57. package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
  58. package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
  59. package/dist/application/analysisView/AnalysisViewService.js +40 -2
  60. package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
  61. package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
  62. package/dist/application/binary/AnalysisClientCleanup.js +0 -24
  63. package/dist/application/binary/BinarySession.js +2 -1
  64. package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
  65. package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
  66. package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
  67. package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
  68. package/dist/application/evm/EvmInterfaceService.js +3 -0
  69. package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
  70. package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
  71. package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
  72. package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
  73. package/dist/application/javascript/ElectronBoundaryGraphNative.js +19 -6
  74. package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
  75. package/dist/application/javascript/JavaScriptApplicationService.js +22 -11
  76. package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
  77. package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -30
  78. package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
  79. package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +67 -19
  80. package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
  81. package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
  82. package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +19 -16
  83. package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
  84. package/dist/application/javascript/JavaScriptArtifactPathResolution.js +258 -235
  85. package/dist/application/javascript/JavaScriptArtifactReconstruction.js +115 -26
  86. package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -1
  87. package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -4
  88. package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
  89. package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
  90. package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +199 -61
  91. package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
  92. package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
  93. package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
  94. package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
  95. package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
  96. package/dist/application/jeb/JebAnalysisPort.js +1 -0
  97. package/dist/application/jeb/JebAnalysisService.js +13 -0
  98. package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
  99. package/dist/application/native/NativeUiActionTrace.js +16 -8
  100. package/dist/application/native/NativeValueTrace.js +23 -6
  101. package/dist/application/process/ProcessCli.js +25 -20
  102. package/dist/artifacts/ArtifactPaths.js +129 -8
  103. package/dist/artifacts/ArtifactProvider.js +20 -15
  104. package/dist/artifacts/ArtifactReader.js +23 -0
  105. package/dist/artifacts/ArtifactResourceScope.js +100 -0
  106. package/dist/artifacts/AsarArtifactReader.js +176 -102
  107. package/dist/artifacts/AsarHeader.js +24 -0
  108. package/dist/artifacts/DirectoryArtifactReader.js +168 -65
  109. package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
  110. package/dist/artifacts/NativeDmgArtifactReader.js +29 -22
  111. package/dist/artifacts/SafeOutputTree.js +245 -70
  112. package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
  113. package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
  114. package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
  115. package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
  116. package/dist/artifacts/ZipArtifactReader.js +77 -27
  117. package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
  118. package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
  119. package/dist/artifacts/apple/KeyedArchiveReader.js +32 -13
  120. package/dist/artifacts/extraction/ArtifactExtraction.js +110 -86
  121. package/dist/artifacts/inventory/ArtifactGraphConstruction.js +110 -43
  122. package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
  123. package/dist/artifacts/inventory/classify.js +75 -32
  124. package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
  125. package/dist/artifacts/inventory/reader.js +13 -5
  126. package/dist/artifacts/inventory/scanCanonical.js +62 -25
  127. package/dist/artifacts/inventory/scanReader.js +38 -11
  128. package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +15 -9
  129. package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
  130. package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
  131. package/dist/browser/BrowserScenarioSecrets.js +52 -37
  132. package/dist/browser/CdpBrowserProvider.js +5 -0
  133. package/dist/browser/CdpCaptureDocuments.js +40 -6
  134. package/dist/browser/CdpCaptureDomSvg.js +210 -0
  135. package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
  136. package/dist/browser/CdpCaptureEventHandlers.js +26 -9
  137. package/dist/browser/CdpCaptureEvents.js +4 -9
  138. package/dist/browser/CdpConnection.js +22 -5
  139. package/dist/browser/CdpPageCapture.js +1 -1
  140. package/dist/browser/CdpTargetSession.js +30 -34
  141. package/dist/browser/CdpWebMcpDiscovery.js +32 -10
  142. package/dist/browser/ElectronFileScope.js +99 -9
  143. package/dist/browser/PlaywrightBrowserScenarioProvider.js +60 -4
  144. package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
  145. package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
  146. package/dist/browser/PlaywrightScenarioBrowser.js +69 -7
  147. package/dist/browser/PlaywrightScenarioSession.js +127 -54
  148. package/dist/browser/PlaywrightScenarioStorage.js +507 -0
  149. package/dist/browser/PngVisualDiff.js +198 -29
  150. package/dist/browser/WebSourceMapFetcher.js +3 -3
  151. package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
  152. package/dist/browser/assets/PublishWebScripts.js +75 -20
  153. package/dist/browser/assets/WebArtifactReads.js +23 -1
  154. package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
  155. package/dist/browser/execution/CdpExecutionCapture.js +3 -3
  156. package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
  157. package/dist/browser/history/HarCapture.js +14 -0
  158. package/dist/browser/history/HarCaptureProcess.js +2 -10
  159. package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
  160. package/dist/browser/modules/WebModuleArtifacts.js +1 -0
  161. package/dist/cli/adbCommands.js +337 -0
  162. package/dist/cli/analysisViewCommands.js +39 -1
  163. package/dist/cli/apktoolCommands.js +53 -0
  164. package/dist/cli/artifactCommands.js +8 -11
  165. package/dist/cli/binaryDiagnosticsCommands.js +19 -1
  166. package/dist/cli/browserAdvancedCommands.js +65 -36
  167. package/dist/cli/coreBinaryCommands.js +0 -5
  168. package/dist/cli/coreNativeCommands.js +1 -14
  169. package/dist/cli/electronCommands.js +6 -1
  170. package/dist/cli/evmCommands.js +13 -4
  171. package/dist/cli/firmwareCommands.js +7 -2
  172. package/dist/cli/javascriptApplicationAnalysis.js +17 -1
  173. package/dist/cli/javascriptRecoveryCommands.js +22 -15
  174. package/dist/cli/jebCommands.js +99 -0
  175. package/dist/cli/jsonOutput.js +11 -4
  176. package/dist/cli/referenceSourceImportStatus.js +7 -0
  177. package/dist/cli/setupCommands.js +15 -3
  178. package/dist/cli/utilityCommands.js +66 -18
  179. package/dist/cli/webScriptCommands.js +20 -1
  180. package/dist/cli/webSourceLocationCommands.js +21 -9
  181. package/dist/cli.js +6 -0
  182. package/dist/cliBrowserScenarioCommands.js +2 -1
  183. package/dist/cliCommandNames.js +32 -0
  184. package/dist/cliJsonInput.js +2 -2
  185. package/dist/cliObservationOptions.js +3 -0
  186. package/dist/composition/adb.js +3 -0
  187. package/dist/composition/apktool.js +3 -0
  188. package/dist/composition/binaryDiagnostics.js +4 -0
  189. package/dist/composition/directAnalysis.js +12 -4
  190. package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
  191. package/dist/composition/jeb.js +6 -0
  192. package/dist/config/environment.js +10 -0
  193. package/dist/config/ghidraLanguageOverride.js +9 -0
  194. package/dist/config/mcpInputSchemaProfile.js +27 -0
  195. package/dist/config/parseConfig.js +28 -1
  196. package/dist/contracts/adb/adbToolContracts.js +353 -0
  197. package/dist/contracts/advertisedInputExamples.js +48 -0
  198. package/dist/contracts/analysisDetail.js +10 -0
  199. package/dist/contracts/analysisViewToolContracts.js +17 -2
  200. package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
  201. package/dist/contracts/artifactToolContracts.js +8 -5
  202. package/dist/contracts/browserToolContracts.js +1 -1
  203. package/dist/contracts/compactInputSchema.js +256 -0
  204. package/dist/contracts/functionWorkflowToolContracts.js +1 -1
  205. package/dist/contracts/inputSchemaPresentation.js +10 -10
  206. package/dist/contracts/javascript/electronToolContracts.js +15 -3
  207. package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
  208. package/dist/contracts/jeb/jebToolContracts.js +64 -0
  209. package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
  210. package/dist/contracts/officialToolContracts.js +5 -5
  211. package/dist/contracts/sessionToolContracts.js +2 -2
  212. package/dist/contracts/sessionToolSchemas.js +6 -2
  213. package/dist/contracts/toolContractExamples.js +6 -0
  214. package/dist/contracts/toolContractTypes.js +3 -0
  215. package/dist/contracts/toolContracts.js +6 -0
  216. package/dist/contracts/toolEffects.js +167 -0
  217. package/dist/contracts/toolOutputSchemaGroups.js +5 -3
  218. package/dist/contracts/toolSchemaMetadata.js +82 -7
  219. package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
  220. package/dist/domain/analysisErrorCleanup.js +29 -0
  221. package/dist/domain/analysisErrorPresentation.js +18 -6
  222. package/dist/domain/analysisErrorProjection.js +4 -1
  223. package/dist/domain/analysisSnapshot.js +2 -1
  224. package/dist/domain/analysisView/analysisView.js +52 -2
  225. package/dist/domain/analysisView/binaryLayoutView.js +2 -0
  226. package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
  227. package/dist/domain/analysisView/nativeFunctionView.js +155 -0
  228. package/dist/domain/android/androidApplication.js +25 -20
  229. package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
  230. package/dist/domain/apple/appleApplication.js +40 -23
  231. package/dist/domain/apple/appleBundleAnatomy.js +95 -28
  232. package/dist/domain/apple/dyldPaths.js +9 -1
  233. package/dist/domain/apple/dylibResolution.js +2 -2
  234. package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
  235. package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
  236. package/dist/domain/artifactComparison.js +35 -7
  237. package/dist/domain/artifactGraph.js +5 -3
  238. package/dist/domain/artifactIdentity.js +30 -2
  239. package/dist/domain/artifactInspection.js +3 -43
  240. package/dist/domain/artifactIntegrityPolicy.js +10 -0
  241. package/dist/domain/artifactInventoryEvidence.js +11 -12
  242. package/dist/domain/artifactPathSyntax.js +1 -1
  243. package/dist/domain/binaryTarget.js +16 -0
  244. package/dist/domain/binaryTargetTypes.js +8 -1
  245. package/dist/domain/browserObservationSchemas.js +8 -4
  246. package/dist/domain/canonicalJsonDigestSteps.js +34 -12
  247. package/dist/domain/compactStringIdentity.js +9 -0
  248. package/dist/domain/evidence.js +2 -1
  249. package/dist/domain/evidenceRecordSummary.js +144 -0
  250. package/dist/domain/inputIssueProjection.js +16 -1
  251. package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -13
  252. package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -20
  253. package/dist/domain/javascript/electronStaticAnalysisNative.js +70 -40
  254. package/dist/domain/javascript/electronStaticAnalysisValues.js +16 -0
  255. package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
  256. package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -1
  257. package/dist/domain/javascript/javascriptApplicationChangeGraph.js +6 -6
  258. package/dist/domain/javascript/javascriptApplicationGraph.js +79 -18
  259. package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
  260. package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
  261. package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -1
  262. package/dist/domain/javascript/javascriptAstFingerprint.js +58 -31
  263. package/dist/domain/javascript/javascriptAstValues.js +32 -0
  264. package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
  265. package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
  266. package/dist/domain/javascript/javascriptNativeHandoff.js +6 -1
  267. package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
  268. package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
  269. package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
  270. package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +8 -11
  271. package/dist/domain/javascript/javascriptSemanticAnalysis.js +190 -33
  272. package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
  273. package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
  274. package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
  275. package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
  276. package/dist/domain/javascript/javascriptSemanticFingerprints.js +42 -41
  277. package/dist/domain/javascript/javascriptSemanticGraph.js +69 -23
  278. package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -10
  279. package/dist/domain/javascript/javascriptSemanticIterationSources.js +40 -7
  280. package/dist/domain/javascript/javascriptSemanticMemberMutations.js +341 -87
  281. package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
  282. package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
  283. package/dist/domain/javascript/javascriptSemanticObjects.js +7 -1
  284. package/dist/domain/javascript/javascriptSemanticProjection.js +52 -14
  285. package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
  286. package/dist/domain/javascript/javascriptSemanticQuery.js +27 -29
  287. package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
  288. package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
  289. package/dist/domain/javascript/javascriptSemanticReturns.js +13 -23
  290. package/dist/domain/javascript/javascriptSemanticState.js +22 -2
  291. package/dist/domain/javascript/javascriptSemanticTraversal.js +19 -1
  292. package/dist/domain/javascript/javascriptSemanticValues.js +47 -19
  293. package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
  294. package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
  295. package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +8 -6
  296. package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
  297. package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
  298. package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
  299. package/dist/domain/jeb/jebAnalysis.js +114 -0
  300. package/dist/domain/jsonShape.js +63 -52
  301. package/dist/domain/jsonValue.js +3 -0
  302. package/dist/domain/managed/managedApplicationGraph.js +37 -0
  303. package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
  304. package/dist/domain/managed/managedApplicationGraphNodes.js +32 -22
  305. package/dist/domain/managed/managedArtifact.js +1 -0
  306. package/dist/domain/managed/managedInspectionEvidence.js +13 -0
  307. package/dist/domain/native/nativeAotPe.js +1408 -0
  308. package/dist/domain/native/nativeInstruction.js +21 -0
  309. package/dist/domain/native/nativeMetadataRecovery.js +79 -6
  310. package/dist/domain/native/peResources.js +94 -0
  311. package/dist/domain/nativeConvention.js +33 -0
  312. package/dist/domain/process/processCapture.js +91 -1
  313. package/dist/domain/process/processCaptureExample.js +24 -0
  314. package/dist/domain/process/processCaptureValidation.js +79 -0
  315. package/dist/domain/process/processScenario.js +59 -7
  316. package/dist/domain/propertyListKeys.js +3 -1
  317. package/dist/domain/referenceSourceGraph.js +25 -16
  318. package/dist/domain/referenceSourceImportParsing.js +6 -3
  319. package/dist/domain/referenceSourcePathIdentity.js +22 -0
  320. package/dist/domain/referenceSourceRequireBindings.js +137 -0
  321. package/dist/domain/webBundleAnalyzerInspection.js +14 -2
  322. package/dist/domain/webCaptureDiff.js +102 -4
  323. package/dist/domain/webScriptExportError.js +10 -4
  324. package/dist/domain/webScriptExportPlan.js +7 -13
  325. package/dist/domain/zipPackageFormat.js +4 -1
  326. package/dist/domain/zodCollectionSteps.js +24 -0
  327. package/dist/dotnet/ManagedArtifactInspector.js +55 -43
  328. package/dist/dotnet/ManagedDecodeBudget.js +80 -0
  329. package/dist/dotnet/ManagedMemberInspector.js +13 -6
  330. package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
  331. package/dist/dotnet/ManagedMemberInstructionDecoder.js +4 -2
  332. package/dist/dotnet/ManagedMemberRows.js +9 -4
  333. package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
  334. package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
  335. package/dist/dotnet/ManagedMetadataLayout.js +10 -4
  336. package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
  337. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
  338. package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
  339. package/dist/dotnet/ManagedPeReader.js +41 -25
  340. package/dist/dotnet/ManagedReaderFailure.js +2 -1
  341. package/dist/dotnet/ManagedStaticProvider.js +55 -24
  342. package/dist/evaluation/AgentEvaluationReport.js +9 -5
  343. package/dist/evaluation/CodexAgentEval.js +43 -13
  344. package/dist/evm/EvmoleFailures.js +0 -2
  345. package/dist/evm/EvmoleInterfaceProvider.js +67 -2
  346. package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
  347. package/dist/filesystem/OwnedFileHandle.js +36 -0
  348. package/dist/filesystem/RegularFile.js +33 -1
  349. package/dist/filesystem/StableFileHash.js +46 -0
  350. package/dist/filesystem/readFileHandleChunks.js +26 -0
  351. package/dist/firmware/FirmwareCommand.js +25 -3
  352. package/dist/firmware/FirmwareFiles.js +23 -8
  353. package/dist/firmware/FirmwareProvider.js +156 -32
  354. package/dist/firmware/FirmwarePublication.js +24 -3
  355. package/dist/firmware/FirmwareRelease.js +1 -0
  356. package/dist/generatedPackageMetadata.js +2 -2
  357. package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
  358. package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
  359. package/dist/ghidra/GhidraClient.js +76 -4
  360. package/dist/ghidra/GhidraDiagnostics.js +11 -8
  361. package/dist/ghidra/GhidraFunctionValues.js +26 -2
  362. package/dist/ghidra/GhidraInstallation.js +1 -1
  363. package/dist/ghidra/GhidraInventoryValues.js +23 -1
  364. package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
  365. package/dist/ghidra/GhidraLauncher.js +80 -39
  366. package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
  367. package/dist/ghidra/GhidraMipsProfile.js +79 -0
  368. package/dist/ghidra/GhidraProvider.js +57 -9
  369. package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
  370. package/dist/ghidra/GhidraProviderClient.js +282 -21
  371. package/dist/ghidra/GhidraSessionValues.js +9 -2
  372. package/dist/hopper/HopperAnalysisProfile.js +2 -0
  373. package/dist/hopper/HopperClient.js +15 -6
  374. package/dist/hopper/HopperMachOImage.js +2 -0
  375. package/dist/hopper/HopperProvider.js +13 -2
  376. package/dist/ida/IdaOperationRunner.js +8 -2
  377. package/dist/ida/IdaProvider.js +7 -0
  378. package/dist/ida/IdaSessionClient.js +3 -1
  379. package/dist/ida/IdaWorkspace.js +4 -2
  380. package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
  381. package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
  382. package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
  383. package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
  384. package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
  385. package/dist/javascript/recovery/RecoveryFiles.js +18 -7
  386. package/dist/javascript/recovery/WakaruCommand.js +22 -9
  387. package/dist/javascript/recovery/WakaruExecution.js +11 -7
  388. package/dist/javascript/recovery/WakaruProvider.js +139 -16
  389. package/dist/javascript/recovery/WakaruPublication.js +14 -4
  390. package/dist/javascript/recovery/WakaruRelease.js +10 -3
  391. package/dist/javascript/recovery/WakaruReport.js +12 -7
  392. package/dist/javascript/recovery/WakaruVersion.js +24 -0
  393. package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
  394. package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
  395. package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
  396. package/dist/jeb/JebMcpConnection.js +179 -0
  397. package/dist/jeb/JebMcpEndpoint.js +40 -0
  398. package/dist/jeb/JebProvider.js +299 -0
  399. package/dist/mcpDoctor.js +15 -6
  400. package/dist/native/AppleDispatchCoverage.js +25 -12
  401. package/dist/native/AppleDispatchMetadata.js +14 -7
  402. package/dist/native/AppleMachoFixups.js +71 -15
  403. package/dist/native/AppleMachoSelection.js +23 -3
  404. package/dist/native/NativeMacOSProvider.js +91 -16
  405. package/dist/native/NativeMachoInspection.js +11 -7
  406. package/dist/native/NativeUiHelperRuntime.js +6 -1
  407. package/dist/native/NativeUiObservation.js +4 -3
  408. package/dist/native/pe/PeResourceLayout.js +120 -0
  409. package/dist/native/pe/PeResourceParser.js +286 -0
  410. package/dist/native/pe/PeResourcesProvider.js +63 -0
  411. package/dist/process/BoundedFileBytes.js +30 -7
  412. package/dist/process/DarwinProcessRunTokenReader.js +8 -3
  413. package/dist/process/OwnedCommand.js +4 -3
  414. package/dist/process/ProcessOwnership.js +104 -112
  415. package/dist/process/ProcessOwnershipObservation.js +96 -39
  416. package/dist/process/ProcessOwnershipProcessTree.js +4 -4
  417. package/dist/process/ProcessRunTokenObservations.js +48 -0
  418. package/dist/process/ProviderDiagnosticRedaction.js +17 -0
  419. package/dist/process/ProviderProcess.js +4 -3
  420. package/dist/process/capture/FilesystemSnapshot.js +28 -4
  421. package/dist/process/capture/ProcessCaptureLifecycle.js +350 -59
  422. package/dist/process/capture/ProcessCaptureProgress.js +62 -0
  423. package/dist/process/capture/ProcessHarness.js +194 -26
  424. package/dist/process/capture/ProcessNormalization.js +3 -1
  425. package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
  426. package/dist/process/capture/TerminalRenderer.js +24 -7
  427. package/dist/reference/ReferenceSourceReader.js +22 -5
  428. package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
  429. package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
  430. package/dist/reference/ReferenceSourceReaderFile.js +50 -10
  431. package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
  432. package/dist/server/EvidenceMcpServer.js +36 -1
  433. package/dist/server/admittedToolOperation.js +9 -0
  434. package/dist/server/contractToolHandler.js +21 -0
  435. package/dist/server/createServer.js +97 -25
  436. package/dist/server/registerAdbTools.js +36 -0
  437. package/dist/server/registerAnalysisViewTool.js +4 -9
  438. package/dist/server/registerAndroidTools.js +3 -12
  439. package/dist/server/registerApktoolTools.js +14 -0
  440. package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
  441. package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
  442. package/dist/server/registerApplicationTools/compareVersions.js +3 -2
  443. package/dist/server/registerApplicationTools/coverage.js +3 -2
  444. package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
  445. package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
  446. package/dist/server/registerApplicationTools/traceFeature.js +3 -2
  447. package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
  448. package/dist/server/registerArtifactComparisonTool.js +5 -2
  449. package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
  450. package/dist/server/registerBrowserScenarioTool.js +10 -7
  451. package/dist/server/registerBrowserTools.js +12 -9
  452. package/dist/server/registerBundleComparisonTool.js +16 -2
  453. package/dist/server/registerCloseLifecycleTool.js +32 -3
  454. package/dist/server/registerElectronTools.js +28 -10
  455. package/dist/server/registerEvmTools.js +4 -9
  456. package/dist/server/registerFirmwareTools.js +3 -11
  457. package/dist/server/registerFunctionComparisonTool.js +5 -2
  458. package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
  459. package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
  460. package/dist/server/registerJebTools.js +16 -0
  461. package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
  462. package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
  463. package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
  464. package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
  465. package/dist/server/registerPeResourcesTool.js +9 -0
  466. package/dist/server/registerProcessComparisonTool.js +5 -2
  467. package/dist/server/registerRecordedCrashTools.js +4 -9
  468. package/dist/server/registerSessionRecordTools.js +2 -1
  469. package/dist/server/registerSessionTools.js +49 -18
  470. package/dist/server/registerWebModuleTool.js +4 -9
  471. package/dist/server/registerWebNetworkCaptureTool.js +4 -9
  472. package/dist/server/registerWebRuntimeTools.js +6 -5
  473. package/dist/server/registerWebScriptTool.js +6 -3
  474. package/dist/server/registerWebSourceLocationTool.js +4 -9
  475. package/dist/server/toolResult.js +21 -2
  476. package/dist/windows/WindowsPrivateRuntime.js +12 -5
  477. package/install.sh +7 -4
  478. package/licenses/nativeaot-parser-MIT.txt +28 -0
  479. package/native/windows/build/manifest.json +2 -2
  480. package/native/windows/build/rea-windows-x64.node +0 -0
  481. package/package.json +33 -5
  482. package/scripts/rea.mjs +16 -1
  483. package/skills/reverse-engineer-anything/SKILL.md +52 -51
  484. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
  485. package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
  486. package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
  487. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +22 -1
@@ -0,0 +1,353 @@
1
+ import { adbInputSchemas, adbResultSchemas, } from "../../domain/adb/adbDeviceAnalysis.js";
2
+ import { evidenceResultOf } from "../toolOutputSchemaPrimitives.js";
3
+ import { toolContractMetadata } from "../toolEffects.js";
4
+ /** ADB device inspection and acquisition over a caller-supplied binary. */
5
+ export const ADB_TOOL_CONTRACTS = [
6
+ {
7
+ name: "inspect_adb_client",
8
+ ...toolContractMetadata("inspect_adb_client"),
9
+ description: "Inspect the caller-selected adb client: resolved binary, version, and install path. Never contacts devices and never starts the adb server. REA never installs platform tools; select a binary with REA_ADB_PATH (absolute) or adb on PATH.",
10
+ kind: "adb-provider",
11
+ inputSchema: adbInputSchemas.inspect_adb_client,
12
+ outputSchema: evidenceResultOf(adbResultSchemas.inspect_adb_client),
13
+ examples: [{ title: "Check the adb client", input: {} }],
14
+ },
15
+ {
16
+ name: "list_adb_devices",
17
+ ...toolContractMetadata("list_adb_devices"),
18
+ description: "List attached devices exactly as `adb devices -l` reports them: serial, state, transport, model metadata, and an inferred emulator/physical kind with its evidence basis. Emulators and USB or network devices appear alike; REA neither starts nor manages them. May start the local adb server on first use.",
19
+ kind: "adb-provider",
20
+ inputSchema: adbInputSchemas.list_adb_devices,
21
+ outputSchema: evidenceResultOf(adbResultSchemas.list_adb_devices),
22
+ examples: [{ title: "List attached devices", input: {} }],
23
+ },
24
+ {
25
+ name: "inspect_adb_device",
26
+ ...toolContractMetadata("inspect_adb_device"),
27
+ description: "Inspect one device's build identity through a fixed `getprop` whitelist: Android and SDK versions, security patch, fingerprint, product identity, CPU ABIs, and debuggable flag, plus the observed emulator indicator ro.kernel.qemu. Read-only with respect to the device.",
28
+ kind: "adb-provider",
29
+ inputSchema: adbInputSchemas.inspect_adb_device,
30
+ outputSchema: evidenceResultOf(adbResultSchemas.inspect_adb_device),
31
+ examples: [
32
+ { title: "Inspect one device", input: { serial: "emulator-5554" } },
33
+ ],
34
+ },
35
+ {
36
+ name: "list_adb_packages",
37
+ ...toolContractMetadata("list_adb_packages"),
38
+ description: "List installed packages on one device with each base APK's device path, optionally scoped to third-party or system packages. Paths are device filesystem paths, not host-local. Read-only.",
39
+ kind: "adb-provider",
40
+ inputSchema: adbInputSchemas.list_adb_packages,
41
+ outputSchema: evidenceResultOf(adbResultSchemas.list_adb_packages),
42
+ examples: [
43
+ {
44
+ title: "List third-party packages",
45
+ input: { serial: "emulator-5554", scope: "third_party" },
46
+ },
47
+ ],
48
+ },
49
+ {
50
+ name: "pull_adb_package",
51
+ ...toolContractMetadata("pull_adb_package"),
52
+ description: "Pull one installed package's complete APK set (base plus every split, as `pm path` reports) from the device into a caller-selected output directory, creating a package-named subdirectory that must not already exist. Every pulled file is digested with SHA-256; partial pulls keep successful artifacts and per-file failure reasons. The device keeps the originals.",
53
+ kind: "adb-provider",
54
+ inputSchema: adbInputSchemas.pull_adb_package,
55
+ outputSchema: evidenceResultOf(adbResultSchemas.pull_adb_package),
56
+ examples: [
57
+ {
58
+ title: "Pull a package APK set",
59
+ input: {
60
+ serial: "emulator-5554",
61
+ package: "com.example.app",
62
+ output_directory: "/tmp/rea-pulls",
63
+ },
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ name: "read_adb_logcat",
69
+ ...toolContractMetadata("read_adb_logcat"),
70
+ description: "Read a bounded dump of the device log (`logcat -d -t`) for one buffer, optionally restricted to a process id. No streaming, no clearing; the newest lines are kept when the count cap trims. Read-only.",
71
+ kind: "adb-provider",
72
+ inputSchema: adbInputSchemas.read_adb_logcat,
73
+ outputSchema: evidenceResultOf(adbResultSchemas.read_adb_logcat),
74
+ examples: [
75
+ {
76
+ title: "Read the last 200 main-buffer lines",
77
+ input: { serial: "emulator-5554", count: 200, buffer: "main" },
78
+ },
79
+ ],
80
+ },
81
+ {
82
+ name: "inspect_adb_package",
83
+ ...toolContractMetadata("inspect_adb_package"),
84
+ description: "Inspect one installed package through `dumpsys package`: version name/code, install and update times, installer, user id, flags, and the requested-permission count. A fixed projection of version-dependent output; unknown sections are ignored rather than guessed. Read-only.",
85
+ kind: "adb-provider",
86
+ inputSchema: adbInputSchemas.inspect_adb_package,
87
+ outputSchema: evidenceResultOf(adbResultSchemas.inspect_adb_package),
88
+ examples: [
89
+ {
90
+ title: "Inspect an installed package",
91
+ input: { serial: "emulator-5554", package: "com.example.app" },
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ name: "pull_adb_file",
97
+ ...toolContractMetadata("pull_adb_file"),
98
+ description: "Pull one absolute device path (a database, shared-preferences XML, or any readable file) into a caller-selected output directory, digesting it with SHA-256. The local copy must not already exist. Read-only with respect to the device.",
99
+ kind: "adb-provider",
100
+ inputSchema: adbInputSchemas.pull_adb_file,
101
+ outputSchema: evidenceResultOf(adbResultSchemas.pull_adb_file),
102
+ examples: [
103
+ {
104
+ title: "Pull an app database",
105
+ input: {
106
+ serial: "emulator-5554",
107
+ device_path: "/data/data/com.example.app/databases/app.db",
108
+ output_directory: "/tmp/rea-pulls",
109
+ },
110
+ },
111
+ ],
112
+ },
113
+ {
114
+ name: "push_adb_file",
115
+ ...toolContractMetadata("push_adb_file"),
116
+ description: "Push one local file to an absolute device path. The only device-mutating ADB tool: existing device files are refused unless overwrite is explicitly requested, and the transfer is verified by comparing the local digest with the device's own sha256sum when the device provides one.",
117
+ kind: "adb-provider",
118
+ inputSchema: adbInputSchemas.push_adb_file,
119
+ outputSchema: evidenceResultOf(adbResultSchemas.push_adb_file),
120
+ examples: [
121
+ {
122
+ title: "Push a script to tmp",
123
+ input: {
124
+ serial: "emulator-5554",
125
+ local_path: "/tmp/frida-server",
126
+ device_path: "/data/local/tmp/frida-server",
127
+ },
128
+ },
129
+ ],
130
+ },
131
+ {
132
+ name: "capture_adb_screen",
133
+ ...toolContractMetadata("capture_adb_screen"),
134
+ description: "Capture one frame of the device screen as a PNG (`screencap -p` through exec-out, no device-side file) into a caller-selected output directory, digesting it and reporting its dimensions. No recording or interaction.",
135
+ kind: "adb-provider",
136
+ inputSchema: adbInputSchemas.capture_adb_screen,
137
+ outputSchema: evidenceResultOf(adbResultSchemas.capture_adb_screen),
138
+ examples: [
139
+ {
140
+ title: "Capture the current screen",
141
+ input: {
142
+ serial: "emulator-5554",
143
+ output_directory: "/tmp/rea-captures",
144
+ },
145
+ },
146
+ ],
147
+ },
148
+ {
149
+ name: "list_adb_processes",
150
+ ...toolContractMetadata("list_adb_processes"),
151
+ description: "List running processes exactly as `ps -A` reports them: user, pid, ppid, rss, state, and name. Useful for pairing with instrumentation lanes. Read-only.",
152
+ kind: "adb-provider",
153
+ inputSchema: adbInputSchemas.list_adb_processes,
154
+ outputSchema: evidenceResultOf(adbResultSchemas.list_adb_processes),
155
+ examples: [{ title: "List processes", input: { serial: "emulator-5554" } }],
156
+ },
157
+ {
158
+ name: "list_adb_directory",
159
+ ...toolContractMetadata("list_adb_directory"),
160
+ description: "List one absolute device directory (`ls -la`): names, kinds, permissions, owner, group, sizes, dates, and symlink targets. Recognizes the standard errors for absent paths and denied reads. Read-only.",
161
+ kind: "adb-provider",
162
+ inputSchema: adbInputSchemas.list_adb_directory,
163
+ outputSchema: evidenceResultOf(adbResultSchemas.list_adb_directory),
164
+ examples: [
165
+ {
166
+ title: "List an app's data directory",
167
+ input: {
168
+ serial: "emulator-5554",
169
+ device_path: "/data/data/com.example.app",
170
+ },
171
+ },
172
+ ],
173
+ },
174
+ {
175
+ name: "list_adb_features",
176
+ ...toolContractMetadata("list_adb_features"),
177
+ description: "List the device's declared hardware and software features (`pm list features`) for device fingerprinting. Read-only.",
178
+ kind: "adb-provider",
179
+ inputSchema: adbInputSchemas.list_adb_features,
180
+ outputSchema: evidenceResultOf(adbResultSchemas.list_adb_features),
181
+ examples: [{ title: "List features", input: { serial: "emulator-5554" } }],
182
+ },
183
+ {
184
+ name: "list_adb_services",
185
+ ...toolContractMetadata("list_adb_services"),
186
+ description: "List the device's binder services with their interfaces (`service list`). Read-only.",
187
+ kind: "adb-provider",
188
+ inputSchema: adbInputSchemas.list_adb_services,
189
+ outputSchema: evidenceResultOf(adbResultSchemas.list_adb_services),
190
+ examples: [{ title: "List services", input: { serial: "emulator-5554" } }],
191
+ },
192
+ {
193
+ name: "inspect_adb_display",
194
+ ...toolContractMetadata("inspect_adb_display"),
195
+ description: "Report the display's physical and any overridden size (`wm size`) and density (`wm density`) as the device declares them. Read-only; setting values is not exposed.",
196
+ kind: "adb-provider",
197
+ inputSchema: adbInputSchemas.inspect_adb_display,
198
+ outputSchema: evidenceResultOf(adbResultSchemas.inspect_adb_display),
199
+ examples: [
200
+ { title: "Inspect the display", input: { serial: "emulator-5554" } },
201
+ ],
202
+ },
203
+ {
204
+ name: "inspect_adb_window",
205
+ ...toolContractMetadata("inspect_adb_window"),
206
+ description: "Report the window manager's current focus declarations (`dumpsys window windows`: mCurrentFocus and mFocusedApp) — what is on screen at read time without any interaction. Read-only.",
207
+ kind: "adb-provider",
208
+ inputSchema: adbInputSchemas.inspect_adb_window,
209
+ outputSchema: evidenceResultOf(adbResultSchemas.inspect_adb_window),
210
+ examples: [
211
+ { title: "Inspect window focus", input: { serial: "emulator-5554" } },
212
+ ],
213
+ },
214
+ {
215
+ name: "read_adb_setting",
216
+ ...toolContractMetadata("read_adb_setting"),
217
+ description: "Read one settings value (`settings get`) from the system, secure, or global namespace. Absent keys report the device's own null observation. Read-only; writing settings is not exposed.",
218
+ kind: "adb-provider",
219
+ inputSchema: adbInputSchemas.read_adb_setting,
220
+ outputSchema: evidenceResultOf(adbResultSchemas.read_adb_setting),
221
+ examples: [
222
+ {
223
+ title: "Read the ADB-enabled setting",
224
+ input: {
225
+ serial: "emulator-5554",
226
+ namespace: "secure",
227
+ key: "adb_enabled",
228
+ },
229
+ },
230
+ ],
231
+ },
232
+ {
233
+ name: "collect_adb_bugreport",
234
+ ...toolContractMetadata("collect_adb_bugreport"),
235
+ description: "Collect one device-generated bugreport archive (`adb bugreport`) into a caller-selected output directory, digesting the zip. The archive contains the device's own dumpstate, dumpsys, and logcat report; collection can take minutes. Read-only with respect to configuration.",
236
+ kind: "adb-provider",
237
+ inputSchema: adbInputSchemas.collect_adb_bugreport,
238
+ outputSchema: evidenceResultOf(adbResultSchemas.collect_adb_bugreport),
239
+ examples: [
240
+ {
241
+ title: "Collect a bugreport",
242
+ input: {
243
+ serial: "emulator-5554",
244
+ output_directory: "/tmp/rea-bugreports",
245
+ },
246
+ },
247
+ ],
248
+ },
249
+ {
250
+ name: "resolve_adb_packages",
251
+ ...toolContractMetadata("resolve_adb_packages"),
252
+ description: "Find installed packages by case-insensitive substring of the package name (e.g. `whatsapp` → `com.whatsapp`), returning each match's base APK device path. The first step of an easy get: resolve, then pull_adb_package the exact name. Read-only.",
253
+ kind: "adb-provider",
254
+ inputSchema: adbInputSchemas.resolve_adb_packages,
255
+ outputSchema: evidenceResultOf(adbResultSchemas.resolve_adb_packages),
256
+ examples: [
257
+ {
258
+ title: "Find a package by partial name",
259
+ input: { serial: "emulator-5554", query: "whatsapp" },
260
+ },
261
+ ],
262
+ },
263
+ {
264
+ name: "install_adb_package",
265
+ ...toolContractMetadata("install_adb_package"),
266
+ description: "Install one local APK on the device (`adb install [-r]`), recording the APK's host digest and byte size. A device-mutating tool: `replace` re-installs over an existing package while keeping its data; the device's own Success/Failure verdict is preserved with its reason.",
267
+ kind: "adb-provider",
268
+ inputSchema: adbInputSchemas.install_adb_package,
269
+ outputSchema: evidenceResultOf(adbResultSchemas.install_adb_package),
270
+ examples: [
271
+ {
272
+ title: "Install an APK",
273
+ input: { serial: "emulator-5554", apk_path: "/tmp/app.apk" },
274
+ },
275
+ {
276
+ title: "Replace an existing install keeping data",
277
+ input: {
278
+ serial: "emulator-5554",
279
+ apk_path: "/tmp/app.apk",
280
+ replace: true,
281
+ },
282
+ },
283
+ ],
284
+ },
285
+ {
286
+ name: "uninstall_adb_package",
287
+ ...toolContractMetadata("uninstall_adb_package"),
288
+ description: "Uninstall one package from the device (`adb uninstall`), removing its data for user 0. A device-mutating tool; absent packages report the device's own refusal reason.",
289
+ kind: "adb-provider",
290
+ inputSchema: adbInputSchemas.uninstall_adb_package,
291
+ outputSchema: evidenceResultOf(adbResultSchemas.uninstall_adb_package),
292
+ examples: [
293
+ {
294
+ title: "Uninstall a package",
295
+ input: { serial: "emulator-5554", package: "com.example.app" },
296
+ },
297
+ ],
298
+ },
299
+ {
300
+ name: "start_adb_app",
301
+ ...toolContractMetadata("start_adb_app"),
302
+ description: "Start one installed app by launching its declared launcher activity: the component is resolved through `cmd package resolve-activity --brief`, then started with `am start -n`. A device-mutating tool for dynamic-analysis workflows; pair with `read_adb_logcat` (pid filter) and `list_adb_processes` to observe the started app, and `stop_adb_app` to end the run.",
303
+ kind: "adb-provider",
304
+ inputSchema: adbInputSchemas.start_adb_app,
305
+ outputSchema: evidenceResultOf(adbResultSchemas.start_adb_app),
306
+ examples: [
307
+ {
308
+ title: "Start an app",
309
+ input: { serial: "emulator-5554", package: "com.example.app" },
310
+ },
311
+ ],
312
+ },
313
+ {
314
+ name: "start_adb_activity",
315
+ ...toolContractMetadata("start_adb_activity"),
316
+ description: "Start an intent with `am start`: one action, optional data URI, optional explicit component, and up to 16 typed extras (string, boolean, int, long, float). A device-mutating tool; the activity manager's Starting/Error verdict is preserved verbatim.",
317
+ kind: "adb-provider",
318
+ inputSchema: adbInputSchemas.start_adb_activity,
319
+ outputSchema: evidenceResultOf(adbResultSchemas.start_adb_activity),
320
+ examples: [
321
+ {
322
+ title: "Open a deep link",
323
+ input: {
324
+ serial: "emulator-5554",
325
+ action: "android.intent.action.VIEW",
326
+ data_uri: "https://example.com/path",
327
+ },
328
+ },
329
+ {
330
+ title: "Start with typed extras",
331
+ input: {
332
+ serial: "emulator-5554",
333
+ action: "com.example.APP_ACTION",
334
+ extras: [{ key: "level", type: "int", value: "3" }],
335
+ },
336
+ },
337
+ ],
338
+ },
339
+ {
340
+ name: "stop_adb_app",
341
+ ...toolContractMetadata("stop_adb_app"),
342
+ description: "Force-stop every process of one package (`am force-stop`), ending a dynamic-analysis run. A device-mutating tool; it succeeds whether or not the package had running processes.",
343
+ kind: "adb-provider",
344
+ inputSchema: adbInputSchemas.stop_adb_app,
345
+ outputSchema: evidenceResultOf(adbResultSchemas.stop_adb_app),
346
+ examples: [
347
+ {
348
+ title: "Stop an app",
349
+ input: { serial: "emulator-5554", package: "com.example.app" },
350
+ },
351
+ ],
352
+ },
353
+ ];
@@ -0,0 +1,48 @@
1
+ import { evidenceSchema } from "../domain/evidence.js";
2
+ /** The Evidence identifier of a complete Evidence record, or undefined. */
3
+ const evidenceRecordId = (value) => typeof value.evidence_id === "string" &&
4
+ Object.hasOwn(value, "normalized_result") &&
5
+ evidenceSchema.safeParse(value).success
6
+ ? value.evidence_id
7
+ : undefined;
8
+ /** Replace each embedded complete Evidence record with its exact retained reference. */
9
+ const referenceEmbeddedEvidence = (value) => {
10
+ if (Array.isArray(value)) {
11
+ const items = value.map(referenceEmbeddedEvidence);
12
+ return {
13
+ value: items.map((item) => item.value),
14
+ embedsEvidence: items.some((item) => item.embedsEvidence),
15
+ };
16
+ }
17
+ if (value === null || typeof value !== "object")
18
+ return { value, embedsEvidence: false };
19
+ const evidenceId = evidenceRecordId(value);
20
+ if (evidenceId !== undefined)
21
+ return {
22
+ value: { kind: "retained-evidence", evidence_id: evidenceId },
23
+ embedsEvidence: true,
24
+ };
25
+ const entries = Object.entries(value).map(([key, child]) => [key, referenceEmbeddedEvidence(child)]);
26
+ return {
27
+ value: Object.fromEntries(entries.map(([key, child]) => [key, child.value])),
28
+ embedsEvidence: entries.some(([, child]) => child.embedsEvidence),
29
+ };
30
+ };
31
+ /**
32
+ * Examples advertised in a tool's input schema. Embedded complete Evidence is
33
+ * shown as its exact same-session retained reference when the canonical input
34
+ * schema accepts that form; an example that can only carry inline Evidence
35
+ * stays in the canonical contract and its executable tests but leaves the
36
+ * advertisement. Every advertised example is a distinct valid canonical input.
37
+ */
38
+ export const advertisedInputExamples = (contract) => {
39
+ const advertised = new Map();
40
+ for (const { input } of contract.examples) {
41
+ const projection = referenceEmbeddedEvidence(input);
42
+ if (projection.embedsEvidence &&
43
+ !contract.inputSchema.safeParse(projection.value).success)
44
+ continue;
45
+ advertised.set(JSON.stringify(projection.value), projection.value);
46
+ }
47
+ return [...advertised.values()];
48
+ };
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ import { analysisViewResultSchema } from "../domain/analysisView/analysisView.js";
3
+ import { evidenceResultOf } from "./toolOutputSchemaPrimitives.js";
4
+ /** Caller-selected delivery of completed analysis Evidence that supports retained views. */
5
+ export const analysisDetailSchema = z
6
+ .enum(["complete", "summary"])
7
+ .default("complete")
8
+ .describe("complete returns the complete analysis Evidence inline. summary retains that complete Evidence in this session and returns its inspect_analysis_view summary; inspect pages, items or facets through normalized_result.parent_evidence_id.");
9
+ /** Complete analysis Evidence, or the summary view of its retained record. */
10
+ export const analysisDetailOutputSchemaOf = (analysis) => evidenceResultOf(z.union([analysis, analysisViewResultSchema]));
@@ -2,13 +2,13 @@ import { analysisViewResultSchema, inspectAnalysisViewInputSchema, } from "../do
2
2
  import { toolContractMetadata } from "./toolEffects.js";
3
3
  import { evidenceResultOf } from "./toolOutputSchemaPrimitives.js";
4
4
  const RETAINED_EXAMPLE_ID = `ev_${"a".repeat(64)}`;
5
- /** Selected views of already completed layout and JavaScript analysis Evidence. */
5
+ /** Selected views of already completed layout, JavaScript and native function Evidence. */
6
6
  export const ANALYSIS_VIEW_TOOL_CONTRACTS = [
7
7
  {
8
8
  name: "inspect_analysis_view",
9
9
  ...toolContractMetadata("inspect_analysis_view"),
10
10
  kind: "application",
11
- description: "Inspect a selected view of completed binary-layout or JavaScript application Evidence without repeating analysis. Use an exact same-session retained evidence_id or portable inline Evidence. Select a summary, layout mitigations/linkage facet, one section/symbol/module, or a stable page with a positive limit. Module pages contain JavaScript assets, bundled modules and source modules; use node_id when paths are ambiguous or unavailable. Returns selected facts inline with artifact identity, parent Evidence ID, a distinct view digest, coverage, limitations and unknowns. Actual serialized size determines MCP transport admission; choose a smaller page or export the retained Evidence when needed.",
11
+ description: "Inspect selected views of completed binary-layout, JavaScript application or native analyze_function Evidence without repeating analysis. Use an exact same-session retained evidence_id or portable inline Evidence. Select a summary, layout mitigations/linkage facet, one section/symbol/module, or a stable page. Module pages include assets, bundled and source modules; use node_id for ambiguous or unavailable paths. Native views select procedure, pseudocode, assembly, basic blocks, comments, callers/callees, references, unresolved calls, referenced strings/names, native API and high-pcode. Use nonnegative offset and a positive caller-selected limit (defaults 0 and 64); pseudocode uses UTF-16 code units, other native pages use rows. Returns artifact identity, parent Evidence ID, a distinct view digest, coverage, limitations and unknowns. Actual serialized size determines MCP transport admission; choose a smaller page or export the complete retained Evidence if needed.",
12
12
  inputSchema: inspectAnalysisViewInputSchema,
13
13
  outputSchema: evidenceResultOf(analysisViewResultSchema),
14
14
  examples: [
@@ -36,6 +36,21 @@ export const ANALYSIS_VIEW_TOOL_CONTRACTS = [
36
36
  },
37
37
  },
38
38
  },
39
+ {
40
+ title: "Page native high-pcode operations from retained Evidence",
41
+ input: {
42
+ source: {
43
+ kind: "retained-evidence",
44
+ evidence_id: RETAINED_EXAMPLE_ID,
45
+ },
46
+ view: {
47
+ kind: "native",
48
+ facet: "value_flow_operations",
49
+ offset: 0,
50
+ limit: 32,
51
+ },
52
+ },
53
+ },
39
54
  {
40
55
  title: "Page module identities from retained application Evidence",
41
56
  input: {
@@ -0,0 +1,33 @@
1
+ import { apktoolInputSchemas, apktoolResultSchemas, } from "../../domain/apktool/apktoolResourceAnalysis.js";
2
+ import { evidenceResultOf } from "../toolOutputSchemaPrimitives.js";
3
+ import { toolContractMetadata } from "../toolEffects.js";
4
+ /** Apktool resource decoding served by a caller-supplied launcher. */
5
+ export const APKTOOL_TOOL_CONTRACTS = [
6
+ {
7
+ name: "inspect_apktool_client",
8
+ ...toolContractMetadata("inspect_apktool_client"),
9
+ description: "Inspect the caller-selected apktool launcher: resolved command, selection source, and version. Decodes nothing. REA never installs Apktool or Java; select a launcher with REA_APKTOOL_COMMAND (absolute) or apktool on PATH.",
10
+ kind: "apktool-provider",
11
+ inputSchema: apktoolInputSchemas.inspect_apktool_client,
12
+ outputSchema: evidenceResultOf(apktoolResultSchemas.inspect_apktool_client),
13
+ examples: [{ title: "Check the Apktool launcher", input: {} }],
14
+ },
15
+ {
16
+ name: "decode_android_resources",
17
+ ...toolContractMetadata("decode_android_resources"),
18
+ description: "Decode one local APK's resources with `apktool d --no-src` in a provider-owned workspace that is removed after projection: the readable AndroidManifest.xml, apktool.yml version and SDK facts, the app's string resources (default or one locale, bounded to 2000 entries), available string locales, and the decoded file count. The target APK is digest with SHA-256 before decoding; smali is skipped because Java-source recovery belongs to the JADX family.",
19
+ kind: "apktool-provider",
20
+ inputSchema: apktoolInputSchemas.decode_android_resources,
21
+ outputSchema: evidenceResultOf(apktoolResultSchemas.decode_android_resources),
22
+ examples: [
23
+ {
24
+ title: "Decode an APK's resources",
25
+ input: { path: "/targets/Example.apk" },
26
+ },
27
+ {
28
+ title: "Decode one locale's strings",
29
+ input: { path: "/targets/Example.apk", locale: "de" },
30
+ },
31
+ ],
32
+ },
33
+ ];
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { artifactOutputSchemas } from "./toolOutputSchemaGroups.js";
3
+ import { artifactIntegrityPolicySchema } from "../domain/artifactIntegrityPolicy.js";
3
4
  import { jsonValueSchema } from "../domain/jsonValue.js";
4
5
  import { toolContractMetadata } from "./toolEffects.js";
5
6
  import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
@@ -8,12 +9,14 @@ import { dylibResolutionInputSchema } from "../domain/apple/dylibResolution.js";
8
9
  import { keyedArchiveInputSchema } from "../domain/apple/keyedArchive.js";
9
10
  /** Exact caller boundary for deterministic artifact inventory. */
10
11
  export const artifactInventoryInputSchema = z.strictObject({
11
- integrity_policy: z.enum(["fail", "record-and-continue"]).default("fail"),
12
+ integrity_policy: artifactIntegrityPolicySchema,
12
13
  });
13
14
  /** Extraction needs no selector: it materializes every regular child file. */
14
- export const artifactExtractionInputSchema = z.strictObject({});
15
+ export const artifactExtractionInputSchema = z.strictObject({
16
+ integrity_policy: artifactIntegrityPolicySchema,
17
+ });
15
18
  /** Provider input containing the destination chosen by the local adapter. */
16
- export const artifactExtractionExecutionSchema = z.strictObject({
19
+ export const artifactExtractionExecutionSchema = artifactExtractionInputSchema.extend({
17
20
  output_root: z.string().min(1),
18
21
  });
19
22
  const exampleInputSchema = z.record(z.string(), jsonValueSchema);
@@ -47,8 +50,8 @@ const artifact = (name, description, inputSchema) => {
47
50
  };
48
51
  /** Artifact-graph inventory and safe extraction contracts. */
49
52
  export const ARTIFACT_TOOL_CONTRACTS = [
50
- artifact("inspect_artifact", "Inspect an active archive or application package in one call. Returns the complete content-addressed artifact graph, source Evidence, observations, relationships, integrity contradictions, hypotheses, unexplored branches, limitations, and next probes inline. Read-only DMG mounting is used automatically on supported macOS hosts. Integrity mismatches fail by default; record-and-continue keeps mismatches explicitly untrusted. It does not extract files; use extract_artifact to materialize its regular contents.", artifactInventoryInputSchema),
51
- artifact("extract_artifact", "Extract all regular files from the active archive or application package into a fresh temporary directory chosen by REA. The result includes its location. Rejects traversal and symlink escapes, never overwrites, enforces archive integrity checks, and verifies cleanup.", artifactExtractionInputSchema),
53
+ artifact("inspect_artifact", "Inspect an active archive or application package in one call. Returns the complete content-addressed artifact graph once, as the nested inventory Evidence, with root and integrity observations, integrity contradictions, hypotheses, unexplored branches, limitations, and next probes inline. Read-only DMG mounting is used automatically on supported macOS hosts. Integrity mismatches fail by default; record-and-continue keeps mismatches explicitly untrusted. It does not extract files; use extract_artifact to materialize its regular contents.", artifactInventoryInputSchema),
54
+ artifact("extract_artifact", "Extract all regular files from the active archive or application package into a fresh temporary directory chosen by REA. The result includes its location. Rejects traversal and symlink escapes, never overwrites, and verifies cleanup. Integrity mismatches fail by default; record-and-continue extracts the observed bytes and returns each mismatch as an explicitly untrusted integrity contradiction.", artifactExtractionInputSchema),
52
55
  artifact("decode_interface_builder", "Decode compiled storyboard and nib archives inside the active Apple app bundle, including keyed property lists and NIBArchive object tables, into a bounded object, hierarchy, and connection graph. This is static archive parsing; unrecognized archive classes and unresolved code handlers remain explicit unknowns.", z.strictObject({
53
56
  max_documents: z.number().int().min(1).max(64).default(64),
54
57
  max_objects: z.number().int().min(1).max(20_000).default(20_000),
@@ -186,7 +186,7 @@ export const BROWSER_TOOL_CONTRACTS = [
186
186
  {
187
187
  name: "compare_web_captures",
188
188
  ...toolContractMetadata("compare_web_captures"),
189
- description: "Compare passive web captures by providing before and after, each with the complete inspect_web_page normalized_result in inspection and an optional complete discover_webmcp_tools normalized_result in webmcp; or compare recorded scenarios by passing complete capture_browser_scenario normalized_result objects in before_scenario and after_scenario with an optional normalization policy. Use exactly one input group. Scenario comparison aligns exact step IDs, records deterministic literal normalization, and returns every artifact-level difference plus alignment failures inline. Missing or truncated evidence never proves equality.",
189
+ description: "Compare passive web captures by providing before and after, each with the complete inspect_web_page normalized_result in inspection and an optional complete discover_webmcp_tools normalized_result in webmcp; or compare recorded scenarios by passing complete capture_browser_scenario normalized_result objects in before_scenario and after_scenario with an optional normalization policy. Use exactly one input group. Network comparison includes observed HTTP requests and WebSocket frame streams; same-URL connections are compared as an unordered collection of ordered streams, retaining connection counts without claiming stable identity between individual connections. Scenario comparison aligns exact step IDs, records deterministic literal normalization, and returns every artifact-level difference plus alignment failures inline. Missing or truncated evidence never proves equality.",
190
190
  kind: "browser-provider",
191
191
  inputSchema: browserCaptureComparisonInputSchema,
192
192
  outputSchema: captureDiffOutputSchema,