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.
- package/README.md +93 -30
- package/bridge/ghidra/ReaGhidraBridge.java +358 -15
- package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
- package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
- package/dist/android/AndroidTargetSnapshot.js +34 -0
- package/dist/android/JadxAnalysis.js +191 -0
- package/dist/android/JadxConfiguration.js +41 -0
- package/dist/android/JadxMcpTransport.js +145 -0
- package/dist/android/JadxProtocol.js +101 -0
- package/dist/android/JadxProvider.js +170 -0
- package/dist/android/JadxRelease.js +19 -0
- package/dist/android/JadxSession.js +97 -0
- package/dist/application/AnalysisContextQueries.js +2 -1
- package/dist/application/AnalysisProviderEvaluation.js +5 -3
- package/dist/application/AnalysisProviderRegistry.js +2 -1
- package/dist/application/AnalysisSnapshotCache.js +4 -1
- package/dist/application/AnalysisSnapshotFiles.js +1 -1
- package/dist/application/AndroidAnalysisPort.js +1 -0
- package/dist/application/AndroidAnalysisService.js +37 -0
- package/dist/application/ArtifactExtraction.js +7 -4
- package/dist/application/ArtifactGraphConstruction.js +10 -17
- package/dist/application/ArtifactInventory/scanCanonical.js +8 -7
- package/dist/application/BinarySession.js +16 -3
- package/dist/application/BinarySessionExecution.js +4 -1
- package/dist/application/BinarySessionOpen.js +3 -2
- package/dist/application/BinarySessionRecords.js +9 -3
- package/dist/application/BinaryTargetResolver.js +25 -6
- package/dist/application/BrowserObservationService.js +2 -1
- package/dist/application/BrowserScenarioCaptureService.js +2 -1
- package/dist/application/BrowserScenarioEvidence.js +2 -2
- package/dist/application/CallPathTracing.js +2 -1
- package/dist/application/CapabilityInventory.js +18 -0
- package/dist/application/ClientConfigPath.js +3 -1
- package/dist/application/ClientConfigurationDocument.js +11 -1
- package/dist/application/ClientRegistrationStatus.js +8 -1
- package/dist/application/CompositeProvider.js +1 -1
- package/dist/application/DirectAnalysis.js +23 -7
- package/dist/application/DirectAnalysisStatus.js +3 -3
- package/dist/application/Doctor.js +48 -8
- package/dist/application/DoctorDiagnostics.js +7 -5
- package/dist/application/DoctorScope.js +1 -1
- package/dist/application/ElectronActiveEvidence.js +2 -2
- package/dist/application/ElectronActiveObservationService.js +2 -1
- package/dist/application/ElectronBoundaryAnalysis.js +1 -1
- package/dist/application/ElectronObservationService.js +2 -1
- package/dist/application/EnhancedLiteralTracing.js +2 -1
- package/dist/application/EnhancedToolTypes.js +2 -1
- package/dist/application/EnhancedTools.js +3 -1
- package/dist/application/EvidenceBundleCommands.js +2 -1
- package/dist/application/EvidenceBundleFiles.js +1 -1
- package/dist/application/EvidenceInputResolver.js +30 -0
- package/dist/application/EvidenceLedger.js +2 -1
- package/dist/application/FirmwareAnalysisPort.js +1 -0
- package/dist/application/FirmwareAnalysisService.js +35 -0
- package/dist/application/FunctionAnalysisEvidence.js +32 -0
- package/dist/application/InventoryProjectionEvidence.js +2 -1
- package/dist/application/JavaScriptApplicationService.js +50 -3
- package/dist/application/JavaScriptApplicationWorkflowService.js +2 -1
- package/dist/application/JavaScriptArtifactAnalysis.js +4 -2
- package/dist/application/JavaScriptArtifactFiles.js +4 -2
- package/dist/application/JavaScriptArtifactPathResolution.js +6 -2
- package/dist/application/JavaScriptJsonModules.js +3 -2
- package/dist/application/JavaScriptModuleRelationships.js +4 -2
- package/dist/application/JavaScriptRuntimeObservationService.js +2 -1
- package/dist/application/JavaScriptRuntimeReconciliationService.js +2 -1
- package/dist/application/JavaScriptSemanticGraphProjection.js +1 -1
- package/dist/application/JavaScriptSemanticTraceService.js +2 -1
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LazyAnalysisProvider.js +3 -1
- package/dist/application/LinuxHopper.js +12 -4
- package/dist/application/MacHopper.js +20 -7
- package/dist/application/ManagedApplicationGraphService.js +2 -1
- package/dist/application/ManagedMemberComparisonService.js +3 -1
- package/dist/application/ManagedNativeVerificationService.js +2 -1
- package/dist/application/ManagedReconstructionService.js +2 -1
- package/dist/application/NativeCallRoutes.js +1 -1
- package/dist/application/NativeDispatchMetadataInspection.js +1 -1
- package/dist/application/NativeUiActionTrace.js +2 -1
- package/dist/application/NativeValueTrace.js +1 -1
- package/dist/application/ProcessCaptureError.js +1 -1
- package/dist/application/ProcessCaptureJournal.js +3 -1
- package/dist/application/ProcessCaptureLifecycle.js +6 -3
- package/dist/application/ProcessCli.js +9 -5
- package/dist/application/ProcessEvidence.js +2 -6
- package/dist/application/ProcessHarness.js +3 -2
- package/dist/application/ProcessNormalization.js +12 -5
- package/dist/application/ProcessSampling.js +3 -1
- package/dist/application/ReconstructionCoverageService.js +2 -1
- package/dist/application/ReconstructionObligationLedgerService.js +2 -1
- package/dist/application/ReferenceSourceImportEntries.js +2 -0
- package/dist/application/ReferenceSourceImportPolicy.js +4 -2
- package/dist/application/ReferenceSourceVcsAdapter.js +35 -4
- package/dist/application/SessionProviderRouter.js +4 -1
- package/dist/application/Setup.js +1 -128
- package/dist/application/SetupClientConfiguration.js +17 -6
- package/dist/application/SetupHost.js +111 -0
- package/dist/application/SetupRegistrationEnvironment.js +1 -2
- package/dist/application/SetupSkill.js +9 -3
- package/dist/application/SetupTypes.js +17 -0
- package/dist/application/StoreFileLock.js +7 -2
- package/dist/application/SupportedClients.js +8 -0
- package/dist/application/Uninstall.js +9 -4
- package/dist/application/UpdateRuntime.js +5 -2
- package/dist/application/WindowsCapabilities.js +7 -7
- package/dist/application/runtime.js +3 -1
- package/dist/artifacts/ArtifactProvider.js +3 -1
- package/dist/artifacts/DirectoryArtifactReader.js +2 -0
- package/dist/artifacts/NativeDmgArtifactReader.js +10 -3
- package/dist/artifacts/NibArchive.js +4 -2
- package/dist/artifacts/SafeOutputTree.js +26 -10
- package/dist/artifacts/ZipArtifactReader.js +1 -0
- package/dist/browser/BrowserProcessStartup.js +3 -1
- package/dist/browser/CdpAuthorizedMainFrame.js +1 -1
- package/dist/browser/CdpBrowserProvider.js +4 -1
- package/dist/browser/CdpCaptureDocuments.js +3 -1
- package/dist/browser/CdpCaptureEventHandlers.js +6 -2
- package/dist/browser/CdpCaptureStorageFingerprints.js +1 -1
- package/dist/browser/CdpCaptureValues.js +6 -2
- package/dist/browser/CdpConnection.js +8 -6
- package/dist/browser/CdpElectronInspection.js +3 -3
- package/dist/browser/CdpElectronProvider.js +4 -1
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpEndpoint.js +22 -10
- package/dist/browser/CdpObservationSession.js +2 -1
- package/dist/browser/CdpOptionalCommand.js +1 -1
- package/dist/browser/CdpPageCapture.js +2 -1
- package/dist/browser/CdpSafeMetadata.js +53 -8
- package/dist/browser/CdpScreenshot.js +1 -1
- package/dist/browser/CdpTargetSession.js +8 -5
- package/dist/browser/CdpWebMcpDiscovery.js +1 -1
- package/dist/browser/ElectronFileScope.js +9 -3
- package/dist/browser/JavaScriptRuntimeScope.js +3 -1
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +3 -1
- package/dist/browser/PlaywrightElectronActiveActions.js +1 -1
- package/dist/browser/PlaywrightElectronActiveProvider.js +6 -2
- package/dist/browser/PlaywrightExecutionBoundary.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +10 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +3 -1
- package/dist/browser/PlaywrightScenarioEvents.js +6 -2
- package/dist/browser/PlaywrightScenarioSession.js +5 -2
- package/dist/browser/V8InspectorEndpoint.js +2 -1
- package/dist/browser/V8InspectorProvider.js +6 -1
- package/dist/browser/WebSourceMapFetcher.js +24 -11
- package/dist/cli/androidCommands.js +81 -0
- package/dist/{cliApplicationCommands.js → cli/applicationCommands.js} +18 -16
- package/dist/{cliBrowserAdvancedCommands.js → cli/browserAdvancedCommands.js} +13 -16
- package/dist/{cliBrowserCommands.js → cli/browserCommands.js} +9 -9
- package/dist/cli/commandCancellation.js +24 -0
- package/dist/cli/coreAnalysisCommands.js +110 -17
- package/dist/{cliElectronCommands.js → cli/electronCommands.js} +14 -13
- package/dist/cli/firmwareCommands.js +75 -0
- package/dist/{cliSetup.js → cli/interactiveSetup.js} +1 -1
- package/dist/cli/javascriptApplicationAnalysis.js +1 -1
- package/dist/cli/managedCommands.js +1 -1
- package/dist/cli/managedProjectGraphCommand.js +1 -1
- package/dist/cli/options.js +7 -1
- package/dist/{cliProcessCommands.js → cli/processCommands.js} +3 -3
- package/dist/cli/referenceSourceImportStatus.js +10 -0
- package/dist/cli/setupCommands.js +4 -2
- package/dist/cli/utilityCommands.js +3 -2
- package/dist/cli.js +10 -15
- package/dist/cliBrowserContext.js +1 -1
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +11 -2
- package/dist/cliEvidenceCommands.js +2 -1
- package/dist/cliJavaScriptRuntimeCommands.js +2 -1
- package/dist/cliJsonInput.js +26 -11
- package/dist/cliLogging.js +2 -1
- package/dist/cliOutput.js +15 -16
- package/dist/config/environment.js +11 -1
- package/dist/config/parseConfig.js +7 -1
- package/dist/config/parsers.js +1 -1
- package/dist/contracts/androidToolContracts.js +77 -0
- package/dist/contracts/applicationToolContracts.js +32 -5
- package/dist/contracts/applicationWorkflowInputContracts.js +13 -13
- package/dist/contracts/artifactComparisonExample.js +7 -14
- package/dist/contracts/enhancedToolContracts.js +31 -0
- package/dist/contracts/errorSchemas.js +4 -2
- package/dist/contracts/evidenceInputContracts.js +13 -0
- package/dist/contracts/firmwareToolContracts.js +38 -0
- package/dist/contracts/officialToolContracts.js +66 -0
- package/dist/contracts/promptContracts.js +1 -1
- package/dist/contracts/sessionLifecycleInputs.js +4 -0
- package/dist/contracts/sessionToolContracts.js +43 -0
- package/dist/contracts/sessionToolSchemas.js +1 -1
- package/dist/contracts/toolContractExamples.js +5 -0
- package/dist/contracts/toolContractTypes.js +2 -0
- package/dist/contracts/toolContracts.js +7 -130
- package/dist/contracts/toolEffects.js +43 -0
- package/dist/contracts/toolOutputSchemaGroups.js +4 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +1 -0
- package/dist/doctorRuntime.js +5 -1
- package/dist/domain/analysisErrorBase.js +33 -0
- package/dist/domain/analysisErrorCore.js +60 -0
- package/dist/domain/analysisErrorPresentation.js +22 -2
- package/dist/domain/analysisErrorProjection.js +24 -3
- package/dist/domain/analysisSnapshot.js +1 -0
- package/dist/domain/androidAnalysis.js +141 -0
- package/dist/domain/appleAssetCatalog.js +1 -1
- package/dist/domain/artifactGraph.js +1 -0
- package/dist/domain/artifactInspection.js +19 -17
- package/dist/domain/artifactInventoryEvidence.js +20 -25
- package/dist/domain/artifactOperationError.js +16 -0
- package/dist/domain/browserObservation.js +12 -4
- package/dist/domain/browserObservationError.js +23 -0
- package/dist/domain/browserScenario.js +1 -1
- package/dist/domain/browserScenarioCapture.js +1 -1
- package/dist/domain/browserScenarioDiff.js +1 -1
- package/dist/domain/browserScenarioNormalization.js +6 -11
- package/dist/domain/browserScenarioValues.js +3 -1
- package/dist/domain/callPath.js +47 -7
- package/dist/domain/canonicalDigest.js +65 -0
- package/dist/domain/canonicalOrdering.js +11 -0
- package/dist/domain/changedBehavior.js +8 -7
- package/dist/domain/comparisonSemantics.js +2 -4
- package/dist/domain/configurationErrors.js +25 -0
- package/dist/domain/dosCom.js +8 -0
- package/dist/domain/electronActiveObservation.js +3 -1
- package/dist/domain/electronStaticAnalysisBrowser.js +13 -23
- package/dist/domain/electronStaticAnalysisNative.js +2 -1
- package/dist/domain/electronStaticAnalysisValues.js +23 -3
- package/dist/domain/evidence.js +3 -11
- package/dist/domain/evidenceErrors.js +30 -0
- package/dist/domain/firmwareAnalysis.js +121 -0
- package/dist/domain/functionComparison.js +4 -2
- package/dist/domain/functionComparisonDimensions.js +6 -4
- package/dist/domain/functionComparisonNormalization.js +8 -1
- package/dist/domain/functionComparisonResults.js +1 -4
- package/dist/domain/hopperErrors.js +78 -0
- package/dist/domain/hopperValues.js +2 -1
- package/dist/domain/interfaceBuilderGraph.js +3 -1
- package/dist/domain/javascriptApplicationChangeGraph.js +2 -2
- package/dist/domain/javascriptApplicationGraph.js +13 -22
- package/dist/domain/javascriptApplicationVersionComparison.js +3 -11
- package/dist/domain/javascriptApplicationVersionItems.js +3 -3
- package/dist/domain/javascriptApplicationVersionKeys.js +1 -1
- package/dist/domain/javascriptAstFingerprint.js +1 -1
- package/dist/domain/javascriptExportShapeComparison.js +1 -2
- package/dist/domain/javascriptExportShapeSelection.js +1 -1
- package/dist/domain/javascriptExportShapeVariants.js +7 -3
- package/dist/domain/javascriptFeatureSeed.js +29 -9
- package/dist/domain/javascriptFeatureTrace.js +9 -13
- package/dist/domain/javascriptFeatureTraversal.js +2 -1
- package/dist/domain/javascriptNativeHandoff.js +2 -1
- package/dist/domain/javascriptRuntimeLoadState.js +2 -2
- package/dist/domain/javascriptRuntimeReconciliationActive.js +3 -10
- package/dist/domain/javascriptRuntimeReconciliationGraph.js +2 -2
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +4 -3
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +8 -14
- package/dist/domain/javascriptRuntimeReconciliationResult.js +4 -4
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +5 -2
- package/dist/domain/javascriptRuntimeStaticCandidates.js +8 -4
- package/dist/domain/javascriptSemanticAnalysis.js +40 -3
- package/dist/domain/javascriptSemanticCallResolution.js +2 -1
- package/dist/domain/javascriptSemanticChildProcesses.js +2 -1
- package/dist/domain/javascriptSemanticDataEffects.js +2 -1
- package/dist/domain/javascriptSemanticFingerprints.js +1 -1
- package/dist/domain/javascriptSemanticGraph.js +23 -28
- package/dist/domain/javascriptSemanticPrimitives.js +9 -2
- package/dist/domain/javascriptSemanticProjection.js +2 -1
- package/dist/domain/javascriptSemanticPromises.js +2 -1
- package/dist/domain/javascriptSemanticProvenance.js +1 -1
- package/dist/domain/javascriptSemanticQuery.js +7 -8
- package/dist/domain/javascriptSemanticQueryAssessment.js +1 -2
- package/dist/domain/javascriptSemanticQueryIdentity.js +1 -2
- package/dist/domain/javascriptSemanticReturns.js +2 -1
- package/dist/domain/javascriptSemanticValues.js +50 -16
- package/dist/domain/javascriptSourceParser.js +4 -2
- package/dist/domain/javascriptStaticAnalysis.js +1 -1
- package/dist/domain/javascriptStaticAnalysisBundler.js +2 -1
- package/dist/domain/javascriptStaticAnalysisCalls.js +14 -6
- package/dist/domain/javascriptStaticAnalysisHelpers.js +31 -4
- package/dist/domain/jsonShape.js +6 -2
- package/dist/domain/managedMemberComparison.js +1 -0
- package/dist/domain/managedMemberComparisonItems.js +2 -0
- package/dist/domain/managedNativeVerificationMatch.js +5 -3
- package/dist/domain/nativeDataType.js +2 -0
- package/dist/domain/nativeFunctionAnnotations.js +43 -0
- package/dist/domain/nativeLoadImage.js +95 -0
- package/dist/domain/nativeMetadataRecovery.js +55 -0
- package/dist/domain/processCapture.js +0 -1
- package/dist/domain/processEvidenceProvider.js +11 -0
- package/dist/domain/processTraceComparison.js +1 -1
- package/dist/domain/providerAdapterError.js +17 -0
- package/dist/domain/providerCleanupError.js +1 -1
- package/dist/domain/providerSelectionError.js +44 -0
- package/dist/domain/reconstructionUnknowns.js +1 -1
- package/dist/domain/reconstructionVerification.js +22 -8
- package/dist/domain/referenceSourceClassification.js +5 -6
- package/dist/domain/referenceSourceGraph.js +9 -17
- package/dist/domain/referenceSourceImportParsing.js +38 -23
- package/dist/domain/runtimeIdentification.js +1 -1
- package/dist/domain/runtimeVersion.js +4 -7
- package/dist/domain/safeJson.js +13 -0
- package/dist/domain/sourceToBundleComparison.js +5 -7
- package/dist/domain/sourceToBundleSignals.js +6 -6
- package/dist/domain/staticRuntimeCorrelation.js +9 -7
- package/dist/domain/unknownRegistryError.js +10 -0
- package/dist/domain/webBundleAnalyzerAst.js +22 -5
- package/dist/domain/webBundleAnalyzerInspection.js +20 -14
- package/dist/dotnet/ManagedMemberRows.js +1 -1
- package/dist/dotnet/ManagedMetadataHeaps.js +3 -2
- package/dist/dotnet/ManagedMetadataInventoryRows.js +4 -2
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -1
- package/dist/dotnet/ManagedStaticProvider.js +3 -1
- package/dist/firmware/FirmwareCommand.js +163 -0
- package/dist/firmware/FirmwareFiles.js +190 -0
- package/dist/firmware/FirmwareProvider.js +258 -0
- package/dist/firmware/FirmwarePublication.js +84 -0
- package/dist/firmware/FirmwareRelease.js +32 -0
- package/dist/firmware/FirmwareReports.js +223 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +5 -5
- package/dist/ghidra/GhidraAnalysisProfile.js +37 -8
- package/dist/ghidra/GhidraClient.js +52 -6
- package/dist/ghidra/GhidraDiagnostics.js +3 -0
- package/dist/ghidra/GhidraDoctor.js +38 -14
- package/dist/ghidra/GhidraFunctionValues.js +10 -4
- package/dist/ghidra/GhidraInstallation.js +10 -4
- package/dist/ghidra/GhidraInventoryValues.js +39 -2
- package/dist/ghidra/GhidraLauncher.js +91 -26
- package/dist/ghidra/GhidraLoadImageValues.js +199 -0
- package/dist/ghidra/GhidraProvider.js +129 -13
- package/dist/ghidra/GhidraProviderCapabilities.js +52 -15
- package/dist/ghidra/GhidraRequestQueue.js +2 -2
- package/dist/ghidra/GhidraSessionError.js +31 -4
- package/dist/ghidra/GhidraSessionValues.js +10 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +16 -2
- package/dist/ghidra/GhidraTransport.js +12 -0
- package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +170 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +21 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +84 -0
- package/dist/hopper/BridgeLauncher.js +4 -2
- package/dist/hopper/HopperAnalysisProfile.js +7 -2
- package/dist/hopper/HopperCleanup.js +55 -9
- package/dist/hopper/HopperClient.js +14 -4
- package/dist/hopper/HopperProcessDiagnostic.js +1 -1
- package/dist/hopper/HopperProvider.js +8 -4
- package/dist/hopper/HopperRequestQueue.js +7 -3
- package/dist/hopper/HopperSessionValues.js +1 -1
- package/dist/hopper/HopperSocketConnection.js +1 -1
- package/dist/hopper/HopperTargetLease.js +23 -15
- package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +7 -8
- package/dist/hopper/LinuxPrivateDisplayProbe.js +6 -2
- package/dist/hopper/protocol.js +8 -8
- package/dist/ida/IdaConfiguration.js +56 -0
- package/dist/ida/IdaDoctor.js +53 -0
- package/dist/ida/IdaInput.js +62 -0
- package/dist/ida/IdaMcpConnection.js +111 -0
- package/dist/ida/IdaOperationRunner.js +299 -0
- package/dist/ida/IdaProtocolValues.js +178 -0
- package/dist/ida/IdaProvider.js +126 -0
- package/dist/ida/IdaProviderCapabilities.js +60 -0
- package/dist/ida/IdaSessionClient.js +306 -0
- package/dist/ida/IdaWorkspace.js +54 -0
- package/dist/main/shutdown.js +21 -1
- package/dist/main/startup.js +1 -1
- package/dist/main/transport.js +8 -4
- package/dist/main.js +5 -2
- package/dist/native/AppleDispatchMetadata.js +31 -10
- package/dist/native/NativeMacOSProvider.js +87 -15
- package/dist/native/NativeMachoInspection.js +42 -12
- package/dist/native/NativeUiHelperRuntime.js +7 -1
- package/dist/native/NativeUiObservation.js +6 -2
- package/dist/native/parsers/demangle.js +1 -1
- package/dist/native/parsers/dyldInfo.js +3 -3
- package/dist/native/parsers/otool.js +4 -1
- package/dist/native/parsers/plist.js +11 -3
- package/dist/process/PrivateRuntimeRoot.js +13 -3
- package/dist/process/ProcessOwnership.js +5 -73
- package/dist/process/ProcessOwnershipObservation.js +62 -2
- package/dist/process/ProcessOwnershipProcessTree.js +13 -0
- package/dist/process/ProviderProcess.js +24 -7
- package/dist/process/ProviderRunLineage.js +1 -1
- package/dist/process/WindowsAuthority.js +20 -1
- package/dist/reference/ReferenceSourceReaderEntries.js +5 -1
- package/dist/reference/ReferenceSourceReaderFile.js +1 -0
- package/dist/server/createServer.js +25 -2
- package/dist/server/mcpProgress.js +2 -1
- package/dist/server/promptCompletion.js +3 -3
- package/dist/server/registerAndroidTools.js +30 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +5 -1
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +7 -2
- package/dist/server/registerApplicationTools/compareVersions.js +5 -1
- package/dist/server/registerApplicationTools/traceFeature.js +7 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +7 -2
- package/dist/server/registerEnhancedTools.js +28 -1
- package/dist/server/registerFirmwareTools.js +22 -0
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools/helpers.js +2 -1
- package/dist/server/registerManagedTools.js +1 -1
- package/dist/server/registerManagedWorkflowTools/evidence.js +1 -1
- package/dist/server/registerOfficialTools.js +4 -1
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerSessionTools.js +3 -1
- package/dist/server/runDerivedOperation.js +1 -1
- package/dist/server/sessionAvailabilityPolicy.js +3 -0
- package/dist/server/sessionEvidence.js +1 -1
- package/dist/server/toolResult.js +2 -1
- package/dist/windows/WindowsNativeLoader.js +108 -0
- package/dist/windows/WindowsOwnedProcess.js +168 -0
- package/dist/windows/WindowsPrivateRuntime.js +137 -0
- package/install.sh +4 -6
- package/native/windows/README.md +102 -0
- package/native/windows/build/manifest.json +9 -0
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +38 -24
- package/scripts/rea.mjs +1 -1
- package/scripts/verify-windows-native-artifact.mjs +39 -0
- package/skills/reverse-engineer-anything/SKILL.md +92 -24
- package/skills/reverse-engineer-anything/references/android-applications.md +31 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +19 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +52 -4
- package/dist/browser/CdpCanonicalJsonDigest.js +0 -9
- 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
|
|
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,
|
|
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 {
|
|
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
|
-
/**
|
|
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(() =>
|
|
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:
|
|
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
|
-
|
|
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
|
|
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();
|