rea-agents 6.3.0 → 6.4.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 +7 -4
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +597 -209
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +186 -0
- package/dist/adb/AdbProvider.js +1190 -0
- package/dist/adb/AdbShellOutput.js +309 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxConfiguration.js +44 -24
- package/dist/android/JadxProvider.js +51 -19
- package/dist/apktool/ApktoolConfiguration.js +84 -0
- package/dist/apktool/ApktoolDecodeOutput.js +59 -0
- package/dist/apktool/ApktoolProvider.js +506 -0
- package/dist/application/AnalysisProvider.js +8 -2
- package/dist/application/AppBundleExecutable.js +27 -22
- package/dist/application/BinaryTargetResolver.js +22 -2
- package/dist/application/CapabilityInventory.js +11 -1
- package/dist/application/ClientConfigurationDocument.js +70 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +35 -0
- package/dist/application/ClientRegistrationStatus.js +66 -31
- package/dist/application/DirectAnalysis.js +2 -2
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +1 -1
- package/dist/application/Doctor.js +5 -3
- package/dist/application/DoctorDiagnostics.js +1 -1
- package/dist/application/EvidenceBundleCommands.js +6 -12
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/JsonFiles.js +6 -5
- package/dist/{cliJsonFile.js → application/JsonInputFile.js} +108 -35
- package/dist/application/LinuxHopper.js +4 -12
- package/dist/application/MacHopper.js +172 -149
- package/dist/application/MipsElfAbiFlags.js +140 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/ReconstructionObligationCandidates.js +9 -3
- package/dist/application/ReferenceSourceImport.js +76 -29
- package/dist/application/ReferenceSourceImportEntries.js +18 -9
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -22
- package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
- package/dist/application/RegularFileRead.js +93 -7
- package/dist/application/Setup.js +54 -6
- package/dist/application/SetupClientConfiguration.js +116 -16
- package/dist/application/SetupHost.js +102 -24
- package/dist/application/SetupPlan.js +5 -8
- package/dist/application/SetupSkill.js +58 -39
- package/dist/application/SupportedClients.js +290 -65
- package/dist/application/Uninstall.js +158 -10
- package/dist/application/UpdateMaintenance.js +17 -21
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +3 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +40 -2
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/BinarySession.js +2 -1
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
- package/dist/application/evm/EvmInterfaceService.js +3 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +19 -6
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
- package/dist/application/javascript/JavaScriptApplicationService.js +22 -11
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -30
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +67 -19
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +19 -16
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +258 -235
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +115 -26
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -4
- package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +199 -61
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
- package/dist/application/native/NativeUiActionTrace.js +16 -8
- package/dist/application/native/NativeValueTrace.js +23 -6
- package/dist/application/process/ProcessCli.js +25 -20
- package/dist/artifacts/ArtifactPaths.js +129 -8
- package/dist/artifacts/ArtifactProvider.js +20 -15
- package/dist/artifacts/ArtifactReader.js +23 -0
- package/dist/artifacts/ArtifactResourceScope.js +100 -0
- package/dist/artifacts/AsarArtifactReader.js +176 -102
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +168 -65
- package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
- package/dist/artifacts/NativeDmgArtifactReader.js +29 -22
- package/dist/artifacts/SafeOutputTree.js +245 -70
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +77 -27
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +32 -13
- package/dist/artifacts/extraction/ArtifactExtraction.js +110 -86
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +110 -43
- package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
- package/dist/artifacts/inventory/classify.js +75 -32
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +13 -5
- package/dist/artifacts/inventory/scanCanonical.js +62 -25
- package/dist/artifacts/inventory/scanReader.js +38 -11
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +15 -9
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
- package/dist/browser/BrowserScenarioSecrets.js +52 -37
- package/dist/browser/CdpBrowserProvider.js +5 -0
- package/dist/browser/CdpCaptureDocuments.js +40 -6
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
- package/dist/browser/CdpCaptureEventHandlers.js +26 -9
- package/dist/browser/CdpCaptureEvents.js +4 -9
- package/dist/browser/CdpConnection.js +22 -5
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpTargetSession.js +30 -34
- package/dist/browser/CdpWebMcpDiscovery.js +32 -10
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +60 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +69 -7
- package/dist/browser/PlaywrightScenarioSession.js +127 -54
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +3 -3
- package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
- package/dist/browser/assets/PublishWebScripts.js +75 -20
- package/dist/browser/assets/WebArtifactReads.js +23 -1
- package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/HarCapture.js +14 -0
- package/dist/browser/history/HarCaptureProcess.js +2 -10
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/modules/WebModuleArtifacts.js +1 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/artifactCommands.js +8 -11
- package/dist/cli/binaryDiagnosticsCommands.js +19 -1
- package/dist/cli/browserAdvancedCommands.js +65 -36
- package/dist/cli/coreBinaryCommands.js +0 -5
- package/dist/cli/coreNativeCommands.js +1 -14
- package/dist/cli/electronCommands.js +6 -1
- package/dist/cli/evmCommands.js +13 -4
- package/dist/cli/firmwareCommands.js +7 -2
- package/dist/cli/javascriptApplicationAnalysis.js +17 -1
- package/dist/cli/javascriptRecoveryCommands.js +22 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +11 -4
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/setupCommands.js +15 -3
- package/dist/cli/utilityCommands.js +66 -18
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli.js +6 -0
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +32 -0
- package/dist/cliJsonInput.js +2 -2
- package/dist/cliObservationOptions.js +3 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/directAnalysis.js +12 -4
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/config/environment.js +10 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/parseConfig.js +28 -1
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +10 -0
- package/dist/contracts/analysisViewToolContracts.js +17 -2
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/artifactToolContracts.js +8 -5
- package/dist/contracts/browserToolContracts.js +1 -1
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +10 -10
- package/dist/contracts/javascript/electronToolContracts.js +15 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
- package/dist/contracts/officialToolContracts.js +5 -5
- package/dist/contracts/sessionToolContracts.js +2 -2
- package/dist/contracts/sessionToolSchemas.js +6 -2
- package/dist/contracts/toolContractExamples.js +6 -0
- package/dist/contracts/toolContractTypes.js +3 -0
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +167 -0
- package/dist/contracts/toolOutputSchemaGroups.js +5 -3
- package/dist/contracts/toolSchemaMetadata.js +82 -7
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorPresentation.js +18 -6
- package/dist/domain/analysisErrorProjection.js +4 -1
- package/dist/domain/analysisSnapshot.js +2 -1
- package/dist/domain/analysisView/analysisView.js +52 -2
- package/dist/domain/analysisView/binaryLayoutView.js +2 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/android/androidApplication.js +25 -20
- package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
- package/dist/domain/apple/appleApplication.js +40 -23
- package/dist/domain/apple/appleBundleAnatomy.js +95 -28
- package/dist/domain/apple/dyldPaths.js +9 -1
- package/dist/domain/apple/dylibResolution.js +2 -2
- package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
- package/dist/domain/artifactComparison.js +35 -7
- package/dist/domain/artifactGraph.js +5 -3
- package/dist/domain/artifactIdentity.js +30 -2
- package/dist/domain/artifactInspection.js +3 -43
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +11 -12
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +16 -0
- package/dist/domain/binaryTargetTypes.js +8 -1
- package/dist/domain/browserObservationSchemas.js +8 -4
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/evidence.js +2 -1
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -13
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +70 -40
- package/dist/domain/javascript/electronStaticAnalysisValues.js +16 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +6 -6
- package/dist/domain/javascript/javascriptApplicationGraph.js +79 -18
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +58 -31
- package/dist/domain/javascript/javascriptAstValues.js +32 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -1
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +8 -11
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +190 -33
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +42 -41
- package/dist/domain/javascript/javascriptSemanticGraph.js +69 -23
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -10
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +40 -7
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +341 -87
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +7 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +52 -14
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +27 -29
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +13 -23
- package/dist/domain/javascript/javascriptSemanticState.js +22 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +19 -1
- package/dist/domain/javascript/javascriptSemanticValues.js +47 -19
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +8 -6
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +3 -0
- package/dist/domain/managed/managedApplicationGraph.js +37 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -22
- package/dist/domain/managed/managedArtifact.js +1 -0
- package/dist/domain/managed/managedInspectionEvidence.js +13 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInstruction.js +21 -0
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/peResources.js +94 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureExample.js +24 -0
- package/dist/domain/process/processCaptureValidation.js +79 -0
- package/dist/domain/process/processScenario.js +59 -7
- package/dist/domain/propertyListKeys.js +3 -1
- package/dist/domain/referenceSourceGraph.js +25 -16
- package/dist/domain/referenceSourceImportParsing.js +6 -3
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/webBundleAnalyzerInspection.js +14 -2
- package/dist/domain/webCaptureDiff.js +102 -4
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +7 -13
- package/dist/domain/zipPackageFormat.js +4 -1
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +55 -43
- package/dist/dotnet/ManagedDecodeBudget.js +80 -0
- package/dist/dotnet/ManagedMemberInspector.js +13 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +4 -2
- package/dist/dotnet/ManagedMemberRows.js +9 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
- package/dist/dotnet/ManagedMetadataLayout.js +10 -4
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
- package/dist/dotnet/ManagedPeReader.js +41 -25
- package/dist/dotnet/ManagedReaderFailure.js +2 -1
- package/dist/dotnet/ManagedStaticProvider.js +55 -24
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +43 -13
- package/dist/evm/EvmoleFailures.js +0 -2
- package/dist/evm/EvmoleInterfaceProvider.js +67 -2
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/RegularFile.js +33 -1
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +26 -0
- package/dist/firmware/FirmwareCommand.js +25 -3
- package/dist/firmware/FirmwareFiles.js +23 -8
- package/dist/firmware/FirmwareProvider.js +156 -32
- package/dist/firmware/FirmwarePublication.js +24 -3
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +76 -4
- package/dist/ghidra/GhidraDiagnostics.js +11 -8
- package/dist/ghidra/GhidraFunctionValues.js +26 -2
- package/dist/ghidra/GhidraInstallation.js +1 -1
- package/dist/ghidra/GhidraInventoryValues.js +23 -1
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +80 -39
- package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
- package/dist/ghidra/GhidraMipsProfile.js +79 -0
- package/dist/ghidra/GhidraProvider.js +57 -9
- package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
- package/dist/ghidra/GhidraProviderClient.js +282 -21
- package/dist/ghidra/GhidraSessionValues.js +9 -2
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperClient.js +15 -6
- package/dist/hopper/HopperMachOImage.js +2 -0
- package/dist/hopper/HopperProvider.js +13 -2
- package/dist/ida/IdaOperationRunner.js +8 -2
- package/dist/ida/IdaProvider.js +7 -0
- package/dist/ida/IdaSessionClient.js +3 -1
- package/dist/ida/IdaWorkspace.js +4 -2
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
- package/dist/javascript/recovery/RecoveryFiles.js +18 -7
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +11 -7
- package/dist/javascript/recovery/WakaruProvider.js +139 -16
- package/dist/javascript/recovery/WakaruPublication.js +14 -4
- package/dist/javascript/recovery/WakaruRelease.js +10 -3
- package/dist/javascript/recovery/WakaruReport.js +12 -7
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
- package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
- package/dist/jeb/JebMcpConnection.js +179 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +299 -0
- package/dist/mcpDoctor.js +15 -6
- package/dist/native/AppleDispatchCoverage.js +25 -12
- package/dist/native/AppleDispatchMetadata.js +14 -7
- package/dist/native/AppleMachoFixups.js +71 -15
- package/dist/native/AppleMachoSelection.js +23 -3
- package/dist/native/NativeMacOSProvider.js +91 -16
- package/dist/native/NativeMachoInspection.js +11 -7
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +4 -3
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/DarwinProcessRunTokenReader.js +8 -3
- package/dist/process/OwnedCommand.js +4 -3
- package/dist/process/ProcessOwnership.js +104 -112
- package/dist/process/ProcessOwnershipObservation.js +96 -39
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +4 -3
- package/dist/process/capture/FilesystemSnapshot.js +28 -4
- package/dist/process/capture/ProcessCaptureLifecycle.js +350 -59
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessHarness.js +194 -26
- package/dist/process/capture/ProcessNormalization.js +3 -1
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
- package/dist/process/capture/TerminalRenderer.js +24 -7
- package/dist/reference/ReferenceSourceReader.js +22 -5
- package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
- package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
- package/dist/reference/ReferenceSourceReaderFile.js +50 -10
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
- package/dist/server/EvidenceMcpServer.js +36 -1
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +97 -25
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +4 -9
- package/dist/server/registerAndroidTools.js +3 -12
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +12 -9
- package/dist/server/registerBundleComparisonTool.js +16 -2
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerElectronTools.js +28 -10
- package/dist/server/registerEvmTools.js +4 -9
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFunctionComparisonTool.js +5 -2
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerSessionRecordTools.js +2 -1
- package/dist/server/registerSessionTools.js +49 -18
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +4 -9
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/toolResult.js +21 -2
- package/dist/windows/WindowsPrivateRuntime.js +12 -5
- package/install.sh +7 -4
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +33 -5
- package/scripts/rea.mjs +16 -1
- package/skills/reverse-engineer-anything/SKILL.md +52 -51
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +22 -1
|
@@ -1,48 +1,185 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { setImmediate } from "node:timers/promises";
|
|
3
3
|
import { resolveJavaScriptSourceMapReference } from "../../domain/javascript/javascriptSourceMapPaths.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { analyzeParsedJavaScriptStaticSourceSteps } from "../../domain/javascript/javascriptStaticAnalysis.js";
|
|
5
|
+
import { analyzeParsedJavaScriptSemanticsSteps, classifyParsedJavaScriptOpenReceiversSteps, } from "../../domain/javascript/javascriptSemanticAnalysis.js";
|
|
6
|
+
import { projectJavaScriptModuleSemantics } from "../../domain/javascript/javascriptModuleSemanticIr.js";
|
|
6
7
|
import { parseJavaScriptSource } from "../../domain/javascript/javascriptSourceParser.js";
|
|
7
8
|
import { hasValidSourceMapContents } from "../../domain/sourceMapContents.js";
|
|
8
9
|
import { flattenSourceMapLeaves } from "../../domain/sourceMapEnvelope.js";
|
|
9
10
|
import { failedJavaScriptStaticAnalysis } from "../../domain/javascript/javascriptStaticAnalysisHelpers.js";
|
|
10
11
|
import { analyzeJavaScriptJsonModule } from "./JavaScriptJsonModules.js";
|
|
12
|
+
import { completeJavaScriptAnalysisSteps } from "./JavaScriptAnalysisControl.js";
|
|
11
13
|
import { htmlArtifactReferences } from "../../domain/javascript/htmlArtifactReferences.js";
|
|
14
|
+
import { AnalysisError } from "../../domain/analysisErrorBase.js";
|
|
15
|
+
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
|
16
|
+
import { AnalysisCancelledError, AnalysisResourceConstraintError, AnalysisTimeoutError, } from "../../domain/analysisErrorCore.js";
|
|
12
17
|
/** Analyze every text source from the artifact without a result quota. */
|
|
13
|
-
export const analyzeJavaScriptArtifactFiles = (fileSet) => analyzeArtifactFiles(fileSet, (_file, ir)
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
export const analyzeJavaScriptArtifactFiles = (fileSet) => analyzeArtifactFiles(fileSet, function* (_file, ir) {
|
|
19
|
+
// The full IR needs no projection; one step keeps the shared protocol.
|
|
20
|
+
yield;
|
|
21
|
+
return ir;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Project each file's full IR immediately, retaining only later module facts.
|
|
25
|
+
* Parsing, analysis and each projection pass run as separate steps, so control
|
|
26
|
+
* messages and cancellation are handled within one large file as well.
|
|
27
|
+
*/
|
|
28
|
+
export const analyzeAndProjectJavaScriptArtifactFiles = async (fileSet, projectSemantics, beforeFile, signal) => {
|
|
16
29
|
const state = emptyArtifactAnalysis();
|
|
17
|
-
const projectFileSemantics = (file, ir)
|
|
18
|
-
projectSemantics(file, ir);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
scopes: programScopes,
|
|
25
|
-
bindings: ir.bindings.filter(({ name, scopeId }) => scopeId === programScopeId && localNames.has(name)),
|
|
26
|
-
callables: ir.callables.filter(({ callableId }) => callableIds.has(callableId)),
|
|
27
|
-
moduleLinks: ir.moduleLinks,
|
|
28
|
-
coverage: ir.coverage,
|
|
29
|
-
limitations: ir.limitations,
|
|
30
|
-
};
|
|
30
|
+
const projectFileSemantics = function* (file, ir) {
|
|
31
|
+
const projection = projectSemantics(file, ir);
|
|
32
|
+
if (projection !== undefined)
|
|
33
|
+
while (projection.next().done !== true)
|
|
34
|
+
yield;
|
|
35
|
+
return projectJavaScriptModuleSemantics(ir);
|
|
31
36
|
};
|
|
32
37
|
const context = { state, projectSemantics: projectFileSemantics };
|
|
33
38
|
for (const [index, file] of fileSet.files.entries()) {
|
|
34
39
|
// Let progress, cancellation and garbage collection run between files.
|
|
35
40
|
await setImmediate();
|
|
36
41
|
await beforeFile?.(file, index, fileSet.files.length);
|
|
37
|
-
|
|
42
|
+
await completeJavaScriptAnalysisSteps(analyzeArtifactFileSteps(file, context), signal);
|
|
38
43
|
}
|
|
39
44
|
return finalizeArtifactAnalysis(state);
|
|
40
45
|
};
|
|
46
|
+
/** Analyze sources behind a hard heap boundary, retaining collected facts on interruption. */
|
|
47
|
+
export const analyzeAndAdoptJavaScriptArtifactFiles = async (fileSet, worker, projection, beforeFile, signal) => {
|
|
48
|
+
const state = emptyArtifactAnalysis();
|
|
49
|
+
let interruption = null;
|
|
50
|
+
for (const [index, file] of fileSet.files.entries()) {
|
|
51
|
+
try {
|
|
52
|
+
await setImmediate();
|
|
53
|
+
await beforeFile(file, index, fileSet.files.length);
|
|
54
|
+
if (signal?.aborted === true)
|
|
55
|
+
throw new AnalysisCancelledError("analyze_javascript_application");
|
|
56
|
+
if (file.kind !== "javascript" || !file.text.included) {
|
|
57
|
+
const steps = analyzeArtifactFileSteps(file, {
|
|
58
|
+
state,
|
|
59
|
+
projectSemantics: function* (_file, ir) {
|
|
60
|
+
yield;
|
|
61
|
+
return projectJavaScriptModuleSemantics(ir);
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
await completeJavaScriptAnalysisSteps(steps, signal);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const result = await worker.analyze(file, projection.remainingFileNodeBudget(), signal);
|
|
68
|
+
const facts = result.ok ? result.value : result.error;
|
|
69
|
+
const applicationProjectionFailure = facts.applicationProjectionFailure;
|
|
70
|
+
if (facts.projection !== null)
|
|
71
|
+
projection.adoptFileProjection(facts.projection);
|
|
72
|
+
const error = result.ok ? null : result.error.error;
|
|
73
|
+
const limits = error instanceof AnalysisResourceConstraintError
|
|
74
|
+
? error.reportedLimits
|
|
75
|
+
: error instanceof AnalysisTimeoutError
|
|
76
|
+
? { worker_timeout_ms: error.timeoutMs }
|
|
77
|
+
: null;
|
|
78
|
+
const failure = error === null
|
|
79
|
+
? undefined
|
|
80
|
+
: {
|
|
81
|
+
reason: `${file.path}: ${error.message}`,
|
|
82
|
+
error: projectAnalysisError(error),
|
|
83
|
+
limits,
|
|
84
|
+
};
|
|
85
|
+
state.files.push({
|
|
86
|
+
file,
|
|
87
|
+
javascript: facts.javascript,
|
|
88
|
+
semantic: facts.module === null ? null : { ir: facts.module },
|
|
89
|
+
...(failure === undefined ? {} : { analysis_failure: failure }),
|
|
90
|
+
...(applicationProjectionFailure === undefined
|
|
91
|
+
? {}
|
|
92
|
+
: {
|
|
93
|
+
application_projection_failure: {
|
|
94
|
+
reason: applicationProjectionFailure.message,
|
|
95
|
+
error: projectAnalysisError(applicationProjectionFailure),
|
|
96
|
+
limits: applicationProjectionFailure.reportedLimits,
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
});
|
|
100
|
+
if (failure !== undefined && facts.projection === null)
|
|
101
|
+
projection.recordUnavailableFile(file, failure.reason, failure.limits, error instanceof AnalysisResourceConstraintError ||
|
|
102
|
+
error instanceof AnalysisTimeoutError
|
|
103
|
+
? "resource-limit"
|
|
104
|
+
: "incomplete-module");
|
|
105
|
+
if (facts.javascript !== null) {
|
|
106
|
+
state.visitedNodes += facts.javascript.visited_ast_nodes;
|
|
107
|
+
state.findings +=
|
|
108
|
+
findingCount(facts.javascript) +
|
|
109
|
+
(facts.module?.moduleLinks.length ?? 0);
|
|
110
|
+
state.modules += facts.javascript.bundler_registrations.reduce((count, item) => count + item.modules.length, 0);
|
|
111
|
+
if (facts.javascript.parse_status === "failed")
|
|
112
|
+
state.parseFailures += 1;
|
|
113
|
+
}
|
|
114
|
+
if (error !== null &&
|
|
115
|
+
(!(error instanceof AnalysisResourceConstraintError) ||
|
|
116
|
+
error.reportedLimits?.parent_result_budget_exhausted === true)) {
|
|
117
|
+
interruption = error;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (cause) {
|
|
122
|
+
if (signal?.aborted !== true && !(cause instanceof AnalysisError))
|
|
123
|
+
throw cause;
|
|
124
|
+
interruption =
|
|
125
|
+
signal?.aborted === true
|
|
126
|
+
? new AnalysisCancelledError("analyze_javascript_application")
|
|
127
|
+
: cause instanceof AnalysisError
|
|
128
|
+
? cause
|
|
129
|
+
: null;
|
|
130
|
+
if (interruption !== null) {
|
|
131
|
+
state.files.push({
|
|
132
|
+
file,
|
|
133
|
+
javascript: null,
|
|
134
|
+
semantic: null,
|
|
135
|
+
analysis_failure: {
|
|
136
|
+
reason: `${file.path}: ${interruption.message}`,
|
|
137
|
+
error: projectAnalysisError(interruption),
|
|
138
|
+
limits: null,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
projection.recordUnavailableFile(file, interruption.message, null, "incomplete-module");
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (interruption !== null) {
|
|
147
|
+
const analyzedPaths = new Set(state.files.map(({ file }) => file.path));
|
|
148
|
+
const failure = {
|
|
149
|
+
reason: `Source analysis was interrupted: ${interruption.message}`,
|
|
150
|
+
error: projectAnalysisError(interruption),
|
|
151
|
+
limits: interruption instanceof AnalysisResourceConstraintError
|
|
152
|
+
? interruption.reportedLimits
|
|
153
|
+
: interruption instanceof AnalysisTimeoutError
|
|
154
|
+
? { worker_timeout_ms: interruption.timeoutMs }
|
|
155
|
+
: null,
|
|
156
|
+
};
|
|
157
|
+
for (const file of fileSet.files) {
|
|
158
|
+
if (analyzedPaths.has(file.path))
|
|
159
|
+
continue;
|
|
160
|
+
state.files.push({
|
|
161
|
+
file,
|
|
162
|
+
javascript: null,
|
|
163
|
+
semantic: null,
|
|
164
|
+
analysis_failure: failure,
|
|
165
|
+
});
|
|
166
|
+
if (file.kind === "javascript")
|
|
167
|
+
projection.recordUnavailableFile(file, failure.reason, failure.limits, interruption instanceof AnalysisResourceConstraintError ||
|
|
168
|
+
interruption instanceof AnalysisTimeoutError
|
|
169
|
+
? "resource-limit"
|
|
170
|
+
: "incomplete-module");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return { analysis: finalizeArtifactAnalysis(state), interruption };
|
|
174
|
+
};
|
|
41
175
|
const analyzeArtifactFiles = (fileSet, projectSemantics) => {
|
|
42
176
|
const state = emptyArtifactAnalysis();
|
|
43
177
|
const context = { state, projectSemantics };
|
|
44
|
-
for (const file of fileSet.files)
|
|
45
|
-
|
|
178
|
+
for (const file of fileSet.files) {
|
|
179
|
+
const steps = analyzeArtifactFileSteps(file, context);
|
|
180
|
+
while (steps.next().done !== true)
|
|
181
|
+
;
|
|
182
|
+
}
|
|
46
183
|
return finalizeArtifactAnalysis(state);
|
|
47
184
|
};
|
|
48
185
|
const finalizeArtifactAnalysis = (state) => {
|
|
@@ -59,10 +196,11 @@ const finalizeArtifactAnalysis = (state) => {
|
|
|
59
196
|
limitations: [
|
|
60
197
|
"JavaScript and HTML were parsed as inert text; bundle bootstrap code was never executed.",
|
|
61
198
|
"Static paths and relationships may remain unresolved when expressions are dynamic or obfuscated.",
|
|
199
|
+
...state.files.flatMap(({ analysis_failure, application_projection_failure }) => [analysis_failure, application_projection_failure].flatMap((failure) => (failure === undefined ? [] : [failure.reason]))),
|
|
62
200
|
],
|
|
63
201
|
};
|
|
64
202
|
};
|
|
65
|
-
|
|
203
|
+
function* analyzeArtifactFileSteps(file, context) {
|
|
66
204
|
const { state } = context;
|
|
67
205
|
addStructuredObservations(file, state);
|
|
68
206
|
if (file.kind === "html" && file.text.included)
|
|
@@ -74,31 +212,34 @@ const analyzeArtifactFile = (file, context) => {
|
|
|
74
212
|
return;
|
|
75
213
|
}
|
|
76
214
|
const parsed = parseJavaScriptSource(file.text.value, file.path);
|
|
215
|
+
yield;
|
|
77
216
|
if (parsed === null) {
|
|
78
217
|
const analysis = failedJavaScriptStaticAnalysis();
|
|
79
218
|
state.files.push({ file, javascript: analysis, semantic: null });
|
|
80
219
|
state.parseFailures += 1;
|
|
81
220
|
return;
|
|
82
221
|
}
|
|
83
|
-
const openReceiverFacts =
|
|
84
|
-
const analysis =
|
|
222
|
+
const openReceiverFacts = yield* classifyParsedJavaScriptOpenReceiversSteps(parsed);
|
|
223
|
+
const analysis = yield* analyzeParsedJavaScriptStaticSourceSteps(file.text.value, parsed, openReceiverFacts);
|
|
85
224
|
const staticFindings = findingCount(analysis);
|
|
225
|
+
yield;
|
|
86
226
|
const semantics = analysis.parse_status === "complete" || analysis.parse_status === "partial"
|
|
87
|
-
?
|
|
227
|
+
? yield* analyzeParsedJavaScriptSemanticsSteps(parsed)
|
|
88
228
|
: null;
|
|
229
|
+
const projected = semantics === null
|
|
230
|
+
? null
|
|
231
|
+
: yield* context.projectSemantics(file, semantics);
|
|
89
232
|
state.files.push({
|
|
90
233
|
file,
|
|
91
234
|
javascript: analysis,
|
|
92
|
-
semantic:
|
|
93
|
-
? null
|
|
94
|
-
: { ir: context.projectSemantics(file, semantics) },
|
|
235
|
+
semantic: projected === null ? null : { ir: projected },
|
|
95
236
|
});
|
|
96
237
|
state.visitedNodes += analysis.visited_ast_nodes;
|
|
97
238
|
state.findings += staticFindings + (semantics?.moduleLinks.length ?? 0);
|
|
98
239
|
state.modules += analysis.bundler_registrations.reduce((count, registration) => count + registration.modules.length, 0);
|
|
99
240
|
if (analysis.parse_status === "failed")
|
|
100
241
|
state.parseFailures += 1;
|
|
101
|
-
}
|
|
242
|
+
}
|
|
102
243
|
const addSourceMap = (file, context) => {
|
|
103
244
|
const sourceMap = parseSourceMap(file);
|
|
104
245
|
context.state.sourceMaps.push(sourceMap);
|
|
@@ -3,7 +3,7 @@ import { createJavaScriptApplicationEdge, createJavaScriptApplicationNode, } fro
|
|
|
3
3
|
export class JavaScriptArtifactGraphAccumulator {
|
|
4
4
|
#nodes = new Map();
|
|
5
5
|
#edges = new Map();
|
|
6
|
-
/** Create or merge one canonical node. */
|
|
6
|
+
/** Create or merge one canonical node, retaining a stable live construction reference. */
|
|
7
7
|
addNode(input) {
|
|
8
8
|
const created = createJavaScriptApplicationNode(displayableNode(input));
|
|
9
9
|
const existing = this.#nodes.get(created.node_id);
|
|
@@ -13,18 +13,20 @@ export class JavaScriptArtifactGraphAccumulator {
|
|
|
13
13
|
}
|
|
14
14
|
const bySemanticId = new Map([...existing.observations, ...created.observations].map((observation) => [
|
|
15
15
|
observation.observation_id,
|
|
16
|
-
|
|
16
|
+
observation,
|
|
17
17
|
]));
|
|
18
|
-
const observations = [...bySemanticId.
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const observations = [...bySemanticId.values()].sort((left, right) => left.observation_id < right.observation_id
|
|
19
|
+
? -1
|
|
20
|
+
: left.observation_id > right.observation_id
|
|
21
|
+
? 1
|
|
22
|
+
: 0);
|
|
23
|
+
// Both factories already validated and identified these observations.
|
|
24
|
+
// Replacing the node retained every previous observation array through
|
|
25
|
+
// path/chunk/IPC indexes when multiple paths shared an entity identity.
|
|
26
|
+
existing.observations.length = 0;
|
|
27
|
+
for (const observation of observations)
|
|
28
|
+
existing.observations.push(observation);
|
|
29
|
+
return existing;
|
|
28
30
|
}
|
|
29
31
|
/** Create or replace one canonical edge by semantic identifier. */
|
|
30
32
|
addEdge(input) {
|
|
@@ -41,10 +43,6 @@ export class JavaScriptArtifactGraphAccumulator {
|
|
|
41
43
|
return [...this.#edges.values()];
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
const observationInput = (observation) => {
|
|
45
|
-
const { observation_id: _observationId, identifier_strategy: _strategy, ...input } = observation;
|
|
46
|
-
return input;
|
|
47
|
-
};
|
|
48
46
|
/**
|
|
49
47
|
* Static findings can carry legal empty strings, such as `fetch("")`,
|
|
50
48
|
* `require("")`, or a source map's `sources: [""]`. Labels must be nonempty,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ELECTRON_IDENTITY_LIMITATION } from "../../domain/javascript/javascriptElectronMemberWrites.js";
|
|
2
|
+
import { createJavaScriptApplicationGraph, sealTransferredJavaScriptApplicationGraphSteps, } from "../../domain/javascript/javascriptApplicationGraph.js";
|
|
2
3
|
import { JavaScriptArtifactGraphAccumulator } from "./JavaScriptArtifactGraphAccumulator.js";
|
|
3
4
|
import { selfReferenceOmissions, } from "./JavaScriptArtifactGraphContext.js";
|
|
4
5
|
import { addJavaScriptHtmlRoles, addJavaScriptSourceMapOriginals, } from "./JavaScriptArtifactGraphDocuments.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { addJavaScriptStaticFindingsSteps } from "./JavaScriptArtifactGraphFindings.js";
|
|
7
|
+
import { addJavaScriptModuleRelationshipsSteps, addJavaScriptSourceModules, } from "./JavaScriptModuleRelationships.js";
|
|
7
8
|
import { completeApplicationCoverage, partialApplicationCoverage, } from "../../domain/javascript/javascriptApplicationEvidenceSchemas.js";
|
|
8
9
|
import { semanticCoverageResourceLimits, semanticResourceLimitCoverage, } from "../../domain/javascript/javascriptSemanticCoverage.js";
|
|
9
10
|
import { semanticResourceLimitReason } from "../../domain/javascript/javascriptSemanticResourceLimits.js";
|
|
@@ -12,10 +13,25 @@ import { addJavaScriptBundlerNodes } from "./JavaScriptArtifactGraphBundlers.js"
|
|
|
12
13
|
import { addElectronBoundaries } from "./ElectronBoundaryGraph.js";
|
|
13
14
|
import { classifyElectronIpcPairings, collectElectronIpcRecords, } from "./ElectronBoundaryAnalysis.js";
|
|
14
15
|
/** Project artifact and AST facts into JavaScript Application Graph. */
|
|
15
|
-
export const buildJavaScriptArtifactGraph = (snapshot, fileSet, analysis) => createJavaScriptApplicationGraph(
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export const buildJavaScriptArtifactGraph = (snapshot, fileSet, analysis) => createJavaScriptApplicationGraph(completeSynchronously(buildJavaScriptArtifactGraphInputSteps(snapshot, fileSet, analysis)));
|
|
17
|
+
/**
|
|
18
|
+
* Build a validated application graph with cooperative immutable ownership.
|
|
19
|
+
* Constructing the graph input also runs in steps: projecting every module
|
|
20
|
+
* relationship and finding at once held the event loop for seconds.
|
|
21
|
+
*/
|
|
22
|
+
export function* buildImmutableJavaScriptArtifactGraphSteps(snapshot, fileSet, analysis) {
|
|
23
|
+
const input = yield* buildJavaScriptArtifactGraphInputSteps(snapshot, fileSet, analysis);
|
|
24
|
+
// The input was built here and is not retained, so it can be transferred.
|
|
25
|
+
return yield* sealTransferredJavaScriptApplicationGraphSteps(input);
|
|
26
|
+
}
|
|
27
|
+
const completeSynchronously = (steps) => {
|
|
28
|
+
for (;;) {
|
|
29
|
+
const step = steps.next();
|
|
30
|
+
if (step.done === true)
|
|
31
|
+
return step.value;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function* buildJavaScriptArtifactGraphInputSteps(snapshot, fileSet, analysis) {
|
|
19
35
|
const accumulator = new JavaScriptArtifactGraphAccumulator();
|
|
20
36
|
const root = createJavaScriptArtifactRootNode(accumulator, snapshot);
|
|
21
37
|
const context = {
|
|
@@ -33,15 +49,33 @@ const buildJavaScriptArtifactGraphInput = (snapshot, fileSet, analysis) => {
|
|
|
33
49
|
containerNodes: new Map([[snapshot.manifest.root_sha256, root]]),
|
|
34
50
|
};
|
|
35
51
|
addJavaScriptArtifactContainers(context);
|
|
52
|
+
yield;
|
|
36
53
|
addJavaScriptArtifactFiles(context);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
yield;
|
|
55
|
+
// Raw observations remain on the file nodes. Only admitted expansions feed
|
|
56
|
+
// the relationship builders, including their Electron and bundler callers.
|
|
57
|
+
const projectionContext = {
|
|
58
|
+
...context,
|
|
59
|
+
analysis: {
|
|
60
|
+
...analysis,
|
|
61
|
+
files: analysis.files.map((file) => file.application_projection_failure === undefined
|
|
62
|
+
? file
|
|
63
|
+
: { ...file, javascript: null, semantic: null }),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const packageRoots = addJavaScriptPackageNodes(projectionContext);
|
|
67
|
+
yield;
|
|
68
|
+
addJavaScriptSourceModules(projectionContext);
|
|
69
|
+
yield;
|
|
70
|
+
const bundlerLimitations = addJavaScriptBundlerNodes(projectionContext);
|
|
71
|
+
const relationshipOmissions = yield* addJavaScriptModuleRelationshipsSteps(projectionContext);
|
|
72
|
+
const findingLimitations = yield* addJavaScriptStaticFindingsSteps(projectionContext);
|
|
73
|
+
addElectronBoundaries(projectionContext);
|
|
74
|
+
yield;
|
|
75
|
+
addJavaScriptHtmlRoles(projectionContext);
|
|
76
|
+
yield;
|
|
77
|
+
addJavaScriptSourceMapOriginals(projectionContext);
|
|
78
|
+
yield;
|
|
45
79
|
const coverage = graphCoverage(context);
|
|
46
80
|
return {
|
|
47
81
|
schema: "JavaScriptApplicationGraph",
|
|
@@ -57,7 +91,7 @@ const buildJavaScriptArtifactGraphInput = (snapshot, fileSet, analysis) => {
|
|
|
57
91
|
...graphLimitations(context, coverage.status, relationshipOmissions),
|
|
58
92
|
],
|
|
59
93
|
};
|
|
60
|
-
}
|
|
94
|
+
}
|
|
61
95
|
const graphCoverage = (context) => {
|
|
62
96
|
const resourceLimits = semanticResourceLimits(context);
|
|
63
97
|
const sourceMapPolicyGap = context.analysis.source_maps.some(({ status }) => status === "invalid");
|
|
@@ -65,13 +99,23 @@ const graphCoverage = (context) => {
|
|
|
65
99
|
context.analysis.json_modules.some(({ status }) => status !== "included") ||
|
|
66
100
|
context.analysis.source_maps.some(({ status }) => status === "invalid");
|
|
67
101
|
const partialJavaScript = context.analysis.files.some(({ javascript }) => javascript !== null && javascript.parse_status === "partial");
|
|
68
|
-
const unknownGap = context.analysis.
|
|
102
|
+
const unknownGap = context.analysis.files.some(({ analysis_failure, application_projection_failure }) => analysis_failure !== undefined ||
|
|
103
|
+
application_projection_failure !== undefined) ||
|
|
104
|
+
context.analysis.parse_failures > 0 ||
|
|
69
105
|
context.fileSet.invalid_utf8_files > 0 ||
|
|
70
106
|
sourceMapPolicyGap ||
|
|
71
107
|
malformedStructuredData ||
|
|
72
108
|
partialJavaScript;
|
|
73
|
-
|
|
74
|
-
|
|
109
|
+
const executionLimits = context.analysis.files.flatMap(({ analysis_failure, application_projection_failure }) => [analysis_failure, application_projection_failure].flatMap((failure) => failure === undefined
|
|
110
|
+
? []
|
|
111
|
+
: javaScriptAnalysisCoverageLimits(failure.limits)));
|
|
112
|
+
if (resourceLimits.length > 0 || executionLimits.length > 0)
|
|
113
|
+
return partialApplicationCoverage([
|
|
114
|
+
...new Map([
|
|
115
|
+
...semanticResourceLimitCoverage(resourceLimits),
|
|
116
|
+
...executionLimits,
|
|
117
|
+
].map((limit) => [JSON.stringify(limit), limit])).values(),
|
|
118
|
+
], null);
|
|
75
119
|
if (unknownGap)
|
|
76
120
|
return partialApplicationCoverage([], null);
|
|
77
121
|
if (context.snapshot.integrity_contradictions.length > 0) {
|
|
@@ -104,6 +148,9 @@ const graphLimitations = (context, coverage, relationshipOmissions) => {
|
|
|
104
148
|
"CommonJS and ESM binding relationships were recovered from inert syntax and resolved only within the inventoried artifact container.",
|
|
105
149
|
"Webpack/Rspack factories were recovered from AST literals; REA did not invoke push handlers or bundle bootstrap code.",
|
|
106
150
|
"Static imports, entrypoints, workers, endpoints, and storage relationships do not prove runtime execution.",
|
|
151
|
+
...(context.analysis.files.some(({ javascript }) => javascript?.limitations.includes(ELECTRON_IDENTITY_LIMITATION))
|
|
152
|
+
? [ELECTRON_IDENTITY_LIMITATION]
|
|
153
|
+
: []),
|
|
107
154
|
...(electronFindings === 0
|
|
108
155
|
? []
|
|
109
156
|
: [
|
|
@@ -137,3 +184,4 @@ const graphLimitations = (context, coverage, relationshipOmissions) => {
|
|
|
137
184
|
]),
|
|
138
185
|
];
|
|
139
186
|
};
|
|
187
|
+
import { javaScriptAnalysisCoverageLimits } from "../../domain/javascript/javascriptAnalysisResourceControls.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { compositeKey } from "../../domain/unicodeCodePointOrder.js";
|
|
1
2
|
import { addAstContainsEdge, artifactLocalIdentity, chunkLookupKey, javascriptAnalysisCoverage, moduleLookupKey, selfReferenceOmissions, } from "./JavaScriptArtifactGraphContext.js";
|
|
2
3
|
import { astObservationEvidence, staticInferenceEvidence, } from "./JavaScriptArtifactGraphEvidence.js";
|
|
3
4
|
/** Project Webpack/Rspack AST literals and disclose unrepresentable relationships. */
|
|
@@ -41,7 +42,7 @@ const createBundlerChunkNode = (context, input) => {
|
|
|
41
42
|
const chunkKey = `${registration.runtime}:${registration.chunk_keys.join(",")}`;
|
|
42
43
|
return context.accumulator.addNode({
|
|
43
44
|
kind: "javascript-chunk",
|
|
44
|
-
identity: artifactLocalIdentity(file.sha256, "bundler-chunk",
|
|
45
|
+
identity: artifactLocalIdentity(file.sha256, "bundler-chunk", compositeKey([registration.runtime, registration.chunk_keys])),
|
|
45
46
|
observations: [
|
|
46
47
|
{
|
|
47
48
|
label: chunkKey,
|
|
@@ -104,7 +105,7 @@ const addBundlerModuleNodes = (context, input) => {
|
|
|
104
105
|
},
|
|
105
106
|
],
|
|
106
107
|
});
|
|
107
|
-
context.moduleNodes.set(moduleLookupKey(file.path, moduleValue.module_key), module);
|
|
108
|
+
context.moduleNodes.set(moduleLookupKey(file.path, registration.runtime, moduleValue.module_key), module);
|
|
108
109
|
addAstContainsEdge(context, {
|
|
109
110
|
source: chunk,
|
|
110
111
|
target: module,
|
|
@@ -124,7 +125,7 @@ const addBundlerRuntimeEdges = (context, record) => {
|
|
|
124
125
|
let selfAsyncChunks = 0;
|
|
125
126
|
const { file, registration, chunk, coverage } = record;
|
|
126
127
|
for (const moduleKey of registration.entry_module_keys) {
|
|
127
|
-
const resolved = context.moduleNodes.get(moduleLookupKey(file.path, moduleKey));
|
|
128
|
+
const resolved = context.moduleNodes.get(moduleLookupKey(file.path, registration.runtime, moduleKey));
|
|
128
129
|
const target = resolved ?? unresolvedBundlerModuleNode(context, record, moduleKey);
|
|
129
130
|
context.accumulator.addEdge({
|
|
130
131
|
source_node_id: chunk.node_id,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { compositeKey } from "../../domain/unicodeCodePointOrder.js";
|
|
1
2
|
import { completeApplicationCoverage, partialApplicationCoverage, } from "../../domain/javascript/javascriptApplicationEvidenceSchemas.js";
|
|
2
3
|
import { JavaScriptArtifactGraphAccumulator } from "./JavaScriptArtifactGraphAccumulator.js";
|
|
3
4
|
import { artifactObservationEvidence, astObservationEvidence, staticInferenceEvidence, unavailableAstEvidence, } from "./JavaScriptArtifactGraphEvidence.js";
|
|
@@ -63,12 +64,15 @@ export const addUnavailableStaticParseScope = (context, input) => {
|
|
|
63
64
|
path: input.file.path,
|
|
64
65
|
operation: input.operation,
|
|
65
66
|
limitation: input.limitation,
|
|
67
|
+
...(input.failure === undefined
|
|
68
|
+
? {}
|
|
69
|
+
: { analysis_failure: input.failure }),
|
|
66
70
|
},
|
|
67
71
|
evidence: unavailableAstEvidence({
|
|
68
72
|
sha256: input.file.sha256,
|
|
69
73
|
path: input.file.path,
|
|
70
74
|
operation: input.operation,
|
|
71
|
-
coverage: partialApplicationCoverage([], null),
|
|
75
|
+
coverage: partialApplicationCoverage(input.limits ?? [], null),
|
|
72
76
|
limitation: input.limitation,
|
|
73
77
|
}),
|
|
74
78
|
},
|
|
@@ -171,9 +175,9 @@ export const selfReferenceOmissions = (count, noun, owner) => count === 0
|
|
|
171
175
|
`${String(count)} ${count === 1 ? noun[0] : noun[1]} resolved back to ${owner} itself and ${count === 1 ? "was" : "were"} omitted; application graph edges cannot be self-referential.`,
|
|
172
176
|
];
|
|
173
177
|
/** Deterministic key for one recovered module inside a bundle asset. */
|
|
174
|
-
export const moduleLookupKey = (path, moduleKey) =>
|
|
178
|
+
export const moduleLookupKey = (path, runtime, moduleKey) => compositeKey([path, runtime, moduleKey]);
|
|
175
179
|
/** Deterministic key for one recovered bundler chunk inside a bundle asset. */
|
|
176
|
-
export const chunkLookupKey = (path, runtime, chunkKey) =>
|
|
180
|
+
export const chunkLookupKey = (path, runtime, chunkKey) => compositeKey([path, runtime, chunkKey]);
|
|
177
181
|
/** Resolve a relative static specifier without escaping the artifact root. */
|
|
178
182
|
export const resolveArtifactPath = (specifier, sourcePath, files, moduleKind) => resolveArtifactPathByContext({
|
|
179
183
|
declaredPath: specifier,
|
|
@@ -183,6 +187,8 @@ export const resolveArtifactPath = (specifier, sourcePath, files, moduleKind) =>
|
|
|
183
187
|
...(moduleKind === undefined ? {} : { moduleKind }),
|
|
184
188
|
}).resolved_path;
|
|
185
189
|
/** Locate the recovered module that owns a static finding. */
|
|
186
|
-
export const sourceNodeFor = (context, path, moduleKey) => moduleKey === null
|
|
190
|
+
export const sourceNodeFor = (context, path, moduleKey, runtime) => moduleKey === null
|
|
187
191
|
? context.sourceModuleNodes.get(path)
|
|
188
|
-
:
|
|
192
|
+
: runtime === undefined
|
|
193
|
+
? undefined
|
|
194
|
+
: context.moduleNodes.get(moduleLookupKey(path, runtime, moduleKey));
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { compactStringIdentityKey } from "../../domain/compactStringIdentity.js";
|
|
2
3
|
import { addStaticInferenceEdge, artifactLocalIdentity, chunkLookupKey, createElectronRoleNode, javascriptAnalysisCoverage, linkElectronRoleToAsset, moduleLookupKey, resolveArtifactPath, selfReferenceOmissions, sourceNodeFor, } from "./JavaScriptArtifactGraphContext.js";
|
|
3
4
|
import { astObservationEvidence, staticInferenceEvidence, } from "./JavaScriptArtifactGraphEvidence.js";
|
|
4
5
|
import { resolveArtifactPathByContext } from "./JavaScriptArtifactPathResolution.js";
|
|
5
6
|
/** Project imports, workers, roles, endpoints, storage, and source-map links. */
|
|
6
|
-
export
|
|
7
|
+
export function* addJavaScriptStaticFindingsSteps(context) {
|
|
7
8
|
const omissions = { selfReferences: 0 };
|
|
8
9
|
for (const analyzed of context.analysis.files) {
|
|
10
|
+
yield;
|
|
9
11
|
const { file, javascript } = analyzed;
|
|
10
12
|
const asset = context.assetNodes.get(file.path);
|
|
11
13
|
if (javascript === null || asset === undefined)
|
|
@@ -23,10 +25,9 @@ export const addJavaScriptStaticFindings = (context) => {
|
|
|
23
25
|
addSourceMapEdge(context, { file, asset, value, coverage });
|
|
24
26
|
}
|
|
25
27
|
return selfReferenceOmissions(omissions.selfReferences, ["static reference", "static references"], "the referencing module");
|
|
26
|
-
}
|
|
28
|
+
}
|
|
27
29
|
const addReference = (context, input, omissions) => {
|
|
28
|
-
const source = sourceNodeFor(context, input.file.path, input.value.module_key) ??
|
|
29
|
-
input.asset;
|
|
30
|
+
const source = sourceNodeFor(context, input.file.path, input.value.module_key, input.value.module_runtime) ?? input.asset;
|
|
30
31
|
const resolved = input.value.specifier === null
|
|
31
32
|
? null
|
|
32
33
|
: resolveReference(context, input.file.path, input.value);
|
|
@@ -98,14 +99,15 @@ const addReference = (context, input, omissions) => {
|
|
|
98
99
|
});
|
|
99
100
|
};
|
|
100
101
|
const addEndpoint = (context, input) => {
|
|
101
|
-
const source = sourceNodeFor(context, input.file.path, input.value.module_key) ??
|
|
102
|
-
|
|
102
|
+
const source = sourceNodeFor(context, input.file.path, input.value.module_key, input.value.module_runtime) ?? input.asset;
|
|
103
|
+
const key = compactStringIdentityKey(input.value.value);
|
|
104
|
+
const label = `${input.value.kind} endpoint`;
|
|
103
105
|
const node = context.accumulator.addNode({
|
|
104
106
|
kind: "endpoint",
|
|
105
|
-
identity: artifactLocalIdentity(input.file.sha256, input.value.kind,
|
|
107
|
+
identity: artifactLocalIdentity(input.file.sha256, input.value.kind, key),
|
|
106
108
|
observations: [
|
|
107
109
|
{
|
|
108
|
-
label: input.value.value,
|
|
110
|
+
label: input.value.value.length <= label.length ? input.value.value : label,
|
|
109
111
|
properties: {
|
|
110
112
|
endpoint_kind: input.value.kind,
|
|
111
113
|
value: input.value.value,
|
|
@@ -132,8 +134,7 @@ const addEndpoint = (context, input) => {
|
|
|
132
134
|
});
|
|
133
135
|
};
|
|
134
136
|
const addStorage = (context, input) => {
|
|
135
|
-
const source = sourceNodeFor(context, input.file.path, input.value.module_key) ??
|
|
136
|
-
input.asset;
|
|
137
|
+
const source = sourceNodeFor(context, input.file.path, input.value.module_key, input.value.module_runtime) ?? input.asset;
|
|
137
138
|
const node = context.accumulator.addNode({
|
|
138
139
|
kind: "storage",
|
|
139
140
|
identity: artifactLocalIdentity(input.file.sha256, input.value.kind, input.value.name ?? input.value.mechanism),
|
|
@@ -180,8 +181,7 @@ const addDiscoveredRole = (context, input) => {
|
|
|
180
181
|
range: input.value.location,
|
|
181
182
|
coverage: input.coverage,
|
|
182
183
|
});
|
|
183
|
-
const source = sourceNodeFor(context, input.file.path, input.value.module_key) ??
|
|
184
|
-
input.asset;
|
|
184
|
+
const source = sourceNodeFor(context, input.file.path, input.value.module_key, input.value.module_runtime) ?? input.asset;
|
|
185
185
|
addStaticInferenceEdge(context, {
|
|
186
186
|
source,
|
|
187
187
|
target: role,
|
|
@@ -262,7 +262,9 @@ const resolveReference = (context, sourcePath, reference) => {
|
|
|
262
262
|
const chunk = resolveBundlerChunkReference(context, sourcePath, reference);
|
|
263
263
|
if (chunk !== null)
|
|
264
264
|
return chunk;
|
|
265
|
-
const module =
|
|
265
|
+
const module = reference.module_runtime === undefined
|
|
266
|
+
? undefined
|
|
267
|
+
: context.moduleNodes.get(moduleLookupKey(sourcePath, reference.module_runtime, specifier));
|
|
266
268
|
if (module !== undefined) {
|
|
267
269
|
const file = context.filesByPath.get(sourcePath);
|
|
268
270
|
return file === undefined
|
|
@@ -300,9 +302,10 @@ const resolveBundlerChunkReference = (context, sourcePath, reference) => {
|
|
|
300
302
|
return null;
|
|
301
303
|
const registrations = context.analysis.files
|
|
302
304
|
.find(({ file: analyzedFile }) => analyzedFile.path === sourcePath)
|
|
303
|
-
?.javascript?.bundler_registrations.filter(({ modules }) => reference.
|
|
304
|
-
?
|
|
305
|
-
:
|
|
305
|
+
?.javascript?.bundler_registrations.filter(({ runtime, modules }) => reference.module_runtime === undefined
|
|
306
|
+
? reference.module_key === null
|
|
307
|
+
: runtime === reference.module_runtime &&
|
|
308
|
+
modules.some(({ module_key: moduleKey }) => moduleKey === reference.module_key));
|
|
306
309
|
if (registrations === undefined)
|
|
307
310
|
return null;
|
|
308
311
|
const candidates = registrations.flatMap(({ runtime }) => {
|