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
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { inferJsonShape } from "../domain/jsonShape.js";
|
|
3
3
|
import { CdpCaptureCompleteness } from "./CdpCaptureCompleteness.js";
|
|
4
4
|
import { BrowserObservationError } from "../domain/browserObservationError.js";
|
|
5
|
-
import { allowedSanitizedUrl, delayWithCancellation, numberValue, recordValue, recordsValue,
|
|
5
|
+
import { allowedSanitizedUrl, delayWithCancellation, numberValue, recordValue, recordsValue, cdpStringValue, } from "./CdpCaptureValues.js";
|
|
6
6
|
import { captureFrames, mainFrameUrl, walkFrameTrees, } from "./CdpCaptureDocuments.js";
|
|
7
7
|
import { optionalCdpCommand } from "./CdpOptionalCommand.js";
|
|
8
8
|
/** Discover WebMCP registrations without evaluating or invoking page code. */
|
|
@@ -96,10 +96,13 @@ const initialFrameScope = (frameTree, frames, completeness) => {
|
|
|
96
96
|
return scoped;
|
|
97
97
|
for (const tree of walkFrameTrees(root, () => completeness.exclude("webmcp_tools", "invalid_protocol_value"))) {
|
|
98
98
|
const frame = recordValue(tree.frame);
|
|
99
|
-
const frameId =
|
|
99
|
+
const frameId = cdpStringValue(frame?.id);
|
|
100
100
|
const prior = frameId === undefined ? undefined : scoped.get(frameId);
|
|
101
101
|
if (frameId !== undefined && prior !== undefined)
|
|
102
|
-
scoped.set(frameId, {
|
|
102
|
+
scoped.set(frameId, {
|
|
103
|
+
...prior,
|
|
104
|
+
loaderId: cdpStringValue(frame?.loaderId),
|
|
105
|
+
});
|
|
103
106
|
}
|
|
104
107
|
return scoped;
|
|
105
108
|
};
|
|
@@ -119,7 +122,7 @@ const ingestFrameScopeEvent = (event, state) => {
|
|
|
119
122
|
}
|
|
120
123
|
};
|
|
121
124
|
const handleFrameDetached = (params, state) => {
|
|
122
|
-
const frameId =
|
|
125
|
+
const frameId = cdpStringValue(params.frameId);
|
|
123
126
|
if (frameId === undefined) {
|
|
124
127
|
state.completeness.exclude("webmcp_tools", "invalid_protocol_value");
|
|
125
128
|
return true;
|
|
@@ -134,12 +137,12 @@ const handleFrameUpdate = (frame, state, documentCommitted) => {
|
|
|
134
137
|
state.completeness.exclude("webmcp_tools", "invalid_protocol_value");
|
|
135
138
|
return true;
|
|
136
139
|
}
|
|
137
|
-
const frameId =
|
|
140
|
+
const frameId = cdpStringValue(frame?.id) ?? cdpStringValue(frame?.frameId);
|
|
138
141
|
if (frameId === undefined) {
|
|
139
142
|
state.completeness.exclude("webmcp_tools", "invalid_protocol_value");
|
|
140
143
|
return true;
|
|
141
144
|
}
|
|
142
|
-
const rawUrl =
|
|
145
|
+
const rawUrl = cdpStringValue(frame?.url);
|
|
143
146
|
// Chromium can briefly commit an inherited, empty document while replacing
|
|
144
147
|
// a subframe. That intermediate URL says nothing about the frame's eventual
|
|
145
148
|
// scope or its registered tools; wait for the next committed URL (or the
|
|
@@ -164,7 +167,7 @@ const updateFrameScope = (frame, frameId, state, documentCommitted) => {
|
|
|
164
167
|
return;
|
|
165
168
|
}
|
|
166
169
|
const previous = state.frames.get(frameId);
|
|
167
|
-
const loaderId =
|
|
170
|
+
const loaderId = cdpStringValue(frame?.loaderId);
|
|
168
171
|
if (hasNewDocument(documentCommitted, previous, url.url, loaderId))
|
|
169
172
|
removeFrameTools(frameId, state.tools);
|
|
170
173
|
if (documentCommitted && state.transientFrames.has(frameId))
|
|
@@ -173,7 +176,7 @@ const updateFrameScope = (frame, frameId, state, documentCommitted) => {
|
|
|
173
176
|
url: url.url,
|
|
174
177
|
origin: url.origin,
|
|
175
178
|
...(loaderId === undefined ? {} : { loaderId }),
|
|
176
|
-
parentFrameId: (
|
|
179
|
+
parentFrameId: (cdpStringValue(frame?.parentId) ??
|
|
177
180
|
state.frames.get(frameId)?.parentFrameId ??
|
|
178
181
|
"") ||
|
|
179
182
|
null,
|
|
@@ -223,8 +226,8 @@ const ingestWebMcpEvent = (options) => {
|
|
|
223
226
|
return;
|
|
224
227
|
if (event.method === "WebMCP.toolsRemoved") {
|
|
225
228
|
for (const removed of recordsValue(params.tools)) {
|
|
226
|
-
const name =
|
|
227
|
-
const frameId =
|
|
229
|
+
const name = cdpStringValue(removed.name);
|
|
230
|
+
const frameId = cdpStringValue(removed.frameId);
|
|
228
231
|
if (name === undefined || frameId === undefined)
|
|
229
232
|
continue;
|
|
230
233
|
for (const [key, tool] of tools)
|
|
@@ -236,7 +239,7 @@ const ingestWebMcpEvent = (options) => {
|
|
|
236
239
|
if (event.method !== "WebMCP.toolsAdded")
|
|
237
240
|
return;
|
|
238
241
|
for (const declared of recordsValue(params.tools)) {
|
|
239
|
-
const frameId =
|
|
242
|
+
const frameId = cdpStringValue(declared.frameId);
|
|
240
243
|
if (frameId !== undefined && transientFrames.has(frameId)) {
|
|
241
244
|
if (!resolvedTransientFrames.has(frameId))
|
|
242
245
|
continue;
|
|
@@ -250,8 +253,8 @@ const ingestWebMcpEvent = (options) => {
|
|
|
250
253
|
}
|
|
251
254
|
};
|
|
252
255
|
const normalizeTool = (value, input, frames, completeness) => {
|
|
253
|
-
const frameId =
|
|
254
|
-
const name =
|
|
256
|
+
const frameId = cdpStringValue(value.frameId);
|
|
257
|
+
const name = cdpStringValue(value.name);
|
|
255
258
|
const frame = frameId === undefined ? undefined : frames.get(frameId);
|
|
256
259
|
if (frameId === undefined ||
|
|
257
260
|
name === undefined ||
|
|
@@ -260,10 +263,10 @@ const normalizeTool = (value, input, frames, completeness) => {
|
|
|
260
263
|
completeness.exclude("webmcp_tools", "out_of_target_scope");
|
|
261
264
|
return undefined;
|
|
262
265
|
}
|
|
263
|
-
const description =
|
|
266
|
+
const description = cdpStringValue(value.description) ?? "";
|
|
264
267
|
const annotations = recordValue(value.annotations);
|
|
265
268
|
return {
|
|
266
|
-
tool_key: toolKey(frame.url, name),
|
|
269
|
+
tool_key: toolKey(frame.url, frameId, name),
|
|
267
270
|
name,
|
|
268
271
|
description,
|
|
269
272
|
frame_id: frameId,
|
|
@@ -322,7 +325,10 @@ const buildWebMcpResult = (options) => {
|
|
|
322
325
|
limitations,
|
|
323
326
|
};
|
|
324
327
|
};
|
|
325
|
-
const toolKey = (frameUrl, name) =>
|
|
328
|
+
const toolKey = (frameUrl, frameId, name) =>
|
|
329
|
+
// Registrations without a known admitted frame are excluded above, so the
|
|
330
|
+
// frame ID here always distinguishes owners and keys cannot collapse.
|
|
331
|
+
`webmcp_${createHash("sha256").update(`${frameUrl}\0${frameId}\0${name}`).digest("hex")}`;
|
|
326
332
|
const booleanOrNull = (value) => typeof value === "boolean" ? value : null;
|
|
327
333
|
const integerOrNull = (value) => {
|
|
328
334
|
const number = numberValue(value);
|
|
@@ -11,11 +11,8 @@ const lazyPlaywrightFactory = {
|
|
|
11
11
|
return (await defaultFactory).open(scenario, options);
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
name: "REA Playwright browser scenario capture provider",
|
|
17
|
-
version: "1",
|
|
18
|
-
});
|
|
14
|
+
export { PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY } from "./providerIdentities.js";
|
|
15
|
+
import { PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY } from "./providerIdentities.js";
|
|
19
16
|
const SNAPSHOT_KINDS = [
|
|
20
17
|
"screenshot",
|
|
21
18
|
"dom",
|
|
@@ -189,6 +186,7 @@ const runScenario = async (factory, scenario, options) => {
|
|
|
189
186
|
start_origin: new URL(scenario.start_url.url).origin,
|
|
190
187
|
action_count: scenario.actions.length,
|
|
191
188
|
secret_references: scenario.secrets.map(({ secret_id: id }) => id).sort(),
|
|
189
|
+
network_content: scenario.capture.network,
|
|
192
190
|
},
|
|
193
191
|
duration_ms: Date.now() - startedAt,
|
|
194
192
|
steps,
|
|
@@ -196,7 +194,10 @@ const runScenario = async (factory, scenario, options) => {
|
|
|
196
194
|
completeness,
|
|
197
195
|
limitations: [
|
|
198
196
|
"Event sequence records provider receipt order; simultaneous browser causality is not inferred.",
|
|
199
|
-
"
|
|
197
|
+
"Network content is retained only when selected; response bytes are browser-decoded, not compressed wire bytes.",
|
|
198
|
+
"Request bytes are limited to what Playwright exposes; not_exposed does not establish body absence or multipart file coverage.",
|
|
199
|
+
"Network content reads settle within 5 seconds each and never wait for unfinished responses or refetch them.",
|
|
200
|
+
"Playwright scenario events do not expose request initiator stacks; receipt order does not prove causality.",
|
|
200
201
|
"Storage values are hashed only after declared-secret redaction.",
|
|
201
202
|
...(session.eventLimitations?.() ?? []),
|
|
202
203
|
...(session.mode === "connect"
|
|
@@ -3,7 +3,7 @@ import { dirname } from "node:path";
|
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { _electron as electron } from "playwright-core";
|
|
6
|
-
import { electronActiveObservationResultSchema, } from "../domain/electronActiveObservation.js";
|
|
6
|
+
import { electronActiveObservationResultSchema, } from "../domain/javascript/electronActiveObservation.js";
|
|
7
7
|
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
|
8
8
|
import { BrowserObservationError } from "../domain/browserObservationError.js";
|
|
9
9
|
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
@@ -15,11 +15,8 @@ import { runElectronActions, readApplicationState, runWithExecutionLimits, } fro
|
|
|
15
15
|
const OPERATION = "capture_electron_scenario";
|
|
16
16
|
const STARTUP_TIMEOUT_MS = 60_000;
|
|
17
17
|
/** Public identity for provider-owned Electron runtime experiments. */
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
name: "REA Playwright active Electron observation provider",
|
|
21
|
-
version: "1",
|
|
22
|
-
});
|
|
18
|
+
export { PLAYWRIGHT_ELECTRON_ACTIVE_PROVIDER_IDENTITY } from "./providerIdentities.js";
|
|
19
|
+
import { PLAYWRIGHT_ELECTRON_ACTIVE_PROVIDER_IDENTITY } from "./providerIdentities.js";
|
|
23
20
|
const hookPath = fileURLToPath(new URL("../../scripts/electron-active-hook.cjs", import.meta.url));
|
|
24
21
|
const observableEventFamilies = [
|
|
25
22
|
"app-lifecycle",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { browserScenarioEventSchema, } from "../domain/browserScenarioCapture.js";
|
|
2
|
+
import { PlaywrightScenarioNetwork } from "./network/PlaywrightScenarioNetwork.js";
|
|
2
3
|
/** Arrival-ordered Playwright event capture with current-step attribution. */
|
|
3
4
|
export class PlaywrightScenarioEvents {
|
|
4
5
|
items = [];
|
|
@@ -9,8 +10,18 @@ export class PlaywrightScenarioEvents {
|
|
|
9
10
|
ownsContext;
|
|
10
11
|
pages = new Set();
|
|
11
12
|
incompleteFamilies = new Set();
|
|
13
|
+
network;
|
|
14
|
+
stopNetwork;
|
|
15
|
+
sealed = false;
|
|
12
16
|
constructor(options) {
|
|
13
|
-
|
|
17
|
+
const network = options.network ?? {
|
|
18
|
+
request_body: false,
|
|
19
|
+
response_body: false,
|
|
20
|
+
header_values: false,
|
|
21
|
+
};
|
|
22
|
+
this.enabled = new Set(options.enabled);
|
|
23
|
+
if (network.request_body || network.response_body || network.header_values)
|
|
24
|
+
this.enabled = new Set([...this.enabled, "network"]);
|
|
14
25
|
this.secrets = options.secrets;
|
|
15
26
|
this.ownsContext = options.ownsContext === true;
|
|
16
27
|
this.pages.add(options.page);
|
|
@@ -18,6 +29,13 @@ export class PlaywrightScenarioEvents {
|
|
|
18
29
|
(options.context ?? options.page.context()).on("page", (page) => this.popup(page));
|
|
19
30
|
if (this.enabled.has("network")) {
|
|
20
31
|
const context = options.context ?? options.page.context();
|
|
32
|
+
const collector = new PlaywrightScenarioNetwork({
|
|
33
|
+
selection: network,
|
|
34
|
+
secrets: options.secrets,
|
|
35
|
+
emit: (event) => this.push(event),
|
|
36
|
+
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
37
|
+
});
|
|
38
|
+
this.network = collector;
|
|
21
39
|
const inScope = (request) => {
|
|
22
40
|
if (this.ownsContext)
|
|
23
41
|
return true;
|
|
@@ -31,18 +49,32 @@ export class PlaywrightScenarioEvents {
|
|
|
31
49
|
return false;
|
|
32
50
|
}
|
|
33
51
|
};
|
|
34
|
-
|
|
52
|
+
const onRequest = (request) => {
|
|
35
53
|
if (inScope(request))
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
54
|
+
collector.request(request);
|
|
55
|
+
};
|
|
56
|
+
const onResponse = (response) => {
|
|
39
57
|
if (inScope(response.request()))
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
58
|
+
collector.response(response);
|
|
59
|
+
};
|
|
60
|
+
const onFailed = (request) => {
|
|
43
61
|
if (inScope(request))
|
|
44
|
-
|
|
45
|
-
}
|
|
62
|
+
collector.failed(request);
|
|
63
|
+
};
|
|
64
|
+
const onFinished = (request) => {
|
|
65
|
+
if (inScope(request))
|
|
66
|
+
collector.finished(request);
|
|
67
|
+
};
|
|
68
|
+
context.on("request", onRequest);
|
|
69
|
+
context.on("response", onResponse);
|
|
70
|
+
context.on("requestfailed", onFailed);
|
|
71
|
+
context.on("requestfinished", onFinished);
|
|
72
|
+
this.stopNetwork = () => {
|
|
73
|
+
context.off("request", onRequest);
|
|
74
|
+
context.off("response", onResponse);
|
|
75
|
+
context.off("requestfailed", onFailed);
|
|
76
|
+
context.off("requestfinished", onFinished);
|
|
77
|
+
};
|
|
46
78
|
}
|
|
47
79
|
this.observePage(options.page);
|
|
48
80
|
}
|
|
@@ -55,15 +87,27 @@ export class PlaywrightScenarioEvents {
|
|
|
55
87
|
lastSequence() {
|
|
56
88
|
return this.sequence;
|
|
57
89
|
}
|
|
90
|
+
/** Drain selected network content and freeze the result before browser teardown. */
|
|
91
|
+
async finish() {
|
|
92
|
+
this.stopNetwork?.();
|
|
93
|
+
this.stopNetwork = undefined;
|
|
94
|
+
try {
|
|
95
|
+
await this.network?.finish();
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
this.sealed = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
58
101
|
/** Report selected popup event families with unrecoverable pre-discovery gaps. */
|
|
59
102
|
limitations() {
|
|
60
103
|
const popupGaps = [...this.incompleteFamilies].map((family) => `Popup ${family} events before Page discovery are unavailable; later events are retained.`);
|
|
104
|
+
const gaps = [...popupGaps, ...(this.network?.limitations() ?? [])];
|
|
61
105
|
return this.enabled.has("network") && !this.ownsContext
|
|
62
106
|
? [
|
|
63
107
|
"Shared-context network capture excludes requests without a known root or descendant Page frame.",
|
|
64
|
-
...
|
|
108
|
+
...gaps,
|
|
65
109
|
]
|
|
66
|
-
:
|
|
110
|
+
: gaps;
|
|
67
111
|
}
|
|
68
112
|
result() {
|
|
69
113
|
return {
|
|
@@ -73,6 +117,8 @@ export class PlaywrightScenarioEvents {
|
|
|
73
117
|
};
|
|
74
118
|
}
|
|
75
119
|
push(event) {
|
|
120
|
+
if (this.sealed)
|
|
121
|
+
return this.sequence;
|
|
76
122
|
this.sequence += 1;
|
|
77
123
|
const parsed = browserScenarioEventSchema.parse({
|
|
78
124
|
...event,
|
|
@@ -80,6 +126,7 @@ export class PlaywrightScenarioEvents {
|
|
|
80
126
|
step_index: this.stepIndex,
|
|
81
127
|
});
|
|
82
128
|
this.items.push(parsed);
|
|
129
|
+
return this.sequence;
|
|
83
130
|
}
|
|
84
131
|
observePage(page) {
|
|
85
132
|
if (this.enabled.has("console"))
|
|
@@ -120,45 +167,6 @@ export class PlaywrightScenarioEvents {
|
|
|
120
167
|
url: location.url === "" ? null : this.safeUrl(location.url),
|
|
121
168
|
});
|
|
122
169
|
}
|
|
123
|
-
request(kind, request) {
|
|
124
|
-
const observation = {
|
|
125
|
-
method: this.secrets.redact(request.method()),
|
|
126
|
-
url: this.safeUrl(request.url()),
|
|
127
|
-
resource_type: this.secrets.redact(request.resourceType()),
|
|
128
|
-
header_names: Object.keys(request.headers())
|
|
129
|
-
.map((name) => this.secrets.redact(name))
|
|
130
|
-
.sort(),
|
|
131
|
-
};
|
|
132
|
-
if (kind === "request-failed") {
|
|
133
|
-
this.push({
|
|
134
|
-
...observation,
|
|
135
|
-
kind,
|
|
136
|
-
status: null,
|
|
137
|
-
failure: this.secrets.redact(request.failure()?.errorText ?? "unknown"),
|
|
138
|
-
});
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
this.push({
|
|
142
|
-
...observation,
|
|
143
|
-
kind,
|
|
144
|
-
status: null,
|
|
145
|
-
failure: null,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
response(response) {
|
|
149
|
-
const request = response.request();
|
|
150
|
-
this.push({
|
|
151
|
-
kind: "response",
|
|
152
|
-
method: this.secrets.redact(request.method()),
|
|
153
|
-
url: this.safeUrl(response.url()),
|
|
154
|
-
resource_type: this.secrets.redact(request.resourceType()),
|
|
155
|
-
status: response.status(),
|
|
156
|
-
header_names: Object.keys(response.headers())
|
|
157
|
-
.map((name) => this.secrets.redact(name))
|
|
158
|
-
.sort(),
|
|
159
|
-
failure: null,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
170
|
webSocket(socket) {
|
|
163
171
|
const url = this.safeUrl(socket.url());
|
|
164
172
|
this.push({ kind: "websocket-opened", url });
|
|
@@ -109,6 +109,8 @@ export class PlaywrightScenarioSession {
|
|
|
109
109
|
ownsContext: scenario.browser.mode === "launch",
|
|
110
110
|
enabled: new Set(scenario.capture.events),
|
|
111
111
|
secrets,
|
|
112
|
+
network: scenario.capture.network,
|
|
113
|
+
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
112
114
|
});
|
|
113
115
|
const session = new PlaywrightScenarioSession(opened, {
|
|
114
116
|
mode: scenario.browser.mode,
|
|
@@ -170,7 +172,12 @@ export class PlaywrightScenarioSession {
|
|
|
170
172
|
? "terminated-owned-process"
|
|
171
173
|
: "disconnected-external";
|
|
172
174
|
this.closed = true;
|
|
173
|
-
|
|
175
|
+
try {
|
|
176
|
+
await this.eventCapture.finish();
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
await closePlaywrightScenarioBrowser(this.opened, this.signal);
|
|
180
|
+
}
|
|
174
181
|
return this.mode === "launch"
|
|
175
182
|
? "terminated-owned-process"
|
|
176
183
|
: "disconnected-external";
|
|
@@ -2,12 +2,14 @@ import * as t from "@babel/types";
|
|
|
2
2
|
import { AnyMap, eachMapping } from "@jridgewell/trace-mapping";
|
|
3
3
|
import { sanitizeBrowserUrl } from "../domain/browserObservation.js";
|
|
4
4
|
import { isUrlLikeModuleSpecifier } from "../domain/webBundleAnalyzerAst.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { analyzeParsedJavaScriptReferences } from "../domain/javascript/javascriptSemanticAnalysis.js";
|
|
6
|
+
import { traverseJavaScriptAst } from "../domain/javascript/javascriptSemanticTraversal.js";
|
|
7
|
+
import { parseJavaScriptSource } from "../domain/javascript/javascriptSourceParser.js";
|
|
7
8
|
import { hasValidSourceMapContents } from "../domain/sourceMapContents.js";
|
|
8
9
|
import { webSourceMapsSchema } from "../domain/webBundleAnalysis.js";
|
|
9
10
|
import { createWebTextArtifact } from "../domain/webContentArtifact.js";
|
|
10
11
|
import { safeParseJson } from "../domain/safeJson.js";
|
|
12
|
+
import { flattenSourceMapLeaves, isVersion3Map, } from "../domain/sourceMapEnvelope.js";
|
|
11
13
|
/** Fetch and validate approved source maps without browser credentials. */
|
|
12
14
|
export const fetchWebSourceMaps = async (requests, input, signal, host = { fetch: globalThis.fetch }) => {
|
|
13
15
|
const items = [];
|
|
@@ -150,32 +152,32 @@ const originalModuleEdges = (sources) => {
|
|
|
150
152
|
if (parsed.errors.length > 0)
|
|
151
153
|
incomplete.push(source.source);
|
|
152
154
|
let unboundRequires;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const { kind, specifier } = dependency;
|
|
158
|
-
if (kind === "require" && t.isCallExpression(node)) {
|
|
159
|
-
unboundRequires ??= new Set(analyzeParsedJavaScriptSemantics(parsed)
|
|
160
|
-
.references.filter(({ name, role, resolution }) => name === "require" &&
|
|
161
|
-
role === "read" &&
|
|
162
|
-
resolution === "unbound")
|
|
163
|
-
.map(({ location }) => `${String(location.start.line)}:${String(location.start.column)}`));
|
|
164
|
-
const location = node.callee.loc?.start;
|
|
165
|
-
if (location === undefined ||
|
|
166
|
-
!unboundRequires.has(`${String(location.line)}:${String(location.column)}`))
|
|
155
|
+
traverseJavaScriptAst(parsed, {
|
|
156
|
+
enter: (node) => {
|
|
157
|
+
const dependency = originalDependency(node);
|
|
158
|
+
if (dependency === null)
|
|
167
159
|
return;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
160
|
+
const { kind, specifier } = dependency;
|
|
161
|
+
if (kind === "require" && t.isCallExpression(node)) {
|
|
162
|
+
unboundRequires ??= new Set(analyzeParsedJavaScriptReferences(parsed, "require")
|
|
163
|
+
.filter(({ role, resolution }) => role === "read" && resolution === "unbound")
|
|
164
|
+
.map(({ location }) => `${String(location.start.line)}:${String(location.start.column)}`));
|
|
165
|
+
const location = node.callee.loc?.start;
|
|
166
|
+
if (location === undefined ||
|
|
167
|
+
!unboundRequires.has(`${String(location.line)}:${String(location.column)}`))
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const key = `${source.source}\0${kind}\0${specifier}`;
|
|
171
|
+
if (seen.has(key))
|
|
172
|
+
return;
|
|
173
|
+
seen.add(key);
|
|
174
|
+
edges.push({
|
|
175
|
+
from_source: source.source,
|
|
176
|
+
kind,
|
|
177
|
+
specifier,
|
|
178
|
+
resolved_source: resolveOriginalSource(specifier, source.source),
|
|
179
|
+
});
|
|
180
|
+
},
|
|
179
181
|
});
|
|
180
182
|
}
|
|
181
183
|
return { edges, incomplete };
|
|
@@ -185,33 +187,13 @@ const validSourceMapEnvelope = (text) => {
|
|
|
185
187
|
if (!parsedResult.ok)
|
|
186
188
|
return false;
|
|
187
189
|
const parsed = parsedResult.value;
|
|
188
|
-
if (
|
|
189
|
-
return false;
|
|
190
|
-
if (typeof parsed.mappings === "string")
|
|
190
|
+
if (isVersion3Map(parsed) && typeof parsed.mappings === "string")
|
|
191
191
|
return validSourceMapLeaf(parsed);
|
|
192
|
-
|
|
192
|
+
const leaves = flattenSourceMapLeaves(parsed, { validateOffsets: true });
|
|
193
|
+
if (leaves === undefined)
|
|
193
194
|
return false;
|
|
194
|
-
|
|
195
|
-
while (pending.length > 0) {
|
|
196
|
-
const section = pending.pop();
|
|
197
|
-
if (!isRecord(section) ||
|
|
198
|
-
!isRecord(section.offset) ||
|
|
199
|
-
!validSourceMapOffset(section.offset.line) ||
|
|
200
|
-
!validSourceMapOffset(section.offset.column) ||
|
|
201
|
-
!("map" in section))
|
|
202
|
-
return false;
|
|
203
|
-
const map = section.map;
|
|
204
|
-
if (!isRecord(map) || map.version !== 3)
|
|
205
|
-
return false;
|
|
206
|
-
if (Array.isArray(map.sections))
|
|
207
|
-
for (const child of map.sections)
|
|
208
|
-
pending.push(child);
|
|
209
|
-
else if (!validSourceMapLeaf(map))
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
return true;
|
|
195
|
+
return leaves.every(validSourceMapLeaf);
|
|
213
196
|
};
|
|
214
|
-
const validSourceMapOffset = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
215
197
|
const validSourceMapLeaf = (map) => typeof map.mappings === "string" &&
|
|
216
198
|
Array.isArray(map.sources) &&
|
|
217
199
|
Array.isArray(map.names) &&
|
|
@@ -265,10 +247,12 @@ const resolveOriginalSource = (specifier, base) => {
|
|
|
265
247
|
return null;
|
|
266
248
|
}
|
|
267
249
|
};
|
|
268
|
-
const sourceMediaType = (source) => source?.endsWith(".ts") ||
|
|
250
|
+
const sourceMediaType = (source) => source?.endsWith(".ts") ||
|
|
251
|
+
source?.endsWith(".tsx") ||
|
|
252
|
+
source?.endsWith(".mts") ||
|
|
253
|
+
source?.endsWith(".cts")
|
|
269
254
|
? "text/typescript"
|
|
270
255
|
: "text/javascript";
|
|
271
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
272
256
|
const originalDependency = (node) => {
|
|
273
257
|
if (t.isImportDeclaration(node) ||
|
|
274
258
|
t.isExportAllDeclaration(node) ||
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
2
|
+
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
3
|
+
import { ArtifactReaderFailure } from "../../artifacts/ArtifactReader.js";
|
|
4
|
+
import { readStableArtifact } from "../../artifacts/readStableArtifact.js";
|
|
5
|
+
import { normalizeArtifactPath } from "../../artifacts/ArtifactPaths.js";
|
|
6
|
+
import { AnalysisCapabilityUnavailableError } from "../../domain/analysisErrorCore.js";
|
|
7
|
+
import { err, ok } from "../../domain/result.js";
|
|
8
|
+
import { webScriptExportManifestSchema } from "../../domain/webScriptExport.js";
|
|
9
|
+
import { decodeWebArtifact, readWebArtifactJson, webArtifactReadError, WebArtifactFormatFailure, } from "./WebArtifactReads.js";
|
|
10
|
+
/** Read one digest-verified captured source under the manifest's current location. */
|
|
11
|
+
export class LocalWebScriptArtifacts {
|
|
12
|
+
operation;
|
|
13
|
+
constructor(operation) {
|
|
14
|
+
this.operation = operation;
|
|
15
|
+
}
|
|
16
|
+
/** Read the selected source; relocated exports retain their reported original root. */
|
|
17
|
+
async load(input, options) {
|
|
18
|
+
let field = ["manifest_path"];
|
|
19
|
+
let targetPath = input.manifest_path;
|
|
20
|
+
try {
|
|
21
|
+
const manifestBytes = await readWebArtifactJson(input.manifest_path, 32 * 1024 * 1024, options?.signal);
|
|
22
|
+
const manifest = webScriptExportManifestSchema.parse(manifestBytes.value);
|
|
23
|
+
field = ["script_index"];
|
|
24
|
+
const selected = manifest.scripts[input.script_index];
|
|
25
|
+
if (selected === undefined)
|
|
26
|
+
throw new WebArtifactFormatFailure(`No script at index ${String(input.script_index)}; manifest contains ${String(manifest.scripts.length)} scripts.`);
|
|
27
|
+
if (selected.content.state !== "exported")
|
|
28
|
+
return err(new AnalysisCapabilityUnavailableError("web-module-artifacts", this.operation, "selected_source_unavailable", {
|
|
29
|
+
userMessage: `Selected script ${String(input.script_index)} has unavailable source bytes (${selected.content.reason}): ${selected.content.message} Capture source bytes before tracing this script.`,
|
|
30
|
+
}));
|
|
31
|
+
const portable = normalizeArtifactPath(selected.content.relative_path);
|
|
32
|
+
if (portable !== selected.content.relative_path)
|
|
33
|
+
throw new ArtifactReaderFailure("path", `Selected source path changes during normalization: ${selected.content.relative_path}`);
|
|
34
|
+
const root = dirname(input.manifest_path);
|
|
35
|
+
const sourcePath = join(root, "files", portable);
|
|
36
|
+
targetPath = sourcePath;
|
|
37
|
+
await assertContained(root, sourcePath);
|
|
38
|
+
const sourceBytes = await readStableArtifact(sourcePath, 16 * 1024 * 1024, options?.signal);
|
|
39
|
+
await assertContained(root, sourcePath);
|
|
40
|
+
if (sourceBytes.sha256 !== selected.content.sha256 ||
|
|
41
|
+
sourceBytes.bytes.length !== selected.content.bytes)
|
|
42
|
+
throw new ArtifactReaderFailure("integrity", `Selected source identity mismatch: ${sourcePath}; expected sha256=${selected.content.sha256}, bytes=${String(selected.content.bytes)}; observed sha256=${sourceBytes.sha256}, bytes=${String(sourceBytes.bytes.length)}.`, undefined, {
|
|
43
|
+
logicalPath: selected.content.relative_path,
|
|
44
|
+
declaredSha256: selected.content.sha256,
|
|
45
|
+
calculatedSha256: sourceBytes.sha256,
|
|
46
|
+
unpacked: false,
|
|
47
|
+
});
|
|
48
|
+
const source = decodeWebArtifact(sourceBytes.bytes);
|
|
49
|
+
return ok({
|
|
50
|
+
manifest,
|
|
51
|
+
manifestFile: {
|
|
52
|
+
path: input.manifest_path,
|
|
53
|
+
sha256: manifestBytes.sha256,
|
|
54
|
+
bytes: manifestBytes.bytes.length,
|
|
55
|
+
},
|
|
56
|
+
sourceFile: {
|
|
57
|
+
path: sourcePath,
|
|
58
|
+
sha256: sourceBytes.sha256,
|
|
59
|
+
bytes: sourceBytes.bytes.length,
|
|
60
|
+
},
|
|
61
|
+
source,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (cause) {
|
|
65
|
+
return err(webArtifactReadError(cause, { operation: this.operation, field, targetPath }, options?.signal));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const assertContained = async (root, path) => {
|
|
70
|
+
const canonicalRoot = await realpath(root);
|
|
71
|
+
const canonicalFile = await realpath(path);
|
|
72
|
+
const fromRoot = relative(canonicalRoot, canonicalFile);
|
|
73
|
+
if (fromRoot === ".." ||
|
|
74
|
+
fromRoot.startsWith(`..${sep}`) ||
|
|
75
|
+
isAbsolute(fromRoot))
|
|
76
|
+
throw new ArtifactReaderFailure("path", `Selected source escapes its manifest directory: ${path}`);
|
|
77
|
+
let directory = dirname(path);
|
|
78
|
+
while (directory !== root) {
|
|
79
|
+
const stat = await lstat(directory);
|
|
80
|
+
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
81
|
+
throw new ArtifactReaderFailure("path", `Selected source directory is a symlink or not a directory: ${directory}`);
|
|
82
|
+
const parent = dirname(directory);
|
|
83
|
+
if (parent === directory)
|
|
84
|
+
throw new ArtifactReaderFailure("path", "Selected source has no containing manifest directory.");
|
|
85
|
+
directory = parent;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Project verified Debugger sources without fetching resource URLs. */
|
|
2
|
+
export const pageScripts = (capture) => capture.scripts.items.map((script) => ({
|
|
3
|
+
source: {
|
|
4
|
+
kind: "page-script",
|
|
5
|
+
script_key: script.script_key,
|
|
6
|
+
frame_id: script.frame_id,
|
|
7
|
+
is_module: script.is_module,
|
|
8
|
+
language: script.language,
|
|
9
|
+
source_map_url: script.source_map_url,
|
|
10
|
+
},
|
|
11
|
+
url: script.url,
|
|
12
|
+
content: !script.source.included
|
|
13
|
+
? {
|
|
14
|
+
state: "unavailable",
|
|
15
|
+
reason: "source-not-included",
|
|
16
|
+
message: script.source.reason || "Debugger source was not included.",
|
|
17
|
+
}
|
|
18
|
+
: script.language !== null && script.language !== "JavaScript"
|
|
19
|
+
? {
|
|
20
|
+
state: "unavailable",
|
|
21
|
+
reason: "unsupported-language",
|
|
22
|
+
message: `Debugger reported language ${script.language}; JavaScript export was not inferred.`,
|
|
23
|
+
}
|
|
24
|
+
: {
|
|
25
|
+
state: "captured",
|
|
26
|
+
bytes: Buffer.from(script.source.artifact.text, "utf8"),
|
|
27
|
+
sha256: script.source.artifact.sha256,
|
|
28
|
+
media_type: script.source.artifact.media_type,
|
|
29
|
+
redacted: null,
|
|
30
|
+
representation: "debugger-source-utf8",
|
|
31
|
+
},
|
|
32
|
+
}));
|