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
@@ -48,6 +48,8 @@ const failedEntry = (entry) => {
48
48
  };
49
49
  };
50
50
  const resolveInternalSpecifier = (fromPath, specifier, filePaths) => {
51
+ if (posix.isAbsolute(specifier))
52
+ return { to: specifier, resolution: "unresolved" };
51
53
  const normalized = posix.normalize(posix.join(posix.dirname(fromPath), specifier));
52
54
  if (normalized.startsWith("../") || normalized === "..")
53
55
  return { to: normalized, resolution: "unresolved" };
@@ -15,7 +15,8 @@ const resolveRoot = async (requestedRoot) => {
15
15
  const canonicalRoot = await realpath(resolve(requestedRoot));
16
16
  return ok(canonicalRoot);
17
17
  }
18
- catch {
18
+ catch (cause) {
19
+ void cause;
19
20
  return err(failure("invalid-root", "Reference source root could not be resolved"));
20
21
  }
21
22
  };
@@ -24,8 +25,9 @@ const buildIgnored = async (root, excludePaths) => {
24
25
  try {
25
26
  ignored.add(await readFile(join(root, ".gitignore"), "utf8"));
26
27
  }
27
- catch {
28
+ catch (cause) {
28
29
  // Missing or unreadable ignore file does not authorize broader access.
30
+ void cause;
29
31
  }
30
32
  ignored.add([...DEFAULT_REFERENCE_SOURCE_IGNORE_PATTERNS]);
31
33
  for (const path of excludePaths) {
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs";
2
- import { lstat } from "node:fs/promises";
3
- import { join } from "node:path";
2
+ import { lstat, readFile } from "node:fs/promises";
3
+ import { join, resolve } from "node:path";
4
4
  import { resolveRef } from "isomorphic-git";
5
5
  /**
6
6
  * Read Git metadata for a directory using isomorphic-git.
@@ -19,15 +19,46 @@ export const readReferenceSourceVcs = async (root, signal) => {
19
19
  : { kind: "unknown", head: null, dirty: null };
20
20
  }
21
21
  try {
22
- const head = await resolveRef({ fs, dir: root, ref: "HEAD" });
22
+ const head = await resolveSourceHead(root);
23
23
  if (isAborted(signal))
24
24
  return { kind: "unknown", head: null, dirty: null };
25
25
  return { kind: "git", head, dirty: null };
26
26
  }
27
- catch {
27
+ catch (cause) {
28
+ // Unresolvable refs mean VCS state is unknown, not absent.
29
+ void cause;
28
30
  return { kind: "unknown", head: null, dirty: null };
29
31
  }
30
32
  };
33
+ const resolveSourceHead = async (root) => {
34
+ const dotgit = join(root, ".git");
35
+ if (!(await lstat(dotgit)).isFile())
36
+ return resolveRef({ fs, dir: root, ref: "HEAD" });
37
+ const pointer = (await readFile(dotgit, "utf8")).replace(/\r?\n$/u, "");
38
+ if (!pointer.startsWith("gitdir: ") || pointer.length === 8)
39
+ throw new Error("Invalid Git directory pointer");
40
+ const gitdir = resolve(root, pointer.slice(8));
41
+ let commonDirectory;
42
+ try {
43
+ commonDirectory = resolve(gitdir, (await readFile(join(gitdir, "commondir"), "utf8")).replace(/\r?\n$/u, ""));
44
+ }
45
+ catch (cause) {
46
+ if (errorCode(cause) !== "ENOENT")
47
+ throw cause;
48
+ return resolveRef({ fs, dir: root, gitdir, ref: "HEAD" });
49
+ }
50
+ const head = (await readFile(join(gitdir, "HEAD"), "utf8")).trim();
51
+ if (!head.startsWith("ref: "))
52
+ return resolveRef({ fs, dir: root, gitdir, ref: "HEAD" });
53
+ const ref = head.slice(5);
54
+ const privateRef = ["refs/bisect/", "refs/rewritten/", "refs/worktree/"].some((prefix) => ref.startsWith(prefix));
55
+ return resolveRef({
56
+ fs,
57
+ dir: root,
58
+ gitdir: privateRef ? gitdir : commonDirectory,
59
+ ref,
60
+ });
61
+ };
31
62
  const errorCode = (cause) => typeof cause === "object" && cause !== null && "code" in cause
32
63
  ? String(cause.code)
33
64
  : undefined;
@@ -1,5 +1,8 @@
1
1
  import { analysisProfileSchema, } from "../domain/analysisProfile.js";
2
- import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, ProviderAdapterError, ProviderSelectionError, } from "../domain/errors.js";
2
+ import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, } from "../domain/analysisErrorCore.js";
3
+ import { ProviderAdapterError } from "../domain/providerAdapterError.js";
4
+ import { ProviderSelectionError } from "../domain/providerSelectionError.js";
5
+ import {} from "../domain/analysisErrorBase.js";
3
6
  import { jsonObjectSchema } from "../domain/jsonValue.js";
4
7
  import { err, ok } from "../domain/result.js";
5
8
  import { AnalysisProviderRegistry, } from "./AnalysisProviderRegistry.js";
@@ -1,47 +1,6 @@
1
- import { access } from "node:fs/promises";
2
- import { homedir } from "node:os";
3
- import { resolve } from "node:path";
4
- import { PRODUCT_IDENTITY } from "../identity.js";
5
- import { supportsNodeVersion } from "../domain/runtimeVersion.js";
6
- import { runDoctor, systemDoctorHost, } from "./Doctor.js";
7
- import { installLinuxHopper, readLinuxDistribution, } from "./LinuxHopper.js";
8
- import { installMacHopper } from "./MacHopper.js";
9
1
  import { configureDetectedClients } from "./SetupClients.js";
10
- import { supportedClients } from "./SupportedClients.js";
11
- import { canonicalSkillNeedsInstall, installCanonicalSkill, } from "./SetupSkill.js";
12
2
  import { discoverSetupState, planSetupActions } from "./SetupPlan.js";
13
- import { clientConfigurationAligned, configureClientConfiguration, configureJsonClient, configureTomlClient, inspectClientConfiguration, } from "./SetupClientConfiguration.js";
14
- export { configureJsonClient, configureTomlClient };
15
- import { setupInstallFailure, } from "./SetupInstallFailure.js";
16
- import { providerRegistrationEnvironment } from "./SetupRegistrationEnvironment.js";
17
- export { canonicalSkillNeedsInstall, installCanonicalSkill };
18
- /** Resolve the executable and arguments used in a managed MCP registration. */
19
- export const setupRegistrationCommand = (platform, useNpmRunner = process.env.npm_command === "exec") => useNpmRunner
20
- ? PRODUCT_IDENTITY.mcpCommand.split(" ")
21
- : platform === "win32"
22
- ? [
23
- process.execPath,
24
- resolve(process.argv[1] ?? PRODUCT_IDENTITY.cliBinary),
25
- "mcp",
26
- ]
27
- : [resolve(process.argv[1] ?? PRODUCT_IDENTITY.cliBinary), "mcp"];
28
- /** Whether the requested setup actions still need approval or human repair. */
29
- export const isSetupFailure = (result) => {
30
- const status = result.status;
31
- switch (status) {
32
- case "planned":
33
- case "cancelled":
34
- case "ready":
35
- return false;
36
- case "needs_confirmation":
37
- case "needs_human":
38
- return true;
39
- default: {
40
- const exhaustive = status;
41
- throw new TypeError(`Unhandled setup result status: ${String(exhaustive)}`);
42
- }
43
- }
44
- };
3
+ import { filterClientsNeedingConfigure, hostRemediation, initialProviderEnvironment, setupRegistrationCommand, systemSetupHost, } from "./SetupHost.js";
45
4
  /** Discover, approve, and apply setup actions idempotently. */
46
5
  export const runSetup = async (options, host = systemSetupHost(), confirm) => {
47
6
  const appliedActions = [];
@@ -310,14 +269,6 @@ const setupFailure = async (remediation, [host, plannedActions, appliedActions,
310
269
  };
311
270
  };
312
271
  const emitProgress = (options, event) => options.onProgress?.(event);
313
- const filterClientsNeedingConfigure = async (host, detectedClients, providerEnvironment, command) => {
314
- const needs = await Promise.all(detectedClients.map((client) => host.clientNeedsConfigure(client, providerEnvironment, command)));
315
- return detectedClients.filter((_, index) => needs[index]);
316
- };
317
- const initialProviderEnvironment = async (host, hopperPath) => ({
318
- ...(await host.providerEnvironment?.()),
319
- ...(hopperPath === undefined ? {} : { HOPPER_LAUNCHER_PATH: hopperPath }),
320
- });
321
272
  const finalSetupRemediation = (platform, installedHopper, healthy, hopperPath) => {
322
273
  if (platform === "darwin" && installedHopper)
323
274
  return "Open Hopper, choose its demo mode or activate a license, then rerun rea doctor --json.";
@@ -371,81 +322,3 @@ const summarizeDoctor = (report) => ({
371
322
  },
372
323
  }),
373
324
  });
374
- const hostRemediation = async (host, installHopper) => {
375
- if (!supportsNodeVersion(host.nodeVersion))
376
- return "Install Node.js 22.19+ or 24.11+ and rerun setup.";
377
- if (!installHopper)
378
- return undefined;
379
- if (host.platform !== "darwin" && host.platform !== "linux")
380
- return "REA supports Hopper on macOS and selected 64-bit Linux distributions.";
381
- if (host.platform === "darwin") {
382
- const version = await host.macosVersion();
383
- return version === undefined || major(version) < 12
384
- ? "Upgrade to macOS 12 or newer."
385
- : undefined;
386
- }
387
- if ((await host.linuxDistribution())?.supported === true)
388
- return undefined;
389
- return "Automated Hopper setup supports Ubuntu 24.04+, Fedora 41+, and 64-bit Arch Linux; configure an existing supported provider instead.";
390
- };
391
- /** Production setup effects for Hopper, agent configuration, and the canonical skill directory. */
392
- export const systemSetupHost = (doctorHost = systemDoctorHost()) => {
393
- const platform = doctorHost.platform;
394
- return {
395
- platform,
396
- nodeVersion: process.versions.node,
397
- macosVersion: () => doctorHost.macosVersion(),
398
- linuxDistribution: readLinuxDistribution,
399
- hopperPath: async () => (await runDoctor(undefined, doctorHost)).hopperPath,
400
- providerEnvironment: async () => {
401
- const diagnosis = await runDoctor(undefined, doctorHost);
402
- return {
403
- ...providerRegistrationEnvironment(diagnosis.providerInspections ?? []),
404
- ...(diagnosis.hopperPath === undefined
405
- ? {}
406
- : { HOPPER_LAUNCHER_PATH: diagnosis.hopperPath }),
407
- };
408
- },
409
- installHopper: async (replaceExisting) => {
410
- const result = platform === "linux"
411
- ? await installLinuxHopper()
412
- : await installMacHopper({ replaceExisting });
413
- if (result.status === "installed")
414
- return result;
415
- return setupInstallFailure(result.reason);
416
- },
417
- detectedClients: () => detectClients(homedir()),
418
- supportedClients: () => Promise.resolve(supportedClients(homedir())),
419
- configureClient: (client, providerEnvironment, command) => client.format === "unsupported"
420
- ? Promise.resolve({ status: "skipped" })
421
- : configureClientConfiguration(client, providerEnvironment, command),
422
- clientNeedsConfigure: (client, providerEnvironment, command) => clientConfigurationAligned(client, providerEnvironment, command).then((aligned) => !aligned),
423
- inspectClientConfiguration: inspectClientConfiguration,
424
- skillNeedsInstall: () => canonicalSkillNeedsInstall(homedir()),
425
- installSkill: () => installCanonicalSkill(homedir()),
426
- doctor: (scope) => runDoctor(undefined, doctorHost, scope),
427
- };
428
- };
429
- /** Detect supported agents from their config files or stable installation markers. */
430
- export const detectClients = async (home) => {
431
- const detected = [];
432
- for (const candidate of supportedClients(home)) {
433
- const [hasConfig, hasMarker] = await Promise.all([
434
- exists(candidate.configPath),
435
- candidate.markerPath === undefined ? false : exists(candidate.markerPath),
436
- ]);
437
- if (hasConfig || hasMarker)
438
- detected.push(candidate);
439
- }
440
- return detected;
441
- };
442
- const major = (version) => Number.parseInt(version.split(".")[0] ?? "0", 10);
443
- const exists = async (path) => {
444
- try {
445
- await access(path);
446
- return true;
447
- }
448
- catch {
449
- return false;
450
- }
451
- };
@@ -38,7 +38,9 @@ const configureClientDocument = async (client, environment, command, format) =>
38
38
  try {
39
39
  parsed = parseClientConfiguration(original ?? (format === "toml" ? "" : "{}"), format);
40
40
  }
41
- catch {
41
+ catch (cause) {
42
+ // Malformed existing configuration fails the readback gate.
43
+ void cause;
42
44
  return { status: "failed", reason: "readback" };
43
45
  }
44
46
  const { document, servers, serversKey } = parsed;
@@ -60,7 +62,9 @@ const configureClientDocument = async (client, environment, command, format) =>
60
62
  mode: 0o600,
61
63
  });
62
64
  }
63
- catch {
65
+ catch (cause) {
66
+ // Write failure is reported by the status reason.
67
+ void cause;
64
68
  return { status: "failed", reason: "write" };
65
69
  }
66
70
  try {
@@ -70,7 +74,9 @@ const configureClientDocument = async (client, environment, command, format) =>
70
74
  return { status: "failed", reason: "readback" };
71
75
  }
72
76
  }
73
- catch {
77
+ catch (cause) {
78
+ // Readback failure restores the transaction before reporting.
79
+ void cause;
74
80
  await restoreConfig(transactionPath, original);
75
81
  return { status: "failed", reason: "readback" };
76
82
  }
@@ -87,7 +93,9 @@ export const clientConfigurationAligned = async (client, providerEnvironment, co
87
93
  const { servers } = parseClientConfiguration(original, client.format);
88
94
  return clientConfigurationValuesEqual(servers[PRODUCT_IDENTITY.mcpServerKey], desired);
89
95
  }
90
- catch {
96
+ catch (cause) {
97
+ // Unreadable configuration is treated as not aligned so setup repairs it.
98
+ void cause;
91
99
  return false;
92
100
  }
93
101
  };
@@ -119,7 +127,9 @@ export const inspectClientConfiguration = async (client, providerEnvironment, co
119
127
  if (clientConfigurationValuesEqual(servers[PRODUCT_IDENTITY.mcpServerKey], desired))
120
128
  return { status: "already_current" };
121
129
  }
122
- catch {
130
+ catch (cause) {
131
+ // Malformed configuration is reported with the invalid remediation.
132
+ void cause;
123
133
  return {
124
134
  status: "invalid",
125
135
  remediation: "The existing configuration is malformed. Repair it before setup applies any other changes.",
@@ -147,8 +157,9 @@ const restoreConfig = async (path, original) => {
147
157
  else
148
158
  await writeFile(path, original, { encoding: "utf8", mode: 0o600 });
149
159
  }
150
- catch {
160
+ catch (cause) {
151
161
  // The backup remains available for the remediation reported by setup.
162
+ void cause;
152
163
  }
153
164
  };
154
165
  const clientConfigurationDesired = (client, providerEnvironment, command, format) => {
@@ -0,0 +1,111 @@
1
+ import { access } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { resolve } from "node:path";
4
+ import { PRODUCT_IDENTITY } from "../identity.js";
5
+ import { supportsNodeVersion } from "../domain/runtimeVersion.js";
6
+ import { runDoctor, systemDoctorHost } from "./Doctor.js";
7
+ import { installLinuxHopper, readLinuxDistribution } from "./LinuxHopper.js";
8
+ import { installMacHopper } from "./MacHopper.js";
9
+ import { supportedClients } from "./SupportedClients.js";
10
+ import { canonicalSkillNeedsInstall, installCanonicalSkill, } from "./SetupSkill.js";
11
+ import { clientConfigurationAligned, configureClientConfiguration, inspectClientConfiguration, } from "./SetupClientConfiguration.js";
12
+ import { setupInstallFailure } from "./SetupInstallFailure.js";
13
+ import { providerRegistrationEnvironment } from "./SetupRegistrationEnvironment.js";
14
+ /** Resolve the executable and arguments used in a managed MCP registration. */
15
+ export const setupRegistrationCommand = (platform, useNpmRunner = process.env.npm_command === "exec") => useNpmRunner
16
+ ? PRODUCT_IDENTITY.mcpCommand.split(" ")
17
+ : platform === "win32"
18
+ ? [
19
+ process.execPath,
20
+ resolve(process.argv[1] ?? PRODUCT_IDENTITY.cliBinary),
21
+ "mcp",
22
+ ]
23
+ : [resolve(process.argv[1] ?? PRODUCT_IDENTITY.cliBinary), "mcp"];
24
+ export const filterClientsNeedingConfigure = async (host, detectedClients, providerEnvironment, command) => {
25
+ const needs = await Promise.all(detectedClients.map((client) => host.clientNeedsConfigure(client, providerEnvironment, command)));
26
+ return detectedClients.filter((_, index) => needs[index]);
27
+ };
28
+ export const initialProviderEnvironment = async (host, hopperPath) => ({
29
+ ...(await host.providerEnvironment?.()),
30
+ ...(hopperPath === undefined ? {} : { HOPPER_LAUNCHER_PATH: hopperPath }),
31
+ });
32
+ export const hostRemediation = async (host, installHopper) => {
33
+ if (!supportsNodeVersion(host.nodeVersion))
34
+ return "Install Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+ and rerun setup.";
35
+ if (!installHopper)
36
+ return undefined;
37
+ if (host.platform !== "darwin" && host.platform !== "linux")
38
+ return "REA supports Hopper on macOS and selected 64-bit Linux distributions.";
39
+ if (host.platform === "darwin") {
40
+ const version = await host.macosVersion();
41
+ return version === undefined || major(version) < 12
42
+ ? "Upgrade to macOS 12 or newer."
43
+ : undefined;
44
+ }
45
+ if ((await host.linuxDistribution())?.supported === true)
46
+ return undefined;
47
+ return "Automated Hopper setup supports Ubuntu 24.04+, Fedora 41+, and 64-bit Arch Linux; configure an existing supported provider instead.";
48
+ };
49
+ /** Production setup effects for Hopper, agent configuration, and the canonical skill directory. */
50
+ export const systemSetupHost = (doctorHost = systemDoctorHost()) => {
51
+ const platform = doctorHost.platform;
52
+ return {
53
+ platform,
54
+ nodeVersion: process.versions.node,
55
+ macosVersion: () => doctorHost.macosVersion(),
56
+ linuxDistribution: readLinuxDistribution,
57
+ hopperPath: async () => (await runDoctor(undefined, doctorHost)).hopperPath,
58
+ providerEnvironment: async () => {
59
+ const diagnosis = await runDoctor(undefined, doctorHost);
60
+ return {
61
+ ...providerRegistrationEnvironment(diagnosis.providerInspections ?? []),
62
+ ...(diagnosis.hopperPath === undefined
63
+ ? {}
64
+ : { HOPPER_LAUNCHER_PATH: diagnosis.hopperPath }),
65
+ };
66
+ },
67
+ installHopper: async (replaceExisting) => {
68
+ const result = platform === "linux"
69
+ ? await installLinuxHopper()
70
+ : await installMacHopper({ replaceExisting });
71
+ if (result.status === "installed")
72
+ return result;
73
+ return setupInstallFailure(result.reason);
74
+ },
75
+ detectedClients: () => detectClients(homedir()),
76
+ supportedClients: () => Promise.resolve(supportedClients(homedir())),
77
+ configureClient: (client, providerEnvironment, command) => client.format === "unsupported"
78
+ ? Promise.resolve({ status: "skipped" })
79
+ : configureClientConfiguration(client, providerEnvironment, command),
80
+ clientNeedsConfigure: (client, providerEnvironment, command) => clientConfigurationAligned(client, providerEnvironment, command).then((aligned) => !aligned),
81
+ inspectClientConfiguration: inspectClientConfiguration,
82
+ skillNeedsInstall: () => canonicalSkillNeedsInstall(homedir()),
83
+ installSkill: () => installCanonicalSkill(homedir()),
84
+ doctor: (scope) => runDoctor(undefined, doctorHost, scope),
85
+ };
86
+ };
87
+ /** Detect supported agents from their config files or stable installation markers. */
88
+ export const detectClients = async (home) => {
89
+ const detected = [];
90
+ for (const candidate of supportedClients(home)) {
91
+ const [hasConfig, hasMarker] = await Promise.all([
92
+ exists(candidate.configPath),
93
+ candidate.markerPath === undefined ? false : exists(candidate.markerPath),
94
+ ]);
95
+ if (hasConfig || hasMarker)
96
+ detected.push(candidate);
97
+ }
98
+ return detected;
99
+ };
100
+ const major = (version) => Number.parseInt(version.split(".")[0] ?? "0", 10);
101
+ const exists = async (path) => {
102
+ try {
103
+ await access(path);
104
+ return true;
105
+ }
106
+ catch (cause) {
107
+ // best-effort cleanup: optional host probing; absence means unavailable.
108
+ void cause;
109
+ return false;
110
+ }
111
+ };
@@ -1,5 +1,4 @@
1
- /** Select exact non-secret settings published by available providers. */
1
+ /** Preserve adapter-published settings independently of runtime readiness. */
2
2
  export const providerRegistrationEnvironment = (inspections) => Object.fromEntries(inspections
3
- .filter(({ available }) => available)
4
3
  .flatMap(({ registrationEnvironment }) => Object.entries(registrationEnvironment))
5
4
  .sort(([left], [right]) => left.localeCompare(right)));
@@ -6,6 +6,7 @@ const SKILL_FILES = [
6
6
  "SKILL.md",
7
7
  "references/native-and-artifacts.md",
8
8
  "references/javascript-applications.md",
9
+ "references/android-applications.md",
9
10
  "references/runtime-observation.md",
10
11
  "references/evidence-workflows.md",
11
12
  ];
@@ -33,7 +34,9 @@ export const canonicalSkillNeedsInstall = async (home) => {
33
34
  try {
34
35
  return (await canonicalSkillFiles(home)).some(({ content, original }) => original !== content);
35
36
  }
36
- catch {
37
+ catch (cause) {
38
+ // Unreadable skill state fails open to install so setup can repair it.
39
+ void cause;
37
40
  return true;
38
41
  }
39
42
  };
@@ -66,12 +69,15 @@ export const installCanonicalSkill = async (home) => {
66
69
  throw new Error(`skill readback mismatch: ${destination}`);
67
70
  return "installed";
68
71
  }
69
- catch {
72
+ catch (cause) {
73
+ // Install failure preserves the original error outcome; report cause inline.
74
+ void cause;
70
75
  try {
71
76
  await restoreSkillFiles(changed);
72
77
  }
73
- catch {
78
+ catch (restoreCause) {
74
79
  // Per-file backups remain beside changed files for operator recovery.
80
+ void restoreCause;
75
81
  }
76
82
  return "failed";
77
83
  }
@@ -0,0 +1,17 @@
1
+ /** Whether the requested setup actions still need approval or human repair. */
2
+ export const isSetupFailure = (result) => {
3
+ const status = result.status;
4
+ switch (status) {
5
+ case "planned":
6
+ case "cancelled":
7
+ case "ready":
8
+ return false;
9
+ case "needs_confirmation":
10
+ case "needs_human":
11
+ return true;
12
+ default: {
13
+ const exhaustive = status;
14
+ throw new TypeError(`Unhandled setup result status: ${String(exhaustive)}`);
15
+ }
16
+ }
17
+ };
@@ -34,7 +34,10 @@ export const createStoreFileLock = async (path) => {
34
34
  }
35
35
  return {
36
36
  release: async () => {
37
- await removeOwner(path, owner).catch(() => undefined);
37
+ await removeOwner(path, owner).catch((cause) => {
38
+ // best-effort cleanup: lock release must not reject unhandled.
39
+ void cause;
40
+ });
38
41
  },
39
42
  };
40
43
  }
@@ -68,7 +71,9 @@ export const removeStaleStoreFileLock = async (path) => {
68
71
  await removeOwner(path, owner);
69
72
  return true;
70
73
  }
71
- catch {
74
+ catch (cause) {
75
+ // best-effort cleanup: stale lock probing; failure means the lock stands.
76
+ void cause;
72
77
  return false;
73
78
  }
74
79
  };
@@ -18,6 +18,7 @@ const claudeCodeConfigDirectory = ({ home, env }) => env.CLAUDE_CONFIG_DIR ?? ho
18
18
  const claudeCodeMarkerDirectory = ({ home, env }) => env.CLAUDE_CONFIG_DIR ?? join(home, ".claude");
19
19
  const codexDirectory = ({ home, env }) => env.CODEX_HOME ?? join(home, ".codex");
20
20
  const copilotDirectory = ({ home, env }) => env.COPILOT_HOME ?? join(home, ".copilot");
21
+ const commandCodeDirectory = ({ home }) => join(home, ".commandcode");
21
22
  const opencodeDirectory = ({ home, env }) => join(env.XDG_CONFIG_HOME ?? join(home, ".config"), "opencode");
22
23
  const existingOpenCodeConfigPath = (context) => {
23
24
  if (context.env.OPENCODE_CONFIG !== undefined)
@@ -118,6 +119,13 @@ export const SUPPORTED_CLIENT_DEFINITIONS = [
118
119
  markerPath: copilotDirectory,
119
120
  format: "copilot_cli",
120
121
  },
122
+ {
123
+ name: "commandcode",
124
+ displayName: "Command Code",
125
+ configPath: (context) => join(commandCodeDirectory(context), "mcp.json"),
126
+ markerPath: commandCodeDirectory,
127
+ format: "commandcode",
128
+ },
121
129
  {
122
130
  name: "vscode",
123
131
  displayName: "VS Code",
@@ -86,7 +86,8 @@ const removeClient = async (client, fileSystem) => {
86
86
  serversKey: key,
87
87
  } = parseClientConfiguration(original, client.format));
88
88
  }
89
- catch {
89
+ catch (cause) {
90
+ void cause;
90
91
  return item(client.name, "failed", `Configuration is not valid ${client.format === "toml" ? "TOML" : client.format === "opencode" ? "JSONC" : "JSON"} and was not changed. Repair it, then rerun uninstall.`);
91
92
  }
92
93
  const registration = servers[PRODUCT_IDENTITY.mcpServerKey];
@@ -101,7 +102,8 @@ const removeClient = async (client, fileSystem) => {
101
102
  try {
102
103
  await fileSystem.copy(transactionPath, backupPath);
103
104
  }
104
- catch {
105
+ catch (cause) {
106
+ void cause;
105
107
  return item(client.name, "failed", "Configuration could not be backed up, so no change was made. Check file permissions, then rerun uninstall.");
106
108
  }
107
109
  try {
@@ -111,11 +113,14 @@ const removeClient = async (client, fileSystem) => {
111
113
  throw new Error("registration readback mismatch");
112
114
  return item(client.name, "removed", `Removed registration from ${client.configPath}.`);
113
115
  }
114
- catch {
116
+ catch (cause) {
117
+ // Update failure attempts a restore before reporting; cause is preserved below.
118
+ void cause;
115
119
  try {
116
120
  await fileSystem.writeText(transactionPath, original);
117
121
  }
118
- catch {
122
+ catch (restoreCause) {
123
+ void restoreCause;
119
124
  return item(client.name, "failed", "Configuration could not be updated or restored. Restore its `.rea.backup` manually, then rerun uninstall.");
120
125
  }
121
126
  return item(client.name, "failed", "Configuration could not be updated. The original was restored and its `.rea.backup` was retained. Repair the configuration or restore the backup, then rerun uninstall.");
@@ -58,7 +58,9 @@ export const detectNpmInstallation = async (packageRoot, host) => {
58
58
  try {
59
59
  canonicalPackageRoot = await host.canonicalPath(packageRoot);
60
60
  }
61
- catch {
61
+ catch (cause) {
62
+ // best-effort cleanup: optional install-location probing; unknown means not npm-managed.
63
+ void cause;
62
64
  return undefined;
63
65
  }
64
66
  try {
@@ -71,8 +73,9 @@ export const detectNpmInstallation = async (packageRoot, host) => {
71
73
  : { prefix, packageRoot: canonicalPackageRoot };
72
74
  }
73
75
  }
74
- catch {
76
+ catch (cause) {
75
77
  // The curl installer uses a Unix prefix that may differ from npm's current default.
78
+ void cause;
76
79
  }
77
80
  const nodeModules = dirname(canonicalPackageRoot);
78
81
  const library = dirname(nodeModules);
@@ -22,7 +22,8 @@ export const probeWindowsCapabilities = async (dependencies = systemDependencies
22
22
  ? { available: true, reason: null }
23
23
  : { available: false, reason: pty.reason },
24
24
  },
25
- security: windowsNativeCapabilities(dependencies.platform),
25
+ security: dependencies.nativeCapabilities?.() ??
26
+ windowsNativeCapabilities(dependencies.platform),
26
27
  };
27
28
  };
28
29
  const systemDependencies = () => ({
@@ -30,10 +31,8 @@ const systemDependencies = () => ({
30
31
  architecture: process.arch,
31
32
  probeSymlinkCreation,
32
33
  probeNoFollowOpen: () => systemNoFollowOpenCapability(process.platform, constants.O_NOFOLLOW),
33
- probePrivateAcl: () => ({
34
- available: false,
35
- reason: "Windows ACL enforcement is not implemented by this REA build",
36
- }),
34
+ probePrivateAcl: () => windowsNativeCapabilities(process.platform).private_runtime_dacl,
35
+ nativeCapabilities: () => windowsNativeCapabilities(process.platform),
37
36
  probeUnixDomainSocket: () => process.platform === "win32"
38
37
  ? {
39
38
  available: false,
@@ -47,7 +46,7 @@ export const systemNoFollowOpenCapability = (platform, noFollow) => {
47
46
  if (platform === "win32")
48
47
  return {
49
48
  available: false,
50
- reason: "Windows reparse-safe handle admission is not implemented",
49
+ reason: "Node pathname O_NOFOLLOW is not Windows handle authority; native admission is reported separately in security.",
51
50
  };
52
51
  return typeof noFollow === "number"
53
52
  ? { available: true, reason: null }
@@ -79,9 +78,10 @@ const probeSymlinkCreation = async () => {
79
78
  try {
80
79
  await rm(root, { recursive: true, force: true });
81
80
  }
82
- catch {
81
+ catch (cause) {
83
82
  // Cleanup failure must not replace the machine-readable probe outcome.
84
83
  // The probe root lives beneath the OS temporary directory and is unique.
84
+ void cause;
85
85
  }
86
86
  }
87
87
  };
@@ -1,5 +1,6 @@
1
1
  import { HopperProvider } from "../hopper/HopperProvider.js";
2
2
  import { GhidraProvider } from "../ghidra/GhidraProvider.js";
3
+ import { IdaProvider } from "../ida/IdaProvider.js";
3
4
  import { silentLogger } from "../logger.js";
4
5
  import { GENERATED_AUXILIARY_PROVIDERS } from "../generatedMcpToolCatalog.js";
5
6
  import { AnalysisProviderRegistry } from "./AnalysisProviderRegistry.js";
@@ -16,6 +17,7 @@ import { SessionProviderRouter } from "./SessionProviderRouter.js";
16
17
  export const createBinarySession = (config, logger = silentLogger) => {
17
18
  const hopper = new HopperProvider(config, logger);
18
19
  const ghidra = new GhidraProvider(config, logger);
20
+ const ida = new IdaProvider(config);
19
21
  const auxiliary = new Map(GENERATED_AUXILIARY_PROVIDERS.map((provider) => [
20
22
  provider.identity.id,
21
23
  provider,
@@ -30,7 +32,7 @@ export const createBinarySession = (config, logger = silentLogger) => {
30
32
  load,
31
33
  });
32
34
  };
33
- return composeBinarySession(new AnalysisProviderRegistry([hopper, ghidra], config.analysisProvider), [
35
+ return composeBinarySession(new AnalysisProviderRegistry([hopper, ghidra, ida], config.analysisProvider), [
34
36
  lazyProvider("rea-artifact-graph", async () => {
35
37
  const { ArtifactProvider } = await import("../artifacts/ArtifactProvider.js");
36
38
  return new ArtifactProvider();