rea-agents 6.1.0 → 6.3.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 +24 -24
- package/bridge/ghidra/ReaGhidraBridge.java +32 -4
- package/bridge/hopper_bridge.py +8 -1
- package/dist/android/JadxConfiguration.js +87 -7
- package/dist/android/JadxMcpTransport.js +14 -2
- package/dist/android/JadxProvider.js +64 -36
- package/dist/android/JadxSession.js +51 -9
- package/dist/application/BinaryTargetResolver.js +68 -20
- package/dist/application/BrowserEvidence.js +3 -8
- package/dist/application/BrowserScenarioEvidence.js +4 -20
- package/dist/application/CapabilityInventory.js +43 -9
- package/dist/application/ClientConfigurationDocument.js +97 -25
- package/dist/application/ClientRegistrationStatus.js +19 -6
- package/dist/application/DirectAnalysis.js +41 -20
- package/dist/application/DirectAnalysisCleanup.js +71 -0
- package/dist/application/DirectAnalysisStatus.js +3 -7
- package/dist/application/Doctor.js +40 -53
- package/dist/application/DoctorDiagnostics.js +2 -3
- package/dist/application/EnhancedTools.js +51 -6
- package/dist/application/EvidenceBundleFiles.js +8 -3
- package/dist/application/InvestigationProviders.js +13 -5
- package/dist/application/JsonFiles.js +56 -23
- package/dist/application/LinuxHopper.js +11 -7
- package/dist/application/MacHopper.js +15 -18
- package/dist/application/RealHopperAssertions.js +0 -11
- package/dist/application/ReconstructionObligationCandidates.js +10 -3
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -1
- package/dist/application/ReferenceSourceImportEntries.js +1 -1
- package/dist/application/RegularFileRead.js +17 -0
- package/dist/application/Setup.js +26 -23
- package/dist/application/SetupClientConfiguration.js +18 -7
- package/dist/application/SetupHost.js +20 -29
- package/dist/application/SetupPlan.js +24 -20
- package/dist/application/SetupSkill.js +57 -8
- package/dist/application/SupportedClients.js +43 -0
- package/dist/application/Uninstall.js +98 -30
- package/dist/application/UpdateMaintenance.js +13 -7
- package/dist/application/UpdateRuntime.js +12 -12
- package/dist/application/Utf8JsonInput.js +64 -0
- package/dist/application/WebScriptExportService.js +38 -5
- package/dist/application/WorkflowEvidence.js +25 -2
- package/dist/application/XrefsAddressResolution.js +45 -0
- package/dist/application/analysisView/AnalysisViewService.js +76 -0
- package/dist/application/android/AndroidAnalysisService.js +1 -1
- package/dist/application/binary/AnalysisClientCleanup.js +30 -5
- package/dist/application/binary/AnalysisProviderEvaluation.js +1 -2
- package/dist/application/binary/AnalysisProviderRegistry.js +2 -6
- package/dist/application/binary/AnalysisSnapshotCache.js +13 -10
- package/dist/application/binary/BinarySession.js +86 -29
- package/dist/application/binary/BinarySessionComposition.js +1 -3
- package/dist/application/binary/BinarySessionExecution.js +3 -5
- package/dist/application/binary/BinarySessionOpen.js +10 -2
- package/dist/application/binary/BinarySessionRecords.js +1 -1
- package/dist/application/binary/BinarySessionStatus.js +1 -6
- package/dist/application/binary/CompositeProvider.js +4 -18
- package/dist/application/binary/LazyAnalysisProvider.js +5 -5
- package/dist/application/binary/SessionProviderRouter.js +27 -135
- package/dist/application/homebrew.js +48 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +10 -14
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +5 -1
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +3 -6
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +107 -46
- package/dist/application/javascript/JavaScriptApplicationService.js +7 -1
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +59 -45
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +5 -9
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +19 -27
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +11 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +9 -0
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +8 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +46 -29
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +86 -27
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +52 -9
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +1 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +2 -2
- package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -18
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +3 -3
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +11 -27
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +4 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +8 -6
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +7 -5
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +3 -4
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +2 -2
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +3 -7
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +76 -47
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +4 -4
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +3 -4
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +51 -25
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +15 -10
- package/dist/application/managed/ManagedMemberComparisonService.js +2 -1
- package/dist/application/managed/ManagedNativeVerificationService.js +2 -1
- package/dist/application/native/NativeCallRoutes.js +2 -4
- package/dist/application/process/ProcessCli.js +11 -11
- package/dist/application/process/ProcessEvidence.js +0 -1
- package/dist/artifacts/ArtifactProvider.js +53 -30
- package/dist/artifacts/ArtifactProviderMetadata.js +1 -4
- package/dist/artifacts/ArtifactReader.js +31 -0
- package/dist/artifacts/AsarArtifactReader.js +81 -17
- package/dist/artifacts/DirectoryArtifactReader.js +2 -1
- package/dist/artifacts/MachOSliceArtifactReader.js +9 -2
- package/dist/artifacts/NativeDmgArtifactReader.js +207 -77
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +16 -2
- package/dist/artifacts/ZipArtifactReader.js +11 -4
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +4 -2
- package/dist/artifacts/apple/DylibResolutionReader.js +17 -7
- package/dist/artifacts/apple/KeyedArchiveReader.js +68 -42
- package/dist/artifacts/apple/MachoLoadCommandReader.js +36 -6
- package/dist/artifacts/extraction/ArtifactExtraction.js +104 -29
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +71 -66
- package/dist/artifacts/inventory/ArtifactInventory.js +0 -1
- package/dist/artifacts/inventory/classify.js +33 -14
- package/dist/artifacts/inventory/hashStableRootArtifact.js +37 -0
- package/dist/artifacts/inventory/reader.js +3 -3
- package/dist/artifacts/inventory/scanCanonical.js +64 -34
- package/dist/artifacts/inventory/scanReader.js +12 -20
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +65 -27
- package/dist/browser/BrowserScenarioPartialObservation.js +106 -0
- package/dist/browser/CdpBrowserProvider.js +6 -6
- package/dist/browser/CdpCaptureEventHandlers.js +2 -4
- package/dist/browser/CdpCaptureEvents.js +0 -1
- package/dist/browser/CdpCaptureStorageFingerprints.js +3 -3
- package/dist/browser/CdpCaptureValues.js +20 -0
- package/dist/browser/CdpElectronInspection.js +2 -2
- package/dist/browser/CdpElectronProvider.js +4 -5
- package/dist/browser/CdpElectronScriptEvents.js +2 -8
- package/dist/browser/CdpElectronScripts.js +4 -5
- package/dist/browser/CdpPageCaptureScripts.js +2 -3
- package/dist/browser/CdpSafeMetadata.js +10 -10
- package/dist/browser/CdpWebMcpDiscovery.js +16 -13
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +64 -49
- package/dist/browser/PlaywrightElectronActiveActions.js +2 -56
- package/dist/browser/PlaywrightElectronActiveProvider.js +10 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +1 -1
- package/dist/browser/PlaywrightScenarioBrowser.js +269 -66
- package/dist/browser/PlaywrightScenarioEvents.js +1 -1
- package/dist/browser/PlaywrightScenarioSession.js +41 -32
- package/dist/browser/WebSourceMapFetcher.js +32 -6
- package/dist/browser/assets/ScenarioScriptCapture.js +8 -12
- package/dist/browser/assets/ScriptCaptureAdapters.js +1 -1
- package/dist/browser/history/CaptureFailures.js +6 -2
- package/dist/browser/history/MitmproxyCaptureAdapter.js +4 -2
- package/dist/catalogIdentity.js +0 -1
- package/dist/cli/analysisViewCommands.js +36 -0
- package/dist/cli/artifactCommands.js +11 -12
- package/dist/cli/coreAnalysisCommands.js +3 -3
- package/dist/cli/coreBinaryCommands.js +37 -28
- package/dist/cli/coreNativeCommands.js +9 -10
- package/dist/cli/electronCommands.js +12 -13
- package/dist/cli/interactiveSetup.js +6 -6
- package/dist/cli/javascriptApplicationAnalysis.js +2 -12
- package/dist/cli/jsonOutput.js +3 -2
- package/dist/cli/managedCommands.js +7 -8
- package/dist/cli/nativeCallCommands.js +1 -2
- package/dist/cli/omittableDefaults.js +50 -0
- package/dist/cli/processCommands.js +3 -2
- package/dist/cli/setupCommands.js +16 -15
- package/dist/cli/streamedJsonOutput.js +83 -4
- package/dist/cli/utilityCommands.js +10 -12
- package/dist/cli.js +19 -8
- package/dist/cliBrowserScenarioCommands.js +2 -2
- package/dist/cliCommandNames.js +1 -0
- package/dist/cliJsonFile.js +179 -0
- package/dist/cliJsonInput.js +60 -33
- package/dist/cliObservationOptions.js +4 -0
- package/dist/cliOutput.js +0 -38
- package/dist/composition/auxiliaryAnalysisProviders.js +30 -25
- package/dist/composition/binary.js +9 -9
- package/dist/composition/browserScenario.js +2 -1
- package/dist/composition/directAnalysis.js +20 -14
- package/dist/composition/electronScenario.js +1 -1
- package/dist/composition/optionalObservationProviders.js +12 -7
- package/dist/config/environment.js +6 -0
- package/dist/config/ghidraStartupTimeout.js +4 -9
- package/dist/config/homeDirectory.js +12 -0
- package/dist/config/mcpResponseBudget.js +9 -1
- package/dist/config/parseConfig.js +7 -3
- package/dist/config/parsers.js +19 -22
- package/dist/contracts/analysisViewToolContracts.js +56 -0
- package/dist/contracts/applicationToolContracts.js +5 -4
- package/dist/contracts/artifactComparisonExample.js +7 -7
- package/dist/contracts/artifactToolContracts.js +1 -1
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +19 -15
- package/dist/contracts/enhancedInputs.js +2 -2
- package/dist/contracts/enhancedToolContracts.js +4 -3
- package/dist/contracts/errorSchemas.js +3 -1
- package/dist/contracts/evm/evmToolContracts.js +1 -1
- package/dist/contracts/functionComparisonExample.js +8 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +181 -0
- package/dist/contracts/investigationExamples.js +4 -3
- package/dist/contracts/javascript/electronToolContracts.js +3 -2
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +3 -22
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
- package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +1 -1
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +8 -7
- package/dist/contracts/managed/managedToolContracts.js +8 -12
- package/dist/contracts/managed/managedWorkflowToolContracts.js +1 -1
- package/dist/contracts/mobileApplicationGraphExamples.js +8 -8
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +1 -1
- package/dist/contracts/native/nativeToolContracts.js +2 -2
- package/dist/contracts/officialToolContracts.js +2 -1
- package/dist/contracts/promptContracts.js +2 -2
- package/dist/contracts/providerSelection.js +1 -1
- package/dist/contracts/sessionLifecycleInputs.js +4 -3
- package/dist/contracts/sessionStatusContract.js +3 -2
- package/dist/contracts/sessionToolContracts.js +17 -4
- package/dist/contracts/sessionToolSchemas.js +4 -16
- package/dist/contracts/toolContracts.js +2 -0
- package/dist/contracts/toolEffects.js +1 -0
- package/dist/contracts/toolOutputSchemaGroups.js +138 -94
- package/dist/contracts/toolOutputSchemaPrimitives.js +13 -26
- package/dist/contracts/toolSchemaMetadata.js +18 -69
- package/dist/contracts/webNetworkCaptureToolContracts.js +1 -1
- package/dist/contracts/webRuntimeToolContracts.js +1 -1
- package/dist/contracts/webScriptToolContracts.js +1 -1
- package/dist/doctorRuntime.js +7 -5
- package/dist/domain/analysisErrorBase.js +5 -0
- package/dist/domain/analysisErrorCore.js +3 -0
- package/dist/domain/analysisErrorPresentation.js +22 -5
- package/dist/domain/analysisErrorProjection.js +24 -5
- package/dist/domain/analysisSnapshot.js +31 -31
- package/dist/domain/analysisView/analysisView.js +241 -0
- package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
- package/dist/domain/analysisView/binaryLayoutView.js +159 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +238 -0
- package/dist/domain/android/androidApplication.js +1 -1
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apple/appleApplication.js +1 -1
- package/dist/domain/apple/dylibResolution.js +10 -3
- package/dist/domain/apple/interfaceBuilderGraph.js +0 -1
- package/dist/domain/apple/keyedArchive.js +26 -2
- package/dist/domain/artifactComparison.js +15 -6
- package/dist/domain/artifactGraph.js +17 -4
- package/dist/domain/artifactIdentity.js +8 -8
- package/dist/domain/artifactInspection.js +8 -8
- package/dist/domain/artifactInventoryEvidence.js +9 -16
- package/dist/domain/artifactOperationError.js +3 -3
- package/dist/domain/artifactPartialObservation.js +1 -0
- package/dist/domain/artifactPathSyntax.js +49 -0
- package/dist/domain/binaryTarget.js +39 -13
- package/dist/domain/browserCaptureComparison.js +13 -49
- package/dist/domain/browserCompleteness.js +3 -2
- package/dist/domain/browserNetworkEvidence.js +10 -4
- package/dist/domain/browserObservation.js +0 -1
- package/dist/domain/browserObservationSchemas.js +14 -3
- package/dist/domain/browserScenario.js +0 -1
- package/dist/domain/browserScenarioCapture.js +1 -2
- package/dist/domain/browserScenarioCaptureValues.js +2 -2
- package/dist/domain/browserScenarioDiff.js +0 -2
- package/dist/domain/browserScenarioDiffEvidence.js +0 -12
- package/dist/domain/browserScenarioDiffValues.js +2 -2
- package/dist/domain/browserScenarioNormalization.js +3 -3
- package/dist/domain/browserScenarioValues.js +6 -6
- package/dist/domain/callPath.js +15 -18
- package/dist/domain/callPathSchemas.js +2 -2
- package/dist/domain/canonicalDigest.js +7 -1
- package/dist/domain/canonicalOrdering.js +1 -13
- package/dist/domain/changedBehavior.js +5 -6
- package/dist/domain/comparisonSemantics.js +0 -5
- package/dist/domain/completionLedgerGeneration.js +2 -1
- package/dist/domain/configurationErrors.js +12 -0
- package/dist/domain/conformancePackage.js +4 -3
- package/dist/domain/digests.js +0 -3
- package/dist/domain/evidence.js +19 -40
- package/dist/domain/evidenceBundle.js +58 -42
- package/dist/domain/evidenceCompletionLedger.js +2 -1
- package/dist/domain/firmware/firmwareAnalysis.js +4 -3
- package/dist/domain/functionComparison.js +6 -6
- package/dist/domain/functionComparisonDimensions.js +120 -87
- package/dist/domain/functionComparisonNormalization.js +26 -36
- package/dist/domain/functionComparisonResults.js +3 -6
- package/dist/domain/functionComparisonSchemas.js +2 -8
- package/dist/domain/functionDossierEvidence.js +4 -38
- package/dist/domain/hopperValues.js +11 -15
- package/dist/domain/javascript/electronActiveObservation.js +29 -71
- package/dist/domain/javascript/electronObservation.js +14 -3
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -11
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -2
- package/dist/domain/javascript/electronStaticAnalysisNative.js +7 -4
- package/dist/domain/javascript/electronStaticAnalysisValues.js +8 -4
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +3 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +12 -8
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +6 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +41 -16
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +9 -2
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +4 -4
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +37 -22
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +50 -36
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -8
- package/dist/domain/javascript/javascriptAstFingerprint.js +2 -2
- package/dist/domain/javascript/javascriptAstValues.js +22 -0
- package/dist/{application/javascript/JavaScriptReturnShapeProjection.js → domain/javascript/javascriptExportReturnShapeProjection.js} +4 -4
- package/dist/domain/javascript/javascriptExportShapeComparison.js +10 -3
- package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +6 -1
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +58 -22
- package/dist/domain/javascript/javascriptExportShapeSelection.js +7 -7
- package/dist/domain/javascript/javascriptExportShapeVariants.js +70 -16
- package/dist/domain/javascript/javascriptFeatureSeed.js +25 -3
- package/dist/domain/javascript/javascriptFeatureTrace.js +7 -6
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +17 -9
- package/dist/domain/javascript/javascriptFeatureTraversal.js +4 -5
- package/dist/domain/javascript/javascriptNativeHandoff.js +7 -7
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeObservation.js +18 -7
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +12 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +9 -8
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +5 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +6 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +12 -222
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +7 -7
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +209 -11
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +2 -1
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +9 -7
- package/dist/domain/javascript/javascriptSemanticCalls.js +2 -1
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +4 -3
- package/dist/domain/javascript/javascriptSemanticCoverage.js +20 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -9
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +4 -11
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +2 -2
- package/dist/domain/javascript/javascriptSemanticGraph.js +220 -71
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +19 -1
- package/dist/domain/javascript/javascriptSemanticIr.js +0 -4
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +106 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +515 -74
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +44 -36
- package/dist/domain/javascript/javascriptSemanticObjects.js +79 -42
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +8 -14
- package/dist/domain/javascript/javascriptSemanticProjection.js +21 -16
- package/dist/domain/javascript/javascriptSemanticPromises.js +16 -21
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +23 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +3 -3
- package/dist/domain/javascript/javascriptSemanticQuery.js +8 -2
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +3 -2
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -9
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +16 -10
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +1 -1
- package/dist/domain/javascript/javascriptSemanticResources.js +1 -1
- package/dist/domain/javascript/javascriptSemanticReturns.js +55 -44
- package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
- package/dist/domain/javascript/javascriptSemanticTraversal.js +6 -1
- package/dist/domain/javascript/javascriptSemanticValues.js +180 -76
- package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
- package/dist/domain/javascript/javascriptSourceParser.js +34 -9
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +5 -6
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +2 -1
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +26 -16
- package/dist/domain/javascript/sourceToBundleComparison.js +19 -8
- package/dist/domain/javascript/sourceToBundleSignals.js +53 -25
- package/dist/domain/jsonSerialization.js +109 -55
- package/dist/domain/jsonShape.js +46 -19
- package/dist/domain/localPath.js +10 -4
- package/dist/domain/managed/managedApplicationGraph.js +10 -6
- package/dist/domain/managed/managedApplicationGraphNodes.js +82 -57
- package/dist/domain/managed/managedArtifact.js +6 -4
- package/dist/domain/managed/managedMemberComparison.js +2 -9
- package/dist/domain/managed/managedMemberComparisonMatch.js +6 -7
- package/dist/domain/managed/managedNativeVerification.js +0 -2
- package/dist/domain/managed/managedNativeVerificationMatch.js +9 -3
- package/dist/domain/native/binaryLayout.js +2 -3
- package/dist/domain/native/nativeApiBoundary.js +1 -1
- package/dist/domain/native/nativeCallObservation.js +3 -3
- package/dist/domain/native/nativeInstruction.js +7 -0
- package/dist/domain/native/nativeValueFlow.js +5 -11
- package/dist/domain/native/objcSwiftMetadata.js +15 -17
- package/dist/domain/native/recordedCrash.js +2 -3
- package/dist/domain/offsetDateTime.js +17 -0
- package/dist/domain/process/processCapture.js +22 -20
- package/dist/domain/process/processCaptureCoverage.js +70 -0
- package/dist/domain/process/processCaptureExample.js +45 -1
- package/dist/domain/process/processCaptureParsing.js +1 -34
- package/dist/domain/process/processCaptureValidation.js +82 -13
- package/dist/domain/process/processComparison.js +39 -43
- package/dist/domain/process/processObservation.js +10 -2
- package/dist/domain/process/processScenario.js +24 -2
- package/dist/domain/process/processTraceComparison.js +0 -2
- package/dist/domain/process/processTraceDimensionProjection.js +1 -1
- package/dist/domain/process/processTraceEvaluation.js +19 -15
- package/dist/domain/process/processTraceSpecification.js +4 -7
- package/dist/domain/providerAdapterError.js +2 -0
- package/dist/domain/providerCleanupError.js +6 -2
- package/dist/domain/reconstructionCoverage.js +7 -3
- package/dist/domain/reconstructionObligationLedgerSchemas.js +2 -1
- package/dist/domain/reconstructionReadinessSchemas.js +2 -1
- package/dist/domain/reconstructionUnknowns.js +4 -3
- package/dist/domain/reconstructionVerification.js +6 -5
- package/dist/domain/reconstructionVerificationSchemas.js +2 -1
- package/dist/domain/referenceSourceGraph.js +27 -28
- package/dist/domain/referenceSourceImportParsing.js +34 -45
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/staticRuntimeCorrelation.js +4 -3
- package/dist/domain/stringPatterns.js +6 -0
- package/dist/domain/swiftSymbolClassification.js +66 -0
- package/dist/domain/symbolAnalysis.js +83 -20
- package/dist/domain/unicodeCodePointOrder.js +6 -0
- package/dist/domain/webBundleAnalyzerInspection.js +9 -1
- package/dist/domain/webCaptureDiff.js +71 -30
- package/dist/domain/webCaptureDiffSchemas.js +8 -11
- package/dist/domain/webEventListeners.js +3 -2
- package/dist/domain/webExecution.js +3 -2
- package/dist/domain/webInventory.js +3 -2
- package/dist/domain/webMcpDiscovery.js +4 -3
- package/dist/domain/webRuntime.js +0 -2
- package/dist/domain/webScriptExport.js +2 -2
- package/dist/dotnet/ManagedArtifactInspector.js +2 -19
- package/dist/dotnet/ManagedMemberInspector.js +12 -18
- package/dist/dotnet/ManagedMemberInspectorCore.js +47 -44
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +1 -2
- package/dist/dotnet/ManagedMemberRows.js +75 -62
- package/dist/dotnet/ManagedMetadataInventory.js +16 -22
- package/dist/dotnet/ManagedMethodBodyReader.js +4 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +109 -94
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +12 -21
- package/dist/dotnet/ManagedReaderFailure.js +16 -0
- package/dist/dotnet/ManagedStaticProvider.js +13 -12
- package/dist/dotnet/ManagedStaticProviderMetadata.js +1 -4
- package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
- package/dist/evaluation/AgentEvaluationReport.js +28 -0
- package/dist/evaluation/CodexAgentEval.js +12 -8
- package/dist/evaluation/KnownAnswerEvaluation.js +281 -0
- package/dist/evm/EvmoleInterfaceProvider.js +2 -1
- package/dist/filesystem/RegularFile.js +41 -0
- package/dist/firmware/FirmwareCommand.js +9 -5
- package/dist/firmware/FirmwareProvider.js +4 -4
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +3 -6
- package/dist/ghidra/GhidraClient.js +105 -36
- package/dist/ghidra/GhidraClientStartup.js +0 -2
- package/dist/ghidra/GhidraDoctor.js +6 -5
- package/dist/ghidra/GhidraFunctionValues.js +3 -5
- package/dist/ghidra/GhidraInstallation.js +151 -22
- package/dist/ghidra/GhidraJavaLaunch.js +6 -2
- package/dist/ghidra/GhidraLauncher.js +58 -26
- package/dist/ghidra/GhidraProvider.js +6 -2
- package/dist/ghidra/GhidraProviderCapabilities.js +6 -0
- package/dist/ghidra/GhidraProviderClient.js +13 -3
- package/dist/ghidra/GhidraSessionError.js +2 -0
- package/dist/ghidra/GhidraSessionRoot.js +39 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +17 -10
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +8 -2
- package/dist/hopper/BridgeLauncher.js +34 -45
- package/dist/hopper/HopperAnalysisProfile.js +3 -8
- package/dist/hopper/HopperCleanup.js +56 -27
- package/dist/hopper/HopperClient.js +86 -65
- package/dist/hopper/HopperMachOImage.js +3 -2
- package/dist/hopper/HopperProvider.js +16 -18
- package/dist/hopper/HopperRegexSearch.js +3 -6
- package/dist/hopper/HopperTargetLease.js +132 -49
- package/dist/hopper/LinuxPrivateDisplayProbe.js +6 -0
- package/dist/ida/IdaConfiguration.js +8 -3
- package/dist/ida/IdaInput.js +1 -7
- package/dist/ida/IdaMcpConnection.js +8 -4
- package/dist/ida/IdaOperationRunner.js +5 -3
- package/dist/ida/IdaProvider.js +8 -12
- package/dist/ida/IdaSessionClient.js +24 -20
- package/dist/ida/IdaWorkspace.js +12 -13
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -5
- package/dist/inspector/V8InspectorCaptureProjection.js +47 -14
- package/dist/inspector/V8InspectorProvider.js +97 -35
- package/dist/javascript/recovery/WakaruCommand.js +7 -2
- package/dist/javascript/recovery/WakaruExecution.js +5 -2
- package/dist/main/shutdown.js +81 -29
- package/dist/main/startup.js +9 -2
- package/dist/main/transport.js +23 -3
- package/dist/main.js +11 -18
- package/dist/native/AppleMachoSelection.js +16 -6
- package/dist/native/AppleObjcDispatchFacets.js +3 -3
- package/dist/native/AppleObjcProperties.js +17 -7
- package/dist/native/CommandRunner.js +9 -7
- package/dist/native/LldbCallTracer.js +249 -77
- package/dist/native/NativeMacOSProvider.js +32 -17
- package/dist/native/NativeMacOSProviderMetadata.js +1 -2
- package/dist/native/NativeUiHelperRuntime.js +11 -2
- package/dist/native/NativeUiObservation.js +2 -2
- package/dist/native/pwntools/PwntoolsDecoder.js +2 -1
- package/dist/process/DarwinProcessRunTokenReader.js +16 -2
- package/dist/process/ExecFileOutput.js +88 -6
- package/dist/process/PrivateRuntimeRoot.js +10 -5
- package/dist/process/ProcessOwnership.js +1 -4
- package/dist/process/ProcessOwnershipObservation.js +18 -16
- package/dist/process/ProviderProcess.js +1 -3
- package/dist/process/capture/FilesystemSnapshot.js +131 -24
- package/dist/process/capture/ProcessCaptureError.js +13 -0
- package/dist/process/capture/ProcessCaptureLifecycle.js +148 -74
- package/dist/process/capture/ProcessFilesystemEffects.js +51 -6
- package/dist/process/capture/ProcessHarness.js +16 -33
- package/dist/process/capture/ProcessNormalization.js +20 -2
- package/dist/process/capture/ProcessSampling.js +25 -2
- package/dist/process/capture/TerminalRenderer.js +14 -0
- package/dist/process/snapshotEnvironment.js +14 -0
- package/dist/server/EvidenceMcpServer.js +25 -14
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/createServer.js +71 -59
- package/dist/server/mcpClientMetadata.js +12 -5
- package/dist/server/promptCompletion.js +3 -8
- package/dist/server/registerAnalysisViewTool.js +15 -0
- package/dist/server/registerAndroidTools.js +2 -3
- package/dist/server/registerApplicationTools/compareExportShapes.js +6 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +4 -5
- package/dist/server/registerApplicationTools/coverage.js +1 -2
- package/dist/server/registerApplicationTools/helpers.js +4 -4
- package/dist/server/registerApplicationTools/obligationLedger.js +4 -5
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -4
- package/dist/server/registerApplicationTools/traceFeature.js +4 -5
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +4 -5
- package/dist/server/registerArtifactTools.js +2 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +2 -3
- package/dist/server/registerBrowserScenarioTool.js +3 -4
- package/dist/server/registerBrowserTools.js +13 -16
- package/dist/server/registerBundleComparisonTool.js +5 -6
- package/dist/server/registerCloseLifecycleTool.js +8 -7
- package/dist/server/registerElectronTools.js +10 -13
- package/dist/server/registerEnhancedTools.js +82 -77
- package/dist/server/registerEvidenceTools.js +54 -47
- package/dist/server/registerEvmTools.js +2 -3
- package/dist/server/registerFirmwareTools.js +2 -3
- package/dist/server/registerFunctionComparisonTool.js +7 -8
- package/dist/server/registerInvestigationTools.js +14 -15
- package/dist/server/registerJavaScriptRecoveryTool.js +2 -3
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +6 -6
- package/dist/server/registerManagedTools.js +7 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +5 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +4 -5
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +6 -7
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +6 -7
- package/dist/server/registerOfficialTools.js +32 -41
- package/dist/server/registerProcessComparisonTool.js +8 -8
- package/dist/server/registerRecordedCrashTools.js +2 -3
- package/dist/server/registerSessionRecordTools.js +15 -19
- package/dist/server/registerSessionStatusTool.js +3 -4
- package/dist/server/registerSessionTools.js +19 -19
- package/dist/server/registerWebModuleTool.js +2 -3
- package/dist/server/registerWebNetworkCaptureTool.js +2 -3
- package/dist/server/registerWebRuntimeTools.js +4 -5
- package/dist/server/registerWebScriptTool.js +2 -3
- package/dist/server/registerWebSourceLocationTool.js +2 -3
- package/dist/server/toolResult.js +66 -94
- package/dist/server/toolResultEncoding.js +11 -10
- package/dist/windows/WindowsNativeLoader.js +1 -0
- package/dist/windows/WindowsOwnedProcess.js +60 -15
- package/dist/windows/WindowsPrivateRuntime.js +7 -8
- package/native/windows/README.md +3 -1
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +42 -30
- package/scripts/rea.mjs +3 -6
- package/skills/reverse-engineer-anything/SKILL.md +14 -13
- package/skills/reverse-engineer-anything/references/android-applications.md +6 -3
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -4
- package/skills/reverse-engineer-anything/references/javascript-applications.md +16 -6
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +18 -0
- package/dist/artifacts/inventory/policy.js +0 -2
- package/dist/config.js +0 -1
- package/dist/contracts/browserCaptureToolInputSchema.js +0 -43
- package/dist/contracts/process/processCaptureExample.js +0 -2
- package/dist/contracts/toolOutputSchemas.js +0 -2
- package/dist/domain/managed/managedApplicationGraphNodeCoverage.js +0 -6
- package/dist/main/reload.js +0 -12
- package/dist/main/state.js +0 -3
- package/dist/server/registerNativeTools.js +0 -6
- package/dist/server/sessionToolPolicies.js +0 -2
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { canonicalExportShapeValue, digestExportShapeValue, } from "./javascriptExportShapeComparisonIdentity.js";
|
|
2
|
-
import {
|
|
2
|
+
import { uniqueSorted } from "../canonicalOrdering.js";
|
|
3
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
4
|
+
const UNKNOWN_COVERAGE_PRESENCE = {
|
|
5
|
+
left: "unknown-coverage",
|
|
6
|
+
right: "unknown-coverage",
|
|
7
|
+
};
|
|
3
8
|
/** Pair variants only through reciprocal unique exact literal discriminants. */
|
|
4
9
|
export const pairJavaScriptExportShapeVariants = (left, right) => {
|
|
5
10
|
const leftKeys = discriminantOccurrences(left);
|
|
@@ -61,12 +66,41 @@ export const buildJavaScriptExportShapeChanges = (input) => {
|
|
|
61
66
|
});
|
|
62
67
|
return [...paired, ...unpairedLeft, ...unpairedRight];
|
|
63
68
|
};
|
|
69
|
+
/** List observed property names per retained variant, including unknown values. */
|
|
70
|
+
export const buildJavaScriptExportShapeInventories = (input) => {
|
|
71
|
+
const leftPairs = new Map(input.pairing.pairs.map((pair) => [pair.leftIndex, pair]));
|
|
72
|
+
const rightPairs = new Map(input.pairing.pairs.map((pair) => [pair.rightIndex, pair]));
|
|
73
|
+
return [
|
|
74
|
+
...input.leftShapes.map((shape, index) => inventoryFor("left", index, shape, leftPairs.get(index))),
|
|
75
|
+
...input.rightShapes.map((shape, index) => inventoryFor("right", index, shape, rightPairs.get(index))),
|
|
76
|
+
];
|
|
77
|
+
};
|
|
78
|
+
const inventoryFor = (side, variantIndex, shape, pair) => ({
|
|
79
|
+
side,
|
|
80
|
+
variant_index: variantIndex,
|
|
81
|
+
discriminant: pair?.discriminant ?? null,
|
|
82
|
+
paired: pair !== undefined,
|
|
83
|
+
source_range: shape.source_range,
|
|
84
|
+
properties: uniqueSorted([
|
|
85
|
+
...shape.fields
|
|
86
|
+
.filter((field) => fieldPresence(shape, field, field.path) === "present")
|
|
87
|
+
.map(({ path }) => path),
|
|
88
|
+
...shape.property_coverage.map(({ path }) => path),
|
|
89
|
+
]).filter((path) => path !== ""),
|
|
90
|
+
property_coverage: shape.property_coverage.map(({ path, status }) => ({
|
|
91
|
+
path,
|
|
92
|
+
status,
|
|
93
|
+
})),
|
|
94
|
+
});
|
|
64
95
|
/** Report whether any retained shape lacks complete property coverage. */
|
|
65
|
-
export const hasPartialJavaScriptExportPropertyCoverage = (shapes) => shapes.some((shape) => shape.property_coverage.some(({ status }) => status === "partial")
|
|
96
|
+
export const hasPartialJavaScriptExportPropertyCoverage = (shapes) => shapes.some((shape) => shape.property_coverage.some(({ status }) => status === "partial") ||
|
|
97
|
+
shape.fields.some((field) => fieldPresence(shape, field, field.path) === "unknown-coverage"));
|
|
66
98
|
const discriminantOccurrences = (shapes) => {
|
|
67
99
|
const output = new Map();
|
|
68
100
|
shapes.forEach((shape, index) => {
|
|
69
101
|
for (const field of shape.fields) {
|
|
102
|
+
if (fieldPresence(shape, field, field.path) !== "present")
|
|
103
|
+
continue;
|
|
70
104
|
const value = literalValue(field);
|
|
71
105
|
if (!value.found)
|
|
72
106
|
continue;
|
|
@@ -106,11 +140,12 @@ const addTarget = (map, source, target) => {
|
|
|
106
140
|
map.set(source, values);
|
|
107
141
|
};
|
|
108
142
|
const indexesNotIn = (shapes, paired) => shapes.map((_, index) => index).filter((index) => !paired.has(index));
|
|
109
|
-
const compareDiscriminants = (left, right) =>
|
|
143
|
+
const compareDiscriminants = (left, right) => compareUnicodeCodePoints(canonicalExportShapeValue(left), canonicalExportShapeValue(right));
|
|
110
144
|
const selectionUnknownChange = (input) => changeWithId({
|
|
111
145
|
status: "unknown",
|
|
112
146
|
path: "",
|
|
113
147
|
discriminant: null,
|
|
148
|
+
presence: UNKNOWN_COVERAGE_PRESENCE,
|
|
114
149
|
left: selectionAvailability(input.leftSelection.selection, "left"),
|
|
115
150
|
right: selectionAvailability(input.rightSelection.selection, "right"),
|
|
116
151
|
left_source_range: null,
|
|
@@ -124,6 +159,7 @@ const emptyShapeUnknownChange = (input) => changeWithId({
|
|
|
124
159
|
status: "unknown",
|
|
125
160
|
path: "",
|
|
126
161
|
discriminant: null,
|
|
162
|
+
presence: UNKNOWN_COVERAGE_PRESENCE,
|
|
127
163
|
left: emptyShapeAvailability(input.leftShapes, "left"),
|
|
128
164
|
right: emptyShapeAvailability(input.rightShapes, "right"),
|
|
129
165
|
left_source_range: null,
|
|
@@ -159,6 +195,10 @@ const diffPair = (left, right, discriminant, evidenceLinks) => {
|
|
|
159
195
|
status,
|
|
160
196
|
path,
|
|
161
197
|
discriminant,
|
|
198
|
+
presence: {
|
|
199
|
+
left: fieldPresence(left, leftField, path),
|
|
200
|
+
right: fieldPresence(right, rightField, path),
|
|
201
|
+
},
|
|
162
202
|
left: fieldAvailability(leftField),
|
|
163
203
|
right: fieldAvailability(rightField),
|
|
164
204
|
left_source_range: left.source_range,
|
|
@@ -181,29 +221,42 @@ const fieldAtPath = (shape, fields, path) => {
|
|
|
181
221
|
return undefined;
|
|
182
222
|
return {
|
|
183
223
|
path,
|
|
224
|
+
presence: "present",
|
|
184
225
|
state: "unknown",
|
|
185
226
|
value: null,
|
|
186
227
|
reason: "A static container is retained at this path, but no primitive field value is projected.",
|
|
187
228
|
};
|
|
188
229
|
};
|
|
189
230
|
const fieldChangeStatus = ({ leftShape, rightShape, path, leftField, rightField, }) => {
|
|
190
|
-
|
|
191
|
-
|
|
231
|
+
const leftPresence = fieldPresence(leftShape, leftField, path);
|
|
232
|
+
const rightPresence = fieldPresence(rightShape, rightField, path);
|
|
233
|
+
if (leftField !== undefined &&
|
|
234
|
+
rightField !== undefined &&
|
|
235
|
+
canonicalExportShapeValue(leftField) ===
|
|
192
236
|
canonicalExportShapeValue(rightField))
|
|
193
|
-
|
|
237
|
+
return null;
|
|
238
|
+
if (leftPresence === "absent" && rightPresence === "absent")
|
|
239
|
+
return null;
|
|
240
|
+
if (leftPresence === "unknown-coverage" ||
|
|
241
|
+
rightPresence === "unknown-coverage")
|
|
242
|
+
return "unknown";
|
|
243
|
+
if (leftPresence === "absent")
|
|
244
|
+
return "added";
|
|
245
|
+
if (rightPresence === "absent")
|
|
246
|
+
return "removed";
|
|
247
|
+
if (leftField !== undefined && rightField !== undefined) {
|
|
194
248
|
return leftField.state === "unknown" || rightField.state === "unknown"
|
|
195
249
|
? "unknown"
|
|
196
250
|
: "changed";
|
|
197
251
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return leftField === undefined ? "added" : "removed";
|
|
252
|
+
return null;
|
|
253
|
+
};
|
|
254
|
+
const fieldPresence = (shape, field, path) => {
|
|
255
|
+
if (field !== undefined)
|
|
256
|
+
return field.presence;
|
|
257
|
+
return propertyCoverageComplete(shape, parentPointer(path))
|
|
258
|
+
? "absent"
|
|
259
|
+
: "unknown-coverage";
|
|
207
260
|
};
|
|
208
261
|
const propertyCoverageComplete = (shape, path) => path !== null &&
|
|
209
262
|
shape.property_coverage.some((coverage) => coverage.path === path && coverage.status === "complete");
|
|
@@ -214,7 +267,7 @@ const parentPointer = (path) => {
|
|
|
214
267
|
return separator < 0 ? null : path.slice(0, separator);
|
|
215
268
|
};
|
|
216
269
|
const fieldAvailability = (field) => {
|
|
217
|
-
if (field === undefined)
|
|
270
|
+
if (field === undefined || field.presence === "absent")
|
|
218
271
|
return { availability: "absent" };
|
|
219
272
|
if (field.state === "unknown")
|
|
220
273
|
return {
|
|
@@ -245,6 +298,7 @@ const unpairedChange = (side, shape, evidenceLinks) => changeWithId({
|
|
|
245
298
|
status: "unknown",
|
|
246
299
|
path: "",
|
|
247
300
|
discriminant: null,
|
|
301
|
+
presence: UNKNOWN_COVERAGE_PRESENCE,
|
|
248
302
|
left: {
|
|
249
303
|
availability: "unknown",
|
|
250
304
|
reason: side === "left"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
2
2
|
import { featureSeedMatchMode, } from "./javascriptFeatureTraceSchemas.js";
|
|
3
3
|
/** Locate every graph node matching a typed literal seed without regex execution. */
|
|
4
4
|
export const findApplicationFeatureSeeds = (nodes, seed) => nodes
|
|
5
5
|
.flatMap((node) => seedMatch(node, seed))
|
|
6
|
-
.sort((left, right) =>
|
|
6
|
+
.sort((left, right) => compareUnicodeCodePoints(`${left.node_id}\0${left.basis}\0${left.field}`, `${right.node_id}\0${right.basis}\0${right.field}`));
|
|
7
7
|
const seedMatch = (node, seed) => {
|
|
8
8
|
if (seed.kind === "node-id")
|
|
9
9
|
return node.node_id === seed.value
|
|
@@ -62,6 +62,16 @@ const candidateFields = (node, seedKind) => {
|
|
|
62
62
|
value: observation.label,
|
|
63
63
|
},
|
|
64
64
|
]),
|
|
65
|
+
...(observation.source_map_reference !== null &&
|
|
66
|
+
observation.source_map_reference.resolution.kind !== "unresolved"
|
|
67
|
+
? [
|
|
68
|
+
{
|
|
69
|
+
basis: "property",
|
|
70
|
+
field: `observations[${String(index)}].source_map_reference.resolution.path`,
|
|
71
|
+
value: observation.source_map_reference.resolution.path,
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
: []),
|
|
65
75
|
...propertyFields(observation.properties, `observations[${String(index)}].properties`),
|
|
66
76
|
]),
|
|
67
77
|
];
|
|
@@ -89,6 +99,7 @@ const relevantFields = {
|
|
|
89
99
|
".path",
|
|
90
100
|
".source",
|
|
91
101
|
".original_source",
|
|
102
|
+
".source_root",
|
|
92
103
|
".exports",
|
|
93
104
|
],
|
|
94
105
|
"native-export": [".label", ".key", ".requested_members", ".members"],
|
|
@@ -104,6 +115,15 @@ const identityFields = (node) => {
|
|
|
104
115
|
field: "identity.original_source",
|
|
105
116
|
value: identity.original_source,
|
|
106
117
|
},
|
|
118
|
+
...(identity.source_root === null
|
|
119
|
+
? []
|
|
120
|
+
: [
|
|
121
|
+
{
|
|
122
|
+
basis: "identity",
|
|
123
|
+
field: "identity.source_root",
|
|
124
|
+
value: identity.source_root,
|
|
125
|
+
},
|
|
126
|
+
]),
|
|
107
127
|
];
|
|
108
128
|
if (identity.strategy === "canonical-path")
|
|
109
129
|
return [
|
|
@@ -151,7 +171,9 @@ const propertyFields = (value, prefix) => {
|
|
|
151
171
|
continue;
|
|
152
172
|
}
|
|
153
173
|
if (current !== null && typeof current === "object") {
|
|
154
|
-
for (const key of Object.keys(current)
|
|
174
|
+
for (const key of Object.keys(current)
|
|
175
|
+
.sort(compareUnicodeCodePoints)
|
|
176
|
+
.reverse())
|
|
155
177
|
pending.push({
|
|
156
178
|
current: current[key] ?? null,
|
|
157
179
|
path: `${path}.${key}`,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { digestCanonicalValue } from "../canonicalDigest.js";
|
|
2
|
+
import { uniqueSorted } from "../canonicalOrdering.js";
|
|
3
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
3
4
|
import { createJavaScriptApplicationGraph, } from "./javascriptApplicationGraph.js";
|
|
4
5
|
import { applicationFeatureTraceResultSchema, } from "./javascriptFeatureTraceSchemas.js";
|
|
5
6
|
import { findApplicationFeatureSeeds, } from "./javascriptFeatureSeed.js";
|
|
@@ -46,7 +47,7 @@ export const traceApplicationFeature = (input) => {
|
|
|
46
47
|
};
|
|
47
48
|
return applicationFeatureTraceResultSchema.parse({
|
|
48
49
|
...semantic,
|
|
49
|
-
trace_id: `jatr_${
|
|
50
|
+
trace_id: `jatr_${digestCanonicalValue(semantic, "Feature trace")}`,
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
53
|
const noMatchResult = (input) => {
|
|
@@ -83,7 +84,7 @@ const noMatchResult = (input) => {
|
|
|
83
84
|
};
|
|
84
85
|
return applicationFeatureTraceResultSchema.parse({
|
|
85
86
|
...semantic,
|
|
86
|
-
trace_id: `jatr_${
|
|
87
|
+
trace_id: `jatr_${digestCanonicalValue(semantic, "Feature trace")}`,
|
|
87
88
|
});
|
|
88
89
|
};
|
|
89
90
|
const traceGraph = (input, seedMatches, traversal) => {
|
|
@@ -112,7 +113,7 @@ const terminalPaths = (traversal, seeds) => {
|
|
|
112
113
|
(!seedIds.has(node.node_id) || traversal.nodes.length === 1))
|
|
113
114
|
.map((node) => pathTo(node, traversal.predecessors, edgeById))
|
|
114
115
|
.filter((path) => path !== null)
|
|
115
|
-
.sort((left, right) =>
|
|
116
|
+
.sort((left, right) => compareUnicodeCodePoints(left.path_id, right.path_id));
|
|
116
117
|
};
|
|
117
118
|
const pathTo = (node, predecessors, edgeById) => {
|
|
118
119
|
const nodeIds = [node.node_id];
|
|
@@ -144,7 +145,7 @@ const pathTo = (node, predecessors, edgeById) => {
|
|
|
144
145
|
};
|
|
145
146
|
return {
|
|
146
147
|
...semantic,
|
|
147
|
-
path_id: `jatp_${
|
|
148
|
+
path_id: `jatp_${digestCanonicalValue(semantic, "Feature trace")}`,
|
|
148
149
|
};
|
|
149
150
|
};
|
|
150
151
|
const isTerminal = (node) => ["endpoint", "storage", "native-addon", "native-export", "unknown"].includes(node.kind);
|
|
@@ -36,6 +36,22 @@ const applicationFeatureSeedSchema = z.union([
|
|
|
36
36
|
case_sensitive: z.boolean().default(false),
|
|
37
37
|
}),
|
|
38
38
|
]);
|
|
39
|
+
/** Check unique native identities before projecting an application trace. */
|
|
40
|
+
const validateApplicationTraceIdentities = (input, context) => {
|
|
41
|
+
const ids = input.native_observations.map(({ evidence_id: id }) => id);
|
|
42
|
+
if (new Set(ids).size !== ids.length)
|
|
43
|
+
context.addIssue({
|
|
44
|
+
code: "custom",
|
|
45
|
+
path: ["native_observations"],
|
|
46
|
+
message: "Native observations must be unique",
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
/** Validate native trace identities without capturing their complete Evidence. */
|
|
50
|
+
export const applicationTraceIdentitiesSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
native_observations: z.array(z.object({ evidence_id: evidenceIdSchema })),
|
|
53
|
+
})
|
|
54
|
+
.superRefine(validateApplicationTraceIdentities);
|
|
39
55
|
/** Evidence-backed application graph and feature seed. */
|
|
40
56
|
export const traceApplicationFeatureInputSchema = z
|
|
41
57
|
.strictObject({
|
|
@@ -44,15 +60,7 @@ export const traceApplicationFeatureInputSchema = z
|
|
|
44
60
|
seed: applicationFeatureSeedSchema,
|
|
45
61
|
direction: z.enum(["outgoing", "incoming", "both"]).default("both"),
|
|
46
62
|
})
|
|
47
|
-
.superRefine(
|
|
48
|
-
const ids = input.native_observations.map(({ evidence_id: id }) => id);
|
|
49
|
-
if (new Set(ids).size !== ids.length)
|
|
50
|
-
context.addIssue({
|
|
51
|
-
code: "custom",
|
|
52
|
-
path: ["native_observations"],
|
|
53
|
-
message: "Native observations must be unique",
|
|
54
|
-
});
|
|
55
|
-
});
|
|
63
|
+
.superRefine(validateApplicationTraceIdentities);
|
|
56
64
|
const seedMatchSchema = z.strictObject({
|
|
57
65
|
node_id: nodeIdSchema,
|
|
58
66
|
kind: z.string().min(1),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {} from "
|
|
2
|
-
import { compareCodePoints } from "../canonicalOrdering.js";
|
|
1
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
3
2
|
/** Traverse a JAG without treating edge inference as observed reachability. */
|
|
4
3
|
export const traverseApplicationFeature = (graph, seedNodeIds, direction) => {
|
|
5
4
|
const nodeById = new Map(graph.nodes.map((node) => [node.node_id, node]));
|
|
@@ -30,8 +29,8 @@ export const traverseApplicationFeature = (graph, seedNodeIds, direction) => {
|
|
|
30
29
|
nodes: [...visited]
|
|
31
30
|
.map((nodeId) => nodeById.get(nodeId))
|
|
32
31
|
.filter((node) => node !== undefined)
|
|
33
|
-
.sort((left, right) =>
|
|
34
|
-
edges: [...retainedEdges.values()].sort((left, right) =>
|
|
32
|
+
.sort((left, right) => compareUnicodeCodePoints(left.node_id, right.node_id)),
|
|
33
|
+
edges: [...retainedEdges.values()].sort((left, right) => compareUnicodeCodePoints(left.edge_id, right.edge_id)),
|
|
35
34
|
predecessors,
|
|
36
35
|
};
|
|
37
36
|
};
|
|
@@ -50,7 +49,7 @@ const buildAdjacency = (edges, direction) => {
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
for (const entries of adjacency.values())
|
|
53
|
-
entries.sort((left, right) =>
|
|
52
|
+
entries.sort((left, right) => compareUnicodeCodePoints(`${left.edge.edge_id}\0${left.nextNodeId}`, `${right.edge.edge_id}\0${right.nextNodeId}`));
|
|
54
53
|
return adjacency;
|
|
55
54
|
};
|
|
56
55
|
const addAdjacency = (adjacency, nodeId, entry) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {} from "./
|
|
1
|
+
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
2
|
+
import {} from "./javascriptApplicationGraphSchemas.js";
|
|
3
3
|
/** Build provider-neutral addon targets and link exact-subject native Evidence. */
|
|
4
4
|
export const buildJavaScriptNativeHandoffs = (nodes, edges, nativeEvidence) => {
|
|
5
5
|
const nodeById = new Map(nodes.map((node) => [node.node_id, node]));
|
|
@@ -24,7 +24,7 @@ export const buildJavaScriptNativeHandoffs = (nodes, edges, nativeEvidence) => {
|
|
|
24
24
|
providers: uniqueProviders(linked),
|
|
25
25
|
evidence_ids: linked
|
|
26
26
|
.map(({ evidence_id: id }) => id)
|
|
27
|
-
.sort(
|
|
27
|
+
.sort(compareUnicodeCodePoints),
|
|
28
28
|
recommended_tools: [
|
|
29
29
|
"open_binary",
|
|
30
30
|
"binary_overview",
|
|
@@ -35,7 +35,7 @@ export const buildJavaScriptNativeHandoffs = (nodes, edges, nativeEvidence) => {
|
|
|
35
35
|
},
|
|
36
36
|
];
|
|
37
37
|
})
|
|
38
|
-
.sort((left, right) =>
|
|
38
|
+
.sort((left, right) => compareUnicodeCodePoints(left.native_node_id, right.native_node_id));
|
|
39
39
|
};
|
|
40
40
|
const artifactDigest = (node) => {
|
|
41
41
|
if (node.identity.strategy === "content-digest")
|
|
@@ -65,7 +65,7 @@ const nativeExportNodes = (addon, edges, nodeById) => {
|
|
|
65
65
|
return [...new Set(ids)]
|
|
66
66
|
.map((id) => nodeById.get(id))
|
|
67
67
|
.filter((node) => node?.kind === "native-export")
|
|
68
|
-
.sort((left, right) =>
|
|
68
|
+
.sort((left, right) => compareUnicodeCodePoints(left.node_id, right.node_id));
|
|
69
69
|
};
|
|
70
70
|
const requestedExports = (nodes) => {
|
|
71
71
|
const values = nodes.flatMap((node) => node.observations.flatMap((observation) => [
|
|
@@ -73,7 +73,7 @@ const requestedExports = (nodes) => {
|
|
|
73
73
|
...stringArray(observation.properties.requested_members),
|
|
74
74
|
...stringArray(observation.properties.members),
|
|
75
75
|
]));
|
|
76
|
-
return [...new Set(values)].sort(
|
|
76
|
+
return [...new Set(values)].sort(compareUnicodeCodePoints);
|
|
77
77
|
};
|
|
78
78
|
const stringArray = (value) => Array.isArray(value)
|
|
79
79
|
? value.filter((item) => typeof item === "string")
|
|
@@ -83,4 +83,4 @@ const uniqueProviders = (evidence) => [
|
|
|
83
83
|
`${provider.id}\0${provider.name}\0${provider.version ?? ""}`,
|
|
84
84
|
provider,
|
|
85
85
|
])).values(),
|
|
86
|
-
].sort((left, right) =>
|
|
86
|
+
].sort((left, right) => compareUnicodeCodePoints(`${left.id}\0${left.name}\0${left.version ?? ""}`, `${right.id}\0${right.name}\0${right.version ?? ""}`));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {} from "./javascriptApplicationGraph.js";
|
|
2
1
|
import { uniqueSorted } from "../canonicalOrdering.js";
|
|
3
2
|
import { createStaticRuntimeScope, mappedRuntimePaths, staticNodeWithinRuntimeScope, } from "./javascriptRuntimeStaticCandidates.js";
|
|
4
3
|
/** Classify static code presence without claiming bundled module execution. */
|
|
@@ -16,7 +16,6 @@ export const javascriptRuntimeKindSchema = z.enum([
|
|
|
16
16
|
"electron-renderer",
|
|
17
17
|
]);
|
|
18
18
|
const observedJavaScriptRuntimeKindSchema = javascriptRuntimeKindSchema.or(z.literal("unknown"));
|
|
19
|
-
/** Input for one bounded, attach-only V8 Inspector observation. */
|
|
20
19
|
/** Input for one passive attach-only V8 Inspector observation. */
|
|
21
20
|
export const observeJavaScriptRuntimeInputSchema = z.strictObject({
|
|
22
21
|
...runtimeEndpoint,
|
|
@@ -33,7 +32,6 @@ export const javascriptRuntimeLocationSchema = z.discriminatedUnion("kind", [
|
|
|
33
32
|
z.strictObject({
|
|
34
33
|
kind: z.literal("file"),
|
|
35
34
|
file_path: z.string().min(1),
|
|
36
|
-
authority: z.literal("scope-fallback").optional(),
|
|
37
35
|
}),
|
|
38
36
|
z.strictObject({
|
|
39
37
|
kind: z.literal("url"),
|
|
@@ -48,8 +46,13 @@ export const javascriptRuntimeLocationSchema = z.discriminatedUnion("kind", [
|
|
|
48
46
|
/** Discovery metadata can identify an endpoint target without verifying its file location. */
|
|
49
47
|
export const javascriptRuntimeUnresolvedLocationSchema = z.strictObject({
|
|
50
48
|
kind: z.literal("unresolved"),
|
|
51
|
-
reported_url: z
|
|
52
|
-
|
|
49
|
+
reported_url: z
|
|
50
|
+
.string()
|
|
51
|
+
.describe("Raw Inspector URL, which may be empty for anonymous or evaluated code."),
|
|
52
|
+
reason: z.enum([
|
|
53
|
+
"unverifiable-file-location",
|
|
54
|
+
"location-authorization-not-attempted",
|
|
55
|
+
]),
|
|
53
56
|
});
|
|
54
57
|
/** Verified locations and explicitly unresolved discovery metadata. */
|
|
55
58
|
export const javascriptRuntimeTargetLocationSchema = z.union([
|
|
@@ -74,11 +77,19 @@ export const javascriptRuntimeTargetListSchema = z.strictObject({
|
|
|
74
77
|
});
|
|
75
78
|
const javascriptRuntimeScriptSchema = z.strictObject({
|
|
76
79
|
script_key: prefixedDigestSchema("v8_script"),
|
|
77
|
-
location:
|
|
80
|
+
location: javascriptRuntimeTargetLocationSchema,
|
|
78
81
|
execution_context_key: z.string().nullable(),
|
|
79
82
|
cdp_hash: z.string().nullable(),
|
|
80
|
-
length: z
|
|
81
|
-
|
|
83
|
+
length: z
|
|
84
|
+
.number()
|
|
85
|
+
.int()
|
|
86
|
+
.min(0)
|
|
87
|
+
.nullable()
|
|
88
|
+
.describe("Producer-reported script length; null when unavailable."),
|
|
89
|
+
is_module: z
|
|
90
|
+
.boolean()
|
|
91
|
+
.nullable()
|
|
92
|
+
.describe("Producer-reported module classification; null when unavailable."),
|
|
82
93
|
status: z.literal("observed-loaded"),
|
|
83
94
|
});
|
|
84
95
|
const javascriptRuntimeContextSchema = z.strictObject({
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { classifyStaticLoadStates } from "./javascriptRuntimeLoadState.js";
|
|
2
2
|
import { buildReconciledApplicationGraph } from "./javascriptRuntimeReconciliationGraph.js";
|
|
3
3
|
import { reconcileRuntimeEntities } from "./javascriptRuntimeReconciliationMatching.js";
|
|
4
|
-
import {
|
|
4
|
+
import { parseStaticLayers, } from "./javascriptRuntimeReconciliationParsing.js";
|
|
5
|
+
import { parseRuntimeCaptures, } from "./javascriptRuntimeReconciliationCaptureParsing.js";
|
|
5
6
|
import { createJavaScriptRuntimeReconciliationResult } from "./javascriptRuntimeReconciliationResult.js";
|
|
6
|
-
import { reconcileJavaScriptRuntimeInputSchema } from "./javascriptRuntimeReconciliationSchemas.js";
|
|
7
7
|
import { projectRuntimeCaptures } from "./javascriptRuntimeReconciliationRuntime.js";
|
|
8
8
|
import { collectStaticRuntimeCandidates } from "./javascriptRuntimeStaticCandidates.js";
|
|
9
|
+
/** Parse caller Evidence once into the owner consumed by reconciliation. */
|
|
10
|
+
export const parseRuntimeReconciliationInput = (input) => ({
|
|
11
|
+
input,
|
|
12
|
+
layers: parseStaticLayers(input.static_layers, ["static_layers"]),
|
|
13
|
+
captures: parseRuntimeCaptures(input.runtime_observations, [
|
|
14
|
+
"runtime_observations",
|
|
15
|
+
]),
|
|
16
|
+
});
|
|
9
17
|
/** Reconcile static JAG layers with authorized passive CDP Evidence. */
|
|
10
|
-
export const reconcileJavaScriptRuntime = (
|
|
11
|
-
const
|
|
12
|
-
const layers = parseStaticLayers(parsed.static_layers);
|
|
13
|
-
const captures = parseRuntimeCaptures(parsed.runtime_observations);
|
|
18
|
+
export const reconcileJavaScriptRuntime = (parsed) => {
|
|
19
|
+
const { layers, captures } = parsed;
|
|
14
20
|
const runtime = projectRuntimeCaptures(captures);
|
|
15
21
|
const candidates = collectStaticRuntimeCandidates(layers);
|
|
16
22
|
const matching = reconcileRuntimeEntities({
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { isAbsolute } from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { digestCanonicalValue } from "../canonicalDigest.js";
|
|
3
3
|
import { isPathWithinRoot } from "../localPath.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
import { invalidInput, parseAtPath, } from "./javascriptRuntimeReconciliationInputValidation.js";
|
|
5
6
|
import { classifyBrowserCompleteness, } from "../browserCompleteness.js";
|
|
6
7
|
import { electronActiveObservationResultSchema, } from "./electronActiveObservation.js";
|
|
7
8
|
/** Parse active Electron Evidence as a bounded, target-only runtime capture. */
|
|
8
9
|
export const parseActiveElectronCapture = (evidence) => {
|
|
9
10
|
assertIdentity(evidence);
|
|
10
|
-
const result = electronActiveObservationResultSchema.parse(evidence.normalized_result);
|
|
11
|
-
const parameters = z
|
|
11
|
+
const result = parseAtPath((value) => electronActiveObservationResultSchema.parse(value), evidence.normalized_result, ["normalized_result"]);
|
|
12
|
+
const parameters = parseAtPath((value) => z
|
|
12
13
|
.object({
|
|
13
14
|
application_path: absolutePathSchema,
|
|
14
15
|
application_root: absolutePathSchema,
|
|
15
16
|
})
|
|
16
17
|
.passthrough()
|
|
17
|
-
.parse(evidence.parameters);
|
|
18
|
+
.parse(value), evidence.parameters, ["parameters"]);
|
|
18
19
|
if (result.application.application_path !== parameters.application_path ||
|
|
19
20
|
!isPathWithinRoot(parameters.application_root, result.application.application_path))
|
|
20
|
-
throw
|
|
21
|
+
throw invalidInput(["normalized_result", "application", "application_path"], "Active Electron Evidence application path disagrees with its configured root");
|
|
21
22
|
return {
|
|
22
23
|
kind: "electron-active",
|
|
23
24
|
evidence,
|
|
24
25
|
inspection: normalizeInspection(result),
|
|
25
|
-
captureSha256:
|
|
26
|
+
captureSha256: digestCanonicalValue(result, "Runtime reconciliation"),
|
|
26
27
|
scriptsCompleteWithinScope: false,
|
|
27
28
|
};
|
|
28
29
|
};
|
|
@@ -36,11 +37,11 @@ const assertIdentity = (evidence) => {
|
|
|
36
37
|
evidence.provider.version !== "1" ||
|
|
37
38
|
evidence.authority !== "controlled-replay" ||
|
|
38
39
|
evidence.confidence !== "observed")
|
|
39
|
-
throw
|
|
40
|
+
throw invalidInput([], "Evidence does not match the supported capture_electron_scenario contract");
|
|
40
41
|
};
|
|
41
42
|
const normalizeInspection = (result) => ({
|
|
42
43
|
target: {
|
|
43
|
-
target_id: `electron-active:${
|
|
44
|
+
target_id: `electron-active:${digestCanonicalValue(result.application.application_path, "Runtime reconciliation").slice(0, 32)}`,
|
|
44
45
|
type: "electron-application",
|
|
45
46
|
title: result.application.application_path,
|
|
46
47
|
attached: true,
|