rea-agents 4.1.0 → 5.0.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 +184 -86
- package/bridge/android/ReaJadxBridge.java +247 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +30 -16
- package/dist/android/AndroidTargetSnapshot.js +5 -3
- package/dist/android/JadxAnalysis.js +8 -6
- package/dist/android/JadxConfiguration.js +19 -3
- package/dist/android/JadxMcpTransport.js +43 -16
- package/dist/android/JadxProtocol.js +8 -0
- package/dist/android/JadxProvider.js +117 -28
- package/dist/android/JadxRelease.js +8 -0
- package/dist/android/JadxSession.js +32 -18
- package/dist/application/AppBundleExecutable.js +141 -0
- package/dist/application/ArtifactInventory/classify.js +1 -1
- package/dist/application/ArtifactInventory/scanCanonical.js +1 -1
- package/dist/application/ArtifactInventory/scanReader.js +1 -1
- package/dist/application/ArtifactInventory.js +1 -1
- package/dist/application/BinaryTargetResolver.js +9 -64
- package/dist/application/CapabilityInventory.js +61 -3
- package/dist/application/ClientConfigurationDocument.js +72 -12
- package/dist/application/ClientRegistrationStatus.js +7 -8
- package/dist/application/DirectAnalysis.js +12 -14
- package/dist/application/DirectAnalysisStatus.js +4 -5
- package/dist/application/DoctorDiagnostics.js +3 -3
- package/dist/application/EnhancedTools.js +4 -4
- package/dist/application/EvidenceBundleCommands.js +1 -1
- package/dist/application/FilesystemSnapshot.js +20 -5
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/LinuxHopper.js +8 -2
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcessCaptureCapability.js +1 -1
- package/dist/application/ProcessCaptureLifecycle.js +2 -2
- package/dist/application/ProcessCli.js +5 -1
- package/dist/application/ProcessHarness.js +20 -9
- package/dist/application/ReconstructionCoverageService.js +2 -6
- package/dist/application/ReconstructionObligationCandidates.js +5 -2
- package/dist/application/ReferenceSourceImport.js +2 -0
- package/dist/application/ReferenceSourceImportEntries.js +20 -3
- package/dist/application/ReferenceSourceImportTypes.js +5 -0
- package/dist/application/Setup.js +10 -2
- package/dist/application/SetupClientConfiguration.js +19 -16
- package/dist/application/SetupHost.js +18 -3
- package/dist/application/SetupPlan.js +1 -1
- package/dist/application/Uninstall.js +23 -17
- package/dist/application/UpdateMaintenance.js +3 -3
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModuleTraceService.js +209 -0
- package/dist/application/WebRuntimeService.js +73 -0
- package/dist/application/WebScriptExportService.js +115 -0
- package/dist/application/WebSourceLocationService.js +160 -0
- package/dist/application/{AndroidAnalysisService.js → android/AndroidAnalysisService.js} +6 -6
- package/dist/application/{AndroidApplicationService.js → android/AndroidApplicationService.js} +3 -3
- package/dist/application/{AppleApplicationService.js → apple/AppleApplicationService.js} +5 -5
- package/dist/application/{AnalysisClientCleanup.js → binary/AnalysisClientCleanup.js} +2 -2
- package/dist/application/{AnalysisProviderEvaluation.js → binary/AnalysisProviderEvaluation.js} +4 -4
- package/dist/application/{AnalysisProviderRegistry.js → binary/AnalysisProviderRegistry.js} +5 -5
- package/dist/application/{AnalysisSnapshotCache.js → binary/AnalysisSnapshotCache.js} +7 -9
- package/dist/application/{AnalysisSnapshotFiles.js → binary/AnalysisSnapshotFiles.js} +4 -4
- package/dist/application/{BinarySession.js → binary/BinarySession.js} +12 -10
- package/dist/application/{BinarySessionComposition.js → binary/BinarySessionComposition.js} +2 -1
- package/dist/application/{BinarySessionExecution.js → binary/BinarySessionExecution.js} +9 -7
- package/dist/application/{BinarySessionOpen.js → binary/BinarySessionOpen.js} +6 -6
- package/dist/application/{BinarySessionRecords.js → binary/BinarySessionRecords.js} +28 -40
- package/dist/application/{CompositeProvider.js → binary/CompositeProvider.js} +2 -2
- package/dist/application/{LazyAnalysisProvider.js → binary/LazyAnalysisProvider.js} +6 -6
- package/dist/application/{SessionProviderRouter.js → binary/SessionProviderRouter.js} +7 -7
- package/dist/application/{FirmwareAnalysisService.js → firmware/FirmwareAnalysisService.js} +5 -5
- package/dist/application/{EvidenceLedger.js → investigation/EvidenceLedger.js} +44 -7
- package/dist/application/investigation/InvestigationRecords.js +69 -0
- package/dist/application/{UnknownEvidence.js → investigation/UnknownEvidence.js} +1 -1
- package/dist/application/{ElectronActiveEvidence.js → javascript/ElectronActiveEvidence.js} +3 -3
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/{ElectronActiveObservationService.js → javascript/ElectronActiveObservationService.js} +3 -3
- package/dist/application/{ElectronBoundaryAnalysis.js → javascript/ElectronBoundaryAnalysis.js} +1 -1
- package/dist/application/{ElectronBoundaryGraphContext.js → javascript/ElectronBoundaryGraphContext.js} +1 -1
- package/dist/application/{ElectronEvidence.js → javascript/ElectronEvidence.js} +2 -2
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/{ElectronObservationService.js → javascript/ElectronObservationService.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidence.js → javascript/JavaScriptApplicationEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidenceGraph.js → javascript/JavaScriptApplicationEvidenceGraph.js} +5 -5
- package/dist/application/{JavaScriptApplicationService.js → javascript/JavaScriptApplicationService.js} +10 -10
- package/dist/application/{JavaScriptApplicationWorkflowEvidence.js → javascript/JavaScriptApplicationWorkflowEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationWorkflowService.js → javascript/JavaScriptApplicationWorkflowService.js} +12 -12
- package/dist/application/{JavaScriptArtifactAnalysis.js → javascript/JavaScriptArtifactAnalysis.js} +8 -24
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/{JavaScriptArtifactGraphAccumulator.js → javascript/JavaScriptArtifactGraphAccumulator.js} +16 -2
- package/dist/application/{JavaScriptArtifactGraphBuilder.js → javascript/JavaScriptArtifactGraphBuilder.js} +2 -2
- package/dist/application/{JavaScriptArtifactGraphContext.js → javascript/JavaScriptArtifactGraphContext.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphDocuments.js → javascript/JavaScriptArtifactGraphDocuments.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphFindings.js → javascript/JavaScriptArtifactGraphFindings.js} +20 -7
- package/dist/application/{JavaScriptArtifactGraphStructure.js → javascript/JavaScriptArtifactGraphStructure.js} +1 -1
- package/dist/application/{JavaScriptArtifactPathResolution.js → javascript/JavaScriptArtifactPathResolution.js} +6 -12
- package/dist/application/{JavaScriptArtifactReconstruction.js → javascript/JavaScriptArtifactReconstruction.js} +4 -8
- package/dist/application/{JavaScriptJsonModules.js → javascript/JavaScriptJsonModules.js} +1 -1
- package/dist/application/{JavaScriptModuleRelationships.js → javascript/JavaScriptModuleRelationships.js} +2 -2
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +52 -0
- package/dist/application/{JavaScriptReturnShapeProjection.js → javascript/JavaScriptReturnShapeProjection.js} +3 -3
- package/dist/application/{JavaScriptRuntimeObservationEvidence.js → javascript/JavaScriptRuntimeObservationEvidence.js} +2 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/{JavaScriptRuntimeObservationService.js → javascript/JavaScriptRuntimeObservationService.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationEvidence.js → javascript/JavaScriptRuntimeReconciliationEvidence.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationService.js → javascript/JavaScriptRuntimeReconciliationService.js} +6 -6
- package/dist/application/{JavaScriptSemanticGraphAsyncProjection.js → javascript/JavaScriptSemanticGraphAsyncProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphBuilder.js → javascript/JavaScriptSemanticGraphBuilder.js} +5 -3
- package/dist/application/{JavaScriptSemanticGraphChildProcessProjection.js → javascript/JavaScriptSemanticGraphChildProcessProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphConstruction.js → javascript/JavaScriptSemanticGraphConstruction.js} +3 -2
- package/dist/application/{JavaScriptSemanticGraphDataProjection.js → javascript/JavaScriptSemanticGraphDataProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFingerprintProjection.js → javascript/JavaScriptSemanticGraphFingerprintProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFlowProjection.js → javascript/JavaScriptSemanticGraphFlowProjection.js} +2 -2
- package/dist/application/{JavaScriptSemanticGraphObjectProjection.js → javascript/JavaScriptSemanticGraphObjectProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphProjection.js → javascript/JavaScriptSemanticGraphProjection.js} +2 -2
- package/dist/application/{JavaScriptSemanticGraphResourceProjection.js → javascript/JavaScriptSemanticGraphResourceProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticTraceService.js → javascript/JavaScriptSemanticTraceService.js} +6 -6
- package/dist/application/{ManagedApplicationGraphService.js → managed/ManagedApplicationGraphService.js} +7 -7
- package/dist/application/{ManagedMemberComparisonService.js → managed/ManagedMemberComparisonService.js} +10 -10
- package/dist/application/{ManagedNativeVerificationService.js → managed/ManagedNativeVerificationService.js} +7 -7
- package/dist/application/{ManagedReconstructionService.js → managed/ManagedReconstructionService.js} +7 -7
- package/dist/application/{NativeApiInspection.js → native/NativeApiInspection.js} +1 -1
- package/dist/application/{NativeCallRoutes.js → native/NativeCallRoutes.js} +3 -3
- package/dist/application/{NativeDispatchMetadataInspection.js → native/NativeDispatchMetadataInspection.js} +4 -4
- package/dist/application/{NativeUiActionTrace.js → native/NativeUiActionTrace.js} +7 -7
- package/dist/application/{NativeValueTrace.js → native/NativeValueTrace.js} +6 -6
- package/dist/{application/ArtifactInventory/hash.js → artifacts/ArtifactHash.js} +4 -2
- package/dist/artifacts/ArtifactPaths.js +3 -3
- package/dist/artifacts/ArtifactProvider.js +7 -37
- package/dist/artifacts/ArtifactProviderMetadata.js +36 -0
- package/dist/artifacts/AsarArtifactReader.js +195 -23
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/DirectoryArtifactReader.js +41 -7
- package/dist/artifacts/NativeDmgArtifactReader.js +161 -9
- package/dist/{application → artifacts/apple}/AppleAssetCatalogAnalysis.js +4 -4
- package/dist/{application → artifacts/apple}/InterfaceBuilderAnalysis.js +125 -51
- package/dist/artifacts/{KeyedArchiveReader.js → apple/KeyedArchiveReader.js} +21 -27
- package/dist/artifacts/apple/NibViewHierarchy.js +150 -0
- package/dist/{application → artifacts/javascript}/JavaScriptArtifactFiles.js +27 -6
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/readStableArtifact.js +52 -0
- package/dist/browser/BrowserScenarioSecrets.js +50 -8
- package/dist/browser/CdpAuthorizedMainFrame.js +4 -4
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +4 -15
- package/dist/browser/CdpCaptureDocuments.js +33 -21
- package/dist/browser/CdpCaptureEventBodyShapes.js +3 -3
- package/dist/browser/CdpCaptureEventHandlers.js +26 -26
- package/dist/browser/CdpCaptureEventHelpers.js +6 -6
- package/dist/browser/CdpCaptureStorage.js +10 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +24 -22
- package/dist/browser/CdpCaptureValues.js +2 -2
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +51 -11
- package/dist/browser/CdpElectronInspection.js +10 -10
- package/dist/browser/CdpElectronProvider.js +3 -6
- package/dist/browser/CdpElectronScriptEvents.js +6 -6
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpElectronWorkers.js +4 -4
- package/dist/browser/CdpObservationSession.js +18 -23
- package/dist/browser/CdpPageCapture.js +4 -4
- package/dist/browser/CdpPageCaptureScripts.js +2 -2
- package/dist/browser/CdpPageCaptureWorkers.js +9 -9
- package/dist/browser/CdpSafeMetadata.js +48 -10
- package/dist/browser/CdpScreenshot.js +5 -5
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +2 -2
- package/dist/browser/CdpWebMcpDiscovery.js +22 -16
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +7 -6
- package/dist/browser/PlaywrightElectronActiveProvider.js +3 -6
- package/dist/browser/PlaywrightScenarioEvents.js +59 -51
- package/dist/browser/PlaywrightScenarioSession.js +8 -1
- package/dist/browser/WebSourceMapFetcher.js +37 -53
- package/dist/browser/assets/LocalWebScriptArtifacts.js +87 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +74 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +76 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +56 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +40 -0
- package/dist/browser/execution/CdpEventListeners.js +79 -0
- package/dist/browser/execution/CdpExecutionCapture.js +135 -0
- package/dist/browser/execution/CdpExecutionCollection.js +57 -0
- package/dist/browser/execution/CdpExecutionWindow.js +100 -0
- package/dist/browser/execution/CdpListenerSelector.js +22 -0
- package/dist/browser/execution/CdpPreciseCoverage.js +48 -0
- package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
- package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
- package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
- package/dist/browser/execution/CdpRuntimeSession.js +163 -0
- package/dist/browser/execution/CdpRuntimeSources.js +223 -0
- package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
- package/dist/browser/modules/NativeModuleResolver.js +210 -0
- package/dist/browser/modules/WebModuleArtifacts.js +40 -0
- package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
- package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
- package/dist/browser/providerIdentities.js +24 -0
- package/dist/catalogIdentity.js +23 -15
- package/dist/cli/androidCommands.js +13 -3
- package/dist/cli/applicationCommands.js +39 -8
- package/dist/cli/artifactCommands.js +1 -1
- package/dist/cli/browserAdvancedCommands.js +27 -9
- package/dist/cli/coreAnalysisCommands.js +5 -493
- package/dist/cli/coreBinaryCommands.js +211 -0
- package/dist/cli/coreNativeCommands.js +293 -0
- package/dist/cli/electronCommands.js +13 -18
- package/dist/cli/firmwareCommands.js +3 -3
- package/dist/cli/javascriptApplicationAnalysis.js +1 -1
- package/dist/cli/javascriptRecoveryCommands.js +45 -0
- package/dist/cli/managedCommands.js +4 -4
- package/dist/cli/managedProjectGraphCommand.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +6 -1
- package/dist/cli/utilityCommands.js +47 -23
- package/dist/cli/webModuleCommands.js +56 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +31 -0
- package/dist/cli/webSourceLocationCommands.js +42 -0
- package/dist/cli.js +10 -0
- package/dist/cliBrowserContext.js +4 -2
- package/dist/cliBrowserScenarioCommands.js +4 -3
- package/dist/cliCommandNames.js +8 -0
- package/dist/cliJavaScriptRuntimeCommands.js +6 -4
- package/dist/cliJsonInput.js +9 -2
- package/dist/cliOutput.js +37 -11
- package/dist/composition/android.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +30 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +3 -0
- package/dist/composition/directAnalysis.js +17 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/optionalObservationProviders.js +49 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/parseConfig.js +22 -3
- package/dist/contracts/{androidToolContracts.js → android/androidToolContracts.js} +5 -5
- package/dist/contracts/applicationToolContracts.js +43 -8
- package/dist/contracts/artifactToolContracts.js +2 -2
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/enhancedInputs.js +1 -1
- package/dist/contracts/{firmwareToolContracts.js → firmware/firmwareToolContracts.js} +5 -5
- package/dist/contracts/{applicationWorkflowInputContracts.js → javascript/applicationWorkflowInputContracts.js} +6 -6
- package/dist/contracts/{electronToolContracts.js → javascript/electronToolContracts.js} +6 -6
- package/dist/contracts/{javascriptApplicationWorkflowExamples.js → javascript/javascriptApplicationWorkflowExamples.js} +3 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +23 -0
- package/dist/contracts/{javascriptRuntimeObservationToolContracts.js → javascript/javascriptRuntimeObservationToolContracts.js} +3 -3
- package/dist/contracts/{javascriptRuntimeReconciliationExample.js → javascript/javascriptRuntimeReconciliationExample.js} +5 -5
- package/dist/contracts/{managedToolContracts.js → managed/managedToolContracts.js} +3 -3
- package/dist/contracts/{managedWorkflowExamples.js → managed/managedWorkflowExamples.js} +1 -1
- package/dist/contracts/{managedWorkflowToolContracts.js → managed/managedWorkflowToolContracts.js} +6 -6
- package/dist/contracts/mobileApplicationGraphExamples.js +105 -0
- package/dist/contracts/{nativeToolContracts.js → native/nativeToolContracts.js} +14 -7
- package/dist/contracts/officialToolContracts.js +3 -3
- package/dist/contracts/sessionToolContracts.js +1 -1
- package/dist/contracts/toolContracts.js +13 -7
- package/dist/contracts/toolEffects.js +32 -0
- package/dist/contracts/toolOutputSchemaGroups.js +18 -18
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/domain/analysisErrorCore.js +4 -2
- package/dist/domain/analysisErrorProjection.js +1 -0
- package/dist/domain/{androidApplication.js → android/androidApplication.js} +7 -6
- package/dist/domain/apple/appleApplication.js +277 -0
- package/dist/domain/{appleAssetCatalog.js → apple/appleAssetCatalog.js} +2 -2
- package/dist/domain/apple/appleBundleAnatomy.js +236 -0
- package/dist/domain/{interfaceBuilderGraph.js → apple/interfaceBuilderGraph.js} +47 -314
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +411 -0
- package/dist/domain/{keyedArchive.js → apple/keyedArchive.js} +10 -9
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactInventoryEvidence.js +12 -2
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +5 -1
- package/dist/domain/artifactPathSyntax.js +26 -0
- package/dist/domain/browserNetworkEvidence.js +82 -0
- package/dist/domain/browserObservationError.js +2 -0
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenarioCapture.js +22 -0
- package/dist/domain/browserScenarioCaptureValues.js +25 -0
- package/dist/domain/browserScenarioDiff.js +6 -3
- package/dist/domain/browserScenarioDiffEvidence.js +35 -1
- package/dist/domain/browserScenarioValues.js +12 -1
- package/dist/domain/browserSession.js +2 -7
- package/dist/domain/bundleComparison.js +2 -1
- package/dist/domain/callPath.js +52 -44
- package/dist/domain/comparisonStatus.js +39 -0
- package/dist/domain/evidenceBundle.js +98 -35
- package/dist/domain/{firmwareAnalysis.js → firmware/firmwareAnalysis.js} +2 -2
- package/dist/domain/functionComparisonNormalization.js +11 -13
- package/dist/domain/hopperValues.js +2 -2
- package/dist/domain/inputIssueProjection.js +17 -2
- package/dist/domain/{electronObservation.js → javascript/electronObservation.js} +5 -11
- package/dist/domain/{electronStaticAnalysisBrowser.js → javascript/electronStaticAnalysisBrowser.js} +4 -3
- package/dist/domain/{electronStaticAnalysisIpc.js → javascript/electronStaticAnalysisIpc.js} +2 -2
- package/dist/domain/{electronStaticAnalysisNative.js → javascript/electronStaticAnalysisNative.js} +12 -13
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/{electronStaticAnalysisValues.js → javascript/electronStaticAnalysisValues.js} +3 -3
- package/dist/domain/{javascriptApplicationAnalysis.js → javascript/javascriptApplicationAnalysis.js} +2 -2
- package/dist/domain/{javascriptApplicationChangeGraph.js → javascript/javascriptApplicationChangeGraph.js} +1 -1
- package/dist/domain/{javascriptApplicationEvidenceSchemas.js → javascript/javascriptApplicationEvidenceSchemas.js} +6 -4
- package/dist/domain/{javascriptApplicationGraph.js → javascript/javascriptApplicationGraph.js} +2 -2
- package/dist/domain/{javascriptApplicationGraphSchemas.js → javascript/javascriptApplicationGraphSchemas.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparison.js → javascript/javascriptApplicationVersionComparison.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparisonSchemas.js → javascript/javascriptApplicationVersionComparisonSchemas.js} +3 -3
- package/dist/domain/{javascriptApplicationVersionItems.js → javascript/javascriptApplicationVersionItems.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionKeys.js → javascript/javascriptApplicationVersionKeys.js} +16 -9
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/{javascriptAstFingerprint.js → javascript/javascriptAstFingerprint.js} +38 -22
- package/dist/domain/javascript/javascriptAstValues.js +23 -0
- package/dist/domain/{javascriptExportShapeComparison.js → javascript/javascriptExportShapeComparison.js} +1 -1
- package/dist/domain/{javascriptExportShapeComparisonSchemas.js → javascript/javascriptExportShapeComparisonSchemas.js} +2 -2
- package/dist/domain/{javascriptExportShapeSelection.js → javascript/javascriptExportShapeSelection.js} +1 -1
- package/dist/domain/{javascriptExportShapeVariants.js → javascript/javascriptExportShapeVariants.js} +1 -1
- package/dist/domain/{javascriptFeatureSeed.js → javascript/javascriptFeatureSeed.js} +4 -3
- package/dist/domain/{javascriptFeatureTrace.js → javascript/javascriptFeatureTrace.js} +2 -2
- package/dist/domain/{javascriptFeatureTraceSchemas.js → javascript/javascriptFeatureTraceSchemas.js} +32 -18
- package/dist/domain/{javascriptFeatureTraversal.js → javascript/javascriptFeatureTraversal.js} +6 -2
- package/dist/domain/{javascriptNativeHandoff.js → javascript/javascriptNativeHandoff.js} +1 -1
- package/dist/domain/javascript/javascriptRecovery.js +88 -0
- package/dist/domain/{javascriptRuntimeLoadState.js → javascript/javascriptRuntimeLoadState.js} +1 -1
- package/dist/domain/{javascriptRuntimeObservation.js → javascript/javascriptRuntimeObservation.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationActive.js → javascript/javascriptRuntimeReconciliationActive.js} +3 -3
- package/dist/domain/{javascriptRuntimeReconciliationGraph.js → javascript/javascriptRuntimeReconciliationGraph.js} +1 -1
- package/dist/domain/{javascriptRuntimeReconciliationMatching.js → javascript/javascriptRuntimeReconciliationMatching.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationParsing.js → javascript/javascriptRuntimeReconciliationParsing.js} +5 -5
- package/dist/domain/{javascriptRuntimeReconciliationResult.js → javascript/javascriptRuntimeReconciliationResult.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationSchemas.js → javascript/javascriptRuntimeReconciliationSchemas.js} +4 -4
- package/dist/domain/{javascriptRuntimeStaticCandidates.js → javascript/javascriptRuntimeStaticCandidates.js} +1 -1
- package/dist/domain/{javascriptSemanticAnalysis.js → javascript/javascriptSemanticAnalysis.js} +40 -14
- package/dist/domain/{javascriptSemanticAsyncEffects.js → javascript/javascriptSemanticAsyncEffects.js} +2 -1
- package/dist/domain/{javascriptSemanticCallResolution.js → javascript/javascriptSemanticCallResolution.js} +10 -5
- package/dist/domain/{javascriptSemanticCalls.js → javascript/javascriptSemanticCalls.js} +7 -4
- package/dist/domain/{javascriptSemanticChildProcesses.js → javascript/javascriptSemanticChildProcesses.js} +4 -2
- package/dist/domain/{javascriptSemanticDataEffectHelpers.js → javascript/javascriptSemanticDataEffectHelpers.js} +7 -6
- package/dist/domain/{javascriptSemanticDataEffects.js → javascript/javascriptSemanticDataEffects.js} +8 -6
- package/dist/domain/{javascriptSemanticFingerprints.js → javascript/javascriptSemanticFingerprints.js} +40 -16
- package/dist/domain/{javascriptSemanticGraph.js → javascript/javascriptSemanticGraph.js} +2 -2
- package/dist/domain/{javascriptSemanticGraphSchemas.js → javascript/javascriptSemanticGraphSchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +116 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +53 -0
- package/dist/domain/{javascriptSemanticObjects.js → javascript/javascriptSemanticObjects.js} +5 -5
- package/dist/domain/{javascriptSemanticPrimitives.js → javascript/javascriptSemanticPrimitives.js} +1 -1
- package/dist/domain/{javascriptSemanticProjection.js → javascript/javascriptSemanticProjection.js} +31 -44
- package/dist/domain/{javascriptSemanticPromises.js → javascript/javascriptSemanticPromises.js} +77 -22
- package/dist/domain/{javascriptSemanticProvenance.js → javascript/javascriptSemanticProvenance.js} +4 -1
- package/dist/domain/{javascriptSemanticQuery.js → javascript/javascriptSemanticQuery.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryAssessment.js → javascript/javascriptSemanticQueryAssessment.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryIdentity.js → javascript/javascriptSemanticQueryIdentity.js} +1 -1
- package/dist/domain/{javascriptSemanticQuerySchemas.js → javascript/javascriptSemanticQuerySchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +25 -0
- package/dist/domain/{javascriptSemanticResources.js → javascript/javascriptSemanticResources.js} +2 -1
- package/dist/domain/{javascriptSemanticReturns.js → javascript/javascriptSemanticReturns.js} +1 -1
- package/dist/domain/{javascriptSemanticTraceSchemas.js → javascript/javascriptSemanticTraceSchemas.js} +2 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +55 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/{javascriptSemanticValues.js → javascript/javascriptSemanticValues.js} +72 -48
- package/dist/domain/{javascriptStaticAnalysis.js → javascript/javascriptStaticAnalysis.js} +7 -4
- package/dist/domain/{javascriptStaticAnalysisBundler.js → javascript/javascriptStaticAnalysisBundler.js} +14 -11
- package/dist/domain/{javascriptStaticAnalysisCalls.js → javascript/javascriptStaticAnalysisCalls.js} +2 -2
- package/dist/domain/{javascriptStaticAnalysisHelpers.js → javascript/javascriptStaticAnalysisHelpers.js} +231 -40
- package/dist/domain/{sourceToBundleComparison.js → javascript/sourceToBundleComparison.js} +2 -2
- package/dist/domain/{sourceToBundleComparisonSchemas.js → javascript/sourceToBundleComparisonSchemas.js} +4 -4
- package/dist/domain/{sourceToBundleSignals.js → javascript/sourceToBundleSignals.js} +2 -2
- package/dist/domain/{managedApplicationGraph.js → managed/managedApplicationGraph.js} +4 -4
- package/dist/domain/{managedApplicationGraphNodes.js → managed/managedApplicationGraphNodes.js} +1 -1
- package/dist/domain/{managedArtifact.js → managed/managedArtifact.js} +1 -1
- package/dist/domain/{managedMemberComparison.js → managed/managedMemberComparison.js} +4 -4
- package/dist/domain/{managedMemberComparisonCoverage.js → managed/managedMemberComparisonCoverage.js} +2 -1
- package/dist/domain/{managedMemberComparisonItems.js → managed/managedMemberComparisonItems.js} +97 -40
- package/dist/domain/{managedMemberComparisonMatch.js → managed/managedMemberComparisonMatch.js} +22 -11
- package/dist/domain/{managedNativeVerification.js → managed/managedNativeVerification.js} +1 -1
- package/dist/domain/{managedNativeVerificationMatch.js → managed/managedNativeVerificationMatch.js} +3 -3
- package/dist/domain/{managedNativeVerificationSchemas.js → managed/managedNativeVerificationSchemas.js} +6 -5
- package/dist/domain/{managedReconstruction.js → managed/managedReconstruction.js} +3 -3
- package/dist/domain/{nativeFunctionAnnotations.js → native/nativeFunctionAnnotations.js} +1 -1
- package/dist/domain/{nativeInspection.js → native/nativeInspection.js} +1 -1
- package/dist/domain/{nativeInvestigationGraph.js → native/nativeInvestigationGraph.js} +13 -4
- package/dist/domain/{nativeLoadImage.js → native/nativeLoadImage.js} +1 -1
- package/dist/domain/{nativeUiObservation.js → native/nativeUiObservation.js} +20 -6
- package/dist/domain/{objcSwiftMetadata.js → native/objcSwiftMetadata.js} +17 -0
- package/dist/domain/processCapture.js +4 -2
- package/dist/domain/processScenario.js +17 -17
- package/dist/domain/propertyListKeys.js +69 -0
- package/dist/domain/providerCleanupError.js +5 -2
- package/dist/domain/reconstructionCoverageEvaluation.js +46 -24
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/runtimeVersion.js +2 -0
- package/dist/domain/sourceMapEnvelope.js +38 -0
- package/dist/domain/unicodeCodePointOrder.js +11 -6
- package/dist/domain/webBundleAnalyzerAst.js +2 -34
- package/dist/domain/webBundleAnalyzerInspection.js +12 -9
- package/dist/domain/webEventListeners.js +28 -0
- package/dist/domain/webExecution.js +74 -0
- package/dist/domain/webMcpDiscovery.js +1 -7
- package/dist/domain/webModuleImports.js +104 -0
- package/dist/domain/webModuleTrace.js +106 -0
- package/dist/domain/webRuntime.js +69 -0
- package/dist/domain/webScreenshot.js +1 -7
- package/dist/domain/webScriptArtifacts.js +39 -0
- package/dist/domain/webScriptExport.js +86 -0
- package/dist/domain/webScriptExportError.js +13 -0
- package/dist/domain/webScriptExportPlan.js +108 -0
- package/dist/domain/webSourceLocation.js +106 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/dotnet/ManagedArtifactInspector.js +1 -1
- package/dist/dotnet/ManagedMemberInspector.js +1 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +34 -0
- package/dist/dotnet/ManagedMemberRows.js +5 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +22 -16
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +56 -50
- package/dist/dotnet/ManagedStaticProvider.js +3 -33
- package/dist/dotnet/ManagedStaticProviderMetadata.js +36 -0
- package/dist/evaluation/CodexAgentEval.js +2 -1
- package/dist/firmware/FirmwareProvider.js +18 -12
- package/dist/firmware/FirmwarePublication.js +1 -1
- package/dist/firmware/FirmwareRelease.js +1 -1
- package/dist/firmware/FirmwareReports.js +12 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraFunctionValues.js +5 -5
- package/dist/ghidra/GhidraInstallation.js +38 -34
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +1 -1
- package/dist/ghidra/GhidraLauncher.js +12 -4
- package/dist/ghidra/GhidraLoadImageAttest.js +36 -0
- package/dist/ghidra/GhidraLoadImageValues.js +1 -1
- package/dist/ghidra/GhidraProvider.js +15 -233
- package/dist/ghidra/GhidraProviderCapabilities.js +7 -14
- package/dist/ghidra/GhidraProviderClient.js +209 -0
- package/dist/ghidra/GhidraResponseBuffer.js +7 -1
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +17 -1
- package/dist/hopper/HopperProvider.js +2 -48
- package/dist/hopper/HopperProviderCapabilities.js +73 -0
- package/dist/hopper/HopperResponseStream.js +7 -1
- package/dist/hopper/LinuxPrivateDisplayProbe.js +4 -4
- package/dist/ida/IdaProviderCapabilities.js +3 -11
- package/dist/ida/IdaSessionClient.js +12 -0
- package/dist/{browser → inspector}/JavaScriptRuntimeScope.js +16 -5
- package/dist/{browser → inspector}/V8InspectorCaptureProjection.js +46 -8
- package/dist/{browser → inspector}/V8InspectorEndpoint.js +1 -1
- package/dist/{browser → inspector}/V8InspectorProvider.js +10 -13
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/recovery/RecoveryFiles.js +122 -0
- package/dist/javascript/recovery/WakaruCommand.js +116 -0
- package/dist/javascript/recovery/WakaruExecution.js +100 -0
- package/dist/javascript/recovery/WakaruProvider.js +96 -0
- package/dist/javascript/recovery/WakaruPublication.js +102 -0
- package/dist/javascript/recovery/WakaruRelease.js +29 -0
- package/dist/javascript/recovery/WakaruReport.js +134 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +176 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +61 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +185 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +138 -0
- package/dist/main/shutdown.js +8 -2
- package/dist/main/transport.js +24 -7
- package/dist/main.js +4 -18
- package/dist/native/AppleDispatchCoverage.js +58 -0
- package/dist/native/AppleDispatchMetadata.js +71 -509
- package/dist/native/AppleMachoFixups.js +292 -0
- package/dist/native/AppleMachoSelection.js +188 -0
- package/dist/native/AppleObjcCategories.js +59 -0
- package/dist/native/AppleObjcDispatchFacets.js +257 -0
- package/dist/native/AppleObjcProperties.js +68 -0
- package/dist/native/AppleObjcProtocols.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +150 -0
- package/dist/native/NativeMacOSProvider.js +132 -72
- package/dist/native/NativeMacOSProviderMetadata.js +42 -0
- package/dist/native/NativeMachoInspection.js +45 -14
- package/dist/native/NativeUiHelperRuntime.js +7 -3
- package/dist/native/NativeUiObservation.js +8 -4
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/parsers/codesign.js +40 -5
- package/dist/native/parsers/demangle.js +6 -2
- package/dist/native/parsers/dyldInfo.js +13 -4
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +14 -0
- package/dist/native/parsers/otool.js +1 -1
- package/dist/native/parsers/plist.js +174 -19
- package/dist/process/ExecFileOutput.js +2 -0
- package/dist/process/ProviderProcess.js +38 -17
- package/dist/reference/ReferenceSourceReaderEntries.js +6 -1
- package/dist/server/createServer.js +48 -6
- package/dist/server/mcpClientMetadata.js +6 -3
- package/dist/server/registerAndroidTools.js +1 -1
- package/dist/server/registerApplicationTools/compareExportShapes.js +2 -2
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +2 -2
- package/dist/server/registerApplicationTools/compareVersions.js +2 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +43 -0
- package/dist/server/registerApplicationTools/traceFeature.js +1 -1
- package/dist/server/registerApplicationTools/traceSemantics.js +1 -1
- package/dist/server/registerApplicationTools.js +2 -0
- package/dist/server/registerBrowserScenarioTool.js +6 -2
- package/dist/server/registerBrowserTools.js +13 -2
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +21 -7
- package/dist/server/registerJavaScriptRecoveryTool.js +17 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -4
- package/dist/server/registerManagedTools.js +3 -3
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -2
- package/dist/server/registerManagedWorkflowTools/contract.js +1 -1
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +1 -1
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +1 -1
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -2
- package/dist/server/registerNativeTools.js +1 -1
- package/dist/server/registerPrompts.js +5 -1
- package/dist/server/registerSessionTools.js +1 -1
- package/dist/server/registerWebModuleTool.js +17 -0
- package/dist/server/registerWebRuntimeTools.js +31 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +17 -0
- package/dist/server/sessionAvailabilityPolicy.js +24 -12
- package/dist/windows/WindowsOwnedProcess.js +3 -1
- package/install.sh +12 -2
- package/native/windows/README.md +5 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +40 -19
- package/scripts/hopper-demo-x11.py +67 -8
- package/scripts/rea.mjs +9 -1
- package/skills/reverse-engineer-anything/SKILL.md +3 -3
- package/skills/reverse-engineer-anything/references/android-applications.md +2 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +1 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +32 -23
- package/dist/application/runtime.js +0 -53
- package/dist/domain/appleApplication.js +0 -181
- package/dist/domain/javascriptAstValues.js +0 -13
- package/dist/domain/javascriptSemanticTraversal.js +0 -30
- package/dist/native/NativeHostCapabilities.js +0 -23
- /package/dist/application/{AndroidAnalysisPort.js → DirectAnalysisDependencies.js} +0 -0
- /package/dist/application/{BinarySessionPort.js → WebModulePorts.js} +0 -0
- /package/dist/application/{ElectronActiveObservationPort.js → WebRuntimePort.js} +0 -0
- /package/dist/application/{ElectronObservationPort.js → WebScriptArtifactPort.js} +0 -0
- /package/dist/application/{FirmwareAnalysisPort.js → WebSourceLocationPorts.js} +0 -0
- /package/dist/application/{JavaScriptArtifactAnalysisTypes.js → android/AndroidAnalysisPort.js} +0 -0
- /package/dist/application/{AbortablePromise.js → binary/AbortablePromise.js} +0 -0
- /package/dist/application/{JavaScriptRuntimeObservationPort.js → binary/BinarySessionPort.js} +0 -0
- /package/dist/application/{BinarySessionStatus.js → binary/BinarySessionStatus.js} +0 -0
- /package/dist/{domain/electronStaticAnalysisTypes.js → application/firmware/FirmwareAnalysisPort.js} +0 -0
- /package/dist/{domain/javascriptSemanticValueTypes.js → application/investigation/InvestigationRecordPort.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraph.js → javascript/ElectronBoundaryGraph.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphIpc.js → javascript/ElectronBoundaryGraphIpc.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphNative.js → javascript/ElectronBoundaryGraphNative.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphWindows.js → javascript/ElectronBoundaryGraphWindows.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphBundlers.js → javascript/JavaScriptArtifactGraphBundlers.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphEvidence.js → javascript/JavaScriptArtifactGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptArtifactReconstructionInput.js → javascript/JavaScriptArtifactReconstructionInput.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphEvidence.js → javascript/JavaScriptSemanticGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphValueProjection.js → javascript/JavaScriptSemanticGraphValueProjection.js} +0 -0
- /package/dist/artifacts/{NibArchive.js → apple/NibArchive.js} +0 -0
- /package/dist/domain/{androidAnalysis.js → android/androidAnalysis.js} +0 -0
- /package/dist/domain/{electronActiveObservation.js → javascript/electronActiveObservation.js} +0 -0
- /package/dist/domain/{electronStaticAnalysis.js → javascript/electronStaticAnalysis.js} +0 -0
- /package/dist/domain/{javascriptExportShapeComparisonIdentity.js → javascript/javascriptExportShapeComparisonIdentity.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliation.js → javascript/javascriptRuntimeReconciliation.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliationRuntime.js → javascript/javascriptRuntimeReconciliationRuntime.js} +0 -0
- /package/dist/domain/{javascriptSemanticCoverage.js → javascript/javascriptSemanticCoverage.js} +0 -0
- /package/dist/domain/{javascriptSemanticDerivedAnalysis.js → javascript/javascriptSemanticDerivedAnalysis.js} +0 -0
- /package/dist/domain/{javascriptSemanticGraphSerialization.js → javascript/javascriptSemanticGraphSerialization.js} +0 -0
- /package/dist/domain/{javascriptSemanticIr.js → javascript/javascriptSemanticIr.js} +0 -0
- /package/dist/domain/{javascriptSemanticQueryRelations.js → javascript/javascriptSemanticQueryRelations.js} +0 -0
- /package/dist/domain/{javascriptSemanticState.js → javascript/javascriptSemanticState.js} +0 -0
- /package/dist/domain/{javascriptSourceParser.js → javascript/javascriptSourceParser.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisFindings.js → javascript/javascriptStaticAnalysisFindings.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisState.js → javascript/javascriptStaticAnalysisState.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisTypes.js → javascript/javascriptStaticAnalysisTypes.js} +0 -0
- /package/dist/domain/{managedApplicationGraphCoverage.js → managed/managedApplicationGraphCoverage.js} +0 -0
- /package/dist/domain/{managedApplicationGraphNodeCoverage.js → managed/managedApplicationGraphNodeCoverage.js} +0 -0
- /package/dist/domain/{nativeApiBoundary.js → native/nativeApiBoundary.js} +0 -0
- /package/dist/domain/{nativeDataType.js → native/nativeDataType.js} +0 -0
- /package/dist/domain/{nativeInstruction.js → native/nativeInstruction.js} +0 -0
- /package/dist/domain/{nativeMetadataRecovery.js → native/nativeMetadataRecovery.js} +0 -0
- /package/dist/domain/{nativeValueFlow.js → native/nativeValueFlow.js} +0 -0
- /package/dist/domain/{nativeValueTrace.js → native/nativeValueTrace.js} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as t from "@babel/types";
|
|
2
|
+
/**
|
|
3
|
+
* Visit every Babel AST node in deterministic source-tree order.
|
|
4
|
+
*
|
|
5
|
+
* `readAncestors` returns a snapshot during `enter`, outermost-first and
|
|
6
|
+
* ending with the direct parent. Callers
|
|
7
|
+
* need it whenever meaning depends on where a node sits, not just what its
|
|
8
|
+
* immediate parent is — a binding inside `catch ({message})` or `({a} = o)`
|
|
9
|
+
* has an ObjectProperty parent, so the parent alone cannot say whether the
|
|
10
|
+
* identifier declares a binding or is assigned to.
|
|
11
|
+
*/
|
|
12
|
+
export const traverseJavaScriptAst = (root, visitor) => {
|
|
13
|
+
const ancestors = [];
|
|
14
|
+
const enter = (node, parent) => {
|
|
15
|
+
visitor.enter(node, parent, () => [...ancestors]);
|
|
16
|
+
ancestors.push(node);
|
|
17
|
+
return { node, parent, children: childNodes(node), nextIndex: 0 };
|
|
18
|
+
};
|
|
19
|
+
const pending = [enter(root, null)];
|
|
20
|
+
while (pending.length > 0) {
|
|
21
|
+
const current = pending.at(-1);
|
|
22
|
+
if (current === undefined)
|
|
23
|
+
break;
|
|
24
|
+
const child = current.children[current.nextIndex];
|
|
25
|
+
if (child !== undefined) {
|
|
26
|
+
current.nextIndex += 1;
|
|
27
|
+
pending.push(enter(child, current.node));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
visitor.exit?.(current.node, current.parent);
|
|
31
|
+
ancestors.pop();
|
|
32
|
+
pending.pop();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const childNodes = (node) => {
|
|
37
|
+
const keys = t.VISITOR_KEYS[node.type];
|
|
38
|
+
if (keys === undefined)
|
|
39
|
+
return [];
|
|
40
|
+
const children = [];
|
|
41
|
+
for (const key of keys) {
|
|
42
|
+
const value = Reflect.get(node, key);
|
|
43
|
+
if (t.isNode(value)) {
|
|
44
|
+
children.push(value);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (!Array.isArray(value))
|
|
48
|
+
continue;
|
|
49
|
+
for (const item of value) {
|
|
50
|
+
if (t.isNode(item))
|
|
51
|
+
children.push(item);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return children;
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { invalidateSemanticMutationPath } from "./javascriptSemanticMutationValues.js";
|
|
3
|
+
import { resolveSemanticBindingState, } from "./javascriptSemanticState.js";
|
|
4
|
+
import { semanticRequireOrigin } from "./javascriptSemanticRequireOrigin.js";
|
|
5
|
+
import { compareCodePoints } from "../canonicalOrdering.js";
|
|
6
|
+
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
|
|
6
7
|
import { semanticAmbiguousProvenance, semanticLocalProvenance, semanticOriginsProvenance, semanticUnresolvedProvenance, uniqueSemanticOrigins, } from "./javascriptSemanticProvenance.js";
|
|
7
8
|
import { semanticPrimitiveCandidates as primitiveCandidates, semanticPrimitiveSet as primitiveSet, semanticPrimitiveValue as primitiveValue, } from "./javascriptSemanticPrimitives.js";
|
|
8
9
|
/** Evaluate one binding in the bounded constant-value lattice. */
|
|
@@ -28,7 +29,8 @@ const evaluateBinding = (binding, context) => {
|
|
|
28
29
|
if (initializer === undefined)
|
|
29
30
|
return { status: "unknown", reason: "Missing binding initializer." };
|
|
30
31
|
const nested = nestedContext(context, binding.bindingId);
|
|
31
|
-
|
|
32
|
+
const value = projectValue(evaluateExpression(initializer.node, nested), initializer.projection);
|
|
33
|
+
return binding.mutatedPaths.reduce(invalidateSemanticMutationPath, value);
|
|
32
34
|
};
|
|
33
35
|
const evaluateExpression = (node, context) => {
|
|
34
36
|
const literal = primitiveValue(node);
|
|
@@ -109,8 +111,8 @@ const evaluateObject = (node, context) => {
|
|
|
109
111
|
invalidateEarlierProperties();
|
|
110
112
|
continue;
|
|
111
113
|
}
|
|
112
|
-
const name =
|
|
113
|
-
if (name ===
|
|
114
|
+
const name = semanticStaticPropertyKey(property.key, property.computed);
|
|
115
|
+
if (name === null) {
|
|
114
116
|
unknownProperties = true;
|
|
115
117
|
if (omittedProperties !== null)
|
|
116
118
|
omittedProperties += 1;
|
|
@@ -180,18 +182,55 @@ const evaluateArray = (node, context) => {
|
|
|
180
182
|
: { status: "array", items, unknownItems: false, omittedItems: 0 };
|
|
181
183
|
};
|
|
182
184
|
const evaluateMember = (node, context) => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
const keys = [];
|
|
186
|
+
let current = node;
|
|
187
|
+
let value;
|
|
188
|
+
while (t.isMemberExpression(current) ||
|
|
189
|
+
t.isOptionalMemberExpression(current)) {
|
|
190
|
+
if (!t.isNode(current.object)) {
|
|
191
|
+
value = { status: "unknown", reason: "Unsupported member base." };
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
const key = semanticStaticPropertyKey(current.property, current.computed);
|
|
195
|
+
if (key === null) {
|
|
196
|
+
value = { status: "unknown", reason: "Dynamic member key." };
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
keys.push(key);
|
|
200
|
+
current = current.object;
|
|
201
|
+
}
|
|
202
|
+
value ??= evaluateExpression(current, nestedContext(context));
|
|
203
|
+
for (const key of keys.reverse())
|
|
204
|
+
value = projectValue(value, [key]);
|
|
205
|
+
return value;
|
|
191
206
|
};
|
|
192
207
|
const evaluateAddition = (node, context) => {
|
|
193
|
-
const
|
|
194
|
-
|
|
208
|
+
const pending = [];
|
|
209
|
+
let current = node;
|
|
210
|
+
while (true) {
|
|
211
|
+
if (t.isBinaryExpression(current, { operator: "+" })) {
|
|
212
|
+
pending.push({ node: current, left: undefined });
|
|
213
|
+
current = current.left;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
let value = evaluateExpression(current, nestedContext(context));
|
|
217
|
+
while (true) {
|
|
218
|
+
const parent = pending.at(-1);
|
|
219
|
+
if (parent === undefined)
|
|
220
|
+
return value;
|
|
221
|
+
if (parent.left === undefined) {
|
|
222
|
+
parent.left = value;
|
|
223
|
+
current = parent.node.right;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
value = addPrimitiveValues(parent.left, value);
|
|
227
|
+
pending.pop();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const addPrimitiveValues = (leftValue, rightValue) => {
|
|
232
|
+
const left = primitiveCandidates(leftValue);
|
|
233
|
+
const right = primitiveCandidates(rightValue);
|
|
195
234
|
if (left === null || right === null)
|
|
196
235
|
return { status: "unknown", reason: "Non-primitive addition." };
|
|
197
236
|
const values = left.flatMap((leftValue) => right.map((rightValue) => typeof leftValue === "string" || typeof rightValue === "string"
|
|
@@ -279,7 +318,7 @@ const provenanceForBinding = (binding, context) => {
|
|
|
279
318
|
})));
|
|
280
319
|
};
|
|
281
320
|
const provenanceForExpression = (node, context) => {
|
|
282
|
-
const required =
|
|
321
|
+
const required = semanticRequireOrigin(node, context.state);
|
|
283
322
|
if (required !== undefined)
|
|
284
323
|
return semanticOriginsProvenance([required]);
|
|
285
324
|
if (t.isIdentifier(node)) {
|
|
@@ -289,17 +328,25 @@ const provenanceForExpression = (node, context) => {
|
|
|
289
328
|
: provenanceForBinding(binding, nestedContext(context));
|
|
290
329
|
}
|
|
291
330
|
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
331
|
+
const members = [];
|
|
332
|
+
let current = node;
|
|
333
|
+
while (t.isMemberExpression(current) ||
|
|
334
|
+
t.isOptionalMemberExpression(current)) {
|
|
335
|
+
if (!t.isNode(current.object))
|
|
336
|
+
return semanticUnresolvedProvenance("unknown", "Unsupported member base.");
|
|
337
|
+
const member = semanticStaticPropertyKey(current.property, current.computed);
|
|
338
|
+
if (member === null)
|
|
339
|
+
return semanticUnresolvedProvenance("unknown", "Dynamic provenance member.");
|
|
340
|
+
members.push(member);
|
|
341
|
+
current = current.object;
|
|
342
|
+
}
|
|
343
|
+
const base = provenanceForExpression(current, nestedContext(context));
|
|
344
|
+
const path = members.reverse();
|
|
298
345
|
return base.status !== "module"
|
|
299
346
|
? base
|
|
300
347
|
: semanticOriginsProvenance(base.origins.map((origin) => ({
|
|
301
348
|
...origin,
|
|
302
|
-
importedPath: [...origin.importedPath,
|
|
349
|
+
importedPath: [...origin.importedPath, ...path],
|
|
303
350
|
})));
|
|
304
351
|
}
|
|
305
352
|
if (t.isConditionalExpression(node) || t.isLogicalExpression(node)) {
|
|
@@ -316,35 +363,12 @@ const provenanceForExpression = (node, context) => {
|
|
|
316
363
|
}
|
|
317
364
|
return semanticLocalProvenance();
|
|
318
365
|
};
|
|
319
|
-
const requireOrigin = (node, state) => {
|
|
320
|
-
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
|
321
|
-
if (!t.isNode(node.object))
|
|
322
|
-
return undefined;
|
|
323
|
-
const nested = requireOrigin(node.object, state);
|
|
324
|
-
const member = memberKey(node);
|
|
325
|
-
return nested === undefined || typeof member !== "string"
|
|
326
|
-
? undefined
|
|
327
|
-
: { ...nested, importedPath: [...nested.importedPath, member] };
|
|
328
|
-
}
|
|
329
|
-
if (!t.isCallExpression(node) ||
|
|
330
|
-
!t.isIdentifier(node.callee, { name: "require" }))
|
|
331
|
-
return undefined;
|
|
332
|
-
if (resolveSemanticBindingState(state, node.callee, "require") !== undefined ||
|
|
333
|
-
semanticResolutionBlocked(state, node.callee, "require"))
|
|
334
|
-
return undefined;
|
|
335
|
-
const specifier = stringValue(node.arguments[0]);
|
|
336
|
-
return specifier === undefined ? undefined : { specifier, importedPath: [] };
|
|
337
|
-
};
|
|
338
366
|
const mergeValues = (values) => {
|
|
339
367
|
const primitives = values.flatMap((value) => primitiveCandidates(value) ?? []);
|
|
340
368
|
return values.every((value) => value.status === "union" || value.status === "literal")
|
|
341
369
|
? primitiveSet(primitives)
|
|
342
370
|
: { status: "ambiguous", reason: "Branches have incompatible values." };
|
|
343
371
|
};
|
|
344
|
-
const memberKey = (node) => {
|
|
345
|
-
const name = semanticStaticPropertyName(node.property, node.computed);
|
|
346
|
-
return name === "" ? undefined : name;
|
|
347
|
-
};
|
|
348
372
|
const nestedContext = (context, bindingId) => ({
|
|
349
373
|
state: context.state,
|
|
350
374
|
bindings: bindingId === undefined
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
+
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
|
2
3
|
import { inspectElectronStaticNode } from "./electronStaticAnalysis.js";
|
|
3
4
|
import { detectVendors, failedJavaScriptStaticAnalysis, registrationKey, sortedUnique, stringValue, } from "./javascriptStaticAnalysisHelpers.js";
|
|
4
5
|
import { addReference, addSourceMapDirectives, inspectCall, inspectRouteProperty, inspectRoleProperty, } from "./javascriptStaticAnalysisCalls.js";
|
|
@@ -21,10 +22,12 @@ export const analyzeParsedJavaScriptStaticSource = (source, file) => {
|
|
|
21
22
|
return finalizeStaticAnalysis(source, file, accumulator);
|
|
22
23
|
};
|
|
23
24
|
const traverseStaticSource = (source, file, accumulator) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
traverseJavaScriptAst(file, {
|
|
26
|
+
enter: (node) => {
|
|
27
|
+
accumulator.visitedNodes += 1;
|
|
28
|
+
inspectNode(source, node, accumulator);
|
|
29
|
+
return undefined;
|
|
30
|
+
},
|
|
28
31
|
});
|
|
29
32
|
};
|
|
30
33
|
const finalizeStaticAnalysis = (source, file, accumulator) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
+
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
|
|
2
3
|
import { collectJavaScriptExports, fingerprintJavaScriptAst, } from "./javascriptAstFingerprint.js";
|
|
3
|
-
import { compareCodePoints } from "
|
|
4
|
+
import { compareCodePoints } from "../canonicalOrdering.js";
|
|
4
5
|
import { addFindingOnce } from "./javascriptStaticAnalysisFindings.js";
|
|
5
6
|
import { argumentValue, calleeName, chunkRuntime, factoryRequireName, moduleFactory, modulePropertyName, range, registrationKey, sha256Text, sourceSlice, staticArrayValues, } from "./javascriptStaticAnalysisHelpers.js";
|
|
6
7
|
/** Inspect a bundler registration call and recover its module table. */
|
|
@@ -160,17 +161,19 @@ const collectBundlerAsyncChunkKeys = (factory, requireName) => requireName === n
|
|
|
160
161
|
const collectBundlerCallArgumentValues = (factory, callee) => {
|
|
161
162
|
const values = [];
|
|
162
163
|
let unknown = 0;
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
traverseJavaScriptAst(factory, {
|
|
165
|
+
enter: (node) => {
|
|
166
|
+
if (!t.isCallExpression(node) && !t.isNewExpression(node))
|
|
167
|
+
return undefined;
|
|
168
|
+
if (calleeName(node.callee) !== callee)
|
|
169
|
+
return undefined;
|
|
170
|
+
const value = argumentValue(node.arguments[0]);
|
|
171
|
+
if (value === undefined)
|
|
172
|
+
unknown += 1;
|
|
173
|
+
else
|
|
174
|
+
values.push(value);
|
|
165
175
|
return undefined;
|
|
166
|
-
|
|
167
|
-
return undefined;
|
|
168
|
-
const value = argumentValue(node.arguments[0]);
|
|
169
|
-
if (value === undefined)
|
|
170
|
-
unknown += 1;
|
|
171
|
-
else
|
|
172
|
-
values.push(value);
|
|
173
|
-
return undefined;
|
|
176
|
+
},
|
|
174
177
|
});
|
|
175
178
|
return uniqueValues(values, unknown);
|
|
176
179
|
};
|
package/dist/domain/{javascriptStaticAnalysisCalls.js → javascript/javascriptStaticAnalysisCalls.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
import { sanitizeEndpointCandidate } from "
|
|
2
|
+
import { sanitizeEndpointCandidate } from "../browserObservation.js";
|
|
3
3
|
import { addFindingOnce, addLocatedFinding, moduleAtOffset, } from "./javascriptStaticAnalysisFindings.js";
|
|
4
4
|
import { STATIC_ROUTE_CALL_NAMES, argumentValue, calleeName, endpointArgument as endpointArgumentHelper, prefixedArgument, semanticStaticPropertyName, range, rangeForOffsets, sourceSlice, staticPath, staticPathResolutionContext, storageKind, stringValue, } from "./javascriptStaticAnalysisHelpers.js";
|
|
5
5
|
/** Inspect one call or new expression for references, endpoints, storage, and roles. */
|
|
@@ -103,7 +103,7 @@ const inspectEndpointCall = (node, name, first, context) => {
|
|
|
103
103
|
value: first,
|
|
104
104
|
mechanism: `call:${name}`,
|
|
105
105
|
});
|
|
106
|
-
const endpoint = endpointArgumentHelper(name, node.arguments);
|
|
106
|
+
const endpoint = endpointArgumentHelper(name, node.arguments, node.callee);
|
|
107
107
|
if (endpoint !== undefined)
|
|
108
108
|
addEndpoint(context, {
|
|
109
109
|
node,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { posix } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import * as t from "@babel/types";
|
|
4
5
|
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
|
|
5
|
-
import { compareCodePoints } from "
|
|
6
|
+
import { compareCodePoints } from "../canonicalOrdering.js";
|
|
6
7
|
export { propertyName, semanticStaticPropertyName, } from "./javascriptAstValues.js";
|
|
7
8
|
/** Explicit result for source text that Babel cannot parse. */
|
|
8
9
|
export const failedJavaScriptStaticAnalysis = () => ({
|
|
@@ -42,20 +43,34 @@ export const chunkRuntime = (call) => {
|
|
|
42
43
|
return findChunkRuntime(call.callee.object);
|
|
43
44
|
};
|
|
44
45
|
const findChunkRuntime = (node) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
const pending = [node];
|
|
47
|
+
while (pending.length > 0) {
|
|
48
|
+
const current = pending.pop();
|
|
49
|
+
if (current === undefined)
|
|
50
|
+
continue;
|
|
51
|
+
if (t.isIdentifier(current) &&
|
|
52
|
+
/(?:webpack|rspack)Chunk/iu.test(current.name))
|
|
53
|
+
return current.name;
|
|
54
|
+
if (t.isMemberExpression(current) ||
|
|
55
|
+
t.isOptionalMemberExpression(current)) {
|
|
56
|
+
const property = semanticStaticPropertyName(current.property, current.computed);
|
|
57
|
+
if (/(?:webpack|rspack)Chunk/iu.test(property))
|
|
58
|
+
return property;
|
|
59
|
+
if (t.isNode(current.object))
|
|
60
|
+
pending.push(current.object);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (t.isAssignmentExpression(current)) {
|
|
64
|
+
pending.push(current.right, current.left);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (t.isLogicalExpression(current) || t.isBinaryExpression(current)) {
|
|
68
|
+
pending.push(current.right, current.left);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (t.isParenthesizedExpression(current) || t.isTSAsExpression(current))
|
|
72
|
+
pending.push(current.expression);
|
|
52
73
|
}
|
|
53
|
-
if (t.isAssignmentExpression(node))
|
|
54
|
-
return findChunkRuntime(node.left) ?? findChunkRuntime(node.right);
|
|
55
|
-
if (t.isLogicalExpression(node) || t.isBinaryExpression(node))
|
|
56
|
-
return findChunkRuntime(node.left) ?? findChunkRuntime(node.right);
|
|
57
|
-
if (t.isParenthesizedExpression(node) || t.isTSAsExpression(node))
|
|
58
|
-
return findChunkRuntime(node.expression);
|
|
59
74
|
return undefined;
|
|
60
75
|
};
|
|
61
76
|
/** Return a literal function factory from one module-table property. */
|
|
@@ -125,8 +140,7 @@ const staticCallPath = (node) => {
|
|
|
125
140
|
? stringValue(node.arguments[0])
|
|
126
141
|
: undefined;
|
|
127
142
|
if (name === "fileURLToPath" || name.endsWith(".fileURLToPath")) {
|
|
128
|
-
|
|
129
|
-
return argument === undefined ? undefined : staticPathAt(argument);
|
|
143
|
+
return staticFileUrlPath(argumentNode(node.arguments[0]));
|
|
130
144
|
}
|
|
131
145
|
if ((name === "dirname" || name.endsWith(".dirname")) &&
|
|
132
146
|
isFileIdentity(argumentNode(node.arguments[0])))
|
|
@@ -148,6 +162,53 @@ const staticCallPath = (node) => {
|
|
|
148
162
|
}
|
|
149
163
|
return parts.length === 0 ? undefined : posix.join(...parts);
|
|
150
164
|
};
|
|
165
|
+
const staticFileUrlPath = (argument) => {
|
|
166
|
+
if (argument === undefined)
|
|
167
|
+
return undefined;
|
|
168
|
+
return isSourceFileUrl(argument)
|
|
169
|
+
? sourceRelativeFileUrlPath(argument)
|
|
170
|
+
: staticPathAt(argument);
|
|
171
|
+
};
|
|
172
|
+
/** Project a known source-relative URL through the actual file URL decoder. */
|
|
173
|
+
const sourceRelativeFileUrlPath = (node) => {
|
|
174
|
+
if (!isSourceFileUrl(node))
|
|
175
|
+
return undefined;
|
|
176
|
+
const value = stringValue(node.arguments[0]);
|
|
177
|
+
if (value === undefined ||
|
|
178
|
+
(value.split(/[?#]/u, 1)[0] ?? "") === "" ||
|
|
179
|
+
value !== value.trim() ||
|
|
180
|
+
value.includes("\\") ||
|
|
181
|
+
[...value].some((character) => character.charCodeAt(0) < 32) ||
|
|
182
|
+
/^[a-z][a-z0-9+.-]*:/iu.test(value) ||
|
|
183
|
+
value.startsWith("//") ||
|
|
184
|
+
/%(?:2e|2f|5c)/iu.test(value.split(/[?#]/u, 1)[0] ?? ""))
|
|
185
|
+
return undefined;
|
|
186
|
+
// A sufficiently deep inert anchor preserves any leading parent segments
|
|
187
|
+
// without using this host's cwd or inventing the application's directory.
|
|
188
|
+
const directory = `/${"source/".repeat(value.split("/").length + 1)}`;
|
|
189
|
+
try {
|
|
190
|
+
const resolved = new URL(value, `file://${directory}entry.js`);
|
|
191
|
+
const path = fileURLToPath(resolved, { windows: false });
|
|
192
|
+
if (value.startsWith("/"))
|
|
193
|
+
return path;
|
|
194
|
+
const relative = posix.relative(directory, path) || ".";
|
|
195
|
+
// Keep the established explicit source-directory observation spelling.
|
|
196
|
+
return value.startsWith("./") &&
|
|
197
|
+
relative !== "." &&
|
|
198
|
+
!relative.startsWith("../")
|
|
199
|
+
? `./${relative}`
|
|
200
|
+
: relative;
|
|
201
|
+
}
|
|
202
|
+
catch (cause) {
|
|
203
|
+
// Malformed escapes and non-file URL forms remain unknown.
|
|
204
|
+
void cause;
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
const isSourceFileUrl = (node) => (t.isCallExpression(node) || t.isNewExpression(node)) &&
|
|
209
|
+
(calleeName(node.callee) === "URL" ||
|
|
210
|
+
calleeName(node.callee).endsWith(".URL")) &&
|
|
211
|
+
isFileIdentity(argumentNode(node.arguments[1]));
|
|
151
212
|
const staticResolvedPath = (node) => {
|
|
152
213
|
const parts = [];
|
|
153
214
|
for (const argument of node.arguments) {
|
|
@@ -223,14 +284,135 @@ const isFileIdentity = (node) => {
|
|
|
223
284
|
return ((name === "fileURLToPath" || name.endsWith(".fileURLToPath")) &&
|
|
224
285
|
isFileIdentity(argumentNode(node.arguments[0])));
|
|
225
286
|
};
|
|
287
|
+
const XHR_METHODS = new Set([
|
|
288
|
+
"CONNECT",
|
|
289
|
+
"DELETE",
|
|
290
|
+
"GET",
|
|
291
|
+
"HEAD",
|
|
292
|
+
"OPTIONS",
|
|
293
|
+
"PATCH",
|
|
294
|
+
"POST",
|
|
295
|
+
"PUT",
|
|
296
|
+
"TRACE",
|
|
297
|
+
]);
|
|
298
|
+
/** An absolute HTTP(S)/WebSocket URL, or an absolute or relative path. */
|
|
299
|
+
const isRequestUrlLiteral = (value) => /^(?:https?|wss?):\/\//iu.test(value) ||
|
|
300
|
+
value.startsWith("/") ||
|
|
301
|
+
value.startsWith("./") ||
|
|
302
|
+
value.startsWith("../");
|
|
303
|
+
/**
|
|
304
|
+
* Browsing-context and document `open` take a URL or type first and a target
|
|
305
|
+
* name second. The name is only a spelling, since `parent` or `self` may be a
|
|
306
|
+
* local XHR binding, so it never overrides a literal HTTP method.
|
|
307
|
+
*/
|
|
308
|
+
const WINDOW_OPEN_CALL = /(?:^|\.)(?:window|self|globalThis|top|parent|opener|frames|document)\.open$/u;
|
|
309
|
+
/** Node `fs.open` flag strings, which are never request URLs. */
|
|
310
|
+
const FS_OPEN_FLAGS = new Set([
|
|
311
|
+
"a",
|
|
312
|
+
"a+",
|
|
313
|
+
"as",
|
|
314
|
+
"as+",
|
|
315
|
+
"ax",
|
|
316
|
+
"ax+",
|
|
317
|
+
"r",
|
|
318
|
+
"r+",
|
|
319
|
+
"rs",
|
|
320
|
+
"rs+",
|
|
321
|
+
"sa",
|
|
322
|
+
"sa+",
|
|
323
|
+
"sr",
|
|
324
|
+
"sr+",
|
|
325
|
+
"w",
|
|
326
|
+
"w+",
|
|
327
|
+
"wx",
|
|
328
|
+
"wx+",
|
|
329
|
+
"xa",
|
|
330
|
+
"xa+",
|
|
331
|
+
"xw",
|
|
332
|
+
"xw+",
|
|
333
|
+
]);
|
|
334
|
+
/** Reserved browsing-context names (ASCII case-insensitive). */
|
|
335
|
+
const BROWSING_CONTEXT_KEYWORDS = new Set([
|
|
336
|
+
"_blank",
|
|
337
|
+
"_parent",
|
|
338
|
+
"_self",
|
|
339
|
+
"_top",
|
|
340
|
+
]);
|
|
341
|
+
/**
|
|
342
|
+
* Read `XMLHttpRequest.open(method, url)`. `fs.open(path, "r")` and
|
|
343
|
+
* `window.open(url, "_blank")` share the callee name. A literal method must
|
|
344
|
+
* be an HTTP method; with a computed method, the second literal is a URL
|
|
345
|
+
* unless it is provably an fs flag or a browsing-context keyword, or the
|
|
346
|
+
* receiver is spelled as a browsing context or storage. XHR normalizes the standard
|
|
347
|
+
* methods' case; extension methods such as WebDAV `PROPFIND` are
|
|
348
|
+
* conventionally uppercase tokens.
|
|
349
|
+
*/
|
|
350
|
+
const xhrOpenUrl = (name, methodNode, urlNode) => {
|
|
351
|
+
const url = stringValue(urlNode);
|
|
352
|
+
if (url === undefined)
|
|
353
|
+
return undefined;
|
|
354
|
+
const method = stringValue(methodNode);
|
|
355
|
+
// IndexedDB and Cache Storage `open` take a name and a version, so a
|
|
356
|
+
// receiver spelled as storage needs a standard HTTP method literal.
|
|
357
|
+
const storage = storageKind(name) !== undefined;
|
|
358
|
+
if (method === undefined)
|
|
359
|
+
return storage ||
|
|
360
|
+
WINDOW_OPEN_CALL.test(name) ||
|
|
361
|
+
FS_OPEN_FLAGS.has(url) ||
|
|
362
|
+
BROWSING_CONTEXT_KEYWORDS.has(url.toLowerCase())
|
|
363
|
+
? undefined
|
|
364
|
+
: url;
|
|
365
|
+
return XHR_METHODS.has(method.toUpperCase()) ||
|
|
366
|
+
(!storage && /^[A-Z][A-Z-]*$/u.test(method))
|
|
367
|
+
? url
|
|
368
|
+
: undefined;
|
|
369
|
+
};
|
|
370
|
+
const KEYED_COLLECTION_CONSTRUCTORS = new Set([
|
|
371
|
+
"FormData",
|
|
372
|
+
"Headers",
|
|
373
|
+
"Map",
|
|
374
|
+
"Set",
|
|
375
|
+
"URLSearchParams",
|
|
376
|
+
"WeakMap",
|
|
377
|
+
"WeakSet",
|
|
378
|
+
]);
|
|
379
|
+
/**
|
|
380
|
+
* Whether a get/delete receiver is spelled as a keyed collection: a
|
|
381
|
+
* constructed Map, Set, Headers, FormData, or URLSearchParams, or a
|
|
382
|
+
* `headers`/`searchParams` property. Spelling alone does not prove the
|
|
383
|
+
* binding, so callers keep URL and path literals as requests.
|
|
384
|
+
*/
|
|
385
|
+
const isKeyedCollectionReceiver = (callee) => {
|
|
386
|
+
if (!t.isMemberExpression(callee) && !t.isOptionalMemberExpression(callee))
|
|
387
|
+
return false;
|
|
388
|
+
const receiver = callee.object;
|
|
389
|
+
if (t.isNewExpression(receiver))
|
|
390
|
+
return (t.isIdentifier(receiver.callee) &&
|
|
391
|
+
KEYED_COLLECTION_CONSTRUCTORS.has(receiver.callee.name));
|
|
392
|
+
if (!t.isMemberExpression(receiver) &&
|
|
393
|
+
!t.isOptionalMemberExpression(receiver))
|
|
394
|
+
return false;
|
|
395
|
+
const property = semanticStaticPropertyName(receiver.property, receiver.computed);
|
|
396
|
+
return property === "headers" || property === "searchParams";
|
|
397
|
+
};
|
|
226
398
|
/** Select the literal URL argument for recognized network callees. */
|
|
227
|
-
export const endpointArgument = (name, args) => {
|
|
399
|
+
export const endpointArgument = (name, args, callee) => {
|
|
228
400
|
if (name === "fetch" || name.endsWith(".fetch") || name === "WebSocket")
|
|
229
401
|
return stringValue(args[0]);
|
|
230
|
-
if (name.endsWith(".open")
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
|
|
402
|
+
if (name.endsWith(".open"))
|
|
403
|
+
return xhrOpenUrl(name, args[0], args[1]);
|
|
404
|
+
const method = ["get", "post", "put", "patch", "delete", "request"].find((candidate) => name === candidate || name.endsWith(`.${candidate}`));
|
|
405
|
+
if (method !== undefined) {
|
|
406
|
+
const value = stringValue(args[0]);
|
|
407
|
+
// Only get and delete also belong to the keyed-collection APIs, whose
|
|
408
|
+
// keys are header, field, and parameter names rather than URLs or paths.
|
|
409
|
+
return value !== undefined &&
|
|
410
|
+
(method === "get" || method === "delete") &&
|
|
411
|
+
!isRequestUrlLiteral(value) &&
|
|
412
|
+
isKeyedCollectionReceiver(callee)
|
|
413
|
+
? undefined
|
|
414
|
+
: value;
|
|
415
|
+
}
|
|
234
416
|
if (name.endsWith("loadURL"))
|
|
235
417
|
return stringValue(args[0]);
|
|
236
418
|
return undefined;
|
|
@@ -250,20 +432,24 @@ export const storageKind = (name) => {
|
|
|
250
432
|
return undefined;
|
|
251
433
|
};
|
|
252
434
|
/** Produce a dotted callee name from member syntax. */
|
|
253
|
-
export const calleeName = (node) =>
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
// A dynamic key commits no name: `target[method]()` must not be reported as
|
|
262
|
-
// `target.method`, which would fabricate a runtime call shape.
|
|
263
|
-
const property = memberPropertyName(node);
|
|
264
|
-
return object === "" ? property : `${object}.${property}`;
|
|
435
|
+
export const calleeName = (node) => {
|
|
436
|
+
const segments = [];
|
|
437
|
+
while (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
|
438
|
+
// Dynamic keys retain their syntax identity instead of inventing a name.
|
|
439
|
+
segments.push(memberPropertyName(node));
|
|
440
|
+
if (!t.isNode(node.object))
|
|
441
|
+
break;
|
|
442
|
+
node = node.object;
|
|
265
443
|
}
|
|
266
|
-
|
|
444
|
+
const base = t.isIdentifier(node)
|
|
445
|
+
? node.name
|
|
446
|
+
: t.isImport(node)
|
|
447
|
+
? "import"
|
|
448
|
+
: "";
|
|
449
|
+
segments.push(base);
|
|
450
|
+
segments.reverse();
|
|
451
|
+
const first = segments.findIndex((segment) => segment !== "");
|
|
452
|
+
return first === -1 ? "" : segments.slice(first).join(".");
|
|
267
453
|
};
|
|
268
454
|
/** Read a member property only when its syntax commits an exact name. */
|
|
269
455
|
const memberPropertyName = (node) => node.computed &&
|
|
@@ -271,14 +457,19 @@ const memberPropertyName = (node) => node.computed &&
|
|
|
271
457
|
!t.isNumericLiteral(node.property)
|
|
272
458
|
? `[computed@${String(node.property.start ?? -1)}]`
|
|
273
459
|
: semanticStaticPropertyName(node.property, node.computed);
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
460
|
+
/**
|
|
461
|
+
* Return a string literal value without evaluating an expression. A template
|
|
462
|
+
* literal without substitutions denotes the same exact string.
|
|
463
|
+
*/
|
|
464
|
+
export const stringValue = (node) => {
|
|
465
|
+
if (t.isStringLiteral(node))
|
|
466
|
+
return node.value;
|
|
467
|
+
if (t.isTemplateLiteral(node) && node.expressions.length === 0)
|
|
468
|
+
return node.quasis[0]?.value.cooked ?? undefined;
|
|
280
469
|
return undefined;
|
|
281
470
|
};
|
|
471
|
+
/** Return a string or numeric argument literal. */
|
|
472
|
+
export const argumentValue = (node) => t.isNumericLiteral(node) ? String(node.value) : stringValue(node);
|
|
282
473
|
/** Prefix a static argument value when one is available. */
|
|
283
474
|
export const prefixedArgument = (prefix, node) => {
|
|
284
475
|
const value = argumentValue(node);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compareCodePoints, uniqueSorted } from "
|
|
2
|
-
import { absenceClaimable, canonicalDigest } from "
|
|
1
|
+
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
|
|
2
|
+
import { absenceClaimable, canonicalDigest } from "../comparisonSemantics.js";
|
|
3
3
|
import { SOURCE_TO_BUNDLE_SIGNAL_WEIGHTS, sourceToBundleComparisonResultSchema, } from "./sourceToBundleComparisonSchemas.js";
|
|
4
4
|
import { buildSourceToBundleCandidateIndex, candidateIdsForSource, historicalSourceFiles, scoreSourceToBundleCandidate, sourceBearingNodes, } from "./sourceToBundleSignals.js";
|
|
5
5
|
/** Compare historical source files to static source-bearing application nodes. */
|