rea-agents 4.0.1 → 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
|
@@ -128,6 +128,24 @@ const javascriptApplicationAvailability = ({ name, }) => {
|
|
|
128
128
|
: null;
|
|
129
129
|
};
|
|
130
130
|
const workflowAvailabilityFor = ({ name, kind, policy, }) => {
|
|
131
|
+
if (kind === "firmware-provider") {
|
|
132
|
+
const enabled = name === "inspect_firmware_regions"
|
|
133
|
+
? policy.firmwareInspectionEnabled
|
|
134
|
+
: policy.firmwareExtractionEnabled;
|
|
135
|
+
return enabled === true
|
|
136
|
+
? { reason: "available", remediation: null }
|
|
137
|
+
: {
|
|
138
|
+
reason: "provider_missing",
|
|
139
|
+
remediation: "On Linux, provide an absolute REA_BINWALK_COMMAND (Binwalk 3.1.0) or REA_UNBLOB_COMMAND (Unblob 26.6.4) path and util-linux prlimit. Extraction also requires the selected format’s external extractor.",
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (kind === "android-provider")
|
|
143
|
+
return policy.androidAnalysisEnabled === true
|
|
144
|
+
? { reason: "available", remediation: null }
|
|
145
|
+
: {
|
|
146
|
+
reason: "provider_missing",
|
|
147
|
+
remediation: "Set REA_JADX_MCP_JAR to a caller-supplied jadx-headless-mcp 0.7.1 JAR and provide Java on Linux or macOS. Only Linux has real-provider verification.",
|
|
148
|
+
};
|
|
131
149
|
const browser = browserProviderAvailability(name, kind, policy);
|
|
132
150
|
if (browser !== null)
|
|
133
151
|
return browser;
|
|
@@ -26,7 +26,9 @@ export const resolveClientConfigTransactionPath = async (requestedPath, fileSyst
|
|
|
26
26
|
? canonicalPath
|
|
27
27
|
: undefined;
|
|
28
28
|
}
|
|
29
|
-
catch {
|
|
29
|
+
catch (cause) {
|
|
30
|
+
// best-effort cleanup: unreadable or vanishing config paths mean no registration.
|
|
31
|
+
void cause;
|
|
30
32
|
return undefined;
|
|
31
33
|
}
|
|
32
34
|
};
|
|
@@ -31,7 +31,9 @@ const parseDocument = (text, format) => {
|
|
|
31
31
|
if (format === "toml")
|
|
32
32
|
return objectSchema.parse(parseToml(text));
|
|
33
33
|
const errors = [];
|
|
34
|
-
|
|
34
|
+
// Accept a UTF-8 BOM without shifting diagnostics or editing the original text.
|
|
35
|
+
const jsonText = text.startsWith("\uFEFF") ? ` ${text.slice(1)}` : text;
|
|
36
|
+
const document = parseJsonc(jsonText, errors, { allowTrailingComma: true });
|
|
35
37
|
const firstError = errors[0];
|
|
36
38
|
if (firstError !== undefined)
|
|
37
39
|
throw new SyntaxError(`Invalid JSON/JSONC at offset ${firstError.offset}: ${printParseErrorCode(firstError.error)}`);
|
|
@@ -94,6 +96,14 @@ export const clientRegistrationEntry = (format, command, environment) => {
|
|
|
94
96
|
tools: ["*"],
|
|
95
97
|
...(Object.keys(environment).length === 0 ? {} : { env: environment }),
|
|
96
98
|
};
|
|
99
|
+
case "commandcode":
|
|
100
|
+
return {
|
|
101
|
+
transport: "stdio",
|
|
102
|
+
enabled: true,
|
|
103
|
+
command: executable,
|
|
104
|
+
args,
|
|
105
|
+
...(Object.keys(environment).length === 0 ? {} : { env: environment }),
|
|
106
|
+
};
|
|
97
107
|
default:
|
|
98
108
|
return {
|
|
99
109
|
command: executable,
|
|
@@ -12,6 +12,7 @@ const registrationSchema = z
|
|
|
12
12
|
args: z.array(z.string()).default([]),
|
|
13
13
|
startup_timeout_sec: z.number().positive().optional(),
|
|
14
14
|
type: z.string().optional(),
|
|
15
|
+
transport: z.string().optional(),
|
|
15
16
|
tools: z.array(z.string()).optional(),
|
|
16
17
|
disabled: z.boolean().optional(),
|
|
17
18
|
enabled: z.boolean().optional(),
|
|
@@ -77,6 +78,8 @@ const registrationAligned = (registration, client, currentCommandPath) => {
|
|
|
77
78
|
(registration.type !== "stdio" ||
|
|
78
79
|
JSON.stringify(registration.tools) !== JSON.stringify(["*"])))
|
|
79
80
|
return false;
|
|
81
|
+
if (client.format === "commandcode" && registration.transport !== "stdio")
|
|
82
|
+
return false;
|
|
80
83
|
if (command.length === 4 &&
|
|
81
84
|
command[0] === "npx" &&
|
|
82
85
|
command[1] === "-y" &&
|
|
@@ -108,6 +111,8 @@ const parseRegistration = (value, client) => {
|
|
|
108
111
|
if ((client.format === "vscode" || client.format === "copilot_cli") &&
|
|
109
112
|
registration.type !== "stdio")
|
|
110
113
|
throw new TypeError("Expected an stdio registration");
|
|
114
|
+
if (client.format === "commandcode" && registration.transport !== "stdio")
|
|
115
|
+
throw new TypeError("Expected an stdio registration");
|
|
111
116
|
return registration;
|
|
112
117
|
};
|
|
113
118
|
const remediation = "Run rea setup to refresh this registration, then restart the client.";
|
|
@@ -128,7 +133,9 @@ const exists = async (path) => {
|
|
|
128
133
|
await access(path);
|
|
129
134
|
return true;
|
|
130
135
|
}
|
|
131
|
-
catch {
|
|
136
|
+
catch (cause) {
|
|
137
|
+
// best-effort cleanup: optional registration probing; absence means unregistered.
|
|
138
|
+
void cause;
|
|
132
139
|
return false;
|
|
133
140
|
}
|
|
134
141
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalysisCapabilityUnavailableError } from "../domain/
|
|
1
|
+
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
|
2
2
|
import { err, ok } from "../domain/result.js";
|
|
3
3
|
import { closeAnalysisClient } from "./AnalysisClientCleanup.js";
|
|
4
4
|
/** Synthetic compatibility identity for a deterministic provider set. */
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { parseConfig } from "../config.js";
|
|
2
2
|
import { EnhancedTools } from "./EnhancedTools.js";
|
|
3
|
+
import { executeFunctionAnalysisEvidence } from "./FunctionAnalysisEvidence.js";
|
|
3
4
|
import { createBinarySession, createManagedBinarySession } from "./runtime.js";
|
|
4
5
|
import { silentLogger } from "../logger.js";
|
|
5
6
|
import { createEvidence } from "../domain/evidence.js";
|
|
6
7
|
import { isManagedToolName, } from "../contracts/managedToolContracts.js";
|
|
7
|
-
import { EvidenceIntegrityError
|
|
8
|
+
import { EvidenceIntegrityError } from "../domain/evidenceErrors.js";
|
|
9
|
+
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
10
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
8
11
|
import { access } from "node:fs/promises";
|
|
9
12
|
import { readAnalysisSnapshot, writeAnalysisSnapshot, } from "./AnalysisSnapshotFiles.js";
|
|
10
13
|
import { parseBinaryTarget } from "./BinaryTargetResolver.js";
|
|
@@ -22,6 +25,9 @@ export const runDirectAnalysis = async (path, tool, arguments_, options = {}) =>
|
|
|
22
25
|
logger: options.logger ?? silentLogger,
|
|
23
26
|
snapshotPath: options.snapshotPath,
|
|
24
27
|
signal,
|
|
28
|
+
...(options.formatHint === undefined
|
|
29
|
+
? {}
|
|
30
|
+
: { formatHint: options.formatHint }),
|
|
25
31
|
...(options.providerId === undefined
|
|
26
32
|
? {}
|
|
27
33
|
: { providerId: options.providerId }),
|
|
@@ -71,12 +77,18 @@ const runAnalysis = async (path, tool, arguments_, options) => {
|
|
|
71
77
|
const prepared = await prepareSnapshot({
|
|
72
78
|
path,
|
|
73
79
|
snapshotPath,
|
|
80
|
+
...(options.formatHint === undefined
|
|
81
|
+
? {}
|
|
82
|
+
: { formatHint: options.formatHint }),
|
|
74
83
|
});
|
|
75
84
|
if (!prepared.ok)
|
|
76
85
|
return cliError(prepared.error);
|
|
77
86
|
const { snapshot } = prepared.value;
|
|
78
87
|
const opened = await session.open(path, {
|
|
79
88
|
signal,
|
|
89
|
+
...(options.formatHint === undefined
|
|
90
|
+
? {}
|
|
91
|
+
: { formatHint: options.formatHint }),
|
|
80
92
|
...(snapshot === undefined ? {} : { snapshot }),
|
|
81
93
|
...(options.providerId === undefined
|
|
82
94
|
? {}
|
|
@@ -86,7 +98,7 @@ const runAnalysis = async (path, tool, arguments_, options) => {
|
|
|
86
98
|
return cliError(opened.error);
|
|
87
99
|
const evidenceProfile = analysisProfileForEvidence(session, tool);
|
|
88
100
|
const bindingProfile = session.analysisProfile();
|
|
89
|
-
if (tool
|
|
101
|
+
if (canReplayDirectTool(session, tool) &&
|
|
90
102
|
snapshot !== undefined &&
|
|
91
103
|
evidenceProfile !== undefined &&
|
|
92
104
|
bindingProfile !== undefined) {
|
|
@@ -127,10 +139,16 @@ const runAnalysis = async (path, tool, arguments_, options) => {
|
|
|
127
139
|
await session.close();
|
|
128
140
|
}
|
|
129
141
|
};
|
|
142
|
+
const canReplayDirectTool = (session, tool) => tool !== "trace_native_ui_action" && session.allowsSnapshotReplay(tool);
|
|
130
143
|
const executeAnalysisTool = async (input) => {
|
|
131
144
|
const { session, tool, signal, evidenceProfile } = input;
|
|
145
|
+
if (tool === "analyze_function") {
|
|
146
|
+
const result = await executeFunctionAnalysisEvidence(session, input.arguments, input.openedTarget, { signal });
|
|
147
|
+
return result.ok
|
|
148
|
+
? { output: result.value, evidence: result.value }
|
|
149
|
+
: { output: cliError(result.error) };
|
|
150
|
+
}
|
|
132
151
|
if (tool === "binary_overview" ||
|
|
133
|
-
tool === "analyze_function" ||
|
|
134
152
|
tool === "inspect_native_api" ||
|
|
135
153
|
tool === "inspect_native_dispatch_metadata" ||
|
|
136
154
|
tool === "trace_feature" ||
|
|
@@ -139,9 +157,7 @@ const executeAnalysisTool = async (input) => {
|
|
|
139
157
|
const result = await new EnhancedTools(session).execute(tool, input.arguments, signal);
|
|
140
158
|
if (!result.ok)
|
|
141
159
|
return { output: cliError(result.error) };
|
|
142
|
-
const evidence = createEvidence(input.openedTarget,
|
|
143
|
-
? session.providerIdentity(tool)
|
|
144
|
-
: REA_WORKFLOW_PROVIDER, {
|
|
160
|
+
const evidence = createEvidence(input.openedTarget, REA_WORKFLOW_PROVIDER, {
|
|
145
161
|
operation: tool,
|
|
146
162
|
parameters: input.arguments,
|
|
147
163
|
result: result.value,
|
|
@@ -193,7 +209,7 @@ const prepareSnapshot = async (options) => {
|
|
|
193
209
|
const loaded = await readAnalysisSnapshot(snapshotPath);
|
|
194
210
|
if (!loaded.ok)
|
|
195
211
|
return loaded;
|
|
196
|
-
const target = await parseBinaryTarget(path);
|
|
212
|
+
const target = await parseBinaryTarget(path, process.cwd(), process.arch, undefined, options.formatHint);
|
|
197
213
|
if (!target.ok)
|
|
198
214
|
return target;
|
|
199
215
|
if (!snapshotMatchesTarget(loaded.value.target, target.value))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseConfig } from "../config.js";
|
|
2
|
-
import { projectAnalysisError } from "../domain/
|
|
2
|
+
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
3
3
|
import { jsonObjectSchema } from "../domain/jsonValue.js";
|
|
4
4
|
import { createServerIdentity } from "../serverIdentity.js";
|
|
5
5
|
import { silentLogger } from "../logger.js";
|
|
@@ -21,7 +21,7 @@ const runSessionStatus = async (logger = silentLogger, environment = process.env
|
|
|
21
21
|
await session.close();
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
/** List
|
|
24
|
+
/** List binary-session provider candidates and auxiliary operation availability. */
|
|
25
25
|
export const runProviderStatus = (logger = silentLogger, environment = process.env) => runSessionStatus(logger, environment);
|
|
26
|
-
/** List
|
|
26
|
+
/** List binary-session operation descriptors; this is not the full MCP catalog. */
|
|
27
27
|
export const runCapabilityStatus = (logger = silentLogger, environment = process.env) => runSessionStatus(logger, environment);
|
|
@@ -2,6 +2,7 @@ import { constants } from "node:fs";
|
|
|
2
2
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { delimiter, join } from "node:path";
|
|
5
|
+
import { analysisErrorRemediationAction } from "../domain/analysisErrorPresentation.js";
|
|
5
6
|
import { parseBinaryTarget } from "./BinaryTargetResolver.js";
|
|
6
7
|
import { execFileOutput } from "../process/ExecFileOutput.js";
|
|
7
8
|
import { probeHomebrew } from "./homebrew.js";
|
|
@@ -12,7 +13,7 @@ import { readClientRegistrationStatuses, } from "./ClientRegistrationStatus.js";
|
|
|
12
13
|
import { collectDoctorDiagnostics, doctorHealthy, } from "./DoctorDiagnostics.js";
|
|
13
14
|
import { normalizeDoctorScope, scopeDoctorChecks, } from "./DoctorScope.js";
|
|
14
15
|
/** Deep provider IDs whose readiness can be selected explicitly by doctor. */
|
|
15
|
-
export const DOCTOR_PROVIDER_IDS = ["hopper", "ghidra"];
|
|
16
|
+
export const DOCTOR_PROVIDER_IDS = ["hopper", "ghidra", "ida"];
|
|
16
17
|
/**
|
|
17
18
|
* Check requirements and an optional target without mutating the host.
|
|
18
19
|
* Every failed check includes remediation suitable for either the one-shot CLI
|
|
@@ -147,6 +148,32 @@ export const systemDoctorHost = (options = {}) => {
|
|
|
147
148
|
async validTarget(path) {
|
|
148
149
|
return (await parseBinaryTarget(path, process.cwd(), architecture)).ok;
|
|
149
150
|
},
|
|
151
|
+
async inspectTarget(path) {
|
|
152
|
+
const result = await parseBinaryTarget(path, process.cwd(), architecture);
|
|
153
|
+
if (result.ok)
|
|
154
|
+
return {
|
|
155
|
+
name: "target",
|
|
156
|
+
ok: true,
|
|
157
|
+
classification: "healthy",
|
|
158
|
+
detail: path,
|
|
159
|
+
};
|
|
160
|
+
const error = result.error;
|
|
161
|
+
return {
|
|
162
|
+
name: "target",
|
|
163
|
+
ok: false,
|
|
164
|
+
classification: error.constraint === "directory_requires_file"
|
|
165
|
+
? "unsupported_target"
|
|
166
|
+
: "config_drift",
|
|
167
|
+
detail: path,
|
|
168
|
+
details: {
|
|
169
|
+
reason: error.reason,
|
|
170
|
+
...(error.constraint === undefined
|
|
171
|
+
? {}
|
|
172
|
+
: { constraint: error.constraint }),
|
|
173
|
+
},
|
|
174
|
+
remediation: analysisErrorRemediationAction(error),
|
|
175
|
+
};
|
|
176
|
+
},
|
|
150
177
|
executable: (path) => executableAvailable(path, platform, hostExecFileOutput, commandEnvironment),
|
|
151
178
|
linuxDemoRuntimeCheck: options.linuxDemoRuntimeCheck ?? uncomposedLinuxDemoRuntimeCheck,
|
|
152
179
|
supportedLinuxHopper: linuxHopperBinarySupported,
|
|
@@ -156,7 +183,9 @@ export const systemDoctorHost = (options = {}) => {
|
|
|
156
183
|
const prefix = (await hostExecFileOutput(command, ["--prefix", "--cask", "hopper-disassembler"], commandEnvironment)).stdout.trim();
|
|
157
184
|
return `${prefix}/Hopper Disassembler.app/Contents/MacOS/hopper`;
|
|
158
185
|
}
|
|
159
|
-
catch {
|
|
186
|
+
catch (cause) {
|
|
187
|
+
// best-effort cleanup: optional Homebrew probing; absence means uninstalled.
|
|
188
|
+
void cause;
|
|
160
189
|
return undefined;
|
|
161
190
|
}
|
|
162
191
|
});
|
|
@@ -173,7 +202,9 @@ export const systemDoctorHost = (options = {}) => {
|
|
|
173
202
|
...commandEnvironment,
|
|
174
203
|
})).stdout);
|
|
175
204
|
}
|
|
176
|
-
catch {
|
|
205
|
+
catch (cause) {
|
|
206
|
+
// best-effort cleanup: optional version probing; failure means unavailable.
|
|
207
|
+
void cause;
|
|
177
208
|
return undefined;
|
|
178
209
|
}
|
|
179
210
|
},
|
|
@@ -184,7 +215,9 @@ export const systemDoctorHost = (options = {}) => {
|
|
|
184
215
|
return uniqueLines((await hostExecFileOutput(command, arguments_, commandEnvironment))
|
|
185
216
|
.stdout);
|
|
186
217
|
}
|
|
187
|
-
catch {
|
|
218
|
+
catch (cause) {
|
|
219
|
+
// best-effort cleanup: optional path probing; failure means none found.
|
|
220
|
+
void cause;
|
|
188
221
|
return [];
|
|
189
222
|
}
|
|
190
223
|
},
|
|
@@ -199,7 +232,9 @@ const readMacosVersion = async (run = execFileOutput, options = { env: process.e
|
|
|
199
232
|
try {
|
|
200
233
|
return (await run("sw_vers", ["-productVersion"], options)).stdout.trim();
|
|
201
234
|
}
|
|
202
|
-
catch {
|
|
235
|
+
catch (cause) {
|
|
236
|
+
// best-effort cleanup: optional OS version probing; failure means unknown.
|
|
237
|
+
void cause;
|
|
203
238
|
return undefined;
|
|
204
239
|
}
|
|
205
240
|
};
|
|
@@ -211,7 +246,9 @@ const executableAvailable = async (path, platform = process.platform, run = exec
|
|
|
211
246
|
const linked = await run("ldd", [path], options);
|
|
212
247
|
return linuxSharedLibrariesAvailable(`${linked.stdout}\n${linked.stderr}`);
|
|
213
248
|
}
|
|
214
|
-
catch {
|
|
249
|
+
catch (cause) {
|
|
250
|
+
// best-effort cleanup: optional executable probing; failure means unavailable.
|
|
251
|
+
void cause;
|
|
215
252
|
return false;
|
|
216
253
|
}
|
|
217
254
|
};
|
|
@@ -231,8 +268,9 @@ const manualHopperPaths = async (home = homedir()) => {
|
|
|
231
268
|
paths.push(join(root, entry.name, "Contents/MacOS/hopper"));
|
|
232
269
|
}
|
|
233
270
|
}
|
|
234
|
-
catch {
|
|
271
|
+
catch (cause) {
|
|
235
272
|
// A missing or unreadable optional application directory is not fatal.
|
|
273
|
+
void cause;
|
|
236
274
|
}
|
|
237
275
|
}
|
|
238
276
|
return paths;
|
|
@@ -249,7 +287,9 @@ const installedSkillIdentity = async (home) => {
|
|
|
249
287
|
null,
|
|
250
288
|
};
|
|
251
289
|
}
|
|
252
|
-
catch {
|
|
290
|
+
catch (cause) {
|
|
291
|
+
// best-effort cleanup: optional skill probing; failure means unknown.
|
|
292
|
+
void cause;
|
|
253
293
|
return undefined;
|
|
254
294
|
}
|
|
255
295
|
};
|
|
@@ -52,7 +52,7 @@ export const doctorHealthy = (checks, providers) => {
|
|
|
52
52
|
providers.providerInspections.some(({ available }) => available)));
|
|
53
53
|
};
|
|
54
54
|
const nodeCheck = (host) => check("node", supportsNodeVersion(host.nodeVersion), host.nodeVersion, {
|
|
55
|
-
remediation: "Install Node.js 22.19
|
|
55
|
+
remediation: "Install Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+.",
|
|
56
56
|
classification: "missing_dependency",
|
|
57
57
|
});
|
|
58
58
|
const hostCheck = async (host) => {
|
|
@@ -123,10 +123,12 @@ const optionalIlspyCheck = async (host) => {
|
|
|
123
123
|
};
|
|
124
124
|
const optionalTargetCheck = async (target, host) => target === undefined
|
|
125
125
|
? undefined
|
|
126
|
-
:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
: host.inspectTarget !== undefined
|
|
127
|
+
? host.inspectTarget(target)
|
|
128
|
+
: check("target", await host.validTarget(target), target, {
|
|
129
|
+
remediation: "Supply a readable local app or program path.",
|
|
130
|
+
classification: "config_drift",
|
|
131
|
+
});
|
|
130
132
|
const check = (name, ok, detail, failure) => ({
|
|
131
133
|
name,
|
|
132
134
|
ok,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { uniqueSorted } from "../domain/canonicalOrdering.js";
|
|
1
2
|
/** Normalize a caller-selected doctor readiness boundary. */
|
|
2
3
|
export const normalizeDoctorScope = (requested, target) => ({
|
|
3
4
|
mode: requested === undefined ? "audit-wide" : "explicit",
|
|
@@ -92,5 +93,4 @@ const selectedSkillCheck = (state, checks) => checks.find(({ name }) => name ===
|
|
|
92
93
|
? { detail: "Installed REA skill identity is aligned." }
|
|
93
94
|
: { remediation: "Run rea setup to update the installed REA skill." }),
|
|
94
95
|
};
|
|
95
|
-
const uniqueSorted = (values) => [...new Set(values)].sort((left, right) => left.localeCompare(right));
|
|
96
96
|
const doctorProviderCheckName = (providerId, name) => name === providerId || name.startsWith(`${providerId}-`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { canonicalDigest } from "../domain/comparisonSemantics.js";
|
|
1
2
|
import { createEvidence } from "../domain/evidence.js";
|
|
2
3
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
3
|
-
import { digestCanonicalJson } from "../domain/browserScenarioNormalization.js";
|
|
4
4
|
/** Create Evidence without retaining arbitrary runtime argument values. */
|
|
5
5
|
export const createElectronActiveEvidence = (input, result, provider) => createEvidence(undefined, provider, {
|
|
6
6
|
predicateType: "rea.electron-active-scenario",
|
|
@@ -29,5 +29,5 @@ const scenarioProjection = (input) => ({
|
|
|
29
29
|
});
|
|
30
30
|
const parameters = (input) => ({
|
|
31
31
|
...scenarioProjection(input),
|
|
32
|
-
scenario_sha256:
|
|
32
|
+
scenario_sha256: canonicalDigest(scenarioProjection(input), "Browser scenario"),
|
|
33
33
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { dirname } from "node:path";
|
|
2
2
|
import { realpath } from "node:fs/promises";
|
|
3
|
-
import { AnalysisCapabilityUnavailableError, AnalysisInputError, } from "../domain/
|
|
3
|
+
import { AnalysisCapabilityUnavailableError, AnalysisInputError, } from "../domain/analysisErrorCore.js";
|
|
4
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
4
5
|
import { err } from "../domain/result.js";
|
|
5
6
|
import { createElectronActiveEvidence } from "./ElectronActiveEvidence.js";
|
|
6
7
|
const OPERATION = "capture_electron_scenario";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { compareCodePoints } from "../domain/canonicalOrdering.js";
|
|
1
2
|
import { resolveArtifactPathByContext } from "./JavaScriptArtifactPathResolution.js";
|
|
2
3
|
/** Flatten all per-file IPC facts into deterministic application records. */
|
|
3
4
|
export const collectElectronIpcRecords = (analysis) => analysis.files
|
|
@@ -110,4 +111,3 @@ const resolvesToFile = (input) => {
|
|
|
110
111
|
(input.kind === undefined || input.files.get(resolved)?.kind === input.kind));
|
|
111
112
|
};
|
|
112
113
|
const ipcRecordKey = (path, finding) => `${path}\0${String(finding.location.start.line)}:${String(finding.location.start.column)}\0${finding.side}\0${finding.operation}`;
|
|
113
|
-
const compareCodePoints = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnalysisCapabilityUnavailableError
|
|
1
|
+
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
|
2
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
2
3
|
import { err, ok } from "../domain/result.js";
|
|
3
4
|
import { createElectronEvidence } from "./ElectronEvidence.js";
|
|
4
5
|
/** List local file pages exposed by the explicitly selected endpoint. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AnalysisOutputError } from "../domain/
|
|
2
|
+
import { AnalysisOutputError } from "../domain/analysisErrorCore.js";
|
|
3
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
3
4
|
import { err, ok } from "../domain/result.js";
|
|
4
5
|
const LITERAL_SEARCH_SOURCES = [
|
|
5
6
|
["search_strings", "string"],
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnalysisInputError } from "../domain/
|
|
1
|
+
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
|
2
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
2
3
|
import { err } from "../domain/result.js";
|
|
3
4
|
import { enhancedInputSchemas, } from "../contracts/enhancedInputs.js";
|
|
4
5
|
export const invalidEnhancedInput = (name, cause) => Promise.resolve(err(new AnalysisInputError(name, { cause })));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { enhancedInputSchemas } from "../contracts/enhancedInputs.js";
|
|
3
|
-
import { AnalysisCancelledError, AnalysisOutputError,
|
|
3
|
+
import { AnalysisCancelledError, AnalysisOutputError, } from "../domain/analysisErrorCore.js";
|
|
4
|
+
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
5
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
4
6
|
import { addressDistance, functionDossierSchema, parseDocuments, parseFunctionDossier, parseListCount, parseRelatedAddresses, parseSegments, } from "../domain/hopperValues.js";
|
|
5
7
|
import { err, ok } from "../domain/result.js";
|
|
6
8
|
import { categorizeSwiftTypes, discoverObjcClasses, discoverObjcProtocols, } from "../domain/symbolAnalysis.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EvidenceIntegrityError
|
|
1
|
+
import { EvidenceIntegrityError } from "../domain/evidenceErrors.js";
|
|
2
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
2
3
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
3
4
|
import { err, ok } from "../domain/result.js";
|
|
4
5
|
import { compareBundles } from "../domain/bundleComparison.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseEvidenceBundle, serializeEvidenceBundle, } from "../domain/evidenceBundle.js";
|
|
2
|
-
import { EvidenceFileError, EvidenceIntegrityError } from "../domain/
|
|
2
|
+
import { EvidenceFileError, EvidenceIntegrityError, } from "../domain/evidenceErrors.js";
|
|
3
3
|
import { err, ok } from "../domain/result.js";
|
|
4
4
|
import { parseProcessCapture } from "../domain/processCapture.js";
|
|
5
5
|
import { readJsonFile, writeTextFile } from "./JsonFiles.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EvidenceReferenceError } from "../domain/evidenceErrors.js";
|
|
2
|
+
import { err, ok } from "../domain/result.js";
|
|
3
|
+
/** Resolve an exact reference without selecting a target or running analysis. */
|
|
4
|
+
export const resolveEvidenceInput = (input, lookup) => {
|
|
5
|
+
if (!("kind" in input))
|
|
6
|
+
return ok(input);
|
|
7
|
+
const record = lookup?.(input.evidence_id);
|
|
8
|
+
if (record === undefined)
|
|
9
|
+
return err(new EvidenceReferenceError(input.evidence_id, "missing", "Evidence retained in this session", null));
|
|
10
|
+
if (record.evidence_id !== input.evidence_id)
|
|
11
|
+
return err(new EvidenceReferenceError(input.evidence_id, "identity_mismatch", input.evidence_id, record.evidence_id));
|
|
12
|
+
return ok(record);
|
|
13
|
+
};
|
|
14
|
+
/** Resolve an application's Evidence before its existing semantic validation. */
|
|
15
|
+
export const resolveApplicationEvidenceRequest = (input, lookup) => {
|
|
16
|
+
const application = resolveEvidenceInput(input.application, lookup);
|
|
17
|
+
if (!application.ok)
|
|
18
|
+
return application;
|
|
19
|
+
return ok({ ...input, application: application.value });
|
|
20
|
+
};
|
|
21
|
+
/** Resolve explicitly paired Evidence without guessing another session's record. */
|
|
22
|
+
export const resolvePairedEvidenceRequest = (input, lookup) => {
|
|
23
|
+
const left = resolveEvidenceInput(input.left, lookup);
|
|
24
|
+
if (!left.ok)
|
|
25
|
+
return left;
|
|
26
|
+
const right = resolveEvidenceInput(input.right, lookup);
|
|
27
|
+
if (!right.ok)
|
|
28
|
+
return right;
|
|
29
|
+
return ok({ ...input, left: left.value, right: right.value });
|
|
30
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import canonicalize from "canonicalize";
|
|
2
2
|
import { createEvidenceBundle, parseEvidenceBundle, validateResidualUnknownAddition, } from "../domain/evidenceBundle.js";
|
|
3
|
-
import { EvidenceIntegrityError
|
|
3
|
+
import { EvidenceIntegrityError } from "../domain/evidenceErrors.js";
|
|
4
|
+
import { UnknownRegistryError } from "../domain/unknownRegistryError.js";
|
|
4
5
|
import { parseEvidence } from "../domain/evidence.js";
|
|
5
6
|
import { createResidualUnknown, updateResidualUnknown, } from "../domain/residualUnknown.js";
|
|
6
7
|
import { err, ok } from "../domain/result.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { firmwareRequestSchema, } from "../domain/firmwareAnalysis.js";
|
|
2
|
+
import { AnalysisCancelledError, AnalysisInputError, AnalysisOutputError, } from "../domain/analysisErrorCore.js";
|
|
3
|
+
import { createEvidence } from "../domain/evidence.js";
|
|
4
|
+
import { jsonObjectSchema } from "../domain/jsonValue.js";
|
|
5
|
+
import { err, ok } from "../domain/result.js";
|
|
6
|
+
/** Shared CLI/MCP validation and Evidence composition for arbitrary firmware files. */
|
|
7
|
+
export class FirmwareAnalysisService {
|
|
8
|
+
provider;
|
|
9
|
+
constructor(provider) {
|
|
10
|
+
this.provider = provider;
|
|
11
|
+
}
|
|
12
|
+
/** Execute an explicit inspection or extraction and preserve its producing identity. */
|
|
13
|
+
async execute(operation, input, options) {
|
|
14
|
+
if (options?.signal?.aborted === true)
|
|
15
|
+
return err(new AnalysisCancelledError(operation));
|
|
16
|
+
const parsed = firmwareRequestSchema.safeParse({ operation, input });
|
|
17
|
+
if (!parsed.success)
|
|
18
|
+
return err(new AnalysisInputError(operation, { cause: parsed.error }));
|
|
19
|
+
const executed = await this.provider.execute(parsed.data, options);
|
|
20
|
+
if (!executed.ok)
|
|
21
|
+
return executed;
|
|
22
|
+
const execution = executed.value;
|
|
23
|
+
if (execution.subject === null)
|
|
24
|
+
return err(new AnalysisOutputError(operation, "Firmware execution did not bind its source artifact"));
|
|
25
|
+
return ok(createEvidence(execution.subject, execution.provider, {
|
|
26
|
+
operation,
|
|
27
|
+
parameters: jsonObjectSchema.parse(parsed.data.input),
|
|
28
|
+
result: execution.result,
|
|
29
|
+
rawResult: execution.rawResult,
|
|
30
|
+
locations: execution.locations,
|
|
31
|
+
limitations: execution.limitations,
|
|
32
|
+
confidence: "observed",
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { toolContract } from "../contracts/toolContracts.js";
|
|
2
|
+
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
|
3
|
+
import { createEvidence } from "../domain/evidence.js";
|
|
4
|
+
import { parseFunctionDossier } from "../domain/hopperValues.js";
|
|
5
|
+
import { jsonObjectSchema } from "../domain/jsonValue.js";
|
|
6
|
+
import { err, ok } from "../domain/result.js";
|
|
7
|
+
import { projectInputIssues } from "../domain/inputIssueProjection.js";
|
|
8
|
+
/** Preserve the provider's observations when presenting a validated function dossier. */
|
|
9
|
+
export const executeFunctionAnalysisEvidence = async (analysis, parameters, target, options) => {
|
|
10
|
+
const input = toolContract("analyze_function").inputSchema.safeParse(parameters);
|
|
11
|
+
if (!input.success)
|
|
12
|
+
return err(new AnalysisInputError("analyze_function", { cause: input.error }, projectInputIssues(input.error.issues, parameters)));
|
|
13
|
+
const arguments_ = jsonObjectSchema.parse(input.data);
|
|
14
|
+
const execution = await analysis.execute("analyze_function", arguments_, options);
|
|
15
|
+
if (!execution.ok)
|
|
16
|
+
return execution;
|
|
17
|
+
const dossier = parseFunctionDossier(execution.value.result);
|
|
18
|
+
if (!dossier.ok)
|
|
19
|
+
return dossier;
|
|
20
|
+
const observation = execution.value;
|
|
21
|
+
return ok(createEvidence(observation.subject ?? target, observation.provider, {
|
|
22
|
+
operation: "analyze_function",
|
|
23
|
+
parameters: arguments_,
|
|
24
|
+
result: dossier.value,
|
|
25
|
+
rawResult: observation.rawResult,
|
|
26
|
+
limitations: observation.limitations,
|
|
27
|
+
locations: observation.locations,
|
|
28
|
+
...(observation.analysisProfile === undefined
|
|
29
|
+
? {}
|
|
30
|
+
: { analysisProfile: observation.analysisProfile }),
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AnalysisInputError, AnalysisProtocolError, } from "../domain/
|
|
2
|
+
import { AnalysisInputError, AnalysisProtocolError, } from "../domain/analysisErrorCore.js";
|
|
3
|
+
import {} from "../domain/analysisErrorBase.js";
|
|
3
4
|
import { createEvidence, } from "../domain/evidence.js";
|
|
4
5
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
5
6
|
import { err, ok } from "../domain/result.js";
|