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
|
@@ -2,7 +2,8 @@ import { Cli, z } from "incur";
|
|
|
2
2
|
import { compareEvidenceBundlesCommand, exportEvidenceBundleCommand, importEvidenceBundleCommand, } from "./application/EvidenceBundleCommands.js";
|
|
3
3
|
import { logCliCommand } from "./cliLogging.js";
|
|
4
4
|
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
|
5
|
-
import { projectAnalysisError } from "./domain/
|
|
5
|
+
import { projectAnalysisError } from "./domain/analysisErrorProjection.js";
|
|
6
|
+
import {} from "./domain/analysisErrorBase.js";
|
|
6
7
|
/** Register caller-path Evidence commands. */
|
|
7
8
|
export const registerEvidenceCommands = (cli, logger) => {
|
|
8
9
|
cli.command(CLI_COMMANDS.evidenceImport, {
|
|
@@ -4,7 +4,8 @@ import { V8InspectorProvider } from "./browser/V8InspectorProvider.js";
|
|
|
4
4
|
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
|
5
5
|
import { logCliCommand } from "./cliLogging.js";
|
|
6
6
|
import { javascriptRuntimeKindSchema, listJavaScriptRuntimeTargetsInputSchema, observeJavaScriptRuntimeInputSchema, } from "./domain/javascriptRuntimeObservation.js";
|
|
7
|
-
import { AnalysisInputError
|
|
7
|
+
import { AnalysisInputError } from "./domain/analysisErrorCore.js";
|
|
8
|
+
import { projectAnalysisError } from "./domain/analysisErrorProjection.js";
|
|
8
9
|
const observeOptionsSchema = z.object({
|
|
9
10
|
runtimeKind: javascriptRuntimeKindSchema
|
|
10
11
|
.optional()
|
package/dist/cliJsonInput.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { AnalysisInputError
|
|
2
|
+
import { AnalysisInputError } from "./domain/analysisErrorCore.js";
|
|
3
|
+
import { projectAnalysisError } from "./domain/analysisErrorProjection.js";
|
|
4
|
+
import { safeParseJson } from "./domain/safeJson.js";
|
|
3
5
|
/** Parse inline JSON or one local JSON file for a CLI workflow. */
|
|
4
6
|
export const parseCliJsonInput = async (value, operation) => {
|
|
5
7
|
const inline = parseJson(value);
|
|
@@ -8,24 +10,37 @@ export const parseCliJsonInput = async (value, operation) => {
|
|
|
8
10
|
if (["{", "["].includes(value.trimStart()[0] ?? ""))
|
|
9
11
|
return { ok: false, error: inputError(operation) };
|
|
10
12
|
try {
|
|
13
|
+
// Read raw bytes so invalid UTF-8 is rejected by parseJson instead of
|
|
14
|
+
// being silently replaced by lossy "utf8" decoding.
|
|
11
15
|
const parsed = parseJson(await readFile(value));
|
|
12
16
|
return parsed === undefined
|
|
13
17
|
? jsonFileError(value, operation, "invalid-json")
|
|
14
18
|
: { ok: true, value: parsed };
|
|
15
19
|
}
|
|
16
|
-
catch {
|
|
17
|
-
return jsonFileError(value, operation, "read-failed");
|
|
20
|
+
catch (cause) {
|
|
21
|
+
return jsonFileError(value, operation, "read-failed", cause);
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
24
|
const parseJson = (value) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
: new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(value));
|
|
25
|
+
let text;
|
|
26
|
+
if (typeof value === "string") {
|
|
27
|
+
text = value;
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
else {
|
|
30
|
+
try {
|
|
31
|
+
text = new TextDecoder("utf-8", {
|
|
32
|
+
fatal: true,
|
|
33
|
+
ignoreBOM: true,
|
|
34
|
+
}).decode(value);
|
|
35
|
+
}
|
|
36
|
+
catch (cause) {
|
|
37
|
+
// Decoding failure means the bytes are not valid UTF-8 JSON input.
|
|
38
|
+
void cause;
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
28
41
|
}
|
|
42
|
+
const parsed = safeParseJson(text);
|
|
43
|
+
return parsed.ok ? parsed.value : undefined;
|
|
29
44
|
};
|
|
30
45
|
const inputError = (operation) => ({
|
|
31
46
|
error: "Application workflow failed",
|
|
@@ -33,11 +48,11 @@ const inputError = (operation) => ({
|
|
|
33
48
|
{ path: [], reason: "invalid_format", expected: "JSON" },
|
|
34
49
|
])),
|
|
35
50
|
});
|
|
36
|
-
const jsonFileError = (path, operation, reason) => ({
|
|
51
|
+
const jsonFileError = (path, operation, reason, cause) => ({
|
|
37
52
|
ok: false,
|
|
38
53
|
error: {
|
|
39
54
|
error: "Application workflow failed",
|
|
40
|
-
...projectAnalysisError(new AnalysisInputError(operation, undefined, reason === "invalid-json"
|
|
55
|
+
...projectAnalysisError(new AnalysisInputError(operation, cause === undefined ? undefined : { cause }, reason === "invalid-json"
|
|
41
56
|
? [{ path: [], reason: "invalid_format", expected: "JSON" }]
|
|
42
57
|
: [])),
|
|
43
58
|
...(path === undefined ? {} : { input_path: path }),
|
package/dist/cliLogging.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { analysisCliErrorEnvelopeSchema, analysisErrorProjectionSchema, } from "./contracts/errorSchemas.js";
|
|
2
|
-
import { AnalysisError
|
|
2
|
+
import { AnalysisError } from "./domain/analysisErrorBase.js";
|
|
3
|
+
import { projectAnalysisError, } from "./domain/analysisErrorProjection.js";
|
|
3
4
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
5
|
/** Identify caller-visible CLI outcomes that mean the requested operation failed. */
|
|
5
6
|
export const isCliOperationFailure = (value) => {
|
package/dist/cliOutput.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { safeParseJson } from "./domain/safeJson.js";
|
|
1
2
|
const SAFE_VALIDATION_MESSAGE = "REA could not read the command arguments. Run `rea --help`, correct the arguments, then try again.";
|
|
2
3
|
const UNSUPPORTED_OUTPUT_COMBINATION_MESSAGE = "Token windows cannot preserve structured output. Remove --token-limit/--token-offset and use --filter-output or command pagination.";
|
|
3
4
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -67,23 +68,21 @@ export const renderCliOutputArgumentError = (error) => {
|
|
|
67
68
|
export const sanitizeCliOutput = (output) => {
|
|
68
69
|
const trimmed = output.trimStart();
|
|
69
70
|
if (trimmed.startsWith("{")) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (error !== undefined) {
|
|
76
|
-
const safeError = {
|
|
77
|
-
code: "VALIDATION_ERROR",
|
|
78
|
-
message: SAFE_VALIDATION_MESSAGE,
|
|
79
|
-
};
|
|
80
|
-
if (error === parsed)
|
|
81
|
-
return `${JSON.stringify(safeError)}\n`;
|
|
82
|
-
return `${JSON.stringify({ ...parsed, error: safeError })}\n`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
71
|
+
const decoded = safeParseJson(trimmed);
|
|
72
|
+
if (!decoded.ok)
|
|
73
|
+
return output;
|
|
74
|
+
const parsed = decoded.value;
|
|
75
|
+
if (!isRecord(parsed))
|
|
86
76
|
return output;
|
|
77
|
+
const error = validationError(parsed);
|
|
78
|
+
if (error !== undefined) {
|
|
79
|
+
const safeError = {
|
|
80
|
+
code: "VALIDATION_ERROR",
|
|
81
|
+
message: SAFE_VALIDATION_MESSAGE,
|
|
82
|
+
};
|
|
83
|
+
if (error === parsed)
|
|
84
|
+
return `${JSON.stringify(safeError)}\n`;
|
|
85
|
+
return `${JSON.stringify({ ...parsed, error: safeError })}\n`;
|
|
87
86
|
}
|
|
88
87
|
return output;
|
|
89
88
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { isAbsolute } from "node:path";
|
|
3
|
-
import { ConfigurationError } from "../domain/
|
|
3
|
+
import { ConfigurationError } from "../domain/configurationErrors.js";
|
|
4
4
|
import { err, ok } from "../domain/result.js";
|
|
5
5
|
import { analysisProviderSelectorSchema } from "../contracts/providerSelection.js";
|
|
6
6
|
const environmentSchema = z.object({
|
|
7
7
|
REA_ANALYSIS_PROVIDER: analysisProviderSelectorSchema.default("auto"),
|
|
8
|
+
REA_IDA_MCP_CONFIG: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.refine(isAbsolute, "REA_IDA_MCP_CONFIG must be absolute")
|
|
12
|
+
.optional(),
|
|
8
13
|
GHIDRA_INSTALL_DIR: z
|
|
9
14
|
.string()
|
|
10
15
|
.min(1)
|
|
@@ -15,6 +20,11 @@ const environmentSchema = z.object({
|
|
|
15
20
|
.min(1)
|
|
16
21
|
.refine(isAbsolute, "JAVA_HOME must be absolute")
|
|
17
22
|
.optional(),
|
|
23
|
+
REA_GHIDRA_NATIVEAOT_JAR: z
|
|
24
|
+
.string()
|
|
25
|
+
.min(1)
|
|
26
|
+
.refine(isAbsolute, "REA_GHIDRA_NATIVEAOT_JAR must be absolute")
|
|
27
|
+
.optional(),
|
|
18
28
|
REA_ILSPY_CMD_PATH: z
|
|
19
29
|
.string()
|
|
20
30
|
.min(1)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurationError } from "../domain/
|
|
1
|
+
import { ConfigurationError } from "../domain/configurationErrors.js";
|
|
2
2
|
import { ok } from "../domain/result.js";
|
|
3
3
|
import { parseEnvironment } from "./environment.js";
|
|
4
4
|
import { parseStringArray, parseLoaderArgs } from "./parsers.js";
|
|
@@ -19,8 +19,14 @@ export const parseConfig = (environment) => {
|
|
|
19
19
|
return secretPatterns;
|
|
20
20
|
return ok({
|
|
21
21
|
analysisProvider: env.REA_ANALYSIS_PROVIDER,
|
|
22
|
+
...(env.REA_IDA_MCP_CONFIG === undefined
|
|
23
|
+
? {}
|
|
24
|
+
: { idaMcpConfigPath: env.REA_IDA_MCP_CONFIG }),
|
|
22
25
|
ghidraInstallDir: env.GHIDRA_INSTALL_DIR,
|
|
23
26
|
ghidraJavaHome: env.JAVA_HOME,
|
|
27
|
+
...(env.REA_GHIDRA_NATIVEAOT_JAR === undefined
|
|
28
|
+
? {}
|
|
29
|
+
: { ghidraNativeAotJar: env.REA_GHIDRA_NATIVEAOT_JAR }),
|
|
24
30
|
ilspyCmdPath: env.REA_ILSPY_CMD_PATH,
|
|
25
31
|
hopperLauncherPath: env.HOPPER_LAUNCHER_PATH ?? defaultHopperLauncherPath(),
|
|
26
32
|
hopperTargetPath: env.HOPPER_TARGET_PATH,
|
package/dist/config/parsers.js
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { androidInputSchemas, androidResultSchemas, } from "../domain/androidAnalysis.js";
|
|
2
|
+
import { evidenceResultOf } from "./toolOutputSchemaPrimitives.js";
|
|
3
|
+
import { toolContractMetadata } from "./toolEffects.js";
|
|
4
|
+
/** Static APK operations backed by a separately supplied headless engine. */
|
|
5
|
+
export const ANDROID_TOOL_CONTRACTS = [
|
|
6
|
+
{
|
|
7
|
+
name: "inspect_android_package",
|
|
8
|
+
...toolContractMetadata("inspect_android_package"),
|
|
9
|
+
description: "Inspect a local APK's package, SDK and permission declarations, decoded manifest and class/resource counts. Does not execute the APK or verify signatures. Requires a caller-supplied JADX MCP JAR and Java; uses one worker in an isolated temporary workspace.",
|
|
10
|
+
kind: "android-provider",
|
|
11
|
+
inputSchema: androidInputSchemas.inspect_android_package,
|
|
12
|
+
outputSchema: evidenceResultOf(androidResultSchemas.inspect_android_package),
|
|
13
|
+
examples: [
|
|
14
|
+
{ title: "Inspect an APK", input: { path: "/tmp/Example.apk" } },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "search_android_classes",
|
|
19
|
+
...toolContractMetadata("search_android_classes"),
|
|
20
|
+
description: "Search complete decompiler class names in an explicit local APK by case-sensitive substring. Empty query inventories all classes. Retains artifact and engine identity; no APK execution.",
|
|
21
|
+
kind: "android-provider",
|
|
22
|
+
inputSchema: androidInputSchemas.search_android_classes,
|
|
23
|
+
outputSchema: evidenceResultOf(androidResultSchemas.search_android_classes),
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
title: "Find activity classes",
|
|
27
|
+
input: { path: "/tmp/Example.apk", query: "Activity" },
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "inspect_android_class",
|
|
33
|
+
...toolContractMetadata("inspect_android_class"),
|
|
34
|
+
description: "Inspect one exact Android class's methods, fields and inner classes. Returns display signatures and explicit unknown DEX descriptors without materializing the whole application source.",
|
|
35
|
+
kind: "android-provider",
|
|
36
|
+
inputSchema: androidInputSchemas.inspect_android_class,
|
|
37
|
+
outputSchema: evidenceResultOf(androidResultSchemas.inspect_android_class),
|
|
38
|
+
examples: [
|
|
39
|
+
{
|
|
40
|
+
title: "Inspect a class",
|
|
41
|
+
input: { path: "/tmp/Example.apk", class_name: "example.MainActivity" },
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "inspect_android_method",
|
|
47
|
+
...toolContractMetadata("inspect_android_method"),
|
|
48
|
+
description: "Decompile one Android method with smali fallback. Requires explicit overload_index when multiple methods share a name. Reports representation, fallback markers and source truncation; never treats display signatures as exact DEX identities.",
|
|
49
|
+
kind: "android-provider",
|
|
50
|
+
inputSchema: androidInputSchemas.inspect_android_method,
|
|
51
|
+
outputSchema: evidenceResultOf(androidResultSchemas.inspect_android_method),
|
|
52
|
+
examples: [
|
|
53
|
+
{
|
|
54
|
+
title: "Decompile a method",
|
|
55
|
+
input: {
|
|
56
|
+
path: "/tmp/Example.apk",
|
|
57
|
+
class_name: "example.MainActivity",
|
|
58
|
+
method_name: "onCreate",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "trace_android_references",
|
|
65
|
+
...toolContractMetadata("trace_android_references"),
|
|
66
|
+
description: "Trace incoming static references to an exact Android class or unique method. Overloaded method reference queries are explicitly unsupported by the current engine. Source lines and DEX offsets remain unknown; no runtime calls are inferred.",
|
|
67
|
+
kind: "android-provider",
|
|
68
|
+
inputSchema: androidInputSchemas.trace_android_references,
|
|
69
|
+
outputSchema: evidenceResultOf(androidResultSchemas.trace_android_references),
|
|
70
|
+
examples: [
|
|
71
|
+
{
|
|
72
|
+
title: "Find references to a class",
|
|
73
|
+
input: { path: "/tmp/Example.apk", class_name: "example.MainActivity" },
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
];
|
|
@@ -17,12 +17,16 @@ const sourceToBundleOutputSchema = evidenceResultOf(sourceToBundleComparisonResu
|
|
|
17
17
|
const exportShapeComparisonOutputSchema = evidenceResultOf(javaScriptExportShapeComparisonResultSchema);
|
|
18
18
|
const reconstructionObligationLedgerOutputSchema = evidenceResultOf(reconstructionObligationLedgerSchema);
|
|
19
19
|
const HASH = "0".repeat(64);
|
|
20
|
+
const retained = (evidence_id) => ({
|
|
21
|
+
kind: "retained-evidence",
|
|
22
|
+
evidence_id,
|
|
23
|
+
});
|
|
20
24
|
/** Provider-neutral graph workflow contracts shared by MCP and CLI adapters. */
|
|
21
25
|
export const APPLICATION_TOOL_CONTRACTS = [
|
|
22
26
|
{
|
|
23
27
|
name: "trace_application_feature",
|
|
24
28
|
...toolContractMetadata("trace_application_feature"),
|
|
25
|
-
description: "Trace a typed literal seed through every reachable part of an authenticated JavaScript Application Graph supplied as inline Evidence. Original static, native, passive-runtime, inferred, and unknown authorities remain distinct; native addon handoffs never open a provider or execute the application.",
|
|
29
|
+
description: "Trace a typed literal seed through every reachable part of an authenticated JavaScript Application Graph supplied as inline Evidence or exact same-session retained references. Original static, native, passive-runtime, inferred, and unknown authorities remain distinct; native addon handoffs never open a provider or execute the application.",
|
|
26
30
|
kind: "application",
|
|
27
31
|
inputSchema: traceApplicationFeatureRequestSchema,
|
|
28
32
|
outputSchema: traceOutputSchema,
|
|
@@ -31,12 +35,19 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
|
|
31
35
|
title: "Trace one module seed through a retained application graph",
|
|
32
36
|
input: JAVASCRIPT_FEATURE_TRACE_EXAMPLE,
|
|
33
37
|
},
|
|
38
|
+
{
|
|
39
|
+
title: "Use exact Evidence already retained in this session",
|
|
40
|
+
input: {
|
|
41
|
+
...JAVASCRIPT_FEATURE_TRACE_EXAMPLE,
|
|
42
|
+
application: retained(JAVASCRIPT_FEATURE_TRACE_EXAMPLE.application.evidence_id),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
34
45
|
],
|
|
35
46
|
},
|
|
36
47
|
{
|
|
37
48
|
name: "trace_javascript_semantics",
|
|
38
49
|
...toolContractMetadata("trace_javascript_semantics"),
|
|
39
|
-
description: "Trace static JavaScript data-flow, direct call/return, and closure relations from inline application Evidence. Dynamic or unsupported semantics remain explicit unknowns; static reachability never claims runtime execution.",
|
|
50
|
+
description: "Trace static JavaScript data-flow, direct call/return, and closure relations from inline application Evidence or an exact same-session retained reference. Dynamic or unsupported semantics remain explicit unknowns; static reachability never claims runtime execution.",
|
|
40
51
|
kind: "application",
|
|
41
52
|
inputSchema: traceJavaScriptSemanticsRequestSchema,
|
|
42
53
|
outputSchema: semanticTraceOutputSchema,
|
|
@@ -56,7 +67,7 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
|
|
56
67
|
{
|
|
57
68
|
name: "compare_application_versions",
|
|
58
69
|
...toolContractMetadata("compare_application_versions"),
|
|
59
|
-
description: "Compare two authenticated JavaScript Application Graph versions supplied as inline Evidence. Uses unique-only exact digest, module source digest, source-map identity, structural fingerprint, and non-module semantic-key tiers. Reports added, removed, changed, ambiguous, and unknown entities plus the complete matching changed_from graph without fuzzy or module-ordinal pairing.",
|
|
70
|
+
description: "Compare two authenticated JavaScript Application Graph versions supplied as inline Evidence or exact same-session retained references. Uses unique-only exact digest, module source digest, source-map identity, structural fingerprint, and non-module semantic-key tiers. Reports added, removed, changed, ambiguous, and unknown entities plus the complete matching changed_from graph without fuzzy or module-ordinal pairing.",
|
|
60
71
|
kind: "application",
|
|
61
72
|
inputSchema: compareApplicationVersionsRequestSchema,
|
|
62
73
|
outputSchema: comparisonOutputSchema,
|
|
@@ -65,12 +76,20 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
|
|
65
76
|
title: "Compare authenticated static and reconciled application graphs",
|
|
66
77
|
input: JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE,
|
|
67
78
|
},
|
|
79
|
+
{
|
|
80
|
+
title: "Use exact Evidence already retained in this session",
|
|
81
|
+
input: {
|
|
82
|
+
...JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE,
|
|
83
|
+
left: retained(JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE.left.evidence_id),
|
|
84
|
+
right: retained(JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE.right.evidence_id),
|
|
85
|
+
},
|
|
86
|
+
},
|
|
68
87
|
],
|
|
69
88
|
},
|
|
70
89
|
{
|
|
71
90
|
name: "compare_source_to_bundle",
|
|
72
91
|
...toolContractMetadata("compare_source_to_bundle"),
|
|
73
|
-
description: "Compare a cryptographically committed HistoricalSourceGraph with
|
|
92
|
+
description: "Compare a cryptographically committed HistoricalSourceGraph with authenticated JavaScript Application Graph Evidence supplied inline or by exact same-session retained reference. Uses explicit exact-digest, source-map path, current-path, suffix, and basename signals with stable weights. Classifies unchanged, modified, removed, split, merged, duplicated, and unknown; incomplete coverage and ambiguous weak signals never become absence or forced matches.",
|
|
74
93
|
kind: "application",
|
|
75
94
|
inputSchema: compareSourceToBundleRequestSchema,
|
|
76
95
|
outputSchema: sourceToBundleOutputSchema,
|
|
@@ -84,7 +103,7 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
|
|
84
103
|
{
|
|
85
104
|
name: "compare_javascript_export_shapes",
|
|
86
105
|
...toolContractMetadata("compare_javascript_export_shapes"),
|
|
87
|
-
description: "Compare static return shapes for one exact module/export selector on each authenticated JavaScript Application Graph supplied as inline Evidence. Variants pair only by reciprocal unique literal discriminants; dynamic values, incomplete properties, and ambiguous variants remain unknown. Reports JSON Pointer changes without executing JavaScript; runtime behavior requires a separate agent-run probe.",
|
|
106
|
+
description: "Compare static return shapes for one exact module/export selector on each authenticated JavaScript Application Graph supplied as inline Evidence or exact same-session retained references. Variants pair only by reciprocal unique literal discriminants; dynamic values, incomplete properties, and ambiguous variants remain unknown. Reports JSON Pointer changes without executing JavaScript; runtime behavior requires a separate agent-run probe.",
|
|
88
107
|
kind: "application",
|
|
89
108
|
inputSchema: compareJavaScriptExportShapesRequestSchema,
|
|
90
109
|
outputSchema: exportShapeComparisonOutputSchema,
|
|
@@ -93,6 +112,14 @@ export const APPLICATION_TOOL_CONTRACTS = [
|
|
|
93
112
|
title: "Compare one exact parser export without execution",
|
|
94
113
|
input: JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE,
|
|
95
114
|
},
|
|
115
|
+
{
|
|
116
|
+
title: "Use exact Evidence already retained in this session",
|
|
117
|
+
input: {
|
|
118
|
+
...JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE,
|
|
119
|
+
left: retained(JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE.left.evidence_id),
|
|
120
|
+
right: retained(JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE.right.evidence_id),
|
|
121
|
+
},
|
|
122
|
+
},
|
|
96
123
|
],
|
|
97
124
|
},
|
|
98
125
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { evidenceInputSchema } from "./evidenceInputContracts.js";
|
|
3
3
|
import { compareApplicationVersionsInputSchema } from "../domain/javascriptApplicationVersionComparisonSchemas.js";
|
|
4
4
|
import { compareJavaScriptExportShapesInputSchema } from "../domain/javascriptExportShapeComparisonSchemas.js";
|
|
5
5
|
import { traceApplicationFeatureInputSchema } from "../domain/javascriptFeatureTraceSchemas.js";
|
|
@@ -10,33 +10,33 @@ const traceApplicationFeatureFacts = {
|
|
|
10
10
|
seed: traceApplicationFeatureInputSchema.shape.seed,
|
|
11
11
|
direction: traceApplicationFeatureInputSchema.shape.direction,
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
13
|
+
/** Application trace request accepting inline or same-session application Evidence. */
|
|
14
14
|
export const traceApplicationFeatureRequestSchema = z.strictObject({
|
|
15
15
|
...traceApplicationFeatureFacts,
|
|
16
|
-
application:
|
|
16
|
+
application: evidenceInputSchema,
|
|
17
17
|
});
|
|
18
|
-
/**
|
|
18
|
+
/** Semantic trace request accepting inline or same-session application Evidence. */
|
|
19
19
|
export const traceJavaScriptSemanticsRequestSchema = z.strictObject({
|
|
20
|
-
application:
|
|
20
|
+
application: evidenceInputSchema,
|
|
21
21
|
query: javaScriptSemanticQueryInputSchema,
|
|
22
22
|
});
|
|
23
23
|
const compareApplicationVersionsFacts = {
|
|
24
24
|
left_native_observations: compareApplicationVersionsInputSchema.shape.left_native_observations,
|
|
25
25
|
right_native_observations: compareApplicationVersionsInputSchema.shape.right_native_observations,
|
|
26
26
|
};
|
|
27
|
-
/**
|
|
27
|
+
/** Application comparison request accepting inline or same-session application Evidence. */
|
|
28
28
|
export const compareApplicationVersionsRequestSchema = z.strictObject({
|
|
29
29
|
...compareApplicationVersionsFacts,
|
|
30
|
-
left:
|
|
31
|
-
right:
|
|
30
|
+
left: evidenceInputSchema,
|
|
31
|
+
right: evidenceInputSchema,
|
|
32
32
|
});
|
|
33
33
|
const compareSourceToBundleFacts = {
|
|
34
34
|
reference: compareSourceToBundleInputSchema.shape.reference,
|
|
35
35
|
};
|
|
36
|
-
/** Historical-source comparison
|
|
36
|
+
/** Historical-source comparison accepting inline or same-session application Evidence. */
|
|
37
37
|
export const compareSourceToBundleRequestSchema = z.strictObject({
|
|
38
38
|
...compareSourceToBundleFacts,
|
|
39
|
-
application:
|
|
39
|
+
application: evidenceInputSchema,
|
|
40
40
|
});
|
|
41
41
|
const compareJavaScriptExportShapesFacts = {
|
|
42
42
|
left_module_path: compareJavaScriptExportShapesInputSchema.shape.left_module_path,
|
|
@@ -44,9 +44,9 @@ const compareJavaScriptExportShapesFacts = {
|
|
|
44
44
|
right_module_path: compareJavaScriptExportShapesInputSchema.shape.right_module_path,
|
|
45
45
|
right_export_name: compareJavaScriptExportShapesInputSchema.shape.right_export_name,
|
|
46
46
|
};
|
|
47
|
-
/**
|
|
47
|
+
/** Export-shape request accepting inline or same-session application Evidence. */
|
|
48
48
|
export const compareJavaScriptExportShapesRequestSchema = z.strictObject({
|
|
49
49
|
...compareJavaScriptExportShapesFacts,
|
|
50
|
-
left:
|
|
51
|
-
right:
|
|
50
|
+
left: evidenceInputSchema,
|
|
51
|
+
right: evidenceInputSchema,
|
|
52
52
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import canonicalize from "canonicalize";
|
|
1
|
+
import { canonicalDigest } from "../domain/comparisonSemantics.js";
|
|
3
2
|
import { createEvidence } from "../domain/evidence.js";
|
|
4
3
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
5
4
|
const inventory = (digit) => {
|
|
6
5
|
const sha = digit.repeat(64);
|
|
7
|
-
const artifactId = `art_${
|
|
8
|
-
const occurrenceId = `occ_${
|
|
6
|
+
const artifactId = `art_${canonicalDigest({ sha256: sha }, "Artifact example")}`;
|
|
7
|
+
const occurrenceId = `occ_${canonicalDigest({ root: artifactId }, "Artifact example")}`;
|
|
9
8
|
const nodes = [
|
|
10
9
|
{
|
|
11
10
|
artifact_id: artifactId,
|
|
@@ -36,18 +35,18 @@ const inventory = (digit) => {
|
|
|
36
35
|
limitations: [],
|
|
37
36
|
},
|
|
38
37
|
];
|
|
39
|
-
const graphSha256 =
|
|
38
|
+
const graphSha256 = canonicalDigest({
|
|
40
39
|
nodes,
|
|
41
40
|
occurrences,
|
|
42
41
|
edges: [],
|
|
43
42
|
integrity_contradictions: [],
|
|
44
|
-
});
|
|
43
|
+
}, "Artifact example");
|
|
45
44
|
return jsonValueSchema.parse({
|
|
46
45
|
manifest: {
|
|
47
|
-
manifest_id: `agm_${
|
|
46
|
+
manifest_id: `agm_${canonicalDigest({
|
|
48
47
|
root_artifact_id: artifactId,
|
|
49
48
|
graph_sha256: graphSha256,
|
|
50
|
-
})}`,
|
|
49
|
+
}, "Artifact example")}`,
|
|
51
50
|
root_artifact_id: artifactId,
|
|
52
51
|
root_sha256: sha,
|
|
53
52
|
root_format: "file",
|
|
@@ -63,12 +62,6 @@ const inventory = (digit) => {
|
|
|
63
62
|
limitations: [],
|
|
64
63
|
});
|
|
65
64
|
};
|
|
66
|
-
const digestCanonical = (value) => {
|
|
67
|
-
const encoded = canonicalize(value);
|
|
68
|
-
if (encoded === undefined)
|
|
69
|
-
throw new TypeError("Artifact example is not canonical JSON");
|
|
70
|
-
return createHash("sha256").update(encoded).digest("hex");
|
|
71
|
-
};
|
|
72
65
|
const provider = {
|
|
73
66
|
id: "rea-artifact",
|
|
74
67
|
name: "REA artifact graph",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { enhancedInputSchemas } from "./enhancedInputs.js";
|
|
3
|
+
import { enhancedOutputSchemas, requireOutputSchema, } from "./toolOutputSchemas.js";
|
|
4
|
+
import { examplesFor } from "./toolContractHelpers.js";
|
|
5
|
+
import { toolContractMetadata } from "./toolEffects.js";
|
|
6
|
+
import { FUNCTION_WORKFLOW_TOOL_CONTRACTS } from "./functionWorkflowToolContracts.js";
|
|
7
|
+
const enhanced = (name, description, inputSchema) => ({
|
|
8
|
+
name,
|
|
9
|
+
...toolContractMetadata(name),
|
|
10
|
+
description,
|
|
11
|
+
kind: "enhanced",
|
|
12
|
+
inputSchema,
|
|
13
|
+
outputSchema: requireOutputSchema(enhancedOutputSchemas, name),
|
|
14
|
+
examples: examplesFor(name, inputSchema),
|
|
15
|
+
});
|
|
16
|
+
/** Workflow tools composed from one or more provider operations. */
|
|
17
|
+
export const ENHANCED_TOOL_CONTRACTS = [
|
|
18
|
+
enhanced("inspect_native_dispatch_metadata", "Inspect the bound provider's name inventory for Objective-C class/method symbols and Swift mangled symbols, returning at most max_records decoded names. Includes target SHA-256 when available, provider identity/version, analysis-profile digest, facet coverage, and per-record Evidence. This is symbol-level evidence, not runtime metadata: ivar layouts, protocol conformances, witness/class tables, and relative pointers are explicitly marked unsupported unless a provider supplies those decoders. The provider controls how its name inventory is acquired.", enhancedInputSchemas.inspect_native_dispatch_metadata),
|
|
19
|
+
enhanced("get_objc_classes", "Discover and deduplicate Objective-C class labels, optionally filtering by literal substring.", enhancedInputSchemas.get_objc_classes),
|
|
20
|
+
enhanced("get_objc_protocols", "Discover and deduplicate Objective-C and Swift protocol labels.", enhancedInputSchemas.get_objc_protocols),
|
|
21
|
+
enhanced("batch_decompile", "Decompile each explicit procedure symbol or address concurrently. Returns ordered per-item success or error results and aggregate counts.", enhancedInputSchemas.batch_decompile),
|
|
22
|
+
enhanced("get_call_graph", "Traverse the bound provider's caller or callee relationships from one symbol or address until the reachable graph is exhausted. Every node has an ok/error status and failures use safe typed projections; unresolved indirect calls may be missing and results are not a whole-program CFG.", enhancedInputSchemas.get_call_graph),
|
|
23
|
+
enhanced("analyze_swift_types", 'Categorize analyzed procedure names into Swift classes, structs, enums, protocols, extensions, and other symbols. Returns deduplicated names grouped with counts. Optionally select one category and/or apply a case-sensitive literal name filter; for example, use {category: "classes", pattern: "Account"} to find matching class symbols.', enhancedInputSchemas.analyze_swift_types),
|
|
24
|
+
enhanced("find_xrefs_to_name", "Resolve an exact name against the bound provider's name inventory and return a resolved or unresolved result. Unresolved names use the stable name_not_found reason; this xref workflow returns address-only projections.", enhancedInputSchemas.find_xrefs_to_name),
|
|
25
|
+
enhanced("binary_overview", "Return native-binary metadata, every segment with its length, and exhaustive procedure/string counts. Use search_procedures, list_procedures, or analyze_function directly when you already know which procedure to inspect.", enhancedInputSchemas.binary_overview),
|
|
26
|
+
...FUNCTION_WORKFLOW_TOOL_CONTRACTS,
|
|
27
|
+
enhanced("trace_feature", "Trace a literal feature query through every matching string and procedure, their xrefs, and truthful containing-procedure resolution. Returns observations, operation count, and residual unknowns without inferring reference kinds.", enhancedInputSchemas.trace_feature),
|
|
28
|
+
enhanced("trace_call_path", "Trace direct callers or callees from one exact procedure address until the graph is exhausted or the optional goal is reached. Returns visited nodes, direct-call edges, a shortest traversal path, provider failures, and residual unknowns; unresolved indirect calls remain unknown.", enhancedInputSchemas.trace_call_path),
|
|
29
|
+
enhanced("trace_native_ui_action", "Trace one unique compiled UI action, object ID, native symbol or exact function address through authored connections, encoded or symbolized Objective-C handlers, and bounded static call references. Typed direct and resolved indirect calls, ambiguous candidates, inferred untyped provider callees, and targetless sites remain distinct. Runtime reachability is unknown; use trace_native_values for recovered value dependencies.", enhancedInputSchemas.trace_native_ui_action),
|
|
30
|
+
enhanced("trace_native_values", "Trace a bounded static dependency graph from one explicit native procedure. Includes high-p-code def-use, constants, operators, memory and branch operations, resolved call edges, and derived argument/parameter and return/output bindings. Missing bindings, alias semantics, persistent state and RNG roles remain unknown. Budgets bound depth, decompilations, graph size and payloads; nodes are paginated.", enhancedInputSchemas.trace_native_values),
|
|
31
|
+
];
|
|
@@ -56,14 +56,16 @@ export const analysisErrorProjectionSchema = z.discriminatedUnion("code", [
|
|
|
56
56
|
generic("target_unavailable"),
|
|
57
57
|
generic("execution_failure"),
|
|
58
58
|
]);
|
|
59
|
-
/**
|
|
59
|
+
/** CLI label and input diagnostics surrounding the strict canonical error projection. */
|
|
60
60
|
export const analysisCliErrorEnvelopeSchema = z
|
|
61
61
|
.object({
|
|
62
62
|
error: z.string().min(1),
|
|
63
|
+
input_path: z.string().optional(),
|
|
64
|
+
input_reason: z.enum(["invalid-json", "read-failed"]).optional(),
|
|
63
65
|
})
|
|
64
66
|
.passthrough()
|
|
65
67
|
.superRefine((value, context) => {
|
|
66
|
-
const { error: _label, ...projection } = value;
|
|
68
|
+
const { error: _label, input_path: _inputPath, input_reason: _inputReason, ...projection } = value;
|
|
67
69
|
const parsed = analysisErrorProjectionSchema.safeParse(projection);
|
|
68
70
|
if (!parsed.success) {
|
|
69
71
|
context.addIssue({
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { evidenceSchema } from "../domain/evidence.js";
|
|
3
|
+
import { prefixedDigestSchema } from "../domain/digests.js";
|
|
4
|
+
/** Exact reference to Evidence already retained by the current session. */
|
|
5
|
+
export const retainedEvidenceReferenceSchema = z.strictObject({
|
|
6
|
+
kind: z.literal("retained-evidence"),
|
|
7
|
+
evidence_id: prefixedDigestSchema("ev"),
|
|
8
|
+
});
|
|
9
|
+
/** Portable inline Evidence or an exact, session-scoped reference. */
|
|
10
|
+
export const evidenceInputSchema = z.union([
|
|
11
|
+
evidenceSchema,
|
|
12
|
+
retainedEvidenceReferenceSchema,
|
|
13
|
+
]);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { firmwareInputSchemas, firmwareResultSchemas, } from "../domain/firmwareAnalysis.js";
|
|
2
|
+
import { evidenceResultOf } from "./toolOutputSchemaPrimitives.js";
|
|
3
|
+
import { toolContractMetadata } from "./toolEffects.js";
|
|
4
|
+
/** Explicit local firmware observations and extraction, backed by caller-supplied tools. */
|
|
5
|
+
export const FIRMWARE_TOOL_CONTRACTS = [
|
|
6
|
+
{
|
|
7
|
+
name: "inspect_firmware_regions",
|
|
8
|
+
...toolContractMetadata("inspect_firmware_regions"),
|
|
9
|
+
kind: "firmware-provider",
|
|
10
|
+
description: "Inspect signature candidates in a local firmware file with Binwalk 3.1.0. Returns offsets, reported lengths, descriptions and raw confidence values. Length validation and runtime addresses remain unknown. No extraction or target execution. Linux, caller-supplied tool and util-linux prlimit required; 128 MiB input limit, one worker and 120-second deadline.",
|
|
11
|
+
inputSchema: firmwareInputSchemas.inspect_firmware_regions,
|
|
12
|
+
outputSchema: evidenceResultOf(firmwareResultSchemas.inspect_firmware_regions),
|
|
13
|
+
examples: [
|
|
14
|
+
{
|
|
15
|
+
title: "Inspect firmware regions",
|
|
16
|
+
input: { path: "/tmp/firmware.bin" },
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "extract_firmware",
|
|
22
|
+
...toolContractMetadata("extract_firmware"),
|
|
23
|
+
kind: "firmware-provider",
|
|
24
|
+
description: "Extract caller-selected firmware bytes with Unblob 26.6.4 into an absent output directory. Returns verified child paths/digests, task derivations, unknown chunks and extraction diagnostics inline. Preserves the default sandbox; publishes regular files only. Linux, caller-supplied tool, format-specific extractors and util-linux prlimit required. No mounts or extracted-code execution. Select a returned native file with open_binary for Ghidra analysis; decompressed offsets are not original-file addresses.",
|
|
25
|
+
inputSchema: firmwareInputSchemas.extract_firmware,
|
|
26
|
+
outputSchema: evidenceResultOf(firmwareResultSchemas.extract_firmware),
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
title: "Extract selected firmware",
|
|
30
|
+
input: {
|
|
31
|
+
path: "/tmp/firmware.bin",
|
|
32
|
+
output_directory: "/tmp/firmware-output",
|
|
33
|
+
range: { offset: 64, length: 4096 },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
];
|