rea-agents 6.3.0 → 6.5.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/DISCLAIMER.md +136 -0
- package/README.md +72 -18
- package/THIRD_PARTY_NOTICES.md +134 -0
- package/bridge/android/ReaJadxBridge.java +123 -11
- package/bridge/cutter/rea_bridge.py +816 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +1729 -283
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +49 -0
- package/bridge/hopper_bridge.py +103 -69
- package/bridge/mitmproxy/capture.py +189 -13
- package/bridge/native/rea_lldb_tracer.py +40 -6
- package/bridge/process/ProcessRunTokenReader.swift +76 -34
- package/bridge/pwntools/layout_impl.py +5 -0
- package/bridge/pwntools/recorded_crash_impl.py +31 -10
- package/dist/adb/AdbConfiguration.js +100 -0
- package/dist/adb/AdbDeviceOutput.js +208 -0
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbProvider.js +1433 -0
- package/dist/adb/AdbShellOutput.js +307 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxAnalysis.js +32 -7
- package/dist/android/JadxConfiguration.js +163 -53
- package/dist/android/JadxDoctor.js +115 -0
- package/dist/android/JadxMcpTransport.js +5 -3
- package/dist/android/JadxProtocol.js +14 -0
- package/dist/android/JadxProvider.js +63 -25
- package/dist/android/JadxRelease.js +12 -1
- package/dist/android/JadxWorkspaceRoot.js +157 -0
- package/dist/apktool/ApktoolConfiguration.js +227 -0
- package/dist/apktool/ApktoolDecodeOutput.js +142 -0
- package/dist/apktool/ApktoolProvider.js +543 -0
- package/dist/application/AnalysisContextQueries.js +5 -8
- package/dist/application/AnalysisProvider.js +24 -14
- package/dist/application/AppBundleExecutable.js +30 -25
- package/dist/application/BinaryTargetResolver.js +210 -33
- package/dist/application/BrowserEvidence.js +1 -1
- package/dist/application/BrowserObservationService.js +13 -2
- package/dist/application/BrowserScenarioCaptureService.js +0 -1
- package/dist/application/CallPathTracing.js +52 -13
- package/dist/application/CapabilityInventory.js +179 -29
- package/dist/application/ClaudeDesktopConfigLocation.js +152 -0
- package/dist/application/ClientConfigurationDocument.js +154 -7
- package/dist/application/ClientConfigurationFiles.js +128 -0
- package/dist/application/ClientRegistrationEnvironment.js +41 -0
- package/dist/application/ClientRegistrationIdentity.js +94 -29
- package/dist/application/ClientRegistrationStatus.js +223 -67
- package/dist/application/DirectAnalysis.js +86 -31
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +14 -2
- package/dist/application/Doctor.js +117 -34
- package/dist/application/DoctorDiagnostics.js +34 -12
- package/dist/application/DoctorProviderIds.js +2 -0
- package/dist/application/DoctorScope.js +11 -2
- package/dist/application/DshCordisPatch.js +355 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +30 -16
- package/dist/application/EnhancedToolTypes.js +0 -1
- package/dist/application/EnhancedTools.js +164 -54
- package/dist/application/EvidenceBundleCommands.js +36 -19
- package/dist/application/EvidenceBundleFiles.js +29 -7
- package/dist/application/FunctionAnalysisEvidence.js +3 -0
- package/dist/application/GeminiClientSettings.js +151 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HermesConfigurationYaml.js +272 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InventoryProjectionEvidence.js +0 -1
- package/dist/application/InvestigationProviders.js +19 -3
- package/dist/application/JsonFiles.js +114 -23
- package/dist/application/JsonInputFile.js +410 -0
- package/dist/application/LinuxHopper.js +130 -60
- package/dist/application/MacHopper.js +177 -150
- package/dist/application/MacHopperPaths.js +40 -0
- package/dist/application/MipsElfMetadata.js +201 -0
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/MipsGnuAttributes.js +90 -0
- package/dist/application/MsixPackageStorage.js +133 -0
- package/dist/application/ProgressReporter.js +1 -1
- package/dist/application/ProviderOperationExecution.js +39 -0
- package/dist/application/ReconstructionCoverageService.js +0 -1
- package/dist/application/ReconstructionObligationCandidates.js +12 -5
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +2 -2
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +15 -33
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -72
- package/dist/application/ReconstructionObligationLedgerService.js +3 -1
- package/dist/application/ReconstructionObligationOriginalCases.js +2 -1
- package/dist/application/ReferenceSourceImport.js +94 -31
- package/dist/application/ReferenceSourceImportEntries.js +40 -30
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -23
- package/dist/application/ReferenceSourceVcsAdapter.js +163 -31
- package/dist/application/RegularFileRead.js +121 -7
- package/dist/application/Setup.js +88 -14
- package/dist/application/SetupClientConfiguration.js +307 -38
- package/dist/application/SetupClients.js +12 -6
- package/dist/application/SetupHost.js +158 -38
- package/dist/application/SetupInstallFailure.js +42 -2
- package/dist/application/SetupPlan.js +83 -57
- package/dist/application/SetupRecoveryBackup.js +66 -0
- package/dist/application/SetupRegistrationEnvironment.js +2 -1
- package/dist/application/SetupSkill.js +354 -88
- package/dist/application/SupportedClients.js +429 -70
- package/dist/application/TypeScriptEmittedSourceCandidates.js +26 -0
- package/dist/application/Uninstall.js +412 -73
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +54 -25
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +25 -47
- package/dist/application/UpdateRuntime.js +141 -27
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebModuleTraceService.js +7 -0
- package/dist/application/WebNetworkCaptureService.js +16 -7
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +22 -3
- package/dist/application/WindowsCapabilities.js +18 -15
- package/dist/application/WorkflowEvidence.js +24 -1
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +122 -6
- package/dist/application/android/AndroidPackageInspection.js +25 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/AnalysisProviderEvaluation.js +1 -1
- package/dist/application/binary/AnalysisProviderRegistry.js +36 -21
- package/dist/application/binary/AnalysisSnapshotCache.js +41 -20
- package/dist/application/binary/AnalysisSnapshotFiles.js +75 -9
- package/dist/application/binary/BinarySession.js +250 -97
- package/dist/application/binary/BinarySessionExecution.js +5 -4
- package/dist/application/binary/BinarySessionOpen.js +13 -6
- package/dist/application/binary/BinarySessionRecords.js +33 -7
- package/dist/application/binary/BinarySessionStatus.js +93 -23
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +71 -28
- package/dist/application/binary/LazyAnalysisProvider.js +3 -1
- package/dist/application/binary/SessionProviderRouter.js +5 -2
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +13 -2
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +114 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +16 -4
- package/dist/application/captures/PacketCaptureService.js +83 -0
- package/dist/application/closeOwnedWebResources.js +7 -0
- package/dist/application/electron/ElectronFusePort.js +1 -0
- package/dist/application/electron/ElectronFuseService.js +80 -0
- package/dist/application/evm/EvmInterfaceService.js +4 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/flutter/DartAotInspection.js +26 -0
- package/dist/application/flutter/FlutterBuildAnalysisPort.js +1 -0
- package/dist/application/flutter/FlutterBuildAnalysisService.js +13 -0
- package/dist/application/frida/FridaInstrumentationPort.js +8 -0
- package/dist/application/frida/FridaInstrumentationService.js +310 -0
- package/dist/application/frida/fridaInputErrors.js +17 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +80 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/investigation/EvidenceLedger.js +40 -14
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/investigation/InvestigationRecords.js +12 -21
- package/dist/application/investigation/UnknownEvidence.js +22 -18
- package/dist/application/javascript/ElectronActiveObservationService.js +55 -25
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +17 -3
- package/dist/application/javascript/ElectronBoundaryGraph.js +2 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +144 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +28 -9
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +20 -7
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +50 -12
- package/dist/application/javascript/ElectronObservationService.js +0 -1
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +15 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +44 -18
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +253 -60
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +51 -23
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +93 -21
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +35 -8
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +25 -14
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +163 -54
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +246 -15
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +1057 -323
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +134 -32
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +6 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +39 -15
- package/dist/application/javascript/JavaScriptRecoveryService.js +32 -9
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +2 -1
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +0 -1
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +228 -74
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +67 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +0 -1
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -2
- package/dist/application/managed/ManagedMemberComparisonService.js +72 -54
- package/dist/application/managed/ManagedNativeVerificationService.js +0 -1
- package/dist/application/managed/ManagedReconstructionService.js +0 -1
- package/dist/application/native/NativeCallRoutes.js +54 -34
- package/dist/application/native/NativeDispatchMetadataInspection.js +6 -2
- package/dist/application/native/NativeUiActionTrace.js +51 -30
- package/dist/application/native/NativeValueTrace.js +75 -24
- package/dist/application/pcap/PcapAnalysisPort.js +1 -0
- package/dist/application/pcap/PcapAnalysisService.js +24 -0
- package/dist/application/process/ProcessCli.js +57 -32
- package/dist/application/reverse/ReverseEngineeringCommandPort.js +1 -0
- package/dist/application/reverse/ReverseEngineeringService.js +688 -0
- package/dist/application/rust/RustBinaryPort.js +1 -0
- package/dist/application/rust/RustBinaryService.js +80 -0
- package/dist/application/signals/SignalRecordingService.js +83 -0
- package/dist/application/sqlite/SqliteDatabaseCapability.js +30 -0
- package/dist/application/sqlite/SqliteDatabasePort.js +1 -0
- package/dist/application/sqlite/SqliteDatabaseService.js +76 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +77 -0
- package/dist/application/wasm/WasmInterfaceComparisonService.js +188 -0
- package/dist/artifacts/ArtifactHash.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +133 -15
- package/dist/artifacts/ArtifactProvider.js +28 -19
- package/dist/artifacts/ArtifactReader.js +35 -0
- package/dist/artifacts/ArtifactResourceScope.js +109 -0
- package/dist/artifacts/AsarArtifactReader.js +295 -156
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/AsarListing.js +78 -0
- package/dist/artifacts/DirectoryArtifactReader.js +247 -74
- package/dist/artifacts/MachOSliceArtifactReader.js +198 -48
- package/dist/artifacts/NativeDmgArtifactReader.js +188 -78
- package/dist/artifacts/OrderedReads.js +57 -0
- package/dist/artifacts/SafeOutputTree.js +261 -71
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +186 -31
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +77 -68
- package/dist/artifacts/apple/DylibResolutionReader.js +11 -5
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +114 -38
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +125 -35
- package/dist/artifacts/apple/KeyedArchiveReader.js +35 -15
- package/dist/artifacts/apple/MachoLoadCommandReader.js +62 -61
- package/dist/artifacts/apple/NibArchive.js +11 -4
- package/dist/artifacts/apple/PlistNumberLiterals.js +2 -2
- package/dist/artifacts/extraction/ArtifactExtraction.js +115 -92
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +236 -69
- package/dist/artifacts/inventory/ArtifactInventory.js +7 -6
- package/dist/artifacts/inventory/classify.js +95 -35
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +40 -17
- package/dist/artifacts/inventory/scanCanonical.js +84 -40
- package/dist/artifacts/inventory/scanReader.js +72 -19
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +177 -15
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/artifacts/readStableArtifact.js +28 -4
- package/dist/browser/BrowserProcessStartup.js +20 -9
- package/dist/browser/BrowserScenarioPartialObservation.js +60 -38
- package/dist/browser/BrowserScenarioSecrets.js +193 -48
- package/dist/browser/CdpBrowserProvider.js +74 -98
- package/dist/browser/CdpCaptureDocuments.js +261 -65
- package/dist/browser/CdpCaptureDomSvg.js +243 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +12 -12
- package/dist/browser/CdpCaptureEventHandlers.js +49 -21
- package/dist/browser/CdpCaptureEvents.js +53 -19
- package/dist/browser/CdpCaptureStorage.js +22 -5
- package/dist/browser/CdpCaptureStorageFingerprints.js +54 -11
- package/dist/browser/CdpCaptureValues.js +0 -1
- package/dist/browser/CdpConnection.js +25 -9
- package/dist/browser/CdpElectronInspection.js +14 -4
- package/dist/browser/CdpElectronProvider.js +7 -2
- package/dist/browser/CdpElectronScripts.js +2 -1
- package/dist/browser/CdpElectronWorkers.js +7 -2
- package/dist/browser/CdpEndpoint.js +143 -17
- package/dist/browser/CdpObservationSession.js +24 -8
- package/dist/browser/CdpPageCapture.js +67 -17
- package/dist/browser/CdpPageCaptureScripts.js +4 -3
- package/dist/browser/CdpPageCaptureWorkers.js +5 -1
- package/dist/browser/CdpSafeMetadata.js +9 -5
- package/dist/browser/CdpScreenshot.js +5 -14
- package/dist/browser/CdpSnapshotStrings.js +21 -0
- package/dist/browser/CdpTargetSession.js +59 -36
- package/dist/browser/CdpWebMcpDiscovery.js +55 -16
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +64 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +4 -4
- package/dist/browser/PlaywrightElectronActiveProjection.js +16 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +114 -36
- package/dist/browser/PlaywrightExecutionBoundary.js +2 -2
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +78 -13
- package/dist/browser/PlaywrightScenarioEvents.js +198 -36
- package/dist/browser/PlaywrightScenarioServiceWorkers.js +249 -0
- package/dist/browser/PlaywrightScenarioSession.js +180 -75
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +164 -81
- package/dist/browser/assets/LocalWebScriptArtifacts.js +27 -4
- package/dist/browser/assets/PublishWebScripts.js +88 -22
- package/dist/browser/assets/ScenarioScriptCapture.js +2 -1
- package/dist/browser/assets/WebArtifactReads.js +34 -4
- package/dist/browser/assets/WebSourceLocationArtifacts.js +39 -3
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/CaptureFailures.js +22 -8
- package/dist/browser/history/CaptureFormatError.js +2 -2
- package/dist/browser/history/{HarJson.js → CaptureJson.js} +14 -4
- package/dist/browser/history/CaptureRedaction.js +16 -3
- package/dist/browser/history/CaptureRelease.js +20 -2
- package/dist/browser/history/HarCapture.js +16 -9
- package/dist/browser/history/HarSchema.js +36 -36
- package/dist/browser/history/HistoricalCaptureDecoder.js +93 -25
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/history/NodeCaptureAdapter.js +48 -0
- package/dist/browser/history/{HarCaptureProcess.js → NodeCaptureProcess.js} +16 -15
- package/dist/browser/history/QlogCapture.js +385 -0
- package/dist/browser/history/SazCapture.js +130 -0
- package/dist/browser/history/SazHttp.js +61 -0
- package/dist/browser/history/SazMetadata.js +92 -0
- package/dist/browser/history/SazProjection.js +90 -0
- package/dist/browser/modules/NativeModuleResolver.js +177 -110
- package/dist/browser/modules/WebModuleArtifacts.js +41 -3
- package/dist/browser/network/PlaywrightNetworkContent.js +40 -5
- package/dist/browser/network/PlaywrightScenarioNetwork.js +125 -11
- package/dist/captures/TsharkCaptureProvider.js +370 -0
- package/dist/captures/parseFieldDiscovery.js +66 -0
- package/dist/captures/parsePacketOutput.js +21 -0
- package/dist/catalogIdentity.js +46 -35
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/androidCommands.js +11 -2
- package/dist/cli/apktoolCommands.js +52 -0
- package/dist/cli/applicationCommands.js +44 -17
- package/dist/cli/artifactCommands.js +9 -12
- package/dist/cli/binaryDiagnosticsCommands.js +27 -5
- package/dist/cli/browserAdvancedCommands.js +97 -55
- package/dist/cli/browserCommands.js +46 -29
- package/dist/cli/captureCommands.js +72 -0
- package/dist/cli/cliResultOutput.js +188 -0
- package/dist/cli/coreBinaryCommands.js +73 -32
- package/dist/cli/coreNativeCommands.js +54 -45
- package/dist/cli/cutterCommands.js +50 -0
- package/dist/cli/electronCommands.js +51 -4
- package/dist/cli/evmCommands.js +16 -8
- package/dist/cli/finishAnalysisCommand.js +44 -0
- package/dist/cli/firmwareCommands.js +21 -38
- package/dist/cli/flutterCommands.js +69 -0
- package/dist/cli/fridaCommands.js +211 -0
- package/dist/cli/goCommands.js +20 -0
- package/dist/cli/interactiveSetup.js +11 -1
- package/dist/cli/javascriptApplicationAnalysis.js +18 -2
- package/dist/cli/javascriptRecoveryCommands.js +29 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +13 -6
- package/dist/cli/managedCommands.js +31 -3
- package/dist/cli/options.js +20 -2
- package/dist/cli/pcapCommands.js +47 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/reverseEngineeringCommands.js +268 -0
- package/dist/cli/rustCommands.js +21 -0
- package/dist/cli/setupCommands.js +55 -15
- package/dist/cli/signalCommands.js +72 -0
- package/dist/cli/sqliteCommands.js +79 -0
- package/dist/cli/utilityCommands.js +179 -89
- package/dist/cli/wasmCommands.js +61 -0
- package/dist/cli/webModuleCommands.js +36 -32
- package/dist/cli/webNetworkCaptureCommands.js +8 -8
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli-runtime/AbortablePromise-BVBemxbD.js +123 -0
- package/dist/cli-runtime/AnalysisProvider-D0Us2OTk.js +27 -0
- package/dist/cli-runtime/AnalysisSnapshotCache-BXS0wRd2.js +710 -0
- package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
- package/dist/cli-runtime/ArtifactResourceScope-DQWTcUwE.js +114 -0
- package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
- package/dist/cli-runtime/BinarySessionStatus-DnMxMk-r.js +211 -0
- package/dist/cli-runtime/BinaryTargetResolver-CVIJ_s1A.js +1308 -0
- package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
- package/dist/cli-runtime/CdpTargetSession-DGX5pV9w.js +650 -0
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
- package/dist/cli-runtime/ClientConfigurationDocument-ffQ9X0Se.js +1957 -0
- package/dist/cli-runtime/ClientRegistrationStatus-DszCyPEU.js +509 -0
- package/dist/cli-runtime/CurrentEntrypointPath-D5FRNdkq.js +14 -0
- package/dist/cli-runtime/DirectAnalysis-BgvAtpN3.js +528 -0
- package/dist/cli-runtime/Doctor-DIpf_I7N.js +588 -0
- package/dist/cli-runtime/ElectronFileScope-dpHm2nrS.js +1054 -0
- package/dist/cli-runtime/ExecFileOutput-BEQs-lDD.js +117 -0
- package/dist/cli-runtime/IdaConfiguration-CtGP7EKo.js +1094 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-D4omRUe4.js +279 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-DIsI4DJ6.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-DoQRIHii.js +117 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-D5aI_FSJ.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-Bz4-V0Ct.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-B1bwMM1a.js +86 -0
- package/dist/cli-runtime/JebMcpEndpoint-DUytrn5G.js +428 -0
- package/dist/cli-runtime/JsonFiles-DQa1PRKy.js +708 -0
- package/dist/cli-runtime/MacCodeSignature-MgYbRK_H.js +24 -0
- package/dist/cli-runtime/MacHopperPaths-CwL5lYPX.js +434 -0
- package/dist/cli-runtime/MachoLoadCommandReader-C7e074Ze.js +510 -0
- package/dist/cli-runtime/ManagedSnapshot-rqyBHcdL.js +4185 -0
- package/dist/cli-runtime/OwnedCommand-Cj9GhmPR.js +112 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-DAy0PiBM.js +263 -0
- package/dist/cli-runtime/ProcessOwnership-DXC5-UWt.js +1378 -0
- package/dist/cli-runtime/ProviderDeadline-8m2pFRDc.js +122 -0
- package/dist/cli-runtime/RegularFile-B_6KPCNQ.js +139 -0
- package/dist/cli-runtime/RegularFileRead-DVlC5faM.js +125 -0
- package/dist/cli-runtime/SafeOutputTree-D6U15GXd.js +524 -0
- package/dist/cli-runtime/SetupHost-FkYWswsq.js +1098 -0
- package/dist/cli-runtime/SupportedClients-DaX6Lt2d.js +1049 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-CbTC_eg1.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/ZipArtifactReader-B8ZgNe4D.js +248 -0
- package/dist/cli-runtime/analysisErrorCleanup-Do6YeeoD.js +32 -0
- package/dist/cli-runtime/analysisErrorPresentation-DGt7TdsH.js +497 -0
- package/dist/cli-runtime/appleArchiveFormat-tVoI2ykA.js +263 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-DpOejOf0.js +150 -0
- package/dist/cli-runtime/application__EnhancedTools-oFE2bOjs.js +1787 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-B6osuhvW.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-DN3wTFQj.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CKcTppX9.js +815 -0
- package/dist/cli-runtime/application__Setup-XpMaRNjy.js +514 -0
- package/dist/cli-runtime/application__Uninstall-_23pU2yB.js +427 -0
- package/dist/cli-runtime/application__UpdateRuntime-DPvY8ohd.js +345 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-CFgIFPM4.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-Db6QCsun.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-CFjocHoK.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-CmVDUI_Z.js +118 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-DEsR8KDN.js +63 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-CCkp8KBh.js +11450 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-lPy0tzr3.js +2329 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-DWleA8K9.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DkALH4rL.js +299 -0
- package/dist/cli-runtime/artifactOperationError-B7n03FbD.js +27 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-zXI0QjSL.js +2187 -0
- package/dist/cli-runtime/binary-BVOr2mgE.js +14206 -0
- package/dist/cli-runtime/browserObservationError-Dx6xRTjb.js +40 -0
- package/dist/cli-runtime/catalogIdentity-DLoXgfIR.js +933 -0
- package/dist/cli-runtime/cli.js +41848 -0
- package/dist/cli-runtime/cliOutput-BC1BdAcB.js +122 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/cliResultOutput-DsRMI8CJ.js +780 -0
- package/dist/cli-runtime/cliResultOutput.js +5 -0
- package/dist/cli-runtime/composition__browserScenario-DHXC1a8n.js +2927 -0
- package/dist/cli-runtime/composition__electronObservation-GecK2EID.js +555 -0
- package/dist/cli-runtime/composition__electronScenario-CEZnVrAL.js +653 -0
- package/dist/cli-runtime/cutterToolContracts-TZH9EHr5.js +5134 -0
- package/dist/cli-runtime/doctorRuntime-BE5ZX8it.js +258 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-C8_yZCDc.js +5 -0
- package/dist/cli-runtime/errorSchemas-CTRmvMl3.js +601 -0
- package/dist/cli-runtime/javascriptApplicationAnalysis-HgMzVMQw.js +2068 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-Dg00g35t.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BYnoIqIk.js +1242 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-DNjDoL3S.js +1507 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-BWpGWNcI.js +247 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-BTCNcvbc.js +126 -0
- package/dist/cli-runtime/lipo-DSWP6fv-.js +396 -0
- package/dist/cli-runtime/logger-CQQCI4a2.js +48 -0
- package/dist/cli-runtime/machoContainer-C8BIkkq3.js +172 -0
- package/dist/cli-runtime/managedApplicationGraph-B08jb3jq.js +1130 -0
- package/dist/cli-runtime/managedToolContracts-D60QmIYj.js +99 -0
- package/dist/cli-runtime/mcpDoctor.js +359 -0
- package/dist/cli-runtime/mcpStartupPolicy-CVVSOmRc.js +21 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-YBTvUeJO.js +4875 -0
- package/dist/cli-runtime/officialToolContracts-CCFF0an9.js +1501 -0
- package/dist/cli-runtime/propertyListKeys-G8e74YWb.js +248 -0
- package/dist/cli-runtime/providerAdapterError-DAjhICdr.js +25 -0
- package/dist/cli-runtime/providerCleanupError-Ceq8f0wK.js +27 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerStartupTimeout-B2tF2LtZ.js +17 -0
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-Bao0xMr-.js +19478 -0
- package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
- package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
- package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
- package/dist/cli-runtime/scanCanonical-KP4T9jSl.js +2724 -0
- package/dist/cli-runtime/snapshotEnvironment-D_tWyOub.js +813 -0
- package/dist/cli-runtime/toolContracts-D2FOG_Nb.js +3721 -0
- package/dist/cli-runtime/toolOutputSchemaGroups-DRiYs1je.js +12070 -0
- package/dist/cli-runtime/workflowInputError-n8Oo-bLA.js +26 -0
- package/dist/cli.js +44 -5
- package/dist/cliBrowserScenarioCommands.js +41 -5
- package/dist/cliCommandNames.js +80 -0
- package/dist/cliEvidenceCommands.js +0 -1
- package/dist/cliJavaScriptRuntimeCommands.js +16 -14
- package/dist/cliJsonInput.js +14 -6
- package/dist/cliLogging.js +50 -14
- package/dist/cliObservationOptions.js +9 -0
- package/dist/cliOutput.js +38 -5
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binary.js +4 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/captures.js +3 -0
- package/dist/composition/directAnalysis.js +36 -11
- package/dist/composition/electronFuses.js +4 -0
- package/dist/composition/evm.js +12 -0
- package/dist/composition/flutter.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +49 -0
- package/dist/composition/jeb.js +35 -0
- package/dist/composition/pcap.js +3 -0
- package/dist/composition/resolveWindowsProviderExecutable.js +61 -0
- package/dist/composition/reverseEngineering.js +29 -0
- package/dist/composition/rust.js +4 -0
- package/dist/composition/signals.js +3 -0
- package/dist/composition/sqlite.js +4 -0
- package/dist/composition/wasm.js +22 -0
- package/dist/composition/webNetworkCaptures.js +7 -2
- package/dist/config/environment.js +55 -4
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/homeDirectory.js +9 -6
- package/dist/config/mcpInputSchemaProfile.js +31 -0
- package/dist/config/mcpOutputSchemaProfile.js +22 -0
- package/dist/config/parseConfig.js +36 -19
- package/dist/config/parsers.js +4 -3
- package/dist/config/{ghidraStartupTimeout.js → providerStartupTimeout.js} +7 -3
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +13 -0
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +39 -3
- package/dist/contracts/android/androidToolContracts.js +17 -8
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/applicationToolContracts.js +17 -2
- package/dist/contracts/artifactToolContracts.js +21 -6
- package/dist/contracts/browserToolContracts.js +2 -1
- package/dist/contracts/captures/captureToolContracts.js +42 -0
- package/dist/contracts/compactInputSchema.js +276 -0
- package/dist/contracts/cutterToolContracts.js +84 -0
- package/dist/contracts/enhancedToolContracts.js +2 -2
- package/dist/contracts/evm/evmToolContracts.js +30 -15
- package/dist/contracts/firmware/firmwareToolContracts.js +1 -1
- package/dist/contracts/flutter/flutterToolContracts.js +47 -0
- package/dist/contracts/fridaRemoteAddress.js +23 -0
- package/dist/contracts/fridaToolContracts.js +273 -0
- package/dist/contracts/functionComparisonExample.js +12 -1
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/gdbToolContracts.js +103 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +15 -0
- package/dist/contracts/inputSchemaPresentation.js +91 -24
- package/dist/contracts/investigationExamples.js +1 -0
- package/dist/contracts/javascript/electronToolContracts.js +40 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +13 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +43 -4
- package/dist/contracts/managed/managedWorkflowExamples.js +7 -1
- package/dist/contracts/managed/managedWorkflowToolContracts.js +4 -30
- package/dist/contracts/mobileApplicationGraphExamples.js +12 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +27 -4
- package/dist/contracts/native/nativeToolContracts.js +10 -6
- package/dist/contracts/officialToolContracts.js +9 -9
- package/dist/contracts/pcap/pcapToolContracts.js +33 -0
- package/dist/contracts/providerSelection.js +1 -0
- package/dist/contracts/reconstructionReadinessExample.js +126 -119
- package/dist/contracts/reverseEngineeringToolContracts.js +52 -0
- package/dist/contracts/rizinDebugToolContracts.js +96 -0
- package/dist/contracts/rust/rustToolContracts.js +20 -0
- package/dist/contracts/sessionLifecycleInputs.js +34 -2
- package/dist/contracts/sessionToolContracts.js +4 -4
- package/dist/contracts/sessionToolSchemas.js +20 -2
- package/dist/contracts/signals/signalToolContracts.js +40 -0
- package/dist/contracts/sqlite/sqliteToolContracts.js +36 -0
- package/dist/contracts/toolContractExamples.js +35 -0
- package/dist/contracts/toolContractTypes.js +5 -0
- package/dist/contracts/toolContracts.js +32 -0
- package/dist/contracts/toolEffects.js +414 -8
- package/dist/contracts/toolOutputSchemaGroups.js +78 -33
- package/dist/contracts/toolOutputSchemaPrimitives.js +111 -10
- package/dist/contracts/toolSchemaMetadata.js +98 -9
- package/dist/contracts/unknownContractExamples.js +1 -1
- package/dist/contracts/wasm/wasmComparisonContracts.js +52 -0
- package/dist/contracts/wasm/wasmToolContracts.js +33 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +15 -4
- package/dist/cutter/CutterBridgeClient.js +621 -0
- package/dist/cutter/CutterBridgeService.js +139 -0
- package/dist/doctorRuntime.js +20 -8
- package/dist/domain/adb/adbDeviceAnalysis.js +605 -0
- package/dist/domain/analysisErrorBase.js +20 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorCore.js +19 -0
- package/dist/domain/analysisErrorPresentation.js +75 -22
- package/dist/domain/analysisErrorProjection.js +35 -13
- package/dist/domain/analysisProfile.js +7 -3
- package/dist/domain/analysisSnapshot.js +313 -185
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +414 -0
- package/dist/domain/analysisView/analysisView.js +417 -45
- package/dist/domain/analysisView/analysisViewCoverage.js +32 -0
- package/dist/domain/analysisView/analysisViewErrors.js +4 -0
- package/dist/domain/analysisView/analysisViewParent.js +12 -0
- package/dist/domain/analysisView/analysisViewText.js +29 -0
- package/dist/domain/analysisView/androidPackageView.js +102 -0
- package/dist/domain/analysisView/artifactInventoryView.js +140 -0
- package/dist/domain/analysisView/binaryLayoutView.js +13 -4
- package/dist/domain/analysisView/dartAotView.js +93 -0
- package/dist/domain/analysisView/evmInterfaceView.js +105 -0
- package/dist/domain/analysisView/interfaceBuilderView.js +182 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +29 -26
- package/dist/domain/analysisView/machoView.js +186 -0
- package/dist/domain/analysisView/managedArtifactView.js +108 -0
- package/dist/domain/analysisView/managedMemberView.js +209 -0
- package/dist/domain/analysisView/nativeFunctionView.js +150 -0
- package/dist/domain/analysisView/pcapCaptureView.js +264 -0
- package/dist/domain/analysisView/qlogCaptureView.js +198 -0
- package/dist/domain/analysisView/wasmArtifactView.js +162 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +123 -0
- package/dist/domain/analysisView/webNetworkCaptureView.js +388 -0
- package/dist/domain/android/androidAnalysis.js +36 -2
- package/dist/domain/android/androidApplication.js +57 -80
- package/dist/domain/apktool/apktoolResourceAnalysis.js +89 -0
- package/dist/domain/apple/appleApplication.js +71 -52
- package/dist/domain/apple/appleArchiveFormat.js +184 -0
- package/dist/domain/apple/appleAssetCatalog.js +15 -0
- package/dist/domain/apple/appleBundleAnatomy.js +96 -29
- package/dist/domain/apple/dyldPaths.js +18 -3
- package/dist/domain/apple/dylibResolution.js +21 -11
- package/dist/domain/apple/dylibResolutionFindings.js +8 -9
- package/dist/domain/apple/interfaceBuilderGraph.js +72 -45
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +38 -9
- package/dist/domain/apple/machoContainer.js +120 -8
- package/dist/domain/apple/machoCpuIdentity.js +4 -0
- package/dist/domain/apple/plistValue.js +6 -1
- package/dist/domain/artifactComparison.js +130 -25
- package/dist/domain/artifactDecompressionBudget.js +26 -0
- package/dist/domain/artifactGraph.js +28 -9
- package/dist/domain/artifactIdentity.js +33 -2
- package/dist/domain/artifactInspection.js +47 -45
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +148 -51
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +253 -80
- package/dist/domain/binaryTargetTypes.js +21 -1
- package/dist/domain/browserNetworkEvidence.js +4 -0
- package/dist/domain/browserObservation.js +88 -29
- package/dist/domain/browserObservationSchemas.js +12 -5
- package/dist/domain/browserScenarioCapture.js +2 -1
- package/dist/domain/browserScenarioCaptureValues.js +26 -2
- package/dist/domain/browserScenarioDiff.js +120 -11
- package/dist/domain/browserScenarioDiffEvidence.js +46 -13
- package/dist/domain/browserScenarioDiffValues.js +10 -3
- package/dist/domain/browserScenarioNetworkComparison.js +158 -0
- package/dist/domain/browserScenarioNormalization.js +10 -13
- package/dist/domain/browserScenarioValues.js +2 -12
- package/dist/domain/browserSession.js +2 -2
- package/dist/domain/bundleComparison.js +1 -5
- package/dist/domain/callPath.js +40 -3
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/captures/packetCapture.js +138 -0
- package/dist/domain/captures/packetFields.js +81 -0
- package/dist/domain/changedBehavior.js +43 -41
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSourceEvidence.js +6 -0
- package/dist/domain/dosCom.js +2 -2
- package/dist/domain/dosMz.js +52 -14
- package/dist/domain/electron/electronFuses.js +360 -0
- package/dist/domain/elfFixedHeader.js +42 -0
- package/dist/domain/evidence.js +104 -38
- package/dist/domain/evidenceBundle.js +58 -20
- package/dist/domain/evidenceErrors.js +5 -0
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/evm/evmInterface.js +18 -4
- package/dist/domain/evm/solidityMetadata.js +70 -0
- package/dist/domain/explicitSensitiveFailure.js +42 -24
- package/dist/domain/firmware/firmwareAnalysis.js +29 -0
- package/dist/domain/flutter/flutterBuildAnalysis.js +141 -0
- package/dist/domain/functionCallCoverage.js +60 -0
- package/dist/domain/functionComparisonDimensions.js +101 -10
- package/dist/domain/functionComparisonNormalization.js +66 -10
- package/dist/domain/functionComparisonResults.js +7 -6
- package/dist/domain/functionComparisonSchemas.js +14 -3
- package/dist/domain/functionDossierEvidence.js +3 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +156 -0
- package/dist/domain/hopperErrors.js +15 -16
- package/dist/domain/hopperPublisher.js +12 -0
- package/dist/domain/hopperValues.js +112 -34
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronObservation.js +4 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +24 -24
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +13 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +85 -41
- package/dist/domain/javascript/electronStaticAnalysisValues.js +30 -8
- package/dist/domain/javascript/electronWrappedCallPaths.js +498 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +94 -4
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +7 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +13 -8
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +1 -1
- package/dist/domain/javascript/javascriptApplicationGraph.js +96 -19
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +40 -19
- package/dist/domain/javascript/javascriptArtifactFiles.js +2 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +100 -39
- package/dist/domain/javascript/javascriptAstValues.js +81 -0
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptBootstrapIntegrity.js +372 -0
- package/dist/domain/javascript/javascriptBuiltinResourceMethods.js +8 -0
- package/dist/domain/javascript/javascriptBundledRequireOrigin.js +291 -0
- package/dist/domain/javascript/javascriptContextBridgeExposure.js +23 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +114 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +6 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +1 -1
- package/dist/domain/javascript/javascriptFeatureSeed.js +33 -16
- package/dist/domain/javascript/javascriptFeatureTrace.js +9 -3
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +42 -11
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +132 -0
- package/dist/domain/javascript/javascriptModuleDeclaration.js +28 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +618 -0
- package/dist/domain/javascript/javascriptModuleResolutionMode.js +18 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptModuleSpecifier.js +5 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -2
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +12 -5
- package/dist/domain/javascript/javascriptRpcEndpoints.js +331 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +12 -3
- package/dist/domain/javascript/javascriptRuntimeObservation.js +4 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +10 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +15 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +5 -4
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +121 -22
- package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +251 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +493 -104
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +17 -34
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +4 -3
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCallableStack.js +52 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +14 -12
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +42 -55
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +428 -32
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +14 -20
- package/dist/domain/javascript/javascriptSemanticDependencies.js +69 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +51 -53
- package/dist/domain/javascript/javascriptSemanticGraph.js +74 -24
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -11
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +41 -8
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +538 -151
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +199 -3
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +671 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +27 -17
- package/dist/domain/javascript/javascriptSemanticProjection.js +202 -56
- package/dist/domain/javascript/javascriptSemanticPromises.js +6 -9
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +5 -1
- package/dist/domain/javascript/javascriptSemanticQuery.js +34 -31
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReferenceSources.js +25 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +331 -8
- package/dist/domain/javascript/javascriptSemanticResources.js +6 -40
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +233 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +49 -52
- package/dist/domain/javascript/javascriptSemanticState.js +61 -4
- package/dist/domain/javascript/javascriptSemanticTraversal.js +25 -5
- package/dist/domain/javascript/javascriptSemanticValues.js +260 -35
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +44 -17
- package/dist/domain/javascript/javascriptSourceParser.js +72 -3
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +72 -26
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +100 -24
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -47
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +166 -56
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +2 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -1
- package/dist/domain/javascript/javascriptSymbolicBindings.js +836 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +3 -1
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +2 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +47 -13
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +40 -12
- package/dist/domain/localPath.js +6 -3
- package/dist/domain/managed/managedApplicationGraph.js +42 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +12 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -23
- package/dist/domain/managed/managedArtifact.js +52 -1
- package/dist/domain/managed/managedInspectionEvidence.js +12 -0
- package/dist/domain/managed/managedMemberComparison.js +3 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +23 -3
- package/dist/domain/managed/managedMemberComparisonItems.js +23 -19
- package/dist/domain/managed/managedMemberComparisonMatch.js +209 -18
- package/dist/domain/managed/managedNativeVerificationMatch.js +49 -26
- package/dist/domain/managed/managedNativeVerificationSchemas.js +13 -2
- package/dist/domain/managed/managedReconstruction.js +5 -8
- package/dist/domain/mobileApplicationGraphProjection.js +80 -0
- package/dist/domain/native/addressCoordinate.js +11 -0
- package/dist/domain/native/binaryLayout.js +2 -4
- package/dist/domain/native/bytePattern.js +100 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInspection.js +38 -4
- package/dist/domain/native/nativeInstruction.js +38 -2
- package/dist/domain/native/nativeInvestigationGraph.js +9 -5
- package/dist/domain/native/nativeLoadImage.js +19 -1
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/nativeUiObservation.js +5 -6
- package/dist/domain/native/objcSwiftMetadata.js +4 -1
- package/dist/domain/native/peResources.js +100 -0
- package/dist/domain/native/recordedCrash.js +79 -10
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/offsetDateTime.js +60 -0
- package/dist/domain/pcap/pcapAnalysis.js +91 -0
- package/dist/domain/pcap/pcapEvidence.js +15 -0
- package/dist/domain/peMachine.js +36 -0
- package/dist/domain/pngHeader.js +18 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureCoverage.js +26 -3
- package/dist/domain/process/processCaptureExample.js +26 -0
- package/dist/domain/process/processCaptureValidation.js +112 -8
- package/dist/domain/process/processComparison.js +41 -13
- package/dist/domain/process/processScenario.js +66 -7
- package/dist/domain/process/processTraceEvaluation.js +54 -50
- package/dist/domain/process/processTraceSpecification.js +243 -89
- package/dist/domain/propertyListKeys.js +214 -12
- package/dist/domain/propertyListXmlText.js +20 -4
- package/dist/domain/providerAdapterError.js +0 -5
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerSelectionError.js +2 -1
- package/dist/domain/qlogCapture.js +62 -0
- package/dist/domain/rawBinary.js +96 -0
- package/dist/domain/reconstructionCoverage.js +5 -1
- package/dist/domain/reconstructionCoverageEvaluation.js +18 -15
- package/dist/domain/reconstructionCoverageVerifierResults.js +35 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +104 -1
- package/dist/domain/reconstructionReadiness.js +4 -8
- package/dist/domain/reconstructionReadinessJourneyFindings.js +4 -1
- package/dist/domain/reconstructionUnknowns.js +9 -1
- package/dist/domain/reconstructionVerification.js +54 -25
- package/dist/domain/recordedTransportUrl.js +59 -0
- package/dist/domain/referenceSourceClassification.js +27 -23
- package/dist/domain/referenceSourceGraph.js +70 -23
- package/dist/domain/referenceSourceImportParsing.js +29 -16
- package/dist/domain/referenceSourcePathIdentity.js +32 -0
- package/dist/domain/referenceSourceRequireBindings.js +130 -0
- package/dist/domain/referenceSourceSummary.js +92 -0
- package/dist/domain/relationshipCoverage.js +44 -0
- package/dist/domain/residualUnknown.js +93 -26
- package/dist/domain/reverseEngineering.js +31 -0
- package/dist/domain/runtimeVersion.js +8 -0
- package/dist/domain/rust/rustBinary.js +200 -0
- package/dist/domain/signals/annotationTextWindow.js +31 -0
- package/dist/domain/signals/signalDecoders.js +69 -0
- package/dist/domain/signals/signalRecording.js +115 -0
- package/dist/domain/sourceMapContents.js +10 -3
- package/dist/domain/sourceMapEnvelope.js +17 -11
- package/dist/domain/sqlite/sqliteDatabase.js +188 -0
- package/dist/domain/staticRuntimeCorrelation.js +7 -9
- package/dist/domain/swiftSymbolClassification.js +17 -0
- package/dist/domain/symbolAnalysis.js +16 -4
- package/dist/domain/urlComponents.js +6 -0
- package/dist/domain/wasm/wasmArtifact.js +119 -0
- package/dist/domain/wasm/wasmInterface.js +89 -0
- package/dist/domain/webBundleAnalysis.js +14 -3
- package/dist/domain/webBundleAnalyzerAst.js +7 -2
- package/dist/domain/webBundleAnalyzerInspection.js +68 -40
- package/dist/domain/webBundleAnalyzerResult.js +18 -6
- package/dist/domain/webCaptureDiff.js +233 -34
- package/dist/domain/webCaptureFrameComparison.js +49 -0
- package/dist/domain/webMcpDiscovery.js +5 -2
- package/dist/domain/webModuleImports.js +22 -27
- package/dist/domain/webModuleTrace.js +3 -8
- package/dist/domain/webNetworkCapture.js +101 -39
- package/dist/domain/webNetworkCaptureCoordinates.js +21 -0
- package/dist/domain/webRuntime.js +0 -1
- package/dist/domain/webScreenshot.js +2 -2
- package/dist/domain/webScriptArtifacts.js +2 -4
- package/dist/domain/webScriptExport.js +6 -8
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +9 -15
- package/dist/domain/webSourceLocation.js +20 -9
- package/dist/domain/zipPackageFormat.js +31 -2
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +81 -54
- package/dist/dotnet/ManagedDecodeBudget.js +138 -0
- package/dist/dotnet/ManagedMemberInspector.js +113 -26
- package/dist/dotnet/ManagedMemberInspectorCore.js +356 -140
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +112 -38
- package/dist/dotnet/ManagedMemberOwnership.js +65 -0
- package/dist/dotnet/ManagedMemberPointers.js +69 -0
- package/dist/dotnet/ManagedMemberRows.js +182 -44
- package/dist/dotnet/ManagedMetadataHeaps.js +123 -27
- package/dist/dotnet/ManagedMetadataInventory.js +5 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +56 -63
- package/dist/dotnet/ManagedMetadataLayout.js +19 -5
- package/dist/dotnet/ManagedMetadataRowSizes.js +1 -1
- package/dist/dotnet/ManagedMethodBodyReader.js +34 -11
- package/dist/dotnet/ManagedMethodSpecs.js +78 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +5 -4
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +52 -44
- package/dist/dotnet/ManagedPeReader.js +96 -52
- package/dist/dotnet/ManagedReaderFailure.js +11 -1
- package/dist/dotnet/ManagedSnapshot.js +88 -0
- package/dist/dotnet/ManagedStaticProvider.js +57 -35
- package/dist/dotnet/ManagedTypeMemberLists.js +105 -0
- package/dist/dotnet/ManagedTypeNames.js +98 -0
- package/dist/dotnet/ManagedUserStrings.js +75 -0
- package/dist/electron/ElectronFusePath.js +247 -0
- package/dist/electron/ElectronFuseProvider.js +113 -0
- package/dist/electron/ElectronFuseReader.js +317 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +194 -11
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +58 -49
- package/dist/evaluation/KnownAnswerEvaluation.js +126 -57
- package/dist/evm/EvmoleFailures.js +19 -16
- package/dist/evm/EvmoleInterfaceAdapter.js +5 -1
- package/dist/evm/EvmoleInterfaceProvider.js +198 -23
- package/dist/evm/EvmoleInterfaceWorker.js +2 -0
- package/dist/evm/SolidityMetadata.js +139 -0
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/OwnedStagedOutput.js +138 -0
- package/dist/filesystem/RegularFile.js +81 -5
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +35 -0
- package/dist/firmware/FirmwareCommand.js +27 -5
- package/dist/firmware/FirmwareFiles.js +18 -7
- package/dist/firmware/FirmwareProvider.js +158 -32
- package/dist/firmware/FirmwarePublication.js +242 -4
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/firmware/FirmwareReports.js +202 -12
- package/dist/flutter/DartElf.js +418 -0
- package/dist/flutter/ElfBuildId.js +137 -0
- package/dist/flutter/ElfLoadMap.js +91 -0
- package/dist/flutter/FlutterBuildProvider.js +826 -0
- package/dist/flutter/FlutterPayloadScan.js +180 -0
- package/dist/frida/FridaInstrumentationManager.js +1104 -0
- package/dist/gdb/GdbSessionManager.js +1451 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +175 -6
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +208 -29
- package/dist/ghidra/GhidraDiagnostics.js +18 -8
- package/dist/ghidra/GhidraDoctor.js +15 -12
- package/dist/ghidra/GhidraFunctionValues.js +73 -2
- package/dist/ghidra/GhidraInstallation.js +216 -20
- package/dist/ghidra/GhidraInstallationPolicy.js +79 -29
- package/dist/ghidra/GhidraInventoryValues.js +53 -1
- package/dist/ghidra/GhidraJavaLaunch.js +91 -10
- package/dist/ghidra/GhidraJavaProperties.js +117 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +169 -0
- package/dist/ghidra/GhidraLauncher.js +306 -88
- package/dist/ghidra/GhidraLoadImageAttest.js +74 -7
- package/dist/ghidra/GhidraLoadImageValues.js +72 -0
- package/dist/ghidra/GhidraMipsProfile.js +315 -0
- package/dist/ghidra/GhidraPeProfile.js +21 -0
- package/dist/ghidra/GhidraPowerPcProfile.js +51 -0
- package/dist/ghidra/GhidraProvider.js +106 -20
- package/dist/ghidra/GhidraProviderCapabilities.js +30 -19
- package/dist/ghidra/GhidraProviderClient.js +520 -56
- package/dist/ghidra/GhidraPspExtension.js +140 -0
- package/dist/ghidra/GhidraPspProfile.js +59 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +40 -0
- package/dist/ghidra/GhidraRiscvProfile.js +100 -0
- package/dist/ghidra/GhidraSessionError.js +155 -11
- package/dist/ghidra/GhidraSessionValues.js +75 -2
- package/dist/ghidra/GhidraTransport.js +2 -1
- package/dist/go/GoBinaryContainer.js +140 -0
- package/dist/go/GoBinaryImage.js +210 -0
- package/dist/go/GoBinaryProvider.js +151 -0
- package/dist/go/GoElfImage.js +211 -0
- package/dist/go/GoMachoImage.js +164 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +124 -0
- package/dist/hopper/BridgeLauncher.js +35 -2
- package/dist/hopper/HopperAnalysisProfile.js +21 -9
- package/dist/hopper/HopperCleanup.js +15 -3
- package/dist/hopper/HopperClient.js +203 -42
- package/dist/hopper/HopperMacPublisher.js +29 -0
- package/dist/hopper/HopperMachOImage.js +61 -27
- package/dist/hopper/HopperProcessDiagnostic.js +27 -0
- package/dist/hopper/HopperProvider.js +68 -26
- package/dist/hopper/HopperProviderCapabilities.js +7 -3
- package/dist/hopper/HopperRequestQueue.js +17 -5
- package/dist/hopper/HopperSessionValues.js +10 -1
- package/dist/hopper/HopperTargetLease.js +66 -19
- package/dist/ida/IdaBusyHealth.js +44 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +7 -2
- package/dist/ida/IdaDiagnosticRedactor.js +199 -0
- package/dist/ida/IdaDiagnosticWriter.js +62 -0
- package/dist/ida/IdaDoctor.js +7 -5
- package/dist/ida/IdaJsonDiagnostic.js +138 -0
- package/dist/ida/IdaMcpConnection.js +297 -27
- package/dist/ida/IdaNativeProtocol.js +93 -0
- package/dist/ida/IdaOperationRunner.js +249 -40
- package/dist/ida/IdaProtocolValues.js +86 -4
- package/dist/ida/IdaProvider.js +34 -8
- package/dist/ida/IdaProviderCapabilities.js +37 -8
- package/dist/ida/IdaSessionClient.js +332 -53
- package/dist/ida/IdaWorkspace.js +57 -7
- package/dist/inspector/V8InspectorCaptureProjection.js +7 -2
- package/dist/inspector/V8InspectorEndpoint.js +15 -13
- package/dist/inspector/V8InspectorProvider.js +41 -7
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +594 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +65 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +590 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +126 -0
- package/dist/javascript/recovery/RecoveryFiles.js +68 -12
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +30 -18
- package/dist/javascript/recovery/WakaruProvider.js +150 -24
- package/dist/javascript/recovery/WakaruPublication.js +38 -14
- package/dist/javascript/recovery/WakaruRelease.js +11 -4
- package/dist/javascript/recovery/WakaruReport.js +15 -9
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +2 -16
- package/dist/javascript/sourceMaps/SourceMapCommand.js +38 -7
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +84 -10
- package/dist/javascript/sourceMaps/SourceMapFormat.js +26 -28
- package/dist/javascript/sourceMaps/TraceSourceMap.js +34 -6
- package/dist/jeb/JebMcpConnection.js +186 -0
- package/dist/jeb/JebMcpEndpoint.js +45 -0
- package/dist/jeb/JebProvider.js +297 -0
- package/dist/logger.js +14 -1
- package/dist/main/shutdown.js +3 -0
- package/dist/main/transport.js +48 -4
- package/dist/main.js +14 -3
- package/dist/mcp/AnalysisSnapshotFiles-BAbiJQOc.js +1412 -0
- package/dist/mcp/ArtifactProvider-DViCU_rn.js +2183 -0
- package/dist/mcp/ArtifactProviderMetadata-b7pOK5_t.js +76 -0
- package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
- package/dist/mcp/ArtifactResourceScope-P3tq5z8Z.js +162 -0
- package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
- package/dist/mcp/BinarySessionStatus-B4P9gf-S.js +212 -0
- package/dist/mcp/BinaryTargetResolver-BMaE_0H1.js +1427 -0
- package/dist/mcp/BoundedFileBytes-DuczXiQZ.js +68 -0
- package/dist/mcp/CdpCaptureDocuments-HDiF2O7k.js +746 -0
- package/dist/mcp/CdpCaptureValues-M-j6CIh1.js +90 -0
- package/dist/mcp/CdpConnection-BpDfz4MK.js +570 -0
- package/dist/mcp/CdpOptionalCommand-BPjRD9Kz.js +120 -0
- package/dist/mcp/CdpTargetSession-BsPoKhEU.js +86 -0
- package/dist/mcp/DirectAnalysis-DrafbXke.js +409 -0
- package/dist/mcp/DirectAnalysisStatus-CjjeDLzW.js +44 -0
- package/dist/mcp/ElectronFileScope-BPG_YoyU.js +110 -0
- package/dist/mcp/InterfaceBuilderDecodeBudget-5F2AkxJT.js +652 -0
- package/dist/mcp/ManagedStaticProvider-BthZbKyZ.js +5028 -0
- package/dist/mcp/NativeMacOSProvider-Bh79k8dI.js +4867 -0
- package/dist/mcp/NativeMacOSProviderMetadata-N1lPOaY_.js +307 -0
- package/dist/mcp/ProcedureAddressResolution-CQpuwm1h.js +19 -0
- package/dist/mcp/ProcessOwnership-Bl_3ejLe.js +1502 -0
- package/dist/mcp/ProviderDeadline-DskQ94YD.js +932 -0
- package/dist/mcp/WorkflowEvidence-umWrB_wm.js +111 -0
- package/dist/mcp/analysisErrorCore-DXRTvF_m.js +235 -0
- package/dist/mcp/analysisErrorProjection-BN0EPM-3.js +892 -0
- package/dist/mcp/artifactOperationError-CkHMMaf7.js +27 -0
- package/dist/mcp/artifactToolContracts-Di4qZlEt.js +72 -0
- package/dist/mcp/browserObservation-C0s4i8UI.js +4468 -0
- package/dist/mcp/browserObservationError-CyLugqX4.js +40 -0
- package/dist/mcp/browserObservationSchemas-tgqjH7aA.js +573 -0
- package/dist/mcp/browserScenario-CAQ8Fns9.js +2929 -0
- package/dist/mcp/browserScenarioCapture-CTNFN-FI.js +479 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/digests-BFoWUT_-.js +223 -0
- package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
- package/dist/mcp/electronObservation-DFOFEood.js +112 -0
- package/dist/mcp/electronObservation-i7LcILQ-.js +562 -0
- package/dist/mcp/electronScenario-nCzE6IfJ.js +653 -0
- package/dist/mcp/emptyArraySchema-tL6Qymyd.js +140 -0
- package/dist/mcp/enhancedInputs-DgdEnzHy.js +56 -0
- package/dist/mcp/javascriptRuntimeObservation-61NhCf7H.js +690 -0
- package/dist/mcp/javascriptRuntimeObservation-PIUoLfX6.js +121 -0
- package/dist/mcp/jsonSerialization-V-wWiFRE.js +152 -0
- package/dist/mcp/lipo-Bnkoq_6W.js +502 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-BQY5ulYv.js +48 -0
- package/dist/mcp/main-kBXHZ8S5.js +69390 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-CK--I_s7.js +101 -0
- package/dist/mcp/nativeValueTrace-DR9UE62L.js +3439 -0
- package/dist/mcp/officialToolContracts-B67NJ2tC.js +1413 -0
- package/dist/mcp/pngHeader-DQ-ObyY2.js +147 -0
- package/dist/mcp/propertyListKeys-DD25WsjI.js +553 -0
- package/dist/mcp/providerAdapterError-sDxToNal.js +25 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-CTYa3iLf.js +48 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-CRXSpule.js +3982 -0
- package/dist/mcp/serverIdentity-Cio4iFV3.js +1328 -0
- package/dist/mcp/sourceMapEnvelope-C0uJlrOh.js +94 -0
- package/dist/mcp/toolContracts-BW05wpcr.js +12200 -0
- package/dist/mcp/toolOutputSchemaGroups-ColvNZ1r.js +17533 -0
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
- package/dist/mcp/webContentArtifact-Dzjc1z-R.js +284 -0
- package/dist/mcp/webRuntime-K__NYzXm.js +74 -0
- package/dist/mcp/webSourceLocation-DbMAT2J9.js +11130 -0
- package/dist/mcpDoctor.js +108 -76
- package/dist/mcpStartupPolicy.js +3 -0
- package/dist/native/AppleDispatchCoverage.js +81 -28
- package/dist/native/AppleDispatchMetadata.js +20 -9
- package/dist/native/AppleMachoFixups.js +253 -34
- package/dist/native/AppleMachoSelection.js +44 -17
- package/dist/native/AppleObjcCategories.js +1 -2
- package/dist/native/AppleObjcDispatchFacets.js +76 -7
- package/dist/native/CommandRunner.js +142 -32
- package/dist/native/LldbCallTracer.js +5 -3
- package/dist/native/MachoArchitectureSelection.js +50 -0
- package/dist/native/NativeCallObservation.js +2 -1
- package/dist/native/NativeMacOSProvider.js +173 -37
- package/dist/native/NativeMachoInspection.js +142 -78
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +6 -5
- package/dist/native/SignatureTargetBinding.js +118 -55
- package/dist/native/parsers/codesign.js +27 -10
- package/dist/native/parsers/demangle.js +7 -1
- package/dist/native/parsers/dyldInfo.js +73 -4
- package/dist/native/parsers/lipo.js +53 -19
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +232 -29
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +77 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +20 -20
- package/dist/native/pwntools/PwntoolsDecoder.js +264 -40
- package/dist/native/pwntools/PwntoolsFailures.js +2 -1
- package/dist/native/pwntools/PwntoolsInputLimit.js +27 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +27 -15
- package/dist/native/pwntools/PwntoolsResourceLimits.js +3 -3
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +12 -8
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +3 -1
- package/dist/objdump/ObjdumpCommand.js +21 -0
- package/dist/pcap/PcapCommand.js +146 -0
- package/dist/pcap/PcapConfiguration.js +93 -0
- package/dist/pcap/PcapNativeBound.js +58 -0
- package/dist/pcap/PcapOutput.js +240 -0
- package/dist/pcap/PcapProvider.js +424 -0
- package/dist/pcap/PcapSnapshot.js +171 -0
- package/dist/process/ArtifactAnalysisResources.js +213 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/CurrentEntrypointPath.js +6 -0
- package/dist/process/DarwinProcessRunTokenReader.js +125 -16
- package/dist/process/ExecFileBoundedOutput.js +44 -0
- package/dist/process/ExecFileOutput.js +30 -6
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/LinuxResourceLimits.js +80 -0
- package/dist/process/MacCodeSignature.js +3 -0
- package/dist/process/OwnedCommand.js +40 -15
- package/dist/process/PrivateRuntimeRoot.js +9 -19
- package/dist/process/PrivateRuntimeRootUnavailableError.js +10 -0
- package/dist/process/ProcessOwnership.js +173 -128
- package/dist/process/ProcessOwnershipObservation.js +131 -43
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDeadline.js +58 -12
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +112 -14
- package/dist/process/WindowsAuthority.js +48 -39
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +87 -12
- package/dist/process/capture/ProcessCaptureClock.js +2 -0
- package/dist/process/capture/ProcessCaptureError.js +22 -3
- package/dist/process/capture/ProcessCaptureJournal.js +2 -1
- package/dist/process/capture/ProcessCaptureLifecycle.js +433 -91
- package/dist/process/capture/ProcessCaptureProgress.js +63 -0
- package/dist/process/capture/ProcessHarness.js +209 -38
- package/dist/process/capture/ProcessNormalization.js +278 -34
- package/dist/process/capture/ProcessSampling.js +3 -2
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +18 -15
- package/dist/process/capture/TerminalRenderer.js +52 -14
- package/dist/process/ownedDebuggerSession.js +203 -0
- package/dist/reference/ReferenceSourceReader.js +22 -6
- package/dist/reference/ReferenceSourceReaderEntries.js +182 -105
- package/dist/reference/ReferenceSourceReaderErrors.js +17 -1
- package/dist/reference/ReferenceSourceReaderFile.js +50 -11
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -2
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -5
- package/dist/rizin/RizinCommand.js +14 -0
- package/dist/rizin/RizinDebugSessionManager.js +1072 -0
- package/dist/rust/RustAuditableReader.js +309 -0
- package/dist/rust/RustBinaryImage.js +116 -0
- package/dist/rust/RustBinaryProvider.js +162 -0
- package/dist/server/EvidenceMcpServer.js +185 -27
- package/dist/server/admittedToolOperation.js +14 -0
- package/dist/server/contractToolHandler.js +28 -0
- package/dist/server/createServer.js +238 -36
- package/dist/server/externalMutationAdmission.js +50 -0
- package/dist/server/mcpProgress.js +4 -2
- package/dist/server/promptCompletion.js +19 -6
- package/dist/server/providerEnvironment.js +3 -0
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +9 -10
- package/dist/server/registerAndroidTools.js +22 -13
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +11 -3
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerArtifactTools.js +21 -1
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +14 -13
- package/dist/server/registerBundleComparisonTool.js +20 -6
- package/dist/server/registerCaptureTools.js +12 -0
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerCutterTools.js +33 -0
- package/dist/server/registerElectronTools.js +38 -17
- package/dist/server/registerEnhancedTools.js +7 -6
- package/dist/server/registerEvidenceTools.js +14 -10
- package/dist/server/registerEvmTools.js +24 -11
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFlutterTools.js +17 -0
- package/dist/server/registerFridaTools.js +205 -0
- package/dist/server/registerFunctionComparisonTool.js +34 -11
- package/dist/server/registerGdbTools.js +64 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +2 -2
- package/dist/server/registerInvestigationTools.js +12 -8
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +10 -11
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +11 -1
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerNativeTools.js +14 -0
- package/dist/server/registerOfficialTools.js +5 -0
- package/dist/server/registerPcapTools.js +35 -0
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +14 -4
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerReverseEngineeringTools.js +86 -0
- package/dist/server/registerRizinDebugTools.js +53 -0
- package/dist/server/registerRustTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +21 -14
- package/dist/server/registerSessionStatusTool.js +22 -4
- package/dist/server/registerSessionTools.js +78 -34
- package/dist/server/registerSignalTools.js +12 -0
- package/dist/server/registerSqliteTools.js +9 -0
- package/dist/server/registerWasmTools.js +46 -0
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +26 -17
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/retainedSummaryDelivery.js +28 -0
- package/dist/server/sessionAvailabilityPolicy.js +3 -0
- package/dist/server/toolRegistrationOptions.js +8 -0
- package/dist/server/toolResult.js +68 -16
- package/dist/server/toolResultEncoding.js +36 -3
- package/dist/serverIdentity.js +17 -8
- package/dist/signals/SigrokRecordingProvider.js +339 -0
- package/dist/signals/parseDecoderDiscovery.js +65 -0
- package/dist/sqlite/SqliteDatabaseFailures.js +134 -0
- package/dist/sqlite/SqliteDatabaseInspection.js +421 -0
- package/dist/sqlite/SqliteDatabaseLimits.js +16 -0
- package/dist/sqlite/SqliteDatabaseProvider.js +295 -0
- package/dist/sqlite/SqliteDatabaseSnapshot.js +156 -0
- package/dist/sqlite/SqliteDatabaseWorker.js +46 -0
- package/dist/sqlite/SqliteDatabaseWorkerExecution.js +112 -0
- package/dist/wasm/WabtArtifactProvider.js +336 -0
- package/dist/wasm/WabtFailures.js +101 -0
- package/dist/wasm/WabtInterface.js +309 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtString.js +48 -0
- package/dist/wasm/WabtWat.js +147 -0
- package/dist/wasm/WasmGlueAdapter.js +53 -0
- package/dist/wasm/WasmInterfaceBudget.js +11 -0
- package/dist/windows/WindowsNativeLoader.js +37 -7
- package/dist/windows/WindowsOwnedProcess.js +150 -17
- package/dist/windows/WindowsPrivateRuntime.js +34 -6
- package/install.sh +157 -95
- package/licenses/Apache-2.0.txt +202 -0
- package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/licenses/GPL-3.0.txt +674 -0
- package/licenses/LGPL-2.0.txt +480 -0
- package/licenses/MIT-template.txt +18 -0
- package/licenses/MinGW-w64-runtime.txt +240 -0
- package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
- package/licenses/README.md +68 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/frida-17.23.2-COPYING.txt +50 -0
- package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
- package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
- package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/licenses/npm-dependencies.txt +3612 -0
- package/licenses/npm-runtime-notices.txt +8548 -0
- package/licenses/upstream-sources.json +72 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +92 -11
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +117 -22
- package/scripts/electron-active-hook.cjs +4 -1
- package/scripts/hopper-demo-x11.py +53 -3
- package/scripts/prepack.mjs +5 -0
- package/scripts/rea-android-workspace-guardian.mjs +46 -0
- package/scripts/rea.mjs +44 -13
- package/scripts/verify-windows-native-artifact.mjs +2 -2
- package/skills/reverse-engineer-anything/SKILL.md +142 -20
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +31 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +118 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +147 -16
- package/skills/reverse-engineer-anything/references/runtime-observation.md +57 -7
- package/third_party/README.md +1 -1
- package/third_party/wabt/README.md +24 -0
- package/dist/browser/history/HarCaptureAdapter.js +0 -20
- package/dist/cli/streamedJsonOutput.js +0 -135
- package/dist/cliJsonFile.js +0 -179
- /package/dist/{application/binary → process}/AbortablePromise.js +0 -0
|
@@ -0,0 +1,2929 @@
|
|
|
1
|
+
import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
|
|
2
|
+
import { _ as ok, f as init_analysisErrorCore, g as init_result, h as err, i as AnalysisCancelledError, m as init_analysisErrorBase, p as AnalysisError, u as AnalysisTimeoutError } from "./analysisErrorCore-DXRTvF_m.js";
|
|
3
|
+
import { n as projectAnalysisError, t as init_analysisErrorProjection } from "./analysisErrorProjection-BN0EPM-3.js";
|
|
4
|
+
import { n as init_providerAdapterError, t as ProviderAdapterError } from "./providerAdapterError-sDxToNal.js";
|
|
5
|
+
import { n as init_browserObservationError, t as BrowserObservationError } from "./browserObservationError-CyLugqX4.js";
|
|
6
|
+
import { c as init_browserObservation, d as isLiteralLoopbackHostname, m as sanitizeBrowserUrl, o as browserObservationEndpointSchema } from "./webContentArtifact-Dzjc1z-R.js";
|
|
7
|
+
import { a as browserScenarioEventSchema, c as classifyBrowserScenarioCompleteness, f as init_browserNetworkEvidence, l as init_browserScenarioCaptureValues, n as init_browserScenarioCapture, o as browserScenarioStepSchema, s as browserStepArtifactsSchema, t as browserScenarioCaptureSchema, u as PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION } from "./browserScenarioCapture-CTNFN-FI.js";
|
|
8
|
+
import { a as init_providerIdentities, r as PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY } from "./providerIdentities--ptAh481.js";
|
|
9
|
+
import { f as withCdpDiscoveryDeadline, l as init_CdpEndpoint, n as init_CdpConnection, t as CdpConnection } from "./CdpConnection-BpDfz4MK.js";
|
|
10
|
+
import { i as openCdpEndpoint, r as init_CdpTargetSession, t as attachCdpTargetSession } from "./CdpTargetSession-BsPoKhEU.js";
|
|
11
|
+
import { join, resolve } from "node:path";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { tmpdir } from "node:os";
|
|
14
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
15
|
+
import { chmod, mkdtemp, rm } from "node:fs/promises";
|
|
16
|
+
|
|
17
|
+
//#region dist/browser/BrowserScenarioPartialObservation.js
|
|
18
|
+
var OPERATION$5, browserScenarioLimitations, browserScenarioCaptureData, browserScenarioCleanupObservation, browserScenarioOperationFailure;
|
|
19
|
+
function init_BrowserScenarioPartialObservation() {
|
|
20
|
+
return (init_BrowserScenarioPartialObservation = __esmMin((() => {
|
|
21
|
+
init_browserNetworkEvidence();
|
|
22
|
+
init_analysisErrorBase();
|
|
23
|
+
init_analysisErrorCore();
|
|
24
|
+
init_analysisErrorProjection();
|
|
25
|
+
init_browserObservationError();
|
|
26
|
+
init_providerAdapterError();
|
|
27
|
+
init_providerIdentities();
|
|
28
|
+
OPERATION$5 = "capture_browser_scenario";
|
|
29
|
+
browserScenarioLimitations = (session, scenario, events) => {
|
|
30
|
+
const capturedResponseBody = scenario.capture.network.response_body && events.some((event) => event.kind === "network-content" && event.phase === "response" && event.body.state === "captured" && (event.body.representation === "playwright-response-body-bytes" || event.body.representation === "browser-decoded-response-bytes"));
|
|
31
|
+
return [
|
|
32
|
+
"Event sequence records provider receipt order; simultaneous browser causality is not inferred.",
|
|
33
|
+
"Network content is retained only when selected; Playwright response-body bytes are API results and are not guaranteed to match wire bytes.",
|
|
34
|
+
"Request bytes are limited to what Playwright exposes; not_exposed does not establish body absence or multipart file coverage.",
|
|
35
|
+
"Network content reads settle within 5 seconds each and the observer does not request bodies from unfinished responses.",
|
|
36
|
+
...capturedResponseBody ? [PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION] : [],
|
|
37
|
+
"Playwright scenario events do not expose request initiator stacks; receipt order does not prove causality.",
|
|
38
|
+
"Storage values are hashed only after declared-secret redaction.",
|
|
39
|
+
...scenario.storage.local_storage.length === 0 && scenario.storage.session_storage.length === 0 ? [] : ["Non-cookie storage seeds use CDP pre-script instrumentation; only pauses in the scenario's private seed script are resumed by this observer."],
|
|
40
|
+
...session.eventLimitations?.() ?? [],
|
|
41
|
+
...session.mode === "connect" ? ["CDP attachment cannot recover pre-attach events or guarantee launch-time context options."] : []
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
browserScenarioCaptureData = (input) => {
|
|
45
|
+
const events = input.session.events();
|
|
46
|
+
return {
|
|
47
|
+
browser: {
|
|
48
|
+
mode: input.session.mode,
|
|
49
|
+
process_ownership: input.session.processOwnership,
|
|
50
|
+
cleanup: input.cleanup,
|
|
51
|
+
product: input.session.product,
|
|
52
|
+
version: input.session.version
|
|
53
|
+
},
|
|
54
|
+
scenario: {
|
|
55
|
+
start_origin: new URL(input.scenario.start_url.url).origin,
|
|
56
|
+
action_count: input.scenario.actions.length,
|
|
57
|
+
secret_references: input.scenario.secrets.map(({ secret_id: id }) => id).sort(),
|
|
58
|
+
network_content: input.scenario.capture.network,
|
|
59
|
+
event_families: [...new Set(input.scenario.capture.events)].sort()
|
|
60
|
+
},
|
|
61
|
+
duration_ms: Math.max(0, Math.round(performance.now() - input.startedAt)),
|
|
62
|
+
steps: [...input.steps],
|
|
63
|
+
events,
|
|
64
|
+
limitations: [...browserScenarioLimitations(input.session, input.scenario, events.items), ...input.limitations ?? []]
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
browserScenarioCleanupObservation = (cause) => cause instanceof AnalysisError && cause.cleanup !== undefined ? cause.cleanup : {
|
|
68
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
69
|
+
resources: cause instanceof AnalysisError && cause.cleanupResources.length > 0 ? cause.cleanupResources : ["browser_transport"]
|
|
70
|
+
};
|
|
71
|
+
browserScenarioOperationFailure = (cause, partialObservation, cleanupFailure) => {
|
|
72
|
+
const primary = cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$5, { cause });
|
|
73
|
+
const primaryProjection = projectAnalysisError(primary);
|
|
74
|
+
const cleanupCause = cleanupFailure === undefined ? undefined : cleanupFailure.cause instanceof AnalysisError ? cleanupFailure.cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, "close_browser_scenario", { cause: cleanupFailure.cause });
|
|
75
|
+
const cleanupObservation = cleanupFailure === undefined ? undefined : browserScenarioCleanupObservation(cleanupFailure.cause);
|
|
76
|
+
const retainedOptions = {
|
|
77
|
+
cause: primary,
|
|
78
|
+
partialObservation,
|
|
79
|
+
...primary.capturedOutput === undefined ? {} : { capturedOutput: primary.capturedOutput },
|
|
80
|
+
...primary.cleanup === undefined ? {} : { cleanup: primary.cleanup }
|
|
81
|
+
};
|
|
82
|
+
if (cleanupCause === undefined) {
|
|
83
|
+
if (primary instanceof AnalysisCancelledError) return new AnalysisCancelledError(primary.operation, retainedOptions);
|
|
84
|
+
if (primary instanceof AnalysisTimeoutError) return new AnalysisTimeoutError(primary.operation, primary.timeoutMs, retainedOptions);
|
|
85
|
+
if (primary instanceof BrowserObservationError) return new BrowserObservationError(primary.operation, primary.reason, {
|
|
86
|
+
...retainedOptions,
|
|
87
|
+
...primary.userMessage === undefined ? {} : { detail: primary.userMessage }
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const cleanup = cleanupObservation ?? primary.cleanup;
|
|
91
|
+
return new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$5, {
|
|
92
|
+
...retainedOptions,
|
|
93
|
+
cause: cleanupCause === undefined ? primary : new AggregateError([primary, cleanupCause], "Browser scenario operation and cleanup both failed", { cause: primary }),
|
|
94
|
+
userMessage: primaryProjection.message,
|
|
95
|
+
...cleanup === undefined ? {} : { cleanup },
|
|
96
|
+
diagnostics: {
|
|
97
|
+
primary_error: primaryProjection,
|
|
98
|
+
...cleanupCause === undefined ? {} : { cleanup_error: projectAnalysisError(cleanupCause) }
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
})))();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region dist/browser/PlaywrightBrowserScenarioProvider.js
|
|
107
|
+
var OPERATION$4, SNAPSHOT_KINDS, requestedForStep, unavailableArtifacts, stepCompleteness, createStep, initialStep, executeStep, globalCompleteness, runScenario, PlaywrightBrowserScenarioProvider;
|
|
108
|
+
function init_PlaywrightBrowserScenarioProvider() {
|
|
109
|
+
return (init_PlaywrightBrowserScenarioProvider = __esmMin((() => {
|
|
110
|
+
init_browserScenarioCapture();
|
|
111
|
+
init_browserScenarioCaptureValues();
|
|
112
|
+
init_analysisErrorBase();
|
|
113
|
+
init_browserObservationError();
|
|
114
|
+
init_providerAdapterError();
|
|
115
|
+
init_result();
|
|
116
|
+
init_BrowserScenarioPartialObservation();
|
|
117
|
+
init_providerIdentities();
|
|
118
|
+
OPERATION$4 = "capture_browser_scenario";
|
|
119
|
+
SNAPSHOT_KINDS = [
|
|
120
|
+
"screenshot",
|
|
121
|
+
"dom",
|
|
122
|
+
"accessibility",
|
|
123
|
+
"url",
|
|
124
|
+
"history",
|
|
125
|
+
"storage"
|
|
126
|
+
];
|
|
127
|
+
requestedForStep = (scenario, stepIndex) => new Set([...scenario.capture.after_each_step, ...stepIndex === scenario.actions.length ? scenario.capture.at_end : []]);
|
|
128
|
+
unavailableArtifacts = (requested, reason) => {
|
|
129
|
+
const state = (kind) => requested.has(kind) ? {
|
|
130
|
+
state: "missing",
|
|
131
|
+
reason
|
|
132
|
+
} : { state: "not_requested" };
|
|
133
|
+
return browserStepArtifactsSchema.parse({
|
|
134
|
+
screenshot: state("screenshot"),
|
|
135
|
+
dom: state("dom"),
|
|
136
|
+
accessibility: state("accessibility"),
|
|
137
|
+
url: state("url"),
|
|
138
|
+
history: state("history"),
|
|
139
|
+
storage: state("storage")
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
stepCompleteness = (artifacts, status) => {
|
|
143
|
+
const missing = SNAPSHOT_KINDS.filter((section) => artifacts[section].state === "missing");
|
|
144
|
+
const truncated = SNAPSHOT_KINDS.filter((section) => artifacts[section].state === "truncated");
|
|
145
|
+
if (status !== "completed") missing.push("action");
|
|
146
|
+
return classifyBrowserScenarioCompleteness(missing, truncated);
|
|
147
|
+
};
|
|
148
|
+
createStep = (input) => browserScenarioStepSchema.parse({
|
|
149
|
+
step_index: input.stepIndex,
|
|
150
|
+
step_id: input.stepId,
|
|
151
|
+
action: input.action,
|
|
152
|
+
status: input.status,
|
|
153
|
+
elapsed_ms: input.elapsedMs,
|
|
154
|
+
before_url: input.beforeUrl,
|
|
155
|
+
after_url: input.afterUrl,
|
|
156
|
+
error: input.error,
|
|
157
|
+
event_sequence_start: input.eventStart,
|
|
158
|
+
event_sequence_end: input.eventEnd,
|
|
159
|
+
artifacts: input.artifacts,
|
|
160
|
+
completeness: stepCompleteness(input.artifacts, input.status)
|
|
161
|
+
});
|
|
162
|
+
initialStep = async (input) => {
|
|
163
|
+
const { session, scenario, elapsedMs, signal } = input;
|
|
164
|
+
const artifacts = await session.capture(requestedForStep(scenario, 0), signal);
|
|
165
|
+
return createStep({
|
|
166
|
+
stepIndex: 0,
|
|
167
|
+
stepId: "scenario_start",
|
|
168
|
+
action: "goto_start",
|
|
169
|
+
status: "completed",
|
|
170
|
+
elapsedMs,
|
|
171
|
+
beforeUrl: session.sanitizeUrl(session.initialUrl),
|
|
172
|
+
afterUrl: session.sanitizeUrl(session.currentUrl()),
|
|
173
|
+
error: null,
|
|
174
|
+
eventStart: 1,
|
|
175
|
+
eventEnd: session.lastEventSequence(),
|
|
176
|
+
artifacts
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
executeStep = async (input) => {
|
|
180
|
+
const { session, scenario, action, stepIndex, priorFailure, signal } = input;
|
|
181
|
+
const beforeUrl = session.sanitizeUrl(session.currentUrl());
|
|
182
|
+
const eventStart = session.nextEventSequence();
|
|
183
|
+
const requested = requestedForStep(scenario, stepIndex);
|
|
184
|
+
if (priorFailure) return createStep({
|
|
185
|
+
stepIndex,
|
|
186
|
+
stepId: action.step_id,
|
|
187
|
+
action: action.action,
|
|
188
|
+
status: "cancelled",
|
|
189
|
+
elapsedMs: 0,
|
|
190
|
+
beforeUrl,
|
|
191
|
+
afterUrl: beforeUrl,
|
|
192
|
+
error: "not executed after an earlier action failure",
|
|
193
|
+
eventStart,
|
|
194
|
+
eventEnd: session.lastEventSequence(),
|
|
195
|
+
artifacts: unavailableArtifacts(requested, "action was not executed after an earlier failure")
|
|
196
|
+
});
|
|
197
|
+
const actionStartedAt = performance.now();
|
|
198
|
+
session.setStep(stepIndex);
|
|
199
|
+
const requestCancelled = () => signal?.aborted === true;
|
|
200
|
+
let outcome = {
|
|
201
|
+
status: "completed",
|
|
202
|
+
error: null
|
|
203
|
+
};
|
|
204
|
+
if (requestCancelled()) {
|
|
205
|
+
outcome = {
|
|
206
|
+
status: "cancelled",
|
|
207
|
+
error: "scenario request cancelled"
|
|
208
|
+
};
|
|
209
|
+
} else {
|
|
210
|
+
try {
|
|
211
|
+
await session.perform(action, signal);
|
|
212
|
+
} catch (cause) {
|
|
213
|
+
outcome = {
|
|
214
|
+
status: requestCancelled() ? "cancelled" : "failed",
|
|
215
|
+
error: session.redactError(cause)
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const artifacts = outcome.status === "cancelled" ? unavailableArtifacts(requested, "scenario request cancelled") : await session.capture(requested, signal);
|
|
220
|
+
return createStep({
|
|
221
|
+
stepIndex,
|
|
222
|
+
stepId: action.step_id,
|
|
223
|
+
action: action.action,
|
|
224
|
+
...outcome,
|
|
225
|
+
elapsedMs: Math.max(0, Math.round(performance.now() - actionStartedAt)),
|
|
226
|
+
beforeUrl,
|
|
227
|
+
afterUrl: session.sanitizeUrl(session.currentUrl()),
|
|
228
|
+
eventStart,
|
|
229
|
+
eventEnd: session.lastEventSequence(),
|
|
230
|
+
artifacts
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
globalCompleteness = (scenario, session, steps) => {
|
|
234
|
+
const missing = steps.flatMap(({ completeness }) => completeness.missing_sections);
|
|
235
|
+
const truncated = steps.flatMap(({ completeness }) => completeness.truncated_sections);
|
|
236
|
+
if (session.mode === "connect") missing.push("events");
|
|
237
|
+
if ((session.eventLimitations?.().length ?? 0) > 0) missing.push("events");
|
|
238
|
+
return classifyBrowserScenarioCompleteness(missing, truncated);
|
|
239
|
+
};
|
|
240
|
+
runScenario = async (openSession, scenario, options, retainCleanup) => {
|
|
241
|
+
if (options.signal?.aborted === true) throw new BrowserObservationError(OPERATION$4, "cancelled");
|
|
242
|
+
const startedAt = performance.now();
|
|
243
|
+
const session = await openSession(scenario, {
|
|
244
|
+
...options.signal === undefined ? {} : { signal: options.signal },
|
|
245
|
+
retainCleanup
|
|
246
|
+
});
|
|
247
|
+
const steps = [];
|
|
248
|
+
let operationOutcome = { ok: true };
|
|
249
|
+
try {
|
|
250
|
+
steps.push(await initialStep({
|
|
251
|
+
session,
|
|
252
|
+
scenario,
|
|
253
|
+
elapsedMs: Math.max(0, Math.round(performance.now() - startedAt)),
|
|
254
|
+
signal: options.signal
|
|
255
|
+
}));
|
|
256
|
+
let failed = false;
|
|
257
|
+
for (const [offset, action] of scenario.actions.entries()) {
|
|
258
|
+
const step = await executeStep({
|
|
259
|
+
session,
|
|
260
|
+
scenario,
|
|
261
|
+
action,
|
|
262
|
+
stepIndex: offset + 1,
|
|
263
|
+
priorFailure: failed,
|
|
264
|
+
signal: options.signal
|
|
265
|
+
});
|
|
266
|
+
steps.push(step);
|
|
267
|
+
failed ||= step.status !== "completed";
|
|
268
|
+
}
|
|
269
|
+
} catch (cause) {
|
|
270
|
+
operationOutcome = {
|
|
271
|
+
ok: false,
|
|
272
|
+
cause
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
let cleanupOutcome;
|
|
276
|
+
try {
|
|
277
|
+
cleanupOutcome = {
|
|
278
|
+
ok: true,
|
|
279
|
+
cleanup: await session.close()
|
|
280
|
+
};
|
|
281
|
+
} catch (cause) {
|
|
282
|
+
cleanupOutcome = {
|
|
283
|
+
ok: false,
|
|
284
|
+
cause
|
|
285
|
+
};
|
|
286
|
+
retainCleanup(() => session.close());
|
|
287
|
+
}
|
|
288
|
+
if (!cleanupOutcome.ok) {
|
|
289
|
+
const cleanup = browserScenarioCleanupObservation(cleanupOutcome.cause);
|
|
290
|
+
const partialObservation = {
|
|
291
|
+
kind: "browser-scenario-observation",
|
|
292
|
+
capture: browserScenarioCaptureData({
|
|
293
|
+
session,
|
|
294
|
+
scenario,
|
|
295
|
+
startedAt,
|
|
296
|
+
steps,
|
|
297
|
+
cleanup: "incomplete",
|
|
298
|
+
limitations: ["Scenario observations are partial because browser cleanup could not be confirmed."]
|
|
299
|
+
})
|
|
300
|
+
};
|
|
301
|
+
if (!operationOutcome.ok) throw browserScenarioOperationFailure(operationOutcome.cause, partialObservation, { cause: cleanupOutcome.cause });
|
|
302
|
+
throw new BrowserObservationError(OPERATION$4, "cleanup_failed", {
|
|
303
|
+
cause: cleanupOutcome.cause,
|
|
304
|
+
cleanup,
|
|
305
|
+
partialObservation,
|
|
306
|
+
detail: `Browser scenario cleanup could not be confirmed: ${cleanup.reason}. Collected steps and events are retained in partial_observation. Review the reported resources before retrying.`
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
if (!operationOutcome.ok) throw browserScenarioOperationFailure(operationOutcome.cause, {
|
|
310
|
+
kind: "browser-scenario-observation",
|
|
311
|
+
capture: browserScenarioCaptureData({
|
|
312
|
+
session,
|
|
313
|
+
scenario,
|
|
314
|
+
startedAt,
|
|
315
|
+
steps,
|
|
316
|
+
cleanup: cleanupOutcome.cleanup,
|
|
317
|
+
limitations: ["Scenario capture ended after an operation failed; uncollected steps are not represented."]
|
|
318
|
+
})
|
|
319
|
+
});
|
|
320
|
+
const completeness = globalCompleteness(scenario, session, steps);
|
|
321
|
+
return browserScenarioCaptureSchema.parse({
|
|
322
|
+
...browserScenarioCaptureData({
|
|
323
|
+
session,
|
|
324
|
+
scenario,
|
|
325
|
+
startedAt,
|
|
326
|
+
steps,
|
|
327
|
+
cleanup: cleanupOutcome.cleanup
|
|
328
|
+
}),
|
|
329
|
+
completeness
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
PlaywrightBrowserScenarioProvider = class {
|
|
333
|
+
openSession;
|
|
334
|
+
#tail = Promise.resolve();
|
|
335
|
+
#closing = false;
|
|
336
|
+
#closePromise;
|
|
337
|
+
#pendingCleanup = new Set();
|
|
338
|
+
constructor(openSession) {
|
|
339
|
+
this.openSession = openSession;
|
|
340
|
+
}
|
|
341
|
+
identity() {
|
|
342
|
+
return PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY;
|
|
343
|
+
}
|
|
344
|
+
captureScenario(scenario, options = {}) {
|
|
345
|
+
if (this.#closing) return Promise.resolve(err(this.#closedError()));
|
|
346
|
+
const operation = this.#tail.then(() => this.#closing ? err(this.#closedError()) : this.#captureScenario(scenario, options));
|
|
347
|
+
this.#tail = operation.then(() => undefined, () => undefined);
|
|
348
|
+
return operation;
|
|
349
|
+
}
|
|
350
|
+
async #captureScenario(scenario, options) {
|
|
351
|
+
const pending = await this.#retryCleanup();
|
|
352
|
+
if (pending !== undefined) return err(pending);
|
|
353
|
+
try {
|
|
354
|
+
return ok(await runScenario(this.openSession, scenario, options, (close) => {
|
|
355
|
+
this.#pendingCleanup.add(close);
|
|
356
|
+
}));
|
|
357
|
+
} catch (cause) {
|
|
358
|
+
if (cause instanceof AnalysisError) return err(cause);
|
|
359
|
+
return err(new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$4, { cause }));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
async close() {
|
|
363
|
+
this.#closing = true;
|
|
364
|
+
this.#closePromise ??= this.#tail.then(async () => {
|
|
365
|
+
const failure = await this.#retryCleanup();
|
|
366
|
+
if (failure !== undefined) throw failure;
|
|
367
|
+
}).catch((cause) => {
|
|
368
|
+
this.#closePromise = undefined;
|
|
369
|
+
throw cause;
|
|
370
|
+
});
|
|
371
|
+
return this.#closePromise;
|
|
372
|
+
}
|
|
373
|
+
#closedError() {
|
|
374
|
+
return new BrowserObservationError(OPERATION$4, "cleanup_failed", {
|
|
375
|
+
detail: "Browser scenario provider is closing.",
|
|
376
|
+
cleanup: {
|
|
377
|
+
reason: "Provider is closing",
|
|
378
|
+
resources: []
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
async #retryCleanup() {
|
|
383
|
+
for (const pending of this.#pendingCleanup) {
|
|
384
|
+
try {
|
|
385
|
+
await pending();
|
|
386
|
+
this.#pendingCleanup.delete(pending);
|
|
387
|
+
} catch (cause) {
|
|
388
|
+
return cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$4, { cause });
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return undefined;
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
})))();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region dist/browser/BrowserScenarioSecrets.js
|
|
399
|
+
var REDACTION_PREFIX, encodedSecretValues, normalizePercentEscapes, secretPatterns, declaredPatterns, secretReplacements, normalizePercentEscapesBytes, isHexByte, lowercaseHexByte, patternMatches, containsSecretPattern, containsSecretBytePattern, redactionMarker, replaceSecretLiterals, secretNeedles, BrowserScenarioSecrets;
|
|
400
|
+
function init_BrowserScenarioSecrets() {
|
|
401
|
+
return (init_BrowserScenarioSecrets = __esmMin((() => {
|
|
402
|
+
init_browserObservation();
|
|
403
|
+
REDACTION_PREFIX = "[REDACTED:";
|
|
404
|
+
encodedSecretValues = (secret) => new Set([encodeURIComponent(secret), new URLSearchParams([["value", secret]]).toString().slice("value=".length)]);
|
|
405
|
+
normalizePercentEscapes = (value) => {
|
|
406
|
+
if (!value.includes("%")) return value;
|
|
407
|
+
return value.replace(/%[0-9a-f]{2}/giu, (escape) => escape.toLowerCase());
|
|
408
|
+
};
|
|
409
|
+
secretPatterns = (secret, spellings) => {
|
|
410
|
+
if (secret === "") return [];
|
|
411
|
+
const patterns = [{
|
|
412
|
+
text: secret,
|
|
413
|
+
searchText: secret,
|
|
414
|
+
percentInsensitive: false
|
|
415
|
+
}, ...[...encodedSecretValues(secret)].map((text) => ({
|
|
416
|
+
text,
|
|
417
|
+
searchText: normalizePercentEscapes(text),
|
|
418
|
+
percentInsensitive: true
|
|
419
|
+
}))];
|
|
420
|
+
if (spellings === "text") patterns.push({
|
|
421
|
+
text: JSON.stringify(secret).slice(1, -1),
|
|
422
|
+
searchText: JSON.stringify(secret).slice(1, -1),
|
|
423
|
+
percentInsensitive: false
|
|
424
|
+
});
|
|
425
|
+
const seen = new Set();
|
|
426
|
+
return patterns.filter(({ text, percentInsensitive }) => {
|
|
427
|
+
if (text === "") return false;
|
|
428
|
+
const key = `${percentInsensitive ? "percent" : "literal"}:${text}`;
|
|
429
|
+
if (seen.has(key)) return false;
|
|
430
|
+
seen.add(key);
|
|
431
|
+
return true;
|
|
432
|
+
});
|
|
433
|
+
};
|
|
434
|
+
declaredPatterns = (values, spellings) => {
|
|
435
|
+
const seen = new Set();
|
|
436
|
+
return [...values.values()].flatMap((secret) => secretPatterns(secret, spellings)).filter(({ text, percentInsensitive }) => {
|
|
437
|
+
const key = `${percentInsensitive ? "percent" : "literal"}:${text}`;
|
|
438
|
+
if (seen.has(key)) return false;
|
|
439
|
+
seen.add(key);
|
|
440
|
+
return true;
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
secretReplacements = (values, spellings) => [...values].flatMap(([id, secret]) => secretPatterns(secret, spellings).map((pattern) => ({
|
|
444
|
+
id,
|
|
445
|
+
...pattern
|
|
446
|
+
}))).sort((left, right) => right.text.length - left.text.length || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
|
|
447
|
+
normalizePercentEscapesBytes = (value) => {
|
|
448
|
+
if (value.indexOf(37) < 0) return value;
|
|
449
|
+
const normalized = Buffer.from(value);
|
|
450
|
+
for (let index = 0; index + 2 < normalized.length; index += 1) if (normalized[index] === 37 && isHexByte(normalized[index + 1]) && isHexByte(normalized[index + 2])) {
|
|
451
|
+
normalized[index + 1] = lowercaseHexByte(normalized[index + 1]);
|
|
452
|
+
normalized[index + 2] = lowercaseHexByte(normalized[index + 2]);
|
|
453
|
+
index += 2;
|
|
454
|
+
}
|
|
455
|
+
return normalized;
|
|
456
|
+
};
|
|
457
|
+
isHexByte = (value) => value !== undefined && (value >= 48 && value <= 57 || value >= 65 && value <= 70 || value >= 97 && value <= 102);
|
|
458
|
+
lowercaseHexByte = (value) => value >= 65 && value <= 70 ? value + 32 : value;
|
|
459
|
+
patternMatches = (value, normalizedValue, pattern) => (pattern.percentInsensitive ? normalizedValue : value).includes(pattern.searchText);
|
|
460
|
+
containsSecretPattern = (value, normalizedValue, patterns) => {
|
|
461
|
+
if (patterns.length === 0) return false;
|
|
462
|
+
return patterns.some((pattern) => patternMatches(value, normalizedValue, pattern));
|
|
463
|
+
};
|
|
464
|
+
containsSecretBytePattern = (value, normalizedValue, needles) => needles.some((needle) => (needle.percentInsensitive ? normalizedValue : value).includes(needle.needle));
|
|
465
|
+
redactionMarker = (id, patterns) => {
|
|
466
|
+
const candidates = [
|
|
467
|
+
`${REDACTION_PREFIX}${id}]`,
|
|
468
|
+
"[REDACTED]",
|
|
469
|
+
"…",
|
|
470
|
+
""
|
|
471
|
+
];
|
|
472
|
+
return candidates.find((candidate) => patterns.every((pattern) => !patternMatches(candidate, normalizePercentEscapes(candidate), pattern))) ?? "";
|
|
473
|
+
};
|
|
474
|
+
replaceSecretLiterals = (value, replacements, patterns) => {
|
|
475
|
+
const normalizedValue = replacements.some(({ percentInsensitive }) => percentInsensitive) ? normalizePercentEscapes(value) : value;
|
|
476
|
+
const parts = [];
|
|
477
|
+
let offset = 0;
|
|
478
|
+
while (offset < value.length) {
|
|
479
|
+
let next;
|
|
480
|
+
for (const replacement of replacements) {
|
|
481
|
+
const search = replacement.searchText;
|
|
482
|
+
const view = replacement.percentInsensitive ? normalizedValue : value;
|
|
483
|
+
const index = view.indexOf(search, offset);
|
|
484
|
+
if (index >= 0 && (next === undefined || index < next.index || index === next.index && replacement.text.length > next.text.length)) next = {
|
|
485
|
+
...replacement,
|
|
486
|
+
index
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
if (next === undefined) break;
|
|
490
|
+
const marker = redactionMarker(next.id, patterns);
|
|
491
|
+
parts.push(value.slice(offset, next.index), marker);
|
|
492
|
+
offset = next.index + next.text.length;
|
|
493
|
+
}
|
|
494
|
+
if (parts.length === 0) return value;
|
|
495
|
+
parts.push(value.slice(offset));
|
|
496
|
+
return parts.join("");
|
|
497
|
+
};
|
|
498
|
+
secretNeedles = (replacements, patterns) => replacements.map((pattern) => ({
|
|
499
|
+
id: pattern.id,
|
|
500
|
+
needle: Buffer.from(pattern.searchText),
|
|
501
|
+
percentInsensitive: pattern.percentInsensitive,
|
|
502
|
+
marker: Buffer.from(redactionMarker(pattern.id, patterns))
|
|
503
|
+
}));
|
|
504
|
+
BrowserScenarioSecrets = class BrowserScenarioSecrets {
|
|
505
|
+
values;
|
|
506
|
+
urlPatterns;
|
|
507
|
+
textPatterns;
|
|
508
|
+
urlReplacements;
|
|
509
|
+
textReplacements;
|
|
510
|
+
textNeedles;
|
|
511
|
+
redactionCostPerCharacter;
|
|
512
|
+
constructor(values) {
|
|
513
|
+
this.values = values;
|
|
514
|
+
this.urlPatterns = declaredPatterns(values, "url");
|
|
515
|
+
this.textPatterns = declaredPatterns(values, "text");
|
|
516
|
+
this.urlReplacements = secretReplacements(values, "url");
|
|
517
|
+
this.textReplacements = secretReplacements(values, "text");
|
|
518
|
+
this.textNeedles = secretNeedles(this.textReplacements, this.textPatterns);
|
|
519
|
+
this.redactionCostPerCharacter = 8;
|
|
520
|
+
for (const [replacements, patterns] of [[this.textReplacements, this.textPatterns], [this.urlReplacements, this.urlPatterns]]) for (const replacement of replacements) this.redactionCostPerCharacter = Math.max(this.redactionCostPerCharacter, 8 + (Buffer.byteLength(redactionMarker(replacement.id, patterns)) * 8 + 128) / replacement.text.length);
|
|
521
|
+
}
|
|
522
|
+
static resolve(scenario, environment) {
|
|
523
|
+
const values = new Map();
|
|
524
|
+
for (const declaration of scenario.secrets) {
|
|
525
|
+
const value = environment[declaration.environment_variable];
|
|
526
|
+
if (!Object.hasOwn(environment, declaration.environment_variable) || typeof value !== "string") return undefined;
|
|
527
|
+
values.set(declaration.secret_id, value);
|
|
528
|
+
}
|
|
529
|
+
return new BrowserScenarioSecrets(values);
|
|
530
|
+
}
|
|
531
|
+
value(source) {
|
|
532
|
+
if (source.source === "literal") return source.value;
|
|
533
|
+
const value = this.values.get(source.secret_id);
|
|
534
|
+
if (value === undefined) throw new Error("Validated browser secret was not resolved");
|
|
535
|
+
return value;
|
|
536
|
+
}
|
|
537
|
+
url(destination) {
|
|
538
|
+
const url = new URL(destination.url);
|
|
539
|
+
for (const { name, value } of destination.query) url.searchParams.append(name, this.value(value));
|
|
540
|
+
return url.href;
|
|
541
|
+
}
|
|
542
|
+
/** Conservative preflight for output expansion and per-match part arrays.
|
|
543
|
+
* Callers measuring untrusted observations must reserve this cost before
|
|
544
|
+
* invoking redaction. A one-byte secret can otherwise expand every byte.
|
|
545
|
+
*/
|
|
546
|
+
redactionAllocationCost(length) {
|
|
547
|
+
return Math.ceil(length * this.redactionCostPerCharacter);
|
|
548
|
+
}
|
|
549
|
+
redact(value) {
|
|
550
|
+
const patterns = this.textPatterns;
|
|
551
|
+
if (patterns.length === 0) return value;
|
|
552
|
+
const output = replaceSecretLiterals(value, this.textReplacements, patterns);
|
|
553
|
+
return containsSecretPattern(output, normalizePercentEscapes(output), patterns) ? "" : output;
|
|
554
|
+
}
|
|
555
|
+
/** Replace declared UTF-8, URI/form, and JSON-escaped secret spellings. */
|
|
556
|
+
redactBytes(value) {
|
|
557
|
+
const patterns = this.textPatterns;
|
|
558
|
+
if (patterns.length === 0) return value;
|
|
559
|
+
const candidates = this.textNeedles;
|
|
560
|
+
const hasPercentPatterns = candidates.some(({ percentInsensitive }) => percentInsensitive);
|
|
561
|
+
const normalizedValue = hasPercentPatterns && value.indexOf(37) >= 0 ? normalizePercentEscapesBytes(value) : value;
|
|
562
|
+
const sortedCandidates = candidates.map((candidate) => ({
|
|
563
|
+
...candidate,
|
|
564
|
+
index: (candidate.percentInsensitive ? normalizedValue : value).indexOf(candidate.needle)
|
|
565
|
+
})).sort((left, right) => right.needle.length - left.needle.length || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
|
|
566
|
+
const parts = [];
|
|
567
|
+
let offset = 0;
|
|
568
|
+
while (true) {
|
|
569
|
+
let next;
|
|
570
|
+
for (const candidate of sortedCandidates) {
|
|
571
|
+
if (candidate.index >= 0 && candidate.index < offset) candidate.index = (candidate.percentInsensitive ? normalizedValue : value).indexOf(candidate.needle, offset);
|
|
572
|
+
if (candidate.index >= 0 && (next === undefined || candidate.index < next.index || candidate.index === next.index && candidate.needle.length > next.needle.length)) next = candidate;
|
|
573
|
+
}
|
|
574
|
+
if (next === undefined) break;
|
|
575
|
+
parts.push(value.subarray(offset, next.index), next.marker);
|
|
576
|
+
offset = next.index + next.needle.length;
|
|
577
|
+
}
|
|
578
|
+
if (parts.length === 0) return value;
|
|
579
|
+
parts.push(value.subarray(offset));
|
|
580
|
+
const redacted = Buffer.concat(parts);
|
|
581
|
+
const normalizedRedacted = hasPercentPatterns && redacted.indexOf(37) >= 0 ? normalizePercentEscapesBytes(redacted) : redacted;
|
|
582
|
+
return containsSecretBytePattern(redacted, normalizedRedacted, candidates) ? Buffer.alloc(0) : redacted;
|
|
583
|
+
}
|
|
584
|
+
/** Remove only declared secret values from one URL and report that action. */
|
|
585
|
+
sanitizeUrl(value) {
|
|
586
|
+
const patterns = this.urlPatterns;
|
|
587
|
+
if (patterns.length === 0) return sanitizeBrowserUrl(value);
|
|
588
|
+
const output = replaceSecretLiterals(value, this.urlReplacements, patterns);
|
|
589
|
+
if (containsSecretPattern(output, normalizePercentEscapes(output), patterns)) return {
|
|
590
|
+
url: "",
|
|
591
|
+
origin: null,
|
|
592
|
+
query_parameter_names: [],
|
|
593
|
+
redacted: true
|
|
594
|
+
};
|
|
595
|
+
const sanitized = sanitizeBrowserUrl(output);
|
|
596
|
+
return {
|
|
597
|
+
...sanitized,
|
|
598
|
+
redacted: sanitized.redacted || output !== value
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
fingerprint(value) {
|
|
602
|
+
const patterns = this.textPatterns;
|
|
603
|
+
if (patterns.length > 0 && containsSecretPattern(value, normalizePercentEscapes(value), patterns)) return {
|
|
604
|
+
value_state: "redacted-secret",
|
|
605
|
+
value_sha256: null
|
|
606
|
+
};
|
|
607
|
+
return {
|
|
608
|
+
value_state: "hashed",
|
|
609
|
+
value_sha256: createHash("sha256").update(value).digest("hex")
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
})))();
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
//#endregion
|
|
617
|
+
//#region dist/browser/PlaywrightExecutionBoundary.js
|
|
618
|
+
var OPERATION$3, withPlaywrightExecutionBoundary;
|
|
619
|
+
function init_PlaywrightExecutionBoundary() {
|
|
620
|
+
return (init_PlaywrightExecutionBoundary = __esmMin((() => {
|
|
621
|
+
init_analysisErrorCore();
|
|
622
|
+
OPERATION$3 = "capture_browser_scenario";
|
|
623
|
+
withPlaywrightExecutionBoundary = (work, timeoutMs, signal) => {
|
|
624
|
+
if (timeoutMs !== undefined && timeoutMs <= 0) return Promise.reject(new AnalysisTimeoutError(OPERATION$3, timeoutMs));
|
|
625
|
+
if (signal?.aborted === true) return Promise.reject(new AnalysisCancelledError(OPERATION$3));
|
|
626
|
+
return new Promise((resolve, reject) => {
|
|
627
|
+
let settled = false;
|
|
628
|
+
let timer;
|
|
629
|
+
const deadline = timeoutMs === undefined ? undefined : performance.now() + timeoutMs;
|
|
630
|
+
const scheduleTimeout = () => {
|
|
631
|
+
if (deadline === undefined) return;
|
|
632
|
+
const remaining = deadline - performance.now();
|
|
633
|
+
if (remaining <= 0) {
|
|
634
|
+
fail(new AnalysisTimeoutError(OPERATION$3, timeoutMs ?? 0));
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
timer = setTimeout(scheduleTimeout, Math.min(remaining, 2147483647));
|
|
638
|
+
timer.unref();
|
|
639
|
+
};
|
|
640
|
+
const cleanup = () => {
|
|
641
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
642
|
+
signal?.removeEventListener("abort", onAbort);
|
|
643
|
+
};
|
|
644
|
+
const succeed = (value) => {
|
|
645
|
+
if (settled) return;
|
|
646
|
+
settled = true;
|
|
647
|
+
cleanup();
|
|
648
|
+
resolve(value);
|
|
649
|
+
};
|
|
650
|
+
const fail = (error) => {
|
|
651
|
+
if (settled) return;
|
|
652
|
+
settled = true;
|
|
653
|
+
cleanup();
|
|
654
|
+
reject(error);
|
|
655
|
+
};
|
|
656
|
+
const onAbort = () => {
|
|
657
|
+
fail(new AnalysisCancelledError(OPERATION$3));
|
|
658
|
+
};
|
|
659
|
+
scheduleTimeout();
|
|
660
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
661
|
+
if (signal?.aborted === true) {
|
|
662
|
+
onAbort();
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
void work().then(succeed, fail);
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
})))();
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
//#endregion
|
|
672
|
+
//#region dist/browser/PlaywrightScenarioBrowser.js
|
|
673
|
+
var OPERATION$2, CLEANUP_CONFIRMATION_TIMEOUT_MS, throwIfScenarioCancelled$1, PlaywrightScenarioBrowserCleanupOwner, attachedScenarioAdmissions, releaseAttachedScenario, createAttachedScenarioRelease, attachedScenarioLeaseKey, acquireAttachedScenario, allowedBrowserEnvironment, findConnectedPage, configureAttachedEnvironment, failBrowserScenarioOperation, openAttachedScenarioBrowser, openPlaywrightScenarioBrowser;
|
|
674
|
+
function init_PlaywrightScenarioBrowser() {
|
|
675
|
+
return (init_PlaywrightScenarioBrowser = __esmMin((() => {
|
|
676
|
+
init_analysisErrorBase();
|
|
677
|
+
init_browserObservation();
|
|
678
|
+
init_browserObservationError();
|
|
679
|
+
init_PlaywrightExecutionBoundary();
|
|
680
|
+
OPERATION$2 = "capture_browser_scenario";
|
|
681
|
+
CLEANUP_CONFIRMATION_TIMEOUT_MS = 3e4;
|
|
682
|
+
throwIfScenarioCancelled$1 = (signal) => {
|
|
683
|
+
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION$2, "cancelled");
|
|
684
|
+
};
|
|
685
|
+
PlaywrightScenarioBrowserCleanupOwner = class {
|
|
686
|
+
resources;
|
|
687
|
+
#browserClosed = false;
|
|
688
|
+
#profileRemoved;
|
|
689
|
+
#closePromise;
|
|
690
|
+
#eventFinalizationPromise;
|
|
691
|
+
/** Keep the narrow provider actions needed to release one opened browser. */
|
|
692
|
+
constructor(resources) {
|
|
693
|
+
this.resources = resources;
|
|
694
|
+
this.#profileRemoved = resources.removeProfile === undefined;
|
|
695
|
+
}
|
|
696
|
+
get browserClosed() {
|
|
697
|
+
return this.#browserClosed;
|
|
698
|
+
}
|
|
699
|
+
close(finishEvents) {
|
|
700
|
+
const cleanup = this.#closePromise ?? this.#closeResources(finishEvents);
|
|
701
|
+
if (this.#closePromise === undefined) {
|
|
702
|
+
this.#closePromise = cleanup;
|
|
703
|
+
void cleanup.then(() => this.resources.onSettled?.(this.#browserClosed), () => {
|
|
704
|
+
if (this.#closePromise === cleanup) this.#closePromise = undefined;
|
|
705
|
+
this.resources.onSettled?.(this.#browserClosed);
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
return this.#awaitCleanup(cleanup);
|
|
709
|
+
}
|
|
710
|
+
async #awaitCleanup(cleanup) {
|
|
711
|
+
try {
|
|
712
|
+
await withPlaywrightExecutionBoundary(() => cleanup, CLEANUP_CONFIRMATION_TIMEOUT_MS);
|
|
713
|
+
} catch (cause) {
|
|
714
|
+
throw new BrowserObservationError(OPERATION$2, "cleanup_failed", {
|
|
715
|
+
cause,
|
|
716
|
+
cleanup: {
|
|
717
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
718
|
+
resources: ["browser_transport", ...this.resources.removeProfile === undefined ? [] : ["browser_profile"]]
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
async #closeResources(finishEvents) {
|
|
724
|
+
const failures = [];
|
|
725
|
+
const eventFinalization = this.#eventFinalizationPromise ??= Promise.resolve().then(async () => {
|
|
726
|
+
await finishEvents?.();
|
|
727
|
+
});
|
|
728
|
+
try {
|
|
729
|
+
await eventFinalization;
|
|
730
|
+
} catch (cause) {
|
|
731
|
+
failures.push(cause);
|
|
732
|
+
}
|
|
733
|
+
if (!this.#browserClosed) {
|
|
734
|
+
try {
|
|
735
|
+
await this.resources.closeBrowser();
|
|
736
|
+
this.#browserClosed = true;
|
|
737
|
+
} catch (cause) {
|
|
738
|
+
failures.push(cause);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (this.#browserClosed && !this.#profileRemoved && this.resources.removeProfile !== undefined) {
|
|
742
|
+
try {
|
|
743
|
+
await this.resources.removeProfile();
|
|
744
|
+
this.#profileRemoved = true;
|
|
745
|
+
} catch (cause) {
|
|
746
|
+
failures.push(cause);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
if (failures.length === 1) throw failures[0];
|
|
750
|
+
if (failures.length > 1) throw new AggregateError(failures, "Browser session cleanup failed");
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
attachedScenarioAdmissions = new Map();
|
|
754
|
+
releaseAttachedScenario = (key, admission) => {
|
|
755
|
+
const waiter = admission.waiters.shift();
|
|
756
|
+
if (waiter === undefined) {
|
|
757
|
+
admission.active = false;
|
|
758
|
+
if (admission.cleanupOwner === undefined && attachedScenarioAdmissions.get(key) === admission) attachedScenarioAdmissions.delete(key);
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
if (waiter.onAbort !== undefined) waiter.signal?.removeEventListener("abort", waiter.onAbort);
|
|
762
|
+
if (waiter.signal?.aborted === true) {
|
|
763
|
+
waiter.reject(new BrowserObservationError(OPERATION$2, "cancelled"));
|
|
764
|
+
releaseAttachedScenario(key, admission);
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
waiter.resolve(createAttachedScenarioRelease(key, admission));
|
|
768
|
+
};
|
|
769
|
+
createAttachedScenarioRelease = (key, admission) => {
|
|
770
|
+
let released = false;
|
|
771
|
+
return () => {
|
|
772
|
+
if (released) return;
|
|
773
|
+
released = true;
|
|
774
|
+
releaseAttachedScenario(key, admission);
|
|
775
|
+
};
|
|
776
|
+
};
|
|
777
|
+
attachedScenarioLeaseKey = (endpoint, targetId) => {
|
|
778
|
+
const discovery = new URL("/json/version", endpoint);
|
|
779
|
+
if (isLiteralLoopbackHostname(discovery.hostname)) discovery.hostname = "127.0.0.1";
|
|
780
|
+
return JSON.stringify([discovery.href, targetId]);
|
|
781
|
+
};
|
|
782
|
+
acquireAttachedScenario = (scenario, signal) => {
|
|
783
|
+
if (signal?.aborted === true) return Promise.reject(new BrowserObservationError(OPERATION$2, "cancelled"));
|
|
784
|
+
const key = attachedScenarioLeaseKey(scenario.cdp_endpoint, scenario.target_id);
|
|
785
|
+
const admission = attachedScenarioAdmissions.get(key) ?? {
|
|
786
|
+
active: false,
|
|
787
|
+
waiters: [],
|
|
788
|
+
cleanupOwner: undefined
|
|
789
|
+
};
|
|
790
|
+
attachedScenarioAdmissions.set(key, admission);
|
|
791
|
+
return new Promise((resolve, reject) => {
|
|
792
|
+
const grant = (release) => resolve({
|
|
793
|
+
admission,
|
|
794
|
+
release
|
|
795
|
+
});
|
|
796
|
+
if (!admission.active) {
|
|
797
|
+
admission.active = true;
|
|
798
|
+
grant(createAttachedScenarioRelease(key, admission));
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
const waiter = {
|
|
802
|
+
signal,
|
|
803
|
+
resolve: (release) => grant(release),
|
|
804
|
+
reject,
|
|
805
|
+
onAbort: undefined
|
|
806
|
+
};
|
|
807
|
+
admission.waiters.push(waiter);
|
|
808
|
+
if (signal !== undefined) {
|
|
809
|
+
const onAbort = () => {
|
|
810
|
+
const index = admission.waiters.indexOf(waiter);
|
|
811
|
+
if (index < 0) return;
|
|
812
|
+
admission.waiters.splice(index, 1);
|
|
813
|
+
signal.removeEventListener("abort", onAbort);
|
|
814
|
+
reject(new BrowserObservationError(OPERATION$2, "cancelled"));
|
|
815
|
+
if (!admission.active && admission.waiters.length === 0) releaseAttachedScenario(key, admission);
|
|
816
|
+
};
|
|
817
|
+
waiter.onAbort = onAbort;
|
|
818
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
819
|
+
if (signal.aborted) {
|
|
820
|
+
onAbort();
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
};
|
|
826
|
+
allowedBrowserEnvironment = (environment) => {
|
|
827
|
+
const allowed = [
|
|
828
|
+
"DBUS_SESSION_BUS_ADDRESS",
|
|
829
|
+
"DISPLAY",
|
|
830
|
+
"HOME",
|
|
831
|
+
"LANG",
|
|
832
|
+
"LD_LIBRARY_PATH",
|
|
833
|
+
"PATH",
|
|
834
|
+
"SystemRoot",
|
|
835
|
+
"TEMP",
|
|
836
|
+
"TMP",
|
|
837
|
+
"TMPDIR",
|
|
838
|
+
"WAYLAND_DISPLAY",
|
|
839
|
+
"XAUTHORITY",
|
|
840
|
+
"XDG_RUNTIME_DIR"
|
|
841
|
+
];
|
|
842
|
+
const selected = Object.fromEntries(allowed.map((name) => [name, environment[name]]).filter((entry) => entry[1] !== undefined));
|
|
843
|
+
if (process.platform !== "android") return selected;
|
|
844
|
+
const prefix = environment.PREFIX;
|
|
845
|
+
if (prefix === undefined) return selected;
|
|
846
|
+
return {
|
|
847
|
+
...selected,
|
|
848
|
+
LD_PRELOAD: `${prefix}/lib/libtermux-exec.so`,
|
|
849
|
+
TERMUX_EXEC__PROC_SELF_EXE: process.execPath
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
findConnectedPage = async (browser, targetId, signal) => {
|
|
853
|
+
for (const context of browser.contexts()) for (const page of context.pages()) {
|
|
854
|
+
const session = await context.newCDPSession(page);
|
|
855
|
+
try {
|
|
856
|
+
throwIfScenarioCancelled$1(signal);
|
|
857
|
+
const { targetInfo } = await session.send("Target.getTargetInfo");
|
|
858
|
+
throwIfScenarioCancelled$1(signal);
|
|
859
|
+
if (targetInfo.targetId !== targetId) continue;
|
|
860
|
+
return {
|
|
861
|
+
context,
|
|
862
|
+
page
|
|
863
|
+
};
|
|
864
|
+
} finally {
|
|
865
|
+
await session.detach();
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
throw new BrowserObservationError(OPERATION$2, "target_not_found");
|
|
869
|
+
};
|
|
870
|
+
configureAttachedEnvironment = async (context, page, environment, signal) => {
|
|
871
|
+
await page.emulateMedia({
|
|
872
|
+
colorScheme: environment.color_scheme,
|
|
873
|
+
reducedMotion: environment.reduced_motion
|
|
874
|
+
});
|
|
875
|
+
throwIfScenarioCancelled$1(signal);
|
|
876
|
+
const session = await context.newCDPSession(page);
|
|
877
|
+
throwIfScenarioCancelled$1(signal);
|
|
878
|
+
await session.send("Emulation.setDeviceMetricsOverride", {
|
|
879
|
+
width: environment.viewport.width,
|
|
880
|
+
height: environment.viewport.height,
|
|
881
|
+
deviceScaleFactor: environment.viewport.device_scale_factor,
|
|
882
|
+
mobile: false,
|
|
883
|
+
dontSetVisibleSize: true
|
|
884
|
+
});
|
|
885
|
+
throwIfScenarioCancelled$1(signal);
|
|
886
|
+
await session.send("Emulation.setLocaleOverride", { locale: environment.locale });
|
|
887
|
+
throwIfScenarioCancelled$1(signal);
|
|
888
|
+
await session.send("Emulation.setTimezoneOverride", { timezoneId: environment.timezone });
|
|
889
|
+
};
|
|
890
|
+
failBrowserScenarioOperation = async (cleanup, primaryFailure, fallbackCleanupResources = ["browser_transport"]) => {
|
|
891
|
+
try {
|
|
892
|
+
await cleanup();
|
|
893
|
+
} catch (cleanupFailure) {
|
|
894
|
+
const cleanupDetails = cleanupFailure instanceof AnalysisError && cleanupFailure.cleanup !== undefined ? cleanupFailure.cleanup : {
|
|
895
|
+
reason: cleanupFailure instanceof Error ? cleanupFailure.message : String(cleanupFailure),
|
|
896
|
+
resources: cleanupFailure instanceof AnalysisError ? cleanupFailure.cleanupResources : fallbackCleanupResources
|
|
897
|
+
};
|
|
898
|
+
throw new BrowserObservationError(OPERATION$2, "cleanup_failed", {
|
|
899
|
+
cause: new AggregateError([primaryFailure, cleanupFailure], "Browser scenario operation and cleanup both failed", { cause: primaryFailure }),
|
|
900
|
+
cleanup: cleanupDetails
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
throw primaryFailure;
|
|
904
|
+
};
|
|
905
|
+
openAttachedScenarioBrowser = async (browserRequest, environment, launcher, signal, retainCleanup) => {
|
|
906
|
+
const lease = await acquireAttachedScenario(browserRequest, signal);
|
|
907
|
+
let cleanupOwner;
|
|
908
|
+
try {
|
|
909
|
+
const priorOwner = lease.admission.cleanupOwner;
|
|
910
|
+
if (priorOwner !== undefined) await priorOwner.close();
|
|
911
|
+
throwIfScenarioCancelled$1(signal);
|
|
912
|
+
const browser = await launcher.connectOverCDP(browserRequest.cdp_endpoint);
|
|
913
|
+
const cleanup = new PlaywrightScenarioBrowserCleanupOwner({
|
|
914
|
+
closeBrowser: () => browser.close(),
|
|
915
|
+
onSettled: (browserClosed) => {
|
|
916
|
+
if (browserClosed && lease.admission.cleanupOwner === cleanup) lease.admission.cleanupOwner = undefined;
|
|
917
|
+
lease.release();
|
|
918
|
+
},
|
|
919
|
+
removeProfile: undefined
|
|
920
|
+
});
|
|
921
|
+
cleanupOwner = cleanup;
|
|
922
|
+
lease.admission.cleanupOwner = cleanup;
|
|
923
|
+
throwIfScenarioCancelled$1(signal);
|
|
924
|
+
const target = await withPlaywrightExecutionBoundary(() => findConnectedPage(browser, browserRequest.target_id, signal), undefined, signal);
|
|
925
|
+
throwIfScenarioCancelled$1(signal);
|
|
926
|
+
await withPlaywrightExecutionBoundary(() => configureAttachedEnvironment(target.context, target.page, environment, signal), undefined, signal);
|
|
927
|
+
return {
|
|
928
|
+
...target,
|
|
929
|
+
browser,
|
|
930
|
+
profilePath: undefined,
|
|
931
|
+
cleanup
|
|
932
|
+
};
|
|
933
|
+
} catch (cause) {
|
|
934
|
+
if (cleanupOwner === undefined) {
|
|
935
|
+
lease.release();
|
|
936
|
+
throw cause;
|
|
937
|
+
}
|
|
938
|
+
const cleanup = cleanupOwner;
|
|
939
|
+
const close = () => cleanup.close();
|
|
940
|
+
try {
|
|
941
|
+
return await failBrowserScenarioOperation(close, cause);
|
|
942
|
+
} catch (failure) {
|
|
943
|
+
if (failure !== cause) retainCleanup?.(close);
|
|
944
|
+
throw failure;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
openPlaywrightScenarioBrowser = async (scenario, environment, options = {}) => {
|
|
949
|
+
const launcher = options.launcher ?? (await import("playwright-core")).chromium;
|
|
950
|
+
if (scenario.browser.mode === "connect") return openAttachedScenarioBrowser(scenario.browser, scenario.environment, launcher, options.signal, options.retainCleanup);
|
|
951
|
+
const profilePath = await mkdtemp(join(tmpdir(), "rea-browser-scenario-"));
|
|
952
|
+
let context;
|
|
953
|
+
try {
|
|
954
|
+
await chmod(profilePath, 448);
|
|
955
|
+
context = await launcher.launchPersistentContext(profilePath, {
|
|
956
|
+
executablePath: resolve(scenario.browser.executable_path),
|
|
957
|
+
headless: scenario.browser.headless,
|
|
958
|
+
acceptDownloads: false,
|
|
959
|
+
viewport: {
|
|
960
|
+
width: scenario.environment.viewport.width,
|
|
961
|
+
height: scenario.environment.viewport.height
|
|
962
|
+
},
|
|
963
|
+
deviceScaleFactor: scenario.environment.viewport.device_scale_factor,
|
|
964
|
+
locale: scenario.environment.locale,
|
|
965
|
+
timezoneId: scenario.environment.timezone,
|
|
966
|
+
colorScheme: scenario.environment.color_scheme,
|
|
967
|
+
reducedMotion: scenario.environment.reduced_motion,
|
|
968
|
+
serviceWorkers: scenario.environment.service_workers,
|
|
969
|
+
env: allowedBrowserEnvironment(environment),
|
|
970
|
+
handleSIGHUP: false,
|
|
971
|
+
handleSIGINT: false,
|
|
972
|
+
handleSIGTERM: false,
|
|
973
|
+
timeout: 0,
|
|
974
|
+
args: process.platform === "android" ? ["--no-sandbox", "--single-process"] : []
|
|
975
|
+
});
|
|
976
|
+
} catch (cause) {
|
|
977
|
+
const cleanup = () => rm(profilePath, {
|
|
978
|
+
recursive: true,
|
|
979
|
+
force: true,
|
|
980
|
+
maxRetries: 3
|
|
981
|
+
});
|
|
982
|
+
try {
|
|
983
|
+
return await failBrowserScenarioOperation(cleanup, cause, ["browser_profile"]);
|
|
984
|
+
} catch (failure) {
|
|
985
|
+
if (failure !== cause) options.retainCleanup?.(cleanup);
|
|
986
|
+
throw failure;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
const cleanup = new PlaywrightScenarioBrowserCleanupOwner({
|
|
990
|
+
closeBrowser: () => context.close(),
|
|
991
|
+
removeProfile: () => rm(profilePath, {
|
|
992
|
+
recursive: true,
|
|
993
|
+
force: true,
|
|
994
|
+
maxRetries: 3
|
|
995
|
+
})
|
|
996
|
+
});
|
|
997
|
+
try {
|
|
998
|
+
const browser = context.browser();
|
|
999
|
+
if (browser === null) throw new BrowserObservationError(OPERATION$2, "protocol_error");
|
|
1000
|
+
const page = context.pages()[0] ?? await context.newPage();
|
|
1001
|
+
return {
|
|
1002
|
+
context,
|
|
1003
|
+
page,
|
|
1004
|
+
browser,
|
|
1005
|
+
profilePath,
|
|
1006
|
+
cleanup
|
|
1007
|
+
};
|
|
1008
|
+
} catch (cause) {
|
|
1009
|
+
const close = () => cleanup.close();
|
|
1010
|
+
try {
|
|
1011
|
+
return await failBrowserScenarioOperation(close, cause);
|
|
1012
|
+
} catch (failure) {
|
|
1013
|
+
if (failure !== cause) options.retainCleanup?.(close);
|
|
1014
|
+
throw failure;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
})))();
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
//#endregion
|
|
1022
|
+
//#region dist/browser/PlaywrightScenarioActions.js
|
|
1023
|
+
var resolveLocator, resolveValue, performPlaywrightScenarioAction;
|
|
1024
|
+
function init_PlaywrightScenarioActions() {
|
|
1025
|
+
return (init_PlaywrightScenarioActions = __esmMin((() => {
|
|
1026
|
+
resolveLocator = (page, locator) => {
|
|
1027
|
+
switch (locator.kind) {
|
|
1028
|
+
case "test_id": return page.getByTestId(locator.value);
|
|
1029
|
+
case "role": return page.getByRole(locator.role, {
|
|
1030
|
+
name: locator.name,
|
|
1031
|
+
exact: true
|
|
1032
|
+
});
|
|
1033
|
+
case "css": return page.locator(locator.selector);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
resolveValue = (value, secrets) => secrets.value(value);
|
|
1037
|
+
performPlaywrightScenarioAction = async (input) => {
|
|
1038
|
+
const { page, action, secrets } = input;
|
|
1039
|
+
const timeout = "timeout_ms" in action ? action.timeout_ms : undefined;
|
|
1040
|
+
const options = timeout === undefined ? {} : { timeout };
|
|
1041
|
+
switch (action.action) {
|
|
1042
|
+
case "goto":
|
|
1043
|
+
await page.goto(secrets.url(action.destination), {
|
|
1044
|
+
...options,
|
|
1045
|
+
waitUntil: action.wait_until
|
|
1046
|
+
});
|
|
1047
|
+
return;
|
|
1048
|
+
case "click":
|
|
1049
|
+
await resolveLocator(page, action.locator).click({
|
|
1050
|
+
...options,
|
|
1051
|
+
button: action.button,
|
|
1052
|
+
clickCount: action.click_count
|
|
1053
|
+
});
|
|
1054
|
+
return;
|
|
1055
|
+
case "fill":
|
|
1056
|
+
await resolveLocator(page, action.locator).fill(resolveValue(action.value, secrets), options);
|
|
1057
|
+
return;
|
|
1058
|
+
case "press":
|
|
1059
|
+
await resolveLocator(page, action.locator).press(action.key, options);
|
|
1060
|
+
return;
|
|
1061
|
+
case "select_option":
|
|
1062
|
+
await resolveLocator(page, action.locator).selectOption(resolveValue(action.value, secrets), options);
|
|
1063
|
+
return;
|
|
1064
|
+
case "check":
|
|
1065
|
+
await resolveLocator(page, action.locator).check(options);
|
|
1066
|
+
return;
|
|
1067
|
+
case "uncheck":
|
|
1068
|
+
await resolveLocator(page, action.locator).uncheck(options);
|
|
1069
|
+
return;
|
|
1070
|
+
case "wait_for":
|
|
1071
|
+
await resolveLocator(page, action.locator).waitFor({
|
|
1072
|
+
...options,
|
|
1073
|
+
state: action.state
|
|
1074
|
+
});
|
|
1075
|
+
return;
|
|
1076
|
+
case "wait_for_timeout": await page.waitForTimeout(action.duration_ms);
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
})))();
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region dist/browser/PlaywrightScenarioArtifacts.js
|
|
1084
|
+
var historyValueSchema, storageValueSchema, notRequested, missing, textArtifact, captureScreenshot, captureDom, captureAccessibility, navigationType, captureHistory, captureStorage, capturePlaywrightStepArtifacts;
|
|
1085
|
+
function init_PlaywrightScenarioArtifacts() {
|
|
1086
|
+
return (init_PlaywrightScenarioArtifacts = __esmMin((() => {
|
|
1087
|
+
init_browserScenarioCaptureValues();
|
|
1088
|
+
historyValueSchema = z.strictObject({
|
|
1089
|
+
length: z.number().int().min(0),
|
|
1090
|
+
navigation_entries: z.array(z.strictObject({
|
|
1091
|
+
type: z.string(),
|
|
1092
|
+
name: z.string()
|
|
1093
|
+
}))
|
|
1094
|
+
});
|
|
1095
|
+
storageValueSchema = z.strictObject({
|
|
1096
|
+
local_storage: z.array(z.tuple([z.string(), z.string()])),
|
|
1097
|
+
session_storage: z.array(z.tuple([z.string(), z.string()]))
|
|
1098
|
+
});
|
|
1099
|
+
notRequested = () => ({ state: "not_requested" });
|
|
1100
|
+
missing = (reason) => ({
|
|
1101
|
+
state: "missing",
|
|
1102
|
+
reason
|
|
1103
|
+
});
|
|
1104
|
+
textArtifact = (text) => {
|
|
1105
|
+
const bytes = Buffer.from(text);
|
|
1106
|
+
return {
|
|
1107
|
+
state: "captured",
|
|
1108
|
+
value: {
|
|
1109
|
+
sha256: createHash("sha256").update(bytes).digest("hex"),
|
|
1110
|
+
bytes: bytes.byteLength,
|
|
1111
|
+
text
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1115
|
+
captureScreenshot = async (page) => {
|
|
1116
|
+
try {
|
|
1117
|
+
const bytes = await page.screenshot({
|
|
1118
|
+
type: "png",
|
|
1119
|
+
fullPage: false,
|
|
1120
|
+
animations: "disabled",
|
|
1121
|
+
caret: "hide"
|
|
1122
|
+
});
|
|
1123
|
+
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
1124
|
+
return {
|
|
1125
|
+
state: "captured",
|
|
1126
|
+
value: {
|
|
1127
|
+
sha256,
|
|
1128
|
+
bytes: bytes.byteLength,
|
|
1129
|
+
media_type: "image/png",
|
|
1130
|
+
data_base64: bytes.toString("base64")
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
} catch (cause) {
|
|
1134
|
+
void cause;
|
|
1135
|
+
return missing("screenshot capture failed");
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
captureDom = async (input) => {
|
|
1139
|
+
const { page, secrets } = input;
|
|
1140
|
+
try {
|
|
1141
|
+
return textArtifact(secrets.redact(await page.content()));
|
|
1142
|
+
} catch (cause) {
|
|
1143
|
+
void cause;
|
|
1144
|
+
return missing("DOM capture failed");
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
captureAccessibility = async (input) => {
|
|
1148
|
+
const { page, secrets } = input;
|
|
1149
|
+
try {
|
|
1150
|
+
const text = await page.locator("html").ariaSnapshot();
|
|
1151
|
+
return textArtifact(secrets.redact(text));
|
|
1152
|
+
} catch (cause) {
|
|
1153
|
+
void cause;
|
|
1154
|
+
return missing("accessibility capture failed");
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
navigationType = (value) => {
|
|
1158
|
+
switch (value) {
|
|
1159
|
+
case "navigate":
|
|
1160
|
+
case "reload":
|
|
1161
|
+
case "back_forward":
|
|
1162
|
+
case "prerender": return value;
|
|
1163
|
+
default: return "unknown";
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1166
|
+
captureHistory = async (page, secrets) => {
|
|
1167
|
+
try {
|
|
1168
|
+
const raw = historyValueSchema.parse(await page.evaluate(`(() => ({
|
|
1169
|
+
length: window.history.length,
|
|
1170
|
+
navigation_entries: performance.getEntriesByType("navigation").map(
|
|
1171
|
+
entry => ({
|
|
1172
|
+
type: typeof entry.type === "string" ? entry.type : "unknown",
|
|
1173
|
+
name: entry.name
|
|
1174
|
+
})
|
|
1175
|
+
)
|
|
1176
|
+
}))()`));
|
|
1177
|
+
const value = {
|
|
1178
|
+
length: raw.length,
|
|
1179
|
+
current_url: secrets.sanitizeUrl(page.url()),
|
|
1180
|
+
navigation_entries: raw.navigation_entries.map(({ type, name }) => ({
|
|
1181
|
+
type: navigationType(type),
|
|
1182
|
+
name: secrets.sanitizeUrl(name)
|
|
1183
|
+
}))
|
|
1184
|
+
};
|
|
1185
|
+
return {
|
|
1186
|
+
state: "captured",
|
|
1187
|
+
value
|
|
1188
|
+
};
|
|
1189
|
+
} catch (cause) {
|
|
1190
|
+
void cause;
|
|
1191
|
+
return missing("history capture failed");
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
captureStorage = async (input) => {
|
|
1195
|
+
const { context, page, secrets } = input;
|
|
1196
|
+
try {
|
|
1197
|
+
const pageUrl = new URL(page.url());
|
|
1198
|
+
const cookies = pageUrl.protocol === "http:" || pageUrl.protocol === "https:" ? await context.cookies(pageUrl.href) : [];
|
|
1199
|
+
const pageStorage = storageValueSchema.parse(await page.evaluate(`(() => ({
|
|
1200
|
+
local_storage: Object.entries(window.localStorage),
|
|
1201
|
+
session_storage: Object.entries(window.sessionStorage)
|
|
1202
|
+
}))()`));
|
|
1203
|
+
const value = {
|
|
1204
|
+
cookies: cookies.map((cookie) => ({
|
|
1205
|
+
name: secrets.redact(cookie.name),
|
|
1206
|
+
domain: secrets.redact(cookie.domain),
|
|
1207
|
+
path: secrets.redact(cookie.path),
|
|
1208
|
+
secure: cookie.secure,
|
|
1209
|
+
http_only: cookie.httpOnly,
|
|
1210
|
+
same_site: cookie.sameSite,
|
|
1211
|
+
...secrets.fingerprint(cookie.value)
|
|
1212
|
+
})),
|
|
1213
|
+
local_storage: pageStorage.local_storage.map(([name, value]) => ({
|
|
1214
|
+
name: secrets.redact(name),
|
|
1215
|
+
...secrets.fingerprint(value)
|
|
1216
|
+
})),
|
|
1217
|
+
session_storage: pageStorage.session_storage.map(([name, value]) => ({
|
|
1218
|
+
name: secrets.redact(name),
|
|
1219
|
+
...secrets.fingerprint(value)
|
|
1220
|
+
}))
|
|
1221
|
+
};
|
|
1222
|
+
return {
|
|
1223
|
+
state: "captured",
|
|
1224
|
+
value
|
|
1225
|
+
};
|
|
1226
|
+
} catch (cause) {
|
|
1227
|
+
void cause;
|
|
1228
|
+
return missing("storage capture failed");
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
capturePlaywrightStepArtifacts = async (input) => {
|
|
1232
|
+
const { context, page, secrets, requested } = input;
|
|
1233
|
+
const state = (kind, capture) => !requested.has(kind) ? Promise.resolve(notRequested()) : capture();
|
|
1234
|
+
return browserStepArtifactsSchema.parse({
|
|
1235
|
+
screenshot: await state("screenshot", () => captureScreenshot(page)),
|
|
1236
|
+
dom: await state("dom", () => captureDom({
|
|
1237
|
+
page,
|
|
1238
|
+
secrets
|
|
1239
|
+
})),
|
|
1240
|
+
accessibility: await state("accessibility", () => captureAccessibility({
|
|
1241
|
+
page,
|
|
1242
|
+
secrets
|
|
1243
|
+
})),
|
|
1244
|
+
url: await state("url", async () => ({
|
|
1245
|
+
state: "captured",
|
|
1246
|
+
value: secrets.sanitizeUrl(page.url())
|
|
1247
|
+
})),
|
|
1248
|
+
history: await state("history", () => captureHistory(page, secrets)),
|
|
1249
|
+
storage: await state("storage", () => captureStorage({
|
|
1250
|
+
context,
|
|
1251
|
+
page,
|
|
1252
|
+
secrets
|
|
1253
|
+
}))
|
|
1254
|
+
});
|
|
1255
|
+
};
|
|
1256
|
+
})))();
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
//#endregion
|
|
1260
|
+
//#region dist/browser/network/PlaywrightNetworkContent.js
|
|
1261
|
+
var credentialHeaders, errorMessage, captureNetworkHeaders, captureNetworkBody;
|
|
1262
|
+
function init_PlaywrightNetworkContent() {
|
|
1263
|
+
return (init_PlaywrightNetworkContent = __esmMin((() => {
|
|
1264
|
+
init_analysisErrorCore();
|
|
1265
|
+
init_PlaywrightExecutionBoundary();
|
|
1266
|
+
credentialHeaders = new Set([
|
|
1267
|
+
"authorization",
|
|
1268
|
+
"proxy-authorization",
|
|
1269
|
+
"cookie",
|
|
1270
|
+
"set-cookie"
|
|
1271
|
+
]);
|
|
1272
|
+
errorMessage = (cause, secrets) => {
|
|
1273
|
+
const message = cause instanceof Error && cause.message !== "" ? cause.message : "Network read failed";
|
|
1274
|
+
return secrets.redactionAllocationCost(message.length) <= 1024 * 1024 ? secrets.redact(message) : "Network read failed; diagnostic exceeds the allocation budget.";
|
|
1275
|
+
};
|
|
1276
|
+
captureNetworkHeaders = async (source, secrets, options) => {
|
|
1277
|
+
try {
|
|
1278
|
+
const headers = await withPlaywrightExecutionBoundary(() => source.headersArray(), options.timeoutMs, options.signal);
|
|
1279
|
+
let cost = 0;
|
|
1280
|
+
for (const { name, value } of headers) {
|
|
1281
|
+
cost += secrets.redactionAllocationCost(name.length + value.length) + 128;
|
|
1282
|
+
if (cost > 1024 * 1024) return {
|
|
1283
|
+
state: "unavailable",
|
|
1284
|
+
message: "Headers exceed the 1 MiB allocation budget."
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
return {
|
|
1288
|
+
state: "captured",
|
|
1289
|
+
items: headers.map(({ name, value }) => {
|
|
1290
|
+
const safeName = secrets.redact(name);
|
|
1291
|
+
const credential = credentialHeaders.has(name.toLowerCase());
|
|
1292
|
+
const safeValue = credential ? null : secrets.redactBytes(Buffer.from(value)).toString("utf8");
|
|
1293
|
+
return {
|
|
1294
|
+
name: safeName,
|
|
1295
|
+
value: safeValue,
|
|
1296
|
+
redacted: credential || safeName !== name || safeValue !== value
|
|
1297
|
+
};
|
|
1298
|
+
})
|
|
1299
|
+
};
|
|
1300
|
+
} catch (cause) {
|
|
1301
|
+
return {
|
|
1302
|
+
state: "unavailable",
|
|
1303
|
+
message: errorMessage(cause, secrets)
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
captureNetworkBody = async (read, phase, source, secrets, options) => {
|
|
1308
|
+
try {
|
|
1309
|
+
const observed = await withPlaywrightExecutionBoundary(read, options.timeoutMs, options.signal);
|
|
1310
|
+
if (observed === null) return { state: "not_exposed" };
|
|
1311
|
+
if (observed.length > 64 * 1024) return {
|
|
1312
|
+
state: "unavailable",
|
|
1313
|
+
reason: "body-read-failed",
|
|
1314
|
+
message: "Body exceeds the 64 KiB retained-content budget."
|
|
1315
|
+
};
|
|
1316
|
+
if (secrets.redactionAllocationCost(observed.length) > 1024 * 1024) return {
|
|
1317
|
+
state: "unavailable",
|
|
1318
|
+
reason: "body-read-failed",
|
|
1319
|
+
message: "Body redaction exceeds the allocation budget."
|
|
1320
|
+
};
|
|
1321
|
+
const retained = secrets.redactBytes(observed);
|
|
1322
|
+
const contentType = source.headers()["content-type"];
|
|
1323
|
+
if (contentType !== undefined && secrets.redactionAllocationCost(contentType.length) > 64 * 1024) return {
|
|
1324
|
+
state: "unavailable",
|
|
1325
|
+
reason: "body-read-failed",
|
|
1326
|
+
message: "Content type exceeds the retained metadata budget."
|
|
1327
|
+
};
|
|
1328
|
+
return {
|
|
1329
|
+
state: "captured",
|
|
1330
|
+
representation: phase === "request" ? "browser-exposed-request-bytes" : "playwright-response-body-bytes",
|
|
1331
|
+
encoding: "base64",
|
|
1332
|
+
content: retained.toString("base64"),
|
|
1333
|
+
bytes: retained.length,
|
|
1334
|
+
sha256: createHash("sha256").update(retained).digest("hex"),
|
|
1335
|
+
media_type: contentType === undefined ? null : secrets.redactBytes(Buffer.from(contentType)).toString("utf8"),
|
|
1336
|
+
redacted: !retained.equals(observed)
|
|
1337
|
+
};
|
|
1338
|
+
} catch (cause) {
|
|
1339
|
+
return {
|
|
1340
|
+
state: "unavailable",
|
|
1341
|
+
reason: cause instanceof AnalysisCancelledError ? "cancelled" : cause instanceof AnalysisTimeoutError ? "body-read-timeout" : "body-read-failed",
|
|
1342
|
+
message: errorMessage(cause, secrets)
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
})))();
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
//#endregion
|
|
1350
|
+
//#region dist/browser/network/PlaywrightScenarioNetwork.js
|
|
1351
|
+
var PlaywrightScenarioNetwork;
|
|
1352
|
+
function init_PlaywrightScenarioNetwork() {
|
|
1353
|
+
return (init_PlaywrightScenarioNetwork = __esmMin((() => {
|
|
1354
|
+
init_PlaywrightNetworkContent();
|
|
1355
|
+
PlaywrightScenarioNetwork = class {
|
|
1356
|
+
options;
|
|
1357
|
+
transactions = new Map();
|
|
1358
|
+
pending = [];
|
|
1359
|
+
gaps = new Set();
|
|
1360
|
+
accepting = true;
|
|
1361
|
+
activeReads = 0;
|
|
1362
|
+
readOptions;
|
|
1363
|
+
constructor(options) {
|
|
1364
|
+
this.options = options;
|
|
1365
|
+
this.readOptions = {
|
|
1366
|
+
timeoutMs: options.readTimeoutMs ?? 5e3,
|
|
1367
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
/** Observe a request start, retaining the producer's redirect relationship when known. */
|
|
1371
|
+
request(request) {
|
|
1372
|
+
if (!this.accepting) return;
|
|
1373
|
+
const transaction = this.transaction(request);
|
|
1374
|
+
if (transaction === undefined || transaction.requestObserved) return;
|
|
1375
|
+
if (!this.admitMetadata(request)) return;
|
|
1376
|
+
transaction.requestObserved = true;
|
|
1377
|
+
const sequence = this.options.emit({
|
|
1378
|
+
...this.metadata(request, transaction),
|
|
1379
|
+
kind: "request",
|
|
1380
|
+
status: null,
|
|
1381
|
+
failure: null
|
|
1382
|
+
});
|
|
1383
|
+
if (sequence === 0) return;
|
|
1384
|
+
if (this.options.selection.request_body || this.options.selection.header_values) this.collect(transaction, sequence, "request", request, () => this.options.selection.request_body ? captureNetworkBody(async () => request.postDataBuffer(), "request", request, this.options.secrets, this.readOptions) : Promise.resolve({ state: "not_requested" }));
|
|
1385
|
+
}
|
|
1386
|
+
/** Observe response metadata without starting a potentially unfinished body read. */
|
|
1387
|
+
response(response) {
|
|
1388
|
+
if (!this.accepting) return;
|
|
1389
|
+
const request = response.request();
|
|
1390
|
+
const transaction = this.transaction(request);
|
|
1391
|
+
if (transaction === undefined || !this.admitMetadata(request, undefined, [], [{
|
|
1392
|
+
source: response,
|
|
1393
|
+
url: response.url()
|
|
1394
|
+
}])) return;
|
|
1395
|
+
const sequence = this.options.emit({
|
|
1396
|
+
...this.metadata(request, transaction),
|
|
1397
|
+
kind: "response",
|
|
1398
|
+
url: this.options.secrets.sanitizeUrl(response.url()),
|
|
1399
|
+
status: response.status(),
|
|
1400
|
+
header_names: this.headerNames(response),
|
|
1401
|
+
failure: null
|
|
1402
|
+
});
|
|
1403
|
+
if (sequence === 0) return;
|
|
1404
|
+
transaction.response = {
|
|
1405
|
+
source: response,
|
|
1406
|
+
sequence
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
/** Record completion and read selected content through the response API. */
|
|
1410
|
+
finished(request) {
|
|
1411
|
+
if (!this.accepting) return;
|
|
1412
|
+
const transaction = this.transaction(request);
|
|
1413
|
+
if (transaction === undefined || !this.admitMetadata(request)) return;
|
|
1414
|
+
transaction.terminal = "finished";
|
|
1415
|
+
const sequence = this.options.emit({
|
|
1416
|
+
...this.metadata(request, transaction),
|
|
1417
|
+
kind: "request-finished",
|
|
1418
|
+
status: null,
|
|
1419
|
+
failure: null
|
|
1420
|
+
});
|
|
1421
|
+
if (sequence === 0) {
|
|
1422
|
+
transaction.responseScheduled = true;
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
this.responseContent(transaction);
|
|
1426
|
+
}
|
|
1427
|
+
/** Preserve request failure separately from missing or unreadable response content. */
|
|
1428
|
+
failed(request) {
|
|
1429
|
+
if (!this.accepting) return;
|
|
1430
|
+
const transaction = this.transaction(request);
|
|
1431
|
+
if (transaction === undefined) return;
|
|
1432
|
+
transaction.terminal = "failed";
|
|
1433
|
+
const failure = request.failure()?.errorText || "Unknown request failure";
|
|
1434
|
+
if (!this.admitMetadata(request, undefined, [failure])) return;
|
|
1435
|
+
const message = this.options.secrets.redact(failure);
|
|
1436
|
+
const sequence = this.options.emit({
|
|
1437
|
+
...this.metadata(request, transaction),
|
|
1438
|
+
kind: "request-failed",
|
|
1439
|
+
status: null,
|
|
1440
|
+
failure: message
|
|
1441
|
+
});
|
|
1442
|
+
if (sequence === 0) {
|
|
1443
|
+
transaction.responseScheduled = true;
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
this.responseContent(transaction, {
|
|
1447
|
+
state: "unavailable",
|
|
1448
|
+
reason: "request-failed",
|
|
1449
|
+
message
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
/** Stop observing, mark unfinished transactions, and settle bounded content reads. */
|
|
1453
|
+
async finish() {
|
|
1454
|
+
if (!this.accepting) {
|
|
1455
|
+
await Promise.all(this.pending);
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
this.accepting = false;
|
|
1459
|
+
for (const [request, transaction] of this.transactions) {
|
|
1460
|
+
if (transaction.terminal === undefined) {
|
|
1461
|
+
if (!this.admitMetadata(request)) continue;
|
|
1462
|
+
this.gaps.add("Some network requests had not completed when capture ended; later activity is unknown.");
|
|
1463
|
+
const sequence = this.options.emit({
|
|
1464
|
+
...this.metadata(request, transaction),
|
|
1465
|
+
kind: "request-unfinished",
|
|
1466
|
+
status: null,
|
|
1467
|
+
failure: null,
|
|
1468
|
+
reason: this.options.signal?.aborted === true ? "cancelled" : "capture-ended"
|
|
1469
|
+
});
|
|
1470
|
+
if (sequence === 0) {
|
|
1471
|
+
transaction.responseScheduled = true;
|
|
1472
|
+
continue;
|
|
1473
|
+
}
|
|
1474
|
+
this.responseContent(transaction, {
|
|
1475
|
+
state: "unavailable",
|
|
1476
|
+
reason: this.options.signal?.aborted === true ? "cancelled" : "response-unfinished",
|
|
1477
|
+
message: "The response had not finished at the capture cutoff; no body read or refetch was attempted."
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
await Promise.all(this.pending);
|
|
1482
|
+
}
|
|
1483
|
+
/** Missing selected content contributes to aggregate completeness. */
|
|
1484
|
+
limitations() {
|
|
1485
|
+
return [...this.gaps];
|
|
1486
|
+
}
|
|
1487
|
+
transaction(request) {
|
|
1488
|
+
const known = this.transactions.get(request);
|
|
1489
|
+
if (known !== undefined) return known;
|
|
1490
|
+
if (this.transactions.size >= 1024) {
|
|
1491
|
+
this.gaps.add("Network collection reached its 1024-transaction resource budget; further transactions were omitted.");
|
|
1492
|
+
return undefined;
|
|
1493
|
+
}
|
|
1494
|
+
const predecessor = request.redirectedFrom();
|
|
1495
|
+
const predecessorTransaction = predecessor === null ? undefined : this.transactions.get(predecessor);
|
|
1496
|
+
const transaction = {
|
|
1497
|
+
id: `request-${this.transactions.size + 1}`,
|
|
1498
|
+
redirectedFrom: predecessorTransaction?.id ?? null,
|
|
1499
|
+
redirectedFromState: predecessor === null ? "root" : predecessorTransaction === undefined ? "unknown" : undefined,
|
|
1500
|
+
responseScheduled: false,
|
|
1501
|
+
requestObserved: false
|
|
1502
|
+
};
|
|
1503
|
+
this.transactions.set(request, transaction);
|
|
1504
|
+
return transaction;
|
|
1505
|
+
}
|
|
1506
|
+
admitProducerStrings(values) {
|
|
1507
|
+
const collected = [];
|
|
1508
|
+
let cost = 0;
|
|
1509
|
+
for (const value of values) {
|
|
1510
|
+
cost += this.options.secrets.redactionAllocationCost(value.length) + 128;
|
|
1511
|
+
if (cost > 1024 * 1024) {
|
|
1512
|
+
this.gaps.add("Some network metadata exceeded its allocation budget and was omitted.");
|
|
1513
|
+
return false;
|
|
1514
|
+
}
|
|
1515
|
+
collected.push(value);
|
|
1516
|
+
}
|
|
1517
|
+
if (this.options.admitText?.(collected) ?? true) return true;
|
|
1518
|
+
this.gaps.add("Some network metadata was omitted because the aggregate browser event budget was reached; affected transactions are incomplete.");
|
|
1519
|
+
return false;
|
|
1520
|
+
}
|
|
1521
|
+
admitMetadata(source, url, additionalStrings = [], additionalSources = []) {
|
|
1522
|
+
return this.admitProducerStrings(this.metadataStrings(source, url, additionalStrings, additionalSources));
|
|
1523
|
+
}
|
|
1524
|
+
*metadataStrings(source, url, additionalStrings, additionalSources) {
|
|
1525
|
+
yield* this.retainedMetadataStrings(source, source.headers(), url);
|
|
1526
|
+
yield* additionalStrings;
|
|
1527
|
+
for (const extra of additionalSources) yield* this.retainedMetadataStrings(extra.source, extra.source.headers(), extra.url);
|
|
1528
|
+
}
|
|
1529
|
+
*retainedMetadataStrings(source, headers, url) {
|
|
1530
|
+
if (url !== undefined) yield url;
|
|
1531
|
+
for (const name in headers) {
|
|
1532
|
+
if (!Object.hasOwn(headers, name)) continue;
|
|
1533
|
+
yield name;
|
|
1534
|
+
if (this.options.selection.header_values) yield headers[name];
|
|
1535
|
+
}
|
|
1536
|
+
if ("method" in source) {
|
|
1537
|
+
const request = source;
|
|
1538
|
+
yield request.method();
|
|
1539
|
+
yield request.url();
|
|
1540
|
+
yield request.resourceType();
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
headerNames(source) {
|
|
1544
|
+
return Object.keys(source.headers()).map((name) => this.options.secrets.redact(name)).sort();
|
|
1545
|
+
}
|
|
1546
|
+
metadata(request, transaction) {
|
|
1547
|
+
return {
|
|
1548
|
+
transaction_id: transaction.id,
|
|
1549
|
+
redirected_from_transaction_id: transaction.redirectedFrom,
|
|
1550
|
+
...transaction.redirectedFromState === undefined ? {} : { redirected_from_transaction_state: transaction.redirectedFromState },
|
|
1551
|
+
method: this.options.secrets.redact(request.method()),
|
|
1552
|
+
url: this.options.secrets.sanitizeUrl(request.url()),
|
|
1553
|
+
resource_type: this.options.secrets.redact(request.resourceType()),
|
|
1554
|
+
header_names: this.headerNames(request)
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
responseContent(transaction, unavailable) {
|
|
1558
|
+
const response = transaction.response;
|
|
1559
|
+
if (response === undefined || transaction.responseScheduled || !this.options.selection.response_body && !this.options.selection.header_values) return;
|
|
1560
|
+
transaction.responseScheduled = true;
|
|
1561
|
+
this.collect(transaction, response.sequence, "response", response.source, () => this.options.selection.response_body ? unavailable === undefined ? captureNetworkBody(() => response.source.body(), "response", response.source, this.options.secrets, this.readOptions) : Promise.resolve(unavailable) : Promise.resolve({ state: "not_requested" }));
|
|
1562
|
+
}
|
|
1563
|
+
collect(transaction, sequence, phase, source, body) {
|
|
1564
|
+
if (this.activeReads >= 16) {
|
|
1565
|
+
const message = "Network content exceeds the 16 concurrent-read budget.";
|
|
1566
|
+
this.gaps.add(message);
|
|
1567
|
+
this.options.emit({
|
|
1568
|
+
kind: "network-content",
|
|
1569
|
+
transaction_id: transaction.id,
|
|
1570
|
+
source_event_sequence: sequence,
|
|
1571
|
+
phase,
|
|
1572
|
+
headers: this.options.selection.header_values ? {
|
|
1573
|
+
state: "unavailable",
|
|
1574
|
+
message
|
|
1575
|
+
} : { state: "not_requested" },
|
|
1576
|
+
body: this.options.selection[phase === "request" ? "request_body" : "response_body"] ? {
|
|
1577
|
+
state: "unavailable",
|
|
1578
|
+
reason: "body-read-failed",
|
|
1579
|
+
message
|
|
1580
|
+
} : { state: "not_requested" }
|
|
1581
|
+
});
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
this.activeReads += 1;
|
|
1585
|
+
const headers = this.options.selection.header_values ? captureNetworkHeaders(source, this.options.secrets, this.readOptions) : Promise.resolve({ state: "not_requested" });
|
|
1586
|
+
this.pending.push(Promise.all([headers, body()]).then(([retainedHeaders, retainedBody]) => {
|
|
1587
|
+
if (retainedHeaders.state === "unavailable" || retainedBody.state === "unavailable" || retainedBody.state === "not_exposed") this.gaps.add("Some selected network content was unavailable; per-transaction content states retain the reason.");
|
|
1588
|
+
this.options.emit({
|
|
1589
|
+
kind: "network-content",
|
|
1590
|
+
transaction_id: transaction.id,
|
|
1591
|
+
source_event_sequence: sequence,
|
|
1592
|
+
phase,
|
|
1593
|
+
headers: retainedHeaders,
|
|
1594
|
+
body: retainedBody
|
|
1595
|
+
});
|
|
1596
|
+
}).finally(() => {
|
|
1597
|
+
this.activeReads -= 1;
|
|
1598
|
+
}));
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
})))();
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
//#endregion
|
|
1605
|
+
//#region dist/browser/PlaywrightScenarioEvents.js
|
|
1606
|
+
var MAX_EVENT_COST, MAX_CAPTURE_COST, MAX_EVENTS, MAX_LISTENER_OWNERS, allocationCost, PlaywrightScenarioEvents;
|
|
1607
|
+
function init_PlaywrightScenarioEvents() {
|
|
1608
|
+
return (init_PlaywrightScenarioEvents = __esmMin((() => {
|
|
1609
|
+
init_browserScenarioCaptureValues();
|
|
1610
|
+
init_PlaywrightScenarioNetwork();
|
|
1611
|
+
MAX_EVENT_COST = 4 * 1024 * 1024;
|
|
1612
|
+
MAX_CAPTURE_COST = 16 * 1024 * 1024;
|
|
1613
|
+
MAX_EVENTS = 1e4;
|
|
1614
|
+
MAX_LISTENER_OWNERS = 2048;
|
|
1615
|
+
allocationCost = (value, remaining) => {
|
|
1616
|
+
if (typeof value === "string") return value.length * 8 + 2;
|
|
1617
|
+
if (value === null || typeof value !== "object") return 32;
|
|
1618
|
+
let cost = 2;
|
|
1619
|
+
for (const key in value) {
|
|
1620
|
+
if (!Object.hasOwn(value, key)) continue;
|
|
1621
|
+
const item = value[key];
|
|
1622
|
+
cost += key.length * 8 + 4 + allocationCost(item, remaining - cost);
|
|
1623
|
+
if (cost > remaining) break;
|
|
1624
|
+
}
|
|
1625
|
+
return cost;
|
|
1626
|
+
};
|
|
1627
|
+
PlaywrightScenarioEvents = class {
|
|
1628
|
+
items = [];
|
|
1629
|
+
retainedCost = 0;
|
|
1630
|
+
dropped = 0;
|
|
1631
|
+
stepIndex = 0;
|
|
1632
|
+
sequence = 0;
|
|
1633
|
+
enabled;
|
|
1634
|
+
secrets;
|
|
1635
|
+
ownsContext;
|
|
1636
|
+
pages = new WeakSet();
|
|
1637
|
+
incompleteFamilies = new Set();
|
|
1638
|
+
network;
|
|
1639
|
+
stopNetwork;
|
|
1640
|
+
stopListeners = new Map();
|
|
1641
|
+
sealed = false;
|
|
1642
|
+
constructor(options) {
|
|
1643
|
+
const network = options.network ?? {
|
|
1644
|
+
request_body: false,
|
|
1645
|
+
response_body: false,
|
|
1646
|
+
header_values: false
|
|
1647
|
+
};
|
|
1648
|
+
this.enabled = new Set(options.enabled);
|
|
1649
|
+
if (network.request_body || network.response_body || network.header_values) this.enabled = new Set([...this.enabled, "network"]);
|
|
1650
|
+
this.secrets = options.secrets;
|
|
1651
|
+
this.ownsContext = options.ownsContext === true;
|
|
1652
|
+
this.pages.add(options.page);
|
|
1653
|
+
if (this.ownsContext && this.enabled.size > 0) {
|
|
1654
|
+
const context = options.context ?? options.page.context();
|
|
1655
|
+
const onPage = (page) => this.popup(page);
|
|
1656
|
+
context.on("page", onPage);
|
|
1657
|
+
this.retainListener(context, () => context.off("page", onPage));
|
|
1658
|
+
}
|
|
1659
|
+
if (this.enabled.has("network")) {
|
|
1660
|
+
const context = options.context ?? options.page.context();
|
|
1661
|
+
const collector = new PlaywrightScenarioNetwork({
|
|
1662
|
+
selection: network,
|
|
1663
|
+
secrets: options.secrets,
|
|
1664
|
+
emit: (event) => this.push(event),
|
|
1665
|
+
admitText: (values) => this.admitProducerText(values),
|
|
1666
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1667
|
+
});
|
|
1668
|
+
this.network = collector;
|
|
1669
|
+
const inScope = (request) => {
|
|
1670
|
+
if (this.ownsContext) return true;
|
|
1671
|
+
try {
|
|
1672
|
+
return this.pages.has(request.frame().page());
|
|
1673
|
+
} catch (cause) {
|
|
1674
|
+
void cause;
|
|
1675
|
+
return false;
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
const onRequest = (request) => {
|
|
1679
|
+
if (inScope(request)) collector.request(request);
|
|
1680
|
+
};
|
|
1681
|
+
const onResponse = (response) => {
|
|
1682
|
+
if (inScope(response.request())) collector.response(response);
|
|
1683
|
+
};
|
|
1684
|
+
const onFailed = (request) => {
|
|
1685
|
+
if (inScope(request)) collector.failed(request);
|
|
1686
|
+
};
|
|
1687
|
+
const onFinished = (request) => {
|
|
1688
|
+
if (inScope(request)) collector.finished(request);
|
|
1689
|
+
};
|
|
1690
|
+
context.on("request", onRequest);
|
|
1691
|
+
context.on("response", onResponse);
|
|
1692
|
+
context.on("requestfailed", onFailed);
|
|
1693
|
+
context.on("requestfinished", onFinished);
|
|
1694
|
+
this.stopNetwork = () => {
|
|
1695
|
+
context.off("request", onRequest);
|
|
1696
|
+
context.off("response", onResponse);
|
|
1697
|
+
context.off("requestfailed", onFailed);
|
|
1698
|
+
context.off("requestfinished", onFinished);
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
this.observePage(options.page);
|
|
1702
|
+
}
|
|
1703
|
+
setStep(index) {
|
|
1704
|
+
this.stepIndex = index;
|
|
1705
|
+
}
|
|
1706
|
+
nextSequence() {
|
|
1707
|
+
return this.sequence + 1;
|
|
1708
|
+
}
|
|
1709
|
+
lastSequence() {
|
|
1710
|
+
return this.sequence;
|
|
1711
|
+
}
|
|
1712
|
+
/** Drain selected network content and freeze the result before browser teardown. */
|
|
1713
|
+
async finish() {
|
|
1714
|
+
this.stopNetwork?.();
|
|
1715
|
+
this.stopNetwork = undefined;
|
|
1716
|
+
for (const owner of this.stopListeners.keys()) this.releaseListeners(owner);
|
|
1717
|
+
this.pages = new WeakSet();
|
|
1718
|
+
try {
|
|
1719
|
+
await this.network?.finish();
|
|
1720
|
+
} finally {
|
|
1721
|
+
this.sealed = true;
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
/** Report selected popup event families with unrecoverable pre-discovery gaps. */
|
|
1725
|
+
limitations() {
|
|
1726
|
+
const popupGaps = [...this.incompleteFamilies].map((family) => `Popup ${family} events before Page discovery are unavailable; later events are retained.`);
|
|
1727
|
+
const gaps = [...popupGaps, ...this.network?.limitations() ?? []];
|
|
1728
|
+
if (this.dropped > 0) gaps.push("Browser event collection reached its resource budget; omitted events and descendant observations are unknown.");
|
|
1729
|
+
return this.enabled.has("network") && !this.ownsContext ? ["Shared-context network capture excludes requests without a known root or descendant Page frame.", ...gaps] : gaps;
|
|
1730
|
+
}
|
|
1731
|
+
result() {
|
|
1732
|
+
return {
|
|
1733
|
+
retained: this.items.length,
|
|
1734
|
+
dropped: this.dropped,
|
|
1735
|
+
items: this.items
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
push(event) {
|
|
1739
|
+
if (this.sealed) return 0;
|
|
1740
|
+
this.sequence += 1;
|
|
1741
|
+
if (this.items.length >= MAX_EVENTS) {
|
|
1742
|
+
this.dropped += 1;
|
|
1743
|
+
return 0;
|
|
1744
|
+
}
|
|
1745
|
+
const cost = allocationCost(event, MAX_EVENT_COST) + 128;
|
|
1746
|
+
if (cost > MAX_EVENT_COST || this.retainedCost + cost > MAX_CAPTURE_COST) {
|
|
1747
|
+
this.dropped += 1;
|
|
1748
|
+
return 0;
|
|
1749
|
+
}
|
|
1750
|
+
this.retainedCost += cost;
|
|
1751
|
+
const parsed = browserScenarioEventSchema.parse({
|
|
1752
|
+
...event,
|
|
1753
|
+
sequence: this.sequence,
|
|
1754
|
+
step_index: this.stepIndex
|
|
1755
|
+
});
|
|
1756
|
+
this.items.push(parsed);
|
|
1757
|
+
return this.sequence;
|
|
1758
|
+
}
|
|
1759
|
+
admitText(...values) {
|
|
1760
|
+
return this.admitProducerText(values);
|
|
1761
|
+
}
|
|
1762
|
+
/** Admit conservative output cost before running redaction or cloning. */
|
|
1763
|
+
admitProducerText(values) {
|
|
1764
|
+
if (this.sealed) return false;
|
|
1765
|
+
let cost = 4096;
|
|
1766
|
+
for (const value of values) {
|
|
1767
|
+
cost += this.secrets.redactionAllocationCost(value.length);
|
|
1768
|
+
if (cost > MAX_EVENT_COST || cost > MAX_CAPTURE_COST - this.retainedCost) {
|
|
1769
|
+
this.sequence += 1;
|
|
1770
|
+
this.dropped += 1;
|
|
1771
|
+
return false;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
if (this.items.length >= MAX_EVENTS || cost > MAX_EVENT_COST || cost > MAX_CAPTURE_COST - this.retainedCost) {
|
|
1775
|
+
this.sequence += 1;
|
|
1776
|
+
this.dropped += 1;
|
|
1777
|
+
return false;
|
|
1778
|
+
}
|
|
1779
|
+
return true;
|
|
1780
|
+
}
|
|
1781
|
+
admitOwner() {
|
|
1782
|
+
if (this.sealed) return false;
|
|
1783
|
+
if (this.stopListeners.size < MAX_LISTENER_OWNERS) return true;
|
|
1784
|
+
this.dropped += 1;
|
|
1785
|
+
return false;
|
|
1786
|
+
}
|
|
1787
|
+
retainListener(owner, stop) {
|
|
1788
|
+
let stops = this.stopListeners.get(owner);
|
|
1789
|
+
if (stops === undefined) {
|
|
1790
|
+
stops = new Set();
|
|
1791
|
+
this.stopListeners.set(owner, stops);
|
|
1792
|
+
}
|
|
1793
|
+
stops.add(stop);
|
|
1794
|
+
}
|
|
1795
|
+
releaseListeners(owner) {
|
|
1796
|
+
const stops = this.stopListeners.get(owner);
|
|
1797
|
+
this.stopListeners.delete(owner);
|
|
1798
|
+
for (const stop of stops ?? []) stop();
|
|
1799
|
+
}
|
|
1800
|
+
observePage(page) {
|
|
1801
|
+
if (this.enabled.size > 0) {
|
|
1802
|
+
const onClose = () => {
|
|
1803
|
+
this.releaseListeners(page);
|
|
1804
|
+
};
|
|
1805
|
+
page.on("close", onClose);
|
|
1806
|
+
this.retainListener(page, () => page.off("close", onClose));
|
|
1807
|
+
}
|
|
1808
|
+
if (this.enabled.has("console")) {
|
|
1809
|
+
const onConsole = (message) => this.console(message);
|
|
1810
|
+
page.on("console", onConsole);
|
|
1811
|
+
this.retainListener(page, () => page.off("console", onConsole));
|
|
1812
|
+
}
|
|
1813
|
+
if (this.enabled.has("page-errors")) {
|
|
1814
|
+
const onError = (error) => {
|
|
1815
|
+
if (!this.admitText(error.message, error.stack ?? "")) return;
|
|
1816
|
+
this.push({
|
|
1817
|
+
kind: "page-error",
|
|
1818
|
+
message: this.secrets.redact(error.message),
|
|
1819
|
+
stack: error.stack === undefined ? null : this.secrets.redact(error.stack)
|
|
1820
|
+
});
|
|
1821
|
+
};
|
|
1822
|
+
page.on("pageerror", onError);
|
|
1823
|
+
this.retainListener(page, () => page.off("pageerror", onError));
|
|
1824
|
+
}
|
|
1825
|
+
if (this.enabled.has("websockets")) {
|
|
1826
|
+
const onWebSocket = (socket) => this.webSocket(socket);
|
|
1827
|
+
page.on("websocket", onWebSocket);
|
|
1828
|
+
this.retainListener(page, () => page.off("websocket", onWebSocket));
|
|
1829
|
+
}
|
|
1830
|
+
if (this.enabled.has("frames")) {
|
|
1831
|
+
const onAttached = (frame) => this.frame("frame-attached", frame);
|
|
1832
|
+
const onDetached = (frame) => this.frame("frame-detached", frame);
|
|
1833
|
+
const onNavigated = (frame) => this.frame("frame-navigated", frame);
|
|
1834
|
+
page.on("frameattached", onAttached);
|
|
1835
|
+
page.on("framedetached", onDetached);
|
|
1836
|
+
page.on("framenavigated", onNavigated);
|
|
1837
|
+
this.retainListener(page, () => page.off("frameattached", onAttached));
|
|
1838
|
+
this.retainListener(page, () => page.off("framedetached", onDetached));
|
|
1839
|
+
this.retainListener(page, () => page.off("framenavigated", onNavigated));
|
|
1840
|
+
}
|
|
1841
|
+
if (this.enabled.has("workers")) {
|
|
1842
|
+
const onWorker = (worker) => this.worker(worker);
|
|
1843
|
+
page.on("worker", onWorker);
|
|
1844
|
+
this.retainListener(page, () => page.off("worker", onWorker));
|
|
1845
|
+
}
|
|
1846
|
+
if (this.enabled.size > 0) {
|
|
1847
|
+
const onPopup = (popup) => this.popup(popup);
|
|
1848
|
+
page.on("popup", onPopup);
|
|
1849
|
+
this.retainListener(page, () => page.off("popup", onPopup));
|
|
1850
|
+
}
|
|
1851
|
+
if (this.enabled.has("downloads")) {
|
|
1852
|
+
const onDownload = (download) => this.download(download);
|
|
1853
|
+
page.on("download", onDownload);
|
|
1854
|
+
this.retainListener(page, () => page.off("download", onDownload));
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
safeUrl(value) {
|
|
1858
|
+
return this.secrets.sanitizeUrl(value);
|
|
1859
|
+
}
|
|
1860
|
+
console(message) {
|
|
1861
|
+
const rawText = message.text();
|
|
1862
|
+
const location = message.location();
|
|
1863
|
+
if (!this.admitText(rawText, location.url, message.type())) return;
|
|
1864
|
+
this.push({
|
|
1865
|
+
kind: "console",
|
|
1866
|
+
level: this.secrets.redact(message.type()),
|
|
1867
|
+
text: this.secrets.redact(rawText),
|
|
1868
|
+
url: location.url === "" ? null : this.safeUrl(location.url)
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
webSocket(socket) {
|
|
1872
|
+
if (!this.admitOwner()) return;
|
|
1873
|
+
if (!this.admitText(socket.url())) return;
|
|
1874
|
+
const url = this.safeUrl(socket.url());
|
|
1875
|
+
this.push({
|
|
1876
|
+
kind: "websocket-opened",
|
|
1877
|
+
url
|
|
1878
|
+
});
|
|
1879
|
+
const onSent = ({ payload }) => this.webSocketFrame("websocket-frame-sent", url, payload);
|
|
1880
|
+
const onReceived = ({ payload }) => this.webSocketFrame("websocket-frame-received", url, payload);
|
|
1881
|
+
const onClose = () => {
|
|
1882
|
+
this.push({
|
|
1883
|
+
kind: "websocket-closed",
|
|
1884
|
+
url
|
|
1885
|
+
});
|
|
1886
|
+
this.releaseListeners(socket);
|
|
1887
|
+
};
|
|
1888
|
+
socket.on("framesent", onSent);
|
|
1889
|
+
socket.on("framereceived", onReceived);
|
|
1890
|
+
socket.on("close", onClose);
|
|
1891
|
+
this.retainListener(socket, () => socket.off("framesent", onSent));
|
|
1892
|
+
this.retainListener(socket, () => socket.off("framereceived", onReceived));
|
|
1893
|
+
this.retainListener(socket, () => socket.off("close", onClose));
|
|
1894
|
+
}
|
|
1895
|
+
webSocketFrame(kind, url, payload) {
|
|
1896
|
+
const bytes = Buffer.byteLength(payload);
|
|
1897
|
+
const isText = typeof payload === "string";
|
|
1898
|
+
if (!isText) {
|
|
1899
|
+
this.push({
|
|
1900
|
+
kind,
|
|
1901
|
+
url,
|
|
1902
|
+
payload_type: "binary",
|
|
1903
|
+
payload_bytes: bytes,
|
|
1904
|
+
payload_text: null,
|
|
1905
|
+
truncated: false
|
|
1906
|
+
});
|
|
1907
|
+
return;
|
|
1908
|
+
}
|
|
1909
|
+
if (!this.admitText(payload)) return;
|
|
1910
|
+
const text = this.secrets.redact(payload);
|
|
1911
|
+
this.push({
|
|
1912
|
+
kind,
|
|
1913
|
+
url,
|
|
1914
|
+
payload_type: "text",
|
|
1915
|
+
payload_bytes: bytes,
|
|
1916
|
+
payload_text: text,
|
|
1917
|
+
truncated: false
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
frame(kind, frame) {
|
|
1921
|
+
if (!this.admitText(frame.url(), frame.name())) return;
|
|
1922
|
+
this.push({
|
|
1923
|
+
kind,
|
|
1924
|
+
url: frame.url() === "" ? null : this.safeUrl(frame.url()),
|
|
1925
|
+
name: frame.name() === "" ? null : this.secrets.redact(frame.name())
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
worker(worker) {
|
|
1929
|
+
if (!this.admitOwner() || !this.admitText(worker.url())) return;
|
|
1930
|
+
const details = {
|
|
1931
|
+
url: this.safeUrl(worker.url()),
|
|
1932
|
+
name: null
|
|
1933
|
+
};
|
|
1934
|
+
this.push({
|
|
1935
|
+
kind: "worker-created",
|
|
1936
|
+
...details
|
|
1937
|
+
});
|
|
1938
|
+
const onClose = () => {
|
|
1939
|
+
this.push({
|
|
1940
|
+
kind: "worker-closed",
|
|
1941
|
+
...details
|
|
1942
|
+
});
|
|
1943
|
+
this.releaseListeners(worker);
|
|
1944
|
+
};
|
|
1945
|
+
worker.on("close", onClose);
|
|
1946
|
+
this.retainListener(worker, () => worker.off("close", onClose));
|
|
1947
|
+
}
|
|
1948
|
+
popup(page) {
|
|
1949
|
+
if (this.pages.has(page)) return;
|
|
1950
|
+
if (!this.admitOwner() || !this.admitText(page.url())) return;
|
|
1951
|
+
this.pages.add(page);
|
|
1952
|
+
for (const family of [
|
|
1953
|
+
"frames",
|
|
1954
|
+
"workers",
|
|
1955
|
+
"websockets",
|
|
1956
|
+
"downloads"
|
|
1957
|
+
]) if (this.enabled.has(family)) this.incompleteFamilies.add(family);
|
|
1958
|
+
const opened = {
|
|
1959
|
+
url: page.url() === "" ? null : this.safeUrl(page.url()),
|
|
1960
|
+
name: null
|
|
1961
|
+
};
|
|
1962
|
+
if (this.enabled.has("popups")) {
|
|
1963
|
+
this.push({
|
|
1964
|
+
kind: "popup-opened",
|
|
1965
|
+
...opened
|
|
1966
|
+
});
|
|
1967
|
+
const onClose = () => {
|
|
1968
|
+
if (!this.admitText(page.url())) return;
|
|
1969
|
+
this.push({
|
|
1970
|
+
kind: "popup-closed",
|
|
1971
|
+
url: page.url() === "" ? null : this.safeUrl(page.url()),
|
|
1972
|
+
name: null
|
|
1973
|
+
});
|
|
1974
|
+
};
|
|
1975
|
+
page.on("close", onClose);
|
|
1976
|
+
this.retainListener(page, () => page.off("close", onClose));
|
|
1977
|
+
}
|
|
1978
|
+
this.observePage(page);
|
|
1979
|
+
}
|
|
1980
|
+
download(download) {
|
|
1981
|
+
if (this.admitText(download.suggestedFilename(), download.url())) this.push({
|
|
1982
|
+
kind: "download-cancelled",
|
|
1983
|
+
suggested_filename: this.secrets.redact(download.suggestedFilename()),
|
|
1984
|
+
url: this.safeUrl(download.url())
|
|
1985
|
+
});
|
|
1986
|
+
void download.cancel().catch((cause) => {
|
|
1987
|
+
void cause;
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
})))();
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
//#endregion
|
|
1995
|
+
//#region dist/browser/PlaywrightScenarioStorage.js
|
|
1996
|
+
var breakpointResponse, scriptIdentifierResponse, storageKeyResponse, targetInfoResponse, STORAGE_EVENT_METHODS, attachedTargetEvent, targetSessionEvent, nestedMessageEvent, nestedProtocolMessage, executionContextEvent, scriptParsedEvent, pausedEvent, evaluationResponse, STORAGE_CLEANUP_TIMEOUT_MS, PlaywrightScenarioStorage;
|
|
1997
|
+
function init_PlaywrightScenarioStorage() {
|
|
1998
|
+
return (init_PlaywrightScenarioStorage = __esmMin((() => {
|
|
1999
|
+
init_browserObservationError();
|
|
2000
|
+
init_PlaywrightExecutionBoundary();
|
|
2001
|
+
breakpointResponse = z.object({ breakpointId: z.string() });
|
|
2002
|
+
scriptIdentifierResponse = z.object({ identifier: z.string() });
|
|
2003
|
+
storageKeyResponse = z.object({ storageKey: z.string() });
|
|
2004
|
+
targetInfoResponse = z.object({ targetInfo: z.object({ targetId: z.string() }) });
|
|
2005
|
+
STORAGE_EVENT_METHODS = new Set([
|
|
2006
|
+
"Runtime.executionContextCreated",
|
|
2007
|
+
"Runtime.executionContextDestroyed",
|
|
2008
|
+
"Runtime.executionContextsCleared",
|
|
2009
|
+
"Debugger.scriptParsed",
|
|
2010
|
+
"Debugger.paused",
|
|
2011
|
+
"Target.attachedToTarget",
|
|
2012
|
+
"Target.detachedFromTarget",
|
|
2013
|
+
"Target.receivedMessageFromTarget"
|
|
2014
|
+
]);
|
|
2015
|
+
attachedTargetEvent = z.object({
|
|
2016
|
+
sessionId: z.string(),
|
|
2017
|
+
targetInfo: z.object({
|
|
2018
|
+
type: z.string(),
|
|
2019
|
+
targetId: z.string()
|
|
2020
|
+
})
|
|
2021
|
+
});
|
|
2022
|
+
targetSessionEvent = z.object({ sessionId: z.string() });
|
|
2023
|
+
nestedMessageEvent = z.object({
|
|
2024
|
+
sessionId: z.string(),
|
|
2025
|
+
message: z.string()
|
|
2026
|
+
});
|
|
2027
|
+
nestedProtocolMessage = z.object({
|
|
2028
|
+
id: z.number().optional(),
|
|
2029
|
+
method: z.string().optional(),
|
|
2030
|
+
params: z.unknown().optional(),
|
|
2031
|
+
result: z.unknown().optional(),
|
|
2032
|
+
error: z.object({ message: z.string() }).optional()
|
|
2033
|
+
});
|
|
2034
|
+
executionContextEvent = z.object({ context: z.object({
|
|
2035
|
+
id: z.number(),
|
|
2036
|
+
origin: z.string(),
|
|
2037
|
+
name: z.string(),
|
|
2038
|
+
auxData: z.object({ frameId: z.string().optional() }).optional()
|
|
2039
|
+
}) });
|
|
2040
|
+
scriptParsedEvent = z.object({
|
|
2041
|
+
scriptId: z.string(),
|
|
2042
|
+
executionContextId: z.number(),
|
|
2043
|
+
url: z.string()
|
|
2044
|
+
});
|
|
2045
|
+
pausedEvent = z.object({ callFrames: z.array(z.object({
|
|
2046
|
+
callFrameId: z.string(),
|
|
2047
|
+
location: z.object({ scriptId: z.string() })
|
|
2048
|
+
})) });
|
|
2049
|
+
evaluationResponse = z.object({ exceptionDetails: z.unknown().optional() });
|
|
2050
|
+
STORAGE_CLEANUP_TIMEOUT_MS = 1e3;
|
|
2051
|
+
PlaywrightScenarioStorage = class PlaywrightScenarioStorage {
|
|
2052
|
+
cdp;
|
|
2053
|
+
signal;
|
|
2054
|
+
#seeds = new Map();
|
|
2055
|
+
#initializedLocal = new Set();
|
|
2056
|
+
#initializedSession = new Set();
|
|
2057
|
+
#targets = new Map();
|
|
2058
|
+
#replies = new Map();
|
|
2059
|
+
#sourceUrl = `rea-storage-${randomUUID()}`;
|
|
2060
|
+
#listeners = [];
|
|
2061
|
+
#sequence = 0;
|
|
2062
|
+
#generation = 0;
|
|
2063
|
+
#closed = false;
|
|
2064
|
+
#cleanupCompleted = false;
|
|
2065
|
+
#failure;
|
|
2066
|
+
#closePromise;
|
|
2067
|
+
#detachPromise;
|
|
2068
|
+
#rootInitialization;
|
|
2069
|
+
#work = Promise.resolve();
|
|
2070
|
+
#removeListeners = () => undefined;
|
|
2071
|
+
constructor(cdp, signal) {
|
|
2072
|
+
this.cdp = cdp;
|
|
2073
|
+
this.signal = signal;
|
|
2074
|
+
}
|
|
2075
|
+
static async create(storagePage, scenario, secrets, options = {}) {
|
|
2076
|
+
const { signal, retainCleanup } = options;
|
|
2077
|
+
const { context, page } = storagePage;
|
|
2078
|
+
if (scenario.storage.local_storage.length === 0 && scenario.storage.session_storage.length === 0) return undefined;
|
|
2079
|
+
const connection = context.newCDPSession(page);
|
|
2080
|
+
let cdp;
|
|
2081
|
+
try {
|
|
2082
|
+
cdp = await withPlaywrightExecutionBoundary(() => connection, undefined, signal);
|
|
2083
|
+
} catch (cause) {
|
|
2084
|
+
if (signal?.aborted === true) {
|
|
2085
|
+
let detached = false;
|
|
2086
|
+
const lateCleanup = async () => {
|
|
2087
|
+
let session;
|
|
2088
|
+
try {
|
|
2089
|
+
session = await connection;
|
|
2090
|
+
} catch {
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
if (!detached) {
|
|
2094
|
+
await session.detach();
|
|
2095
|
+
detached = true;
|
|
2096
|
+
}
|
|
2097
|
+
};
|
|
2098
|
+
retainCleanup?.(lateCleanup);
|
|
2099
|
+
void withPlaywrightExecutionBoundary(lateCleanup, STORAGE_CLEANUP_TIMEOUT_MS).catch(() => undefined);
|
|
2100
|
+
}
|
|
2101
|
+
throw cause;
|
|
2102
|
+
}
|
|
2103
|
+
const owner = new PlaywrightScenarioStorage(cdp, signal);
|
|
2104
|
+
owner.addSeeds(scenario.storage.local_storage, "local", secrets);
|
|
2105
|
+
owner.addSeeds(scenario.storage.session_storage, "session", secrets);
|
|
2106
|
+
return owner;
|
|
2107
|
+
}
|
|
2108
|
+
async initialize(page, context) {
|
|
2109
|
+
const initialization = this.initializeRoot(page, context);
|
|
2110
|
+
this.#rootInitialization = initialization;
|
|
2111
|
+
await withPlaywrightExecutionBoundary(() => initialization, undefined, this.signal);
|
|
2112
|
+
}
|
|
2113
|
+
async initializeRoot(page, context) {
|
|
2114
|
+
const rootInfo = targetInfoResponse.parse(await this.cdp.send("Target.getTargetInfo"));
|
|
2115
|
+
const root = this.createTarget(undefined, rootInfo.targetInfo.targetId, (method, params) => this.cdp.send(method, params));
|
|
2116
|
+
this.#targets.set("", root);
|
|
2117
|
+
if (this.#closed) return;
|
|
2118
|
+
this.listen(page, context);
|
|
2119
|
+
const ready = this.initializeTarget(root);
|
|
2120
|
+
root.ready = ready;
|
|
2121
|
+
await ready;
|
|
2122
|
+
}
|
|
2123
|
+
addSeeds(blocks, kind, secrets) {
|
|
2124
|
+
for (const { origin, entries } of blocks) {
|
|
2125
|
+
const seed = this.#seeds.get(origin) ?? {
|
|
2126
|
+
local: [],
|
|
2127
|
+
session: []
|
|
2128
|
+
};
|
|
2129
|
+
seed[kind].push(...entries.map(({ name, value }) => [name, secrets.value(value)]));
|
|
2130
|
+
this.#seeds.set(origin, seed);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
listen(page, context) {
|
|
2134
|
+
const browser = context.browser();
|
|
2135
|
+
const detached = () => this.targetDetached("");
|
|
2136
|
+
page.on("close", detached);
|
|
2137
|
+
context.on("close", detached);
|
|
2138
|
+
browser?.on("disconnected", detached);
|
|
2139
|
+
this.#removeListeners = () => {
|
|
2140
|
+
page.off("close", detached);
|
|
2141
|
+
context.off("close", detached);
|
|
2142
|
+
browser?.off("disconnected", detached);
|
|
2143
|
+
};
|
|
2144
|
+
for (const method of [
|
|
2145
|
+
"Runtime.executionContextCreated",
|
|
2146
|
+
"Runtime.executionContextDestroyed",
|
|
2147
|
+
"Runtime.executionContextsCleared",
|
|
2148
|
+
"Debugger.scriptParsed",
|
|
2149
|
+
"Debugger.paused",
|
|
2150
|
+
"Target.attachedToTarget",
|
|
2151
|
+
"Target.detachedFromTarget",
|
|
2152
|
+
"Target.receivedMessageFromTarget"
|
|
2153
|
+
]) {
|
|
2154
|
+
const listener = (params) => this.event("", method, params);
|
|
2155
|
+
this.#listeners.push({
|
|
2156
|
+
method,
|
|
2157
|
+
listener
|
|
2158
|
+
});
|
|
2159
|
+
this.cdp.on(method, listener);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
createTarget(parentId, topLevelTargetId, send) {
|
|
2163
|
+
return {
|
|
2164
|
+
parentId,
|
|
2165
|
+
topLevelTargetId,
|
|
2166
|
+
send,
|
|
2167
|
+
contexts: new Map(),
|
|
2168
|
+
scripts: new Map(),
|
|
2169
|
+
ready: Promise.resolve(),
|
|
2170
|
+
waitingForDebugger: false
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
async initializeTarget(target) {
|
|
2174
|
+
if (this.#closed) return;
|
|
2175
|
+
await target.send("Page.enable");
|
|
2176
|
+
if (this.#closed) return;
|
|
2177
|
+
await target.send("Runtime.enable");
|
|
2178
|
+
if (this.#closed) return;
|
|
2179
|
+
await target.send("Debugger.enable");
|
|
2180
|
+
if (this.#closed) return;
|
|
2181
|
+
breakpointResponse.parse(await target.send("Debugger.setBreakpointByUrl", {
|
|
2182
|
+
url: this.#sourceUrl,
|
|
2183
|
+
lineNumber: 1
|
|
2184
|
+
}));
|
|
2185
|
+
if (this.#closed) return;
|
|
2186
|
+
scriptIdentifierResponse.parse(await target.send("Page.addScriptToEvaluateOnNewDocument", {
|
|
2187
|
+
worldName: this.#sourceUrl,
|
|
2188
|
+
source: `(() => {\n void 0;\n})()\n//# sourceURL=${this.#sourceUrl}`
|
|
2189
|
+
}));
|
|
2190
|
+
if (this.#closed) return;
|
|
2191
|
+
await target.send("Target.setAutoAttach", {
|
|
2192
|
+
autoAttach: true,
|
|
2193
|
+
waitForDebuggerOnStart: true,
|
|
2194
|
+
flatten: false
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2197
|
+
sendObserved(target, method, params) {
|
|
2198
|
+
return withPlaywrightExecutionBoundary(() => target.send(method, params), undefined, this.signal);
|
|
2199
|
+
}
|
|
2200
|
+
event(sessionId, method, params) {
|
|
2201
|
+
if (this.#closed) return;
|
|
2202
|
+
const target = this.#targets.get(sessionId);
|
|
2203
|
+
if (target === undefined) return;
|
|
2204
|
+
try {
|
|
2205
|
+
if (method === "Runtime.executionContextCreated") {
|
|
2206
|
+
const { context } = executionContextEvent.parse(params);
|
|
2207
|
+
if (context.name === this.#sourceUrl) target.contexts.set(context.id, context);
|
|
2208
|
+
} else if (method === "Runtime.executionContextDestroyed") {
|
|
2209
|
+
const { executionContextId } = z.object({ executionContextId: z.number() }).parse(params);
|
|
2210
|
+
target.contexts.delete(executionContextId);
|
|
2211
|
+
} else if (method === "Runtime.executionContextsCleared") {
|
|
2212
|
+
target.contexts.clear();
|
|
2213
|
+
target.scripts.clear();
|
|
2214
|
+
} else if (method === "Debugger.scriptParsed") {
|
|
2215
|
+
const script = scriptParsedEvent.parse(params);
|
|
2216
|
+
if (script.url === this.#sourceUrl) target.scripts.set(script.scriptId, script.executionContextId);
|
|
2217
|
+
} else if (method === "Debugger.paused") {
|
|
2218
|
+
const pause = pausedEvent.parse(params);
|
|
2219
|
+
const frame = pause.callFrames[0];
|
|
2220
|
+
if (frame === undefined || !target.scripts.has(frame.location.scriptId)) return;
|
|
2221
|
+
this.#generation += 1;
|
|
2222
|
+
this.#work = this.#work.then(() => this.seed(target, pause)).catch((cause) => {
|
|
2223
|
+
if (sessionId === "" || this.#targets.get(sessionId) === target) this.fail(cause);
|
|
2224
|
+
});
|
|
2225
|
+
} else if (method === "Target.attachedToTarget") {
|
|
2226
|
+
this.#generation += 1;
|
|
2227
|
+
this.attach(sessionId, attachedTargetEvent.parse(params));
|
|
2228
|
+
} else if (method === "Target.detachedFromTarget") {
|
|
2229
|
+
this.#generation += 1;
|
|
2230
|
+
this.targetDetached(targetSessionEvent.parse(params).sessionId);
|
|
2231
|
+
} else if (method === "Target.receivedMessageFromTarget") {
|
|
2232
|
+
this.nestedMessage(nestedMessageEvent.parse(params));
|
|
2233
|
+
}
|
|
2234
|
+
} catch (cause) {
|
|
2235
|
+
this.fail(cause);
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
nestedMessage(event) {
|
|
2239
|
+
const reply = nestedProtocolMessage.parse(JSON.parse(event.message));
|
|
2240
|
+
if (reply.id !== undefined) {
|
|
2241
|
+
const waiter = this.#replies.get(reply.id);
|
|
2242
|
+
if (waiter?.sessionId !== event.sessionId) return;
|
|
2243
|
+
this.#replies.delete(reply.id);
|
|
2244
|
+
if (reply.error !== undefined) waiter.reject(new Error(reply.error.message));
|
|
2245
|
+
else waiter.resolve(reply.result);
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
if (reply.method !== undefined && STORAGE_EVENT_METHODS.has(reply.method)) this.event(event.sessionId, reply.method, reply.params);
|
|
2249
|
+
}
|
|
2250
|
+
fail(cause) {
|
|
2251
|
+
this.#generation += 1;
|
|
2252
|
+
this.#failure ??= new BrowserObservationError("capture_browser_scenario", "protocol_error", { cause });
|
|
2253
|
+
}
|
|
2254
|
+
async seedPausedFrame(target, frame) {
|
|
2255
|
+
const contextId = target.scripts.get(frame.location.scriptId);
|
|
2256
|
+
const context = contextId === undefined ? undefined : target.contexts.get(contextId);
|
|
2257
|
+
const seed = context === undefined ? undefined : this.#seeds.get(context.origin);
|
|
2258
|
+
if (this.#closed || seed === undefined || context?.auxData?.frameId === undefined) return;
|
|
2259
|
+
const storageKey = storageKeyResponse.parse(await this.sendObserved(target, "Storage.getStorageKey", { frameId: context.auxData.frameId })).storageKey;
|
|
2260
|
+
const sessionKey = JSON.stringify([target.topLevelTargetId, storageKey]);
|
|
2261
|
+
const local = this.#initializedLocal.has(storageKey) || seed.local.length === 0 ? [] : seed.local;
|
|
2262
|
+
const session = this.#initializedSession.has(sessionKey) || seed.session.length === 0 ? [] : seed.session;
|
|
2263
|
+
if (local.length === 0 && session.length === 0) return;
|
|
2264
|
+
const payload = JSON.stringify({
|
|
2265
|
+
local,
|
|
2266
|
+
session
|
|
2267
|
+
}).replaceAll("<", "\\u003c");
|
|
2268
|
+
const response = evaluationResponse.parse(await this.sendObserved(target, "Debugger.evaluateOnCallFrame", {
|
|
2269
|
+
callFrameId: frame.callFrameId,
|
|
2270
|
+
expression: `(() => { const seed = ${payload}; for (const [name, value] of seed.local) localStorage.setItem(name, value); for (const [name, value] of seed.session) sessionStorage.setItem(name, value); })()`,
|
|
2271
|
+
returnByValue: true
|
|
2272
|
+
}));
|
|
2273
|
+
if (response.exceptionDetails !== undefined) throw new BrowserObservationError("capture_browser_scenario", "protocol_error", { detail: "The browser denied initial storage initialization." });
|
|
2274
|
+
if (local.length > 0) this.#initializedLocal.add(storageKey);
|
|
2275
|
+
if (session.length > 0) this.#initializedSession.add(sessionKey);
|
|
2276
|
+
}
|
|
2277
|
+
async seed(target, pause) {
|
|
2278
|
+
const frame = pause.callFrames[0];
|
|
2279
|
+
if (frame === undefined) return;
|
|
2280
|
+
let primaryFailure;
|
|
2281
|
+
let hasPrimaryFailure = false;
|
|
2282
|
+
try {
|
|
2283
|
+
await this.seedPausedFrame(target, frame);
|
|
2284
|
+
} catch (cause) {
|
|
2285
|
+
primaryFailure = cause;
|
|
2286
|
+
hasPrimaryFailure = true;
|
|
2287
|
+
}
|
|
2288
|
+
let resumeFailure;
|
|
2289
|
+
try {
|
|
2290
|
+
await withPlaywrightExecutionBoundary(() => target.send("Debugger.resume"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2291
|
+
} catch (cause) {
|
|
2292
|
+
resumeFailure = cause;
|
|
2293
|
+
}
|
|
2294
|
+
if (hasPrimaryFailure && resumeFailure !== undefined) throw new AggregateError([primaryFailure, resumeFailure], "Storage initialization and debugger resume both failed", { cause: primaryFailure });
|
|
2295
|
+
if (this.signal?.aborted === true && resumeFailure === undefined) return;
|
|
2296
|
+
if (hasPrimaryFailure) throw primaryFailure;
|
|
2297
|
+
if (resumeFailure !== undefined) throw resumeFailure;
|
|
2298
|
+
}
|
|
2299
|
+
attach(parentId, event) {
|
|
2300
|
+
const parent = this.#targets.get(parentId);
|
|
2301
|
+
if (parent === undefined) return;
|
|
2302
|
+
const { sessionId, targetInfo } = event;
|
|
2303
|
+
const target = this.createTarget(parentId, event.targetInfo.type === "iframe" ? parent.topLevelTargetId : event.targetInfo.targetId, async (method, params = {}) => {
|
|
2304
|
+
const id = ++this.#sequence;
|
|
2305
|
+
const reply = new Promise((resolve, reject) => this.#replies.set(id, {
|
|
2306
|
+
sessionId,
|
|
2307
|
+
resolve,
|
|
2308
|
+
reject
|
|
2309
|
+
}));
|
|
2310
|
+
try {
|
|
2311
|
+
const sent = parent.send("Target.sendMessageToTarget", {
|
|
2312
|
+
sessionId,
|
|
2313
|
+
message: JSON.stringify({
|
|
2314
|
+
id,
|
|
2315
|
+
method,
|
|
2316
|
+
params
|
|
2317
|
+
})
|
|
2318
|
+
});
|
|
2319
|
+
const [, result] = await Promise.all([sent, reply]);
|
|
2320
|
+
return result;
|
|
2321
|
+
} finally {
|
|
2322
|
+
this.#replies.delete(id);
|
|
2323
|
+
}
|
|
2324
|
+
});
|
|
2325
|
+
target.waitingForDebugger = true;
|
|
2326
|
+
this.#targets.set(sessionId, target);
|
|
2327
|
+
target.ready = (async () => {
|
|
2328
|
+
try {
|
|
2329
|
+
if (!this.#closed && (targetInfo.type === "iframe" || targetInfo.type === "page")) await this.initializeTarget(target);
|
|
2330
|
+
} catch (cause) {
|
|
2331
|
+
if (this.signal?.aborted !== true && !this.#closed && this.#targets.get(sessionId) === target) this.fail(cause);
|
|
2332
|
+
}
|
|
2333
|
+
if (this.#targets.get(sessionId) !== target) return;
|
|
2334
|
+
try {
|
|
2335
|
+
await withPlaywrightExecutionBoundary(() => target.send("Runtime.runIfWaitingForDebugger"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2336
|
+
target.waitingForDebugger = false;
|
|
2337
|
+
} catch (cause) {
|
|
2338
|
+
if (this.signal?.aborted !== true && !this.#closed && this.#targets.get(sessionId) === target) this.fail(cause);
|
|
2339
|
+
}
|
|
2340
|
+
})();
|
|
2341
|
+
}
|
|
2342
|
+
targetDetached(sessionId) {
|
|
2343
|
+
for (const [id, target] of this.#targets) if (target.parentId === sessionId) this.targetDetached(id);
|
|
2344
|
+
this.#targets.delete(sessionId);
|
|
2345
|
+
for (const [id, reply] of this.#replies) if (reply.sessionId === sessionId) {
|
|
2346
|
+
this.#replies.delete(id);
|
|
2347
|
+
reply.reject(new BrowserObservationError("capture_browser_scenario", "disconnected"));
|
|
2348
|
+
}
|
|
2349
|
+
this.#generation += 1;
|
|
2350
|
+
}
|
|
2351
|
+
async settle() {
|
|
2352
|
+
for (;;) {
|
|
2353
|
+
const generation = this.#generation;
|
|
2354
|
+
const work = this.#work;
|
|
2355
|
+
const targets = [...this.#targets.entries()];
|
|
2356
|
+
await withPlaywrightExecutionBoundary(() => Promise.all(targets.map(([, target]) => target.ready)), undefined, this.signal);
|
|
2357
|
+
await withPlaywrightExecutionBoundary(() => work, undefined, this.signal);
|
|
2358
|
+
await Promise.resolve();
|
|
2359
|
+
if (this.#failure !== undefined) throw this.#failure;
|
|
2360
|
+
if (generation === this.#generation && work === this.#work && targets.every(([id, target]) => this.#targets.get(id) === target)) return;
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
close(stopLoading = false) {
|
|
2364
|
+
if (this.#cleanupCompleted) return Promise.resolve();
|
|
2365
|
+
if (this.#closePromise !== undefined) return this.#closePromise;
|
|
2366
|
+
const closing = this.closeResources(stopLoading).catch((cause) => {
|
|
2367
|
+
throw new BrowserObservationError("capture_browser_scenario", "cleanup_failed", {
|
|
2368
|
+
cause,
|
|
2369
|
+
cleanup: {
|
|
2370
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
2371
|
+
resources: ["browser_transport", "browser_storage_bootstrap"]
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
});
|
|
2375
|
+
this.#closePromise = closing;
|
|
2376
|
+
void closing.catch(() => {
|
|
2377
|
+
if (this.#closePromise === closing) this.#closePromise = undefined;
|
|
2378
|
+
});
|
|
2379
|
+
return closing;
|
|
2380
|
+
}
|
|
2381
|
+
async closeResources(stopLoading) {
|
|
2382
|
+
this.#closed = true;
|
|
2383
|
+
let stopLoadingFailure;
|
|
2384
|
+
if (stopLoading) {
|
|
2385
|
+
try {
|
|
2386
|
+
const root = this.#targets.get("");
|
|
2387
|
+
if (root !== undefined) await withPlaywrightExecutionBoundary(() => root.send("Page.stopLoading"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2388
|
+
} catch (cause) {
|
|
2389
|
+
stopLoadingFailure = { cause };
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
const work = this.#work;
|
|
2393
|
+
const rootInitialization = this.#rootInitialization;
|
|
2394
|
+
const targets = [...this.#targets.values()];
|
|
2395
|
+
try {
|
|
2396
|
+
await withPlaywrightExecutionBoundary(() => Promise.all([
|
|
2397
|
+
work.catch(() => undefined),
|
|
2398
|
+
...rootInitialization === undefined ? [] : [rootInitialization.catch(() => undefined)],
|
|
2399
|
+
...targets.map((target) => target.ready.catch(() => undefined))
|
|
2400
|
+
]), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2401
|
+
} catch {}
|
|
2402
|
+
let detach = this.#detachPromise;
|
|
2403
|
+
if (detach === undefined) {
|
|
2404
|
+
detach = Promise.resolve().then(() => this.cdp.detach());
|
|
2405
|
+
this.#detachPromise = detach;
|
|
2406
|
+
void detach.catch(() => {
|
|
2407
|
+
if (this.#detachPromise === detach) this.#detachPromise = undefined;
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
await withPlaywrightExecutionBoundary(() => detach, STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2411
|
+
for (const { method, listener } of this.#listeners) this.cdp.off(method, listener);
|
|
2412
|
+
this.#removeListeners();
|
|
2413
|
+
for (const reply of this.#replies.values()) reply.reject(new BrowserObservationError("capture_browser_scenario", "disconnected"));
|
|
2414
|
+
this.#targets.clear();
|
|
2415
|
+
this.#replies.clear();
|
|
2416
|
+
this.#cleanupCompleted = true;
|
|
2417
|
+
if (stopLoadingFailure !== undefined) throw stopLoadingFailure.cause;
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
})))();
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region dist/browser/PlaywrightScenarioServiceWorkers.js
|
|
2425
|
+
var OPERATION$1, scriptResponse, attachedEvent, detachedEvent, PlaywrightScenarioServiceWorkers;
|
|
2426
|
+
function init_PlaywrightScenarioServiceWorkers() {
|
|
2427
|
+
return (init_PlaywrightScenarioServiceWorkers = __esmMin((() => {
|
|
2428
|
+
init_browserObservation();
|
|
2429
|
+
init_browserObservationError();
|
|
2430
|
+
init_CdpConnection();
|
|
2431
|
+
init_CdpEndpoint();
|
|
2432
|
+
init_CdpTargetSession();
|
|
2433
|
+
init_PlaywrightExecutionBoundary();
|
|
2434
|
+
OPERATION$1 = "capture_browser_scenario";
|
|
2435
|
+
scriptResponse = z.object({ identifier: z.string() });
|
|
2436
|
+
attachedEvent = z.object({
|
|
2437
|
+
sessionId: z.string(),
|
|
2438
|
+
targetInfo: z.object({ type: z.string() })
|
|
2439
|
+
});
|
|
2440
|
+
detachedEvent = z.object({ sessionId: z.string() });
|
|
2441
|
+
PlaywrightScenarioServiceWorkers = class {
|
|
2442
|
+
page;
|
|
2443
|
+
endpoint;
|
|
2444
|
+
targetId;
|
|
2445
|
+
marker = JSON.stringify(`rea-service-workers-${randomUUID()}`);
|
|
2446
|
+
restoreKey = JSON.stringify(`rea-restore-${randomUUID()}`);
|
|
2447
|
+
secret = JSON.stringify(randomUUID());
|
|
2448
|
+
#initialization;
|
|
2449
|
+
#restoration;
|
|
2450
|
+
#session;
|
|
2451
|
+
#targets = new Map();
|
|
2452
|
+
#closed = false;
|
|
2453
|
+
#released = false;
|
|
2454
|
+
#detached = false;
|
|
2455
|
+
#removeListener;
|
|
2456
|
+
#setup = new AbortController();
|
|
2457
|
+
constructor(page, endpoint, targetId) {
|
|
2458
|
+
this.page = page;
|
|
2459
|
+
this.endpoint = endpoint;
|
|
2460
|
+
this.targetId = targetId;
|
|
2461
|
+
}
|
|
2462
|
+
initialize() {
|
|
2463
|
+
return this.#initialization ??= this.install();
|
|
2464
|
+
}
|
|
2465
|
+
async install() {
|
|
2466
|
+
this.#session = await withCdpDiscoveryDeadline(OPERATION$1, this.#setup.signal, async (signal) => {
|
|
2467
|
+
await withPlaywrightExecutionBoundary(() => this.assertBlocked(), undefined, signal);
|
|
2468
|
+
const opened = await openCdpEndpoint(browserObservationEndpointSchema.parse(this.endpoint), OPERATION$1, signal);
|
|
2469
|
+
const target = opened.discovery.targets.find(({ id }) => id === this.targetId);
|
|
2470
|
+
if (target === undefined) {
|
|
2471
|
+
await opened.connection?.close();
|
|
2472
|
+
throw new BrowserObservationError(OPERATION$1, "target_not_found");
|
|
2473
|
+
}
|
|
2474
|
+
const connection = opened.connection ?? await CdpConnection.connect(opened.discovery.webSocket.url, OPERATION$1, signal);
|
|
2475
|
+
return await attachCdpTargetSession(connection, target, OPERATION$1, signal);
|
|
2476
|
+
});
|
|
2477
|
+
const connection = this.#session.connection;
|
|
2478
|
+
this.#removeListener = connection.onEvent((event) => {
|
|
2479
|
+
if (event.method === "Target.attachedToTarget" && this.#targets.has(event.sessionId ?? "")) {
|
|
2480
|
+
const { sessionId, targetInfo } = attachedEvent.parse(event.params);
|
|
2481
|
+
if (targetInfo.type === "iframe") this.addTarget(sessionId);
|
|
2482
|
+
} else if (event.method === "Target.detachedFromTarget") {
|
|
2483
|
+
const id = detachedEvent.parse(event.params).sessionId;
|
|
2484
|
+
this.#targets.delete(id);
|
|
2485
|
+
if (id === this.#session?.sessionId) this.#detached = true;
|
|
2486
|
+
}
|
|
2487
|
+
});
|
|
2488
|
+
const id = this.#session.sessionId;
|
|
2489
|
+
if (id === undefined) throw new BrowserObservationError(OPERATION$1, "protocol_error");
|
|
2490
|
+
this.addTarget(id);
|
|
2491
|
+
await this.settle();
|
|
2492
|
+
await withPlaywrightExecutionBoundary(() => this.assertBlocked(), undefined, this.#setup.signal);
|
|
2493
|
+
}
|
|
2494
|
+
addTarget(id) {
|
|
2495
|
+
const target = {
|
|
2496
|
+
id,
|
|
2497
|
+
ready: Promise.resolve()
|
|
2498
|
+
};
|
|
2499
|
+
this.#targets.set(id, target);
|
|
2500
|
+
const ready = this.initializeTarget(target);
|
|
2501
|
+
target.ready = ready;
|
|
2502
|
+
void ready.catch(() => undefined);
|
|
2503
|
+
}
|
|
2504
|
+
async initializeTarget(target) {
|
|
2505
|
+
try {
|
|
2506
|
+
if (this.#closed) return;
|
|
2507
|
+
await this.send(target.id, "Page.enable");
|
|
2508
|
+
if (this.#closed) return;
|
|
2509
|
+
const added = scriptResponse.parse(await this.send(target.id, "Page.addScriptToEvaluateOnNewDocument", {
|
|
2510
|
+
runImmediately: true,
|
|
2511
|
+
source: `(() => {
|
|
2512
|
+
if (!("serviceWorker" in navigator)) return;
|
|
2513
|
+
const prototype = ServiceWorkerContainer.prototype;
|
|
2514
|
+
const descriptor = Object.getOwnPropertyDescriptor(prototype, "register");
|
|
2515
|
+
if (typeof descriptor?.value === "function" && Object.hasOwn(descriptor.value, Symbol.for(${this.marker}))) return;
|
|
2516
|
+
const register = () => Promise.reject(new Error("service workers are blocked by scenario policy"));
|
|
2517
|
+
Object.defineProperty(register, Symbol.for(${this.marker}), { value: true });
|
|
2518
|
+
const secret = ${this.secret};
|
|
2519
|
+
Object.defineProperty(globalThis, ${this.restoreKey}, { configurable: true, value: (provided) => {
|
|
2520
|
+
if (provided !== secret) return false;
|
|
2521
|
+
if (Object.getOwnPropertyDescriptor(prototype, "register")?.value === register) {
|
|
2522
|
+
if (descriptor === undefined) delete prototype.register;
|
|
2523
|
+
else Object.defineProperty(prototype, "register", descriptor);
|
|
2524
|
+
}
|
|
2525
|
+
delete globalThis[${this.restoreKey}];
|
|
2526
|
+
return true;
|
|
2527
|
+
}});
|
|
2528
|
+
Object.defineProperty(prototype, "register", { ...descriptor, configurable: true, value: register });
|
|
2529
|
+
})()`
|
|
2530
|
+
}));
|
|
2531
|
+
target.identifier = added.identifier;
|
|
2532
|
+
if (!this.#closed) await this.send(target.id, "Target.setAutoAttach", {
|
|
2533
|
+
autoAttach: true,
|
|
2534
|
+
waitForDebuggerOnStart: true,
|
|
2535
|
+
flatten: true,
|
|
2536
|
+
filter: [{
|
|
2537
|
+
type: "iframe",
|
|
2538
|
+
exclude: false
|
|
2539
|
+
}, { exclude: true }]
|
|
2540
|
+
});
|
|
2541
|
+
} finally {
|
|
2542
|
+
if (this.#targets.has(target.id) && target.id !== this.#session?.sessionId) await this.send(target.id, "Runtime.runIfWaitingForDebugger");
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
send(id, method, params = {}) {
|
|
2546
|
+
if (this.#session === undefined) throw new BrowserObservationError(OPERATION$1, "disconnected");
|
|
2547
|
+
return this.#session.connection.send(method, params, id);
|
|
2548
|
+
}
|
|
2549
|
+
async settle() {
|
|
2550
|
+
for (;;) {
|
|
2551
|
+
const targets = [...this.#targets.values()];
|
|
2552
|
+
await Promise.all(targets.map(async (target) => {
|
|
2553
|
+
try {
|
|
2554
|
+
await target.ready;
|
|
2555
|
+
} catch (cause) {
|
|
2556
|
+
if (this.#targets.get(target.id) === target) throw cause;
|
|
2557
|
+
}
|
|
2558
|
+
}));
|
|
2559
|
+
if (targets.length === this.#targets.size && targets.every((target) => this.#targets.get(target.id) === target)) return;
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
async assertBlocked() {
|
|
2563
|
+
if (this.#session !== undefined) await this.settle();
|
|
2564
|
+
for (const frame of this.page.frames()) {
|
|
2565
|
+
let violatesPolicy;
|
|
2566
|
+
try {
|
|
2567
|
+
violatesPolicy = await frame.evaluate(`(async () => {
|
|
2568
|
+
if (!("serviceWorker" in navigator)) return false;
|
|
2569
|
+
const serviceWorker = navigator.serviceWorker;
|
|
2570
|
+
if (${this.#session !== undefined} &&
|
|
2571
|
+
(!Object.hasOwn(serviceWorker.register, Symbol.for(${this.marker})) ||
|
|
2572
|
+
typeof globalThis[${this.restoreKey}] !== "function")) return true;
|
|
2573
|
+
if (serviceWorker.controller !== null) return true;
|
|
2574
|
+
return (await serviceWorker.getRegistrations()).length > 0;
|
|
2575
|
+
})()`);
|
|
2576
|
+
} catch (cause) {
|
|
2577
|
+
if (frame.isDetached()) continue;
|
|
2578
|
+
throw cause;
|
|
2579
|
+
}
|
|
2580
|
+
if (violatesPolicy) throw new BrowserObservationError(OPERATION$1, "target_not_allowed");
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
close(stopLoading = false) {
|
|
2584
|
+
this.#closed = true;
|
|
2585
|
+
this.#setup.abort();
|
|
2586
|
+
const restoration = this.#restoration ??= this.restore(stopLoading);
|
|
2587
|
+
void restoration.then(() => {
|
|
2588
|
+
if (this.#restoration === restoration) this.#restoration = undefined;
|
|
2589
|
+
}, () => {
|
|
2590
|
+
if (this.#restoration === restoration) this.#restoration = undefined;
|
|
2591
|
+
});
|
|
2592
|
+
return withPlaywrightExecutionBoundary(() => restoration, 1e3);
|
|
2593
|
+
}
|
|
2594
|
+
async restore(stopLoading) {
|
|
2595
|
+
await this.#initialization?.catch(() => undefined);
|
|
2596
|
+
if (this.#released) return;
|
|
2597
|
+
const session = this.#session;
|
|
2598
|
+
if (session === undefined) return;
|
|
2599
|
+
if (!this.page.isClosed()) {
|
|
2600
|
+
if (stopLoading && !this.#detached && session.sessionId !== undefined) await this.send(session.sessionId, "Page.stopLoading");
|
|
2601
|
+
await Promise.all([...this.#targets.values()].map(({ ready }) => ready.catch(() => undefined)));
|
|
2602
|
+
for (const target of this.#targets.values()) {
|
|
2603
|
+
if (!this.#detached && target.identifier !== undefined) {
|
|
2604
|
+
try {
|
|
2605
|
+
await this.send(target.id, "Page.removeScriptToEvaluateOnNewDocument", { identifier: target.identifier });
|
|
2606
|
+
} catch (cause) {
|
|
2607
|
+
if (this.#targets.get(target.id) === target) throw cause;
|
|
2608
|
+
}
|
|
2609
|
+
delete target.identifier;
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
for (const frame of this.page.frames()) {
|
|
2613
|
+
if (frame.isDetached()) continue;
|
|
2614
|
+
try {
|
|
2615
|
+
await frame.evaluate(`(() => {
|
|
2616
|
+
const restore = globalThis[${this.restoreKey}];
|
|
2617
|
+
if (typeof restore === "function" && restore(${this.secret}) === true) return;
|
|
2618
|
+
const register = globalThis.ServiceWorkerContainer?.prototype.register;
|
|
2619
|
+
if (typeof register === "function" && Object.hasOwn(register, Symbol.for(${this.marker})))
|
|
2620
|
+
throw new Error("service-worker policy restoration could not be confirmed");
|
|
2621
|
+
})()`);
|
|
2622
|
+
} catch (cause) {
|
|
2623
|
+
if (!frame.isDetached()) throw cause;
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
if (!this.page.isClosed() && !this.#detached && session.sessionId !== undefined) {
|
|
2628
|
+
await session.connection.send("Target.detachFromTarget", { sessionId: session.sessionId });
|
|
2629
|
+
this.#detached = true;
|
|
2630
|
+
}
|
|
2631
|
+
this.#removeListener?.();
|
|
2632
|
+
await session.connection.close();
|
|
2633
|
+
this.#released = true;
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
})))();
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
//#endregion
|
|
2640
|
+
//#region dist/browser/PlaywrightScenarioSession.js
|
|
2641
|
+
var OPERATION, throwIfScenarioCancelled, throwCleanupFailures, installCookies, initializePage, PlaywrightScenarioSession;
|
|
2642
|
+
function init_PlaywrightScenarioSession() {
|
|
2643
|
+
return (init_PlaywrightScenarioSession = __esmMin((() => {
|
|
2644
|
+
init_browserObservationError();
|
|
2645
|
+
init_BrowserScenarioSecrets();
|
|
2646
|
+
init_PlaywrightScenarioBrowser();
|
|
2647
|
+
init_PlaywrightScenarioActions();
|
|
2648
|
+
init_PlaywrightScenarioArtifacts();
|
|
2649
|
+
init_PlaywrightScenarioEvents();
|
|
2650
|
+
init_PlaywrightScenarioStorage();
|
|
2651
|
+
init_PlaywrightScenarioServiceWorkers();
|
|
2652
|
+
init_PlaywrightExecutionBoundary();
|
|
2653
|
+
init_BrowserScenarioPartialObservation();
|
|
2654
|
+
OPERATION = "capture_browser_scenario";
|
|
2655
|
+
throwIfScenarioCancelled = (signal) => {
|
|
2656
|
+
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION, "cancelled");
|
|
2657
|
+
};
|
|
2658
|
+
throwCleanupFailures = (failures) => {
|
|
2659
|
+
if (failures.length === 1) throw failures[0];
|
|
2660
|
+
if (failures.length > 1) throw new AggregateError(failures, "Browser scenario cleanup failed");
|
|
2661
|
+
};
|
|
2662
|
+
installCookies = async (context, scenario, secrets) => {
|
|
2663
|
+
await context.addCookies(scenario.storage.cookies.map((cookie) => ({
|
|
2664
|
+
name: cookie.name,
|
|
2665
|
+
value: secrets.value(cookie.value),
|
|
2666
|
+
url: secrets.url(cookie.destination),
|
|
2667
|
+
httpOnly: cookie.http_only,
|
|
2668
|
+
secure: cookie.secure,
|
|
2669
|
+
sameSite: cookie.same_site
|
|
2670
|
+
})));
|
|
2671
|
+
};
|
|
2672
|
+
initializePage = async (context, scenario, secrets) => {
|
|
2673
|
+
context.setDefaultTimeout(0);
|
|
2674
|
+
context.setDefaultNavigationTimeout(0);
|
|
2675
|
+
await installCookies(context, scenario, secrets);
|
|
2676
|
+
};
|
|
2677
|
+
PlaywrightScenarioSession = class PlaywrightScenarioSession {
|
|
2678
|
+
opened;
|
|
2679
|
+
mode;
|
|
2680
|
+
processOwnership;
|
|
2681
|
+
product = "Chromium";
|
|
2682
|
+
version;
|
|
2683
|
+
initialUrl;
|
|
2684
|
+
secrets;
|
|
2685
|
+
eventCapture;
|
|
2686
|
+
storage;
|
|
2687
|
+
serviceWorkers;
|
|
2688
|
+
signal;
|
|
2689
|
+
#storageReleased = false;
|
|
2690
|
+
constructor(opened, options) {
|
|
2691
|
+
this.opened = opened;
|
|
2692
|
+
this.mode = options.mode;
|
|
2693
|
+
this.processOwnership = options.mode === "launch" ? "provider-owned" : "external";
|
|
2694
|
+
this.secrets = options.secrets;
|
|
2695
|
+
this.eventCapture = options.eventCapture;
|
|
2696
|
+
this.storage = options.storage;
|
|
2697
|
+
this.serviceWorkers = options.serviceWorkers;
|
|
2698
|
+
this.signal = options.signal;
|
|
2699
|
+
this.version = opened.browser.version();
|
|
2700
|
+
this.initialUrl = opened.page.url();
|
|
2701
|
+
}
|
|
2702
|
+
static async open(scenario, environment, options) {
|
|
2703
|
+
throwIfScenarioCancelled(options.signal);
|
|
2704
|
+
const secrets = BrowserScenarioSecrets.resolve(scenario, environment);
|
|
2705
|
+
if (secrets === undefined) throw new BrowserObservationError(OPERATION, "secret_unavailable");
|
|
2706
|
+
const startedAt = performance.now();
|
|
2707
|
+
const opening = openPlaywrightScenarioBrowser(scenario, environment, {
|
|
2708
|
+
signal: options.signal,
|
|
2709
|
+
...options.retainCleanup === undefined ? {} : { retainCleanup: options.retainCleanup }
|
|
2710
|
+
});
|
|
2711
|
+
let opened;
|
|
2712
|
+
try {
|
|
2713
|
+
opened = await withPlaywrightExecutionBoundary(() => opening, undefined, options.signal);
|
|
2714
|
+
} catch (cause) {
|
|
2715
|
+
const lateCleanup = () => opening.then((lateOpened) => lateOpened.cleanup.close(), () => undefined);
|
|
2716
|
+
options.retainCleanup?.(() => withPlaywrightExecutionBoundary(lateCleanup, 1e3));
|
|
2717
|
+
void lateCleanup().catch((cleanupCause) => {
|
|
2718
|
+
void cleanupCause;
|
|
2719
|
+
});
|
|
2720
|
+
throw cause;
|
|
2721
|
+
}
|
|
2722
|
+
const session = await this.initializeSession(opened, scenario, secrets, options);
|
|
2723
|
+
try {
|
|
2724
|
+
await withPlaywrightExecutionBoundary(() => opened.page.goto(secrets.url(scenario.start_url), {
|
|
2725
|
+
waitUntil: "load",
|
|
2726
|
+
timeout: 0
|
|
2727
|
+
}), undefined, options.signal);
|
|
2728
|
+
await withPlaywrightExecutionBoundary(() => session.serviceWorkers?.assertBlocked() ?? Promise.resolve(), undefined, options.signal);
|
|
2729
|
+
await withPlaywrightExecutionBoundary(() => session.storage?.settle() ?? Promise.resolve(), undefined, options.signal);
|
|
2730
|
+
return session;
|
|
2731
|
+
} catch (cause) {
|
|
2732
|
+
let cleanup;
|
|
2733
|
+
let cleanupFailure;
|
|
2734
|
+
try {
|
|
2735
|
+
cleanup = await session.close(true);
|
|
2736
|
+
} catch (failure) {
|
|
2737
|
+
cleanup = "incomplete";
|
|
2738
|
+
cleanupFailure = { cause: failure };
|
|
2739
|
+
options.retainCleanup?.(() => session.close());
|
|
2740
|
+
}
|
|
2741
|
+
throw browserScenarioOperationFailure(cause, {
|
|
2742
|
+
kind: "browser-scenario-observation",
|
|
2743
|
+
capture: browserScenarioCaptureData({
|
|
2744
|
+
session,
|
|
2745
|
+
scenario,
|
|
2746
|
+
startedAt,
|
|
2747
|
+
steps: [],
|
|
2748
|
+
cleanup,
|
|
2749
|
+
limitations: ["Scenario navigation failed before the initial state was captured."]
|
|
2750
|
+
})
|
|
2751
|
+
}, cleanupFailure);
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
static async initializeSession(opened, scenario, secrets, options) {
|
|
2755
|
+
let events;
|
|
2756
|
+
let storage;
|
|
2757
|
+
const serviceWorkers = scenario.browser.mode === "connect" && scenario.environment.service_workers === "block" ? new PlaywrightScenarioServiceWorkers(opened.page, scenario.browser.cdp_endpoint, scenario.browser.target_id) : undefined;
|
|
2758
|
+
try {
|
|
2759
|
+
await withPlaywrightExecutionBoundary(async () => {
|
|
2760
|
+
await serviceWorkers?.initialize();
|
|
2761
|
+
await initializePage(opened.context, scenario, secrets);
|
|
2762
|
+
}, undefined, options.signal);
|
|
2763
|
+
storage = await PlaywrightScenarioStorage.create(opened, scenario, secrets, {
|
|
2764
|
+
...options.signal === undefined ? {} : { signal: options.signal },
|
|
2765
|
+
...options.retainCleanup === undefined ? {} : { retainCleanup: options.retainCleanup }
|
|
2766
|
+
});
|
|
2767
|
+
await storage?.initialize(opened.page, opened.context);
|
|
2768
|
+
throwIfScenarioCancelled(options.signal);
|
|
2769
|
+
events = new PlaywrightScenarioEvents({
|
|
2770
|
+
page: opened.page,
|
|
2771
|
+
context: opened.context,
|
|
2772
|
+
ownsContext: scenario.browser.mode === "launch",
|
|
2773
|
+
enabled: new Set(scenario.capture.events),
|
|
2774
|
+
secrets,
|
|
2775
|
+
network: scenario.capture.network,
|
|
2776
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
2777
|
+
});
|
|
2778
|
+
return new PlaywrightScenarioSession(opened, {
|
|
2779
|
+
mode: scenario.browser.mode,
|
|
2780
|
+
secrets,
|
|
2781
|
+
eventCapture: events,
|
|
2782
|
+
storage,
|
|
2783
|
+
serviceWorkers,
|
|
2784
|
+
signal: options.signal
|
|
2785
|
+
});
|
|
2786
|
+
} catch (cause) {
|
|
2787
|
+
let storageReleased = false;
|
|
2788
|
+
const cleanup = async () => {
|
|
2789
|
+
let storageFailure;
|
|
2790
|
+
let policyFailure;
|
|
2791
|
+
let browserFailure;
|
|
2792
|
+
if (!storageReleased) {
|
|
2793
|
+
try {
|
|
2794
|
+
await storage?.close(options.signal?.aborted === true);
|
|
2795
|
+
} catch (failure) {
|
|
2796
|
+
storageFailure = { cause: failure };
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
try {
|
|
2800
|
+
if (!opened.cleanup.browserClosed) await serviceWorkers?.close(true);
|
|
2801
|
+
} catch (failure) {
|
|
2802
|
+
policyFailure = { cause: failure };
|
|
2803
|
+
}
|
|
2804
|
+
if (policyFailure === undefined) {
|
|
2805
|
+
try {
|
|
2806
|
+
await opened.cleanup.close(events === undefined ? undefined : () => events?.finish() ?? Promise.resolve());
|
|
2807
|
+
} catch (failure) {
|
|
2808
|
+
browserFailure = { cause: failure };
|
|
2809
|
+
}
|
|
2810
|
+
} else {
|
|
2811
|
+
try {
|
|
2812
|
+
await events?.finish();
|
|
2813
|
+
} catch (failure) {
|
|
2814
|
+
browserFailure = { cause: failure };
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
if (opened.cleanup.browserClosed) storageReleased = true;
|
|
2818
|
+
throwCleanupFailures([
|
|
2819
|
+
...policyFailure === undefined ? [] : [policyFailure.cause],
|
|
2820
|
+
...storageReleased || storageFailure === undefined ? [] : [storageFailure.cause],
|
|
2821
|
+
...browserFailure === undefined ? [] : [browserFailure.cause]
|
|
2822
|
+
]);
|
|
2823
|
+
};
|
|
2824
|
+
try {
|
|
2825
|
+
return await failBrowserScenarioOperation(cleanup, cause);
|
|
2826
|
+
} catch (failure) {
|
|
2827
|
+
if (failure !== cause) options.retainCleanup?.(cleanup);
|
|
2828
|
+
throw failure;
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
currentUrl() {
|
|
2833
|
+
return this.opened.page.url();
|
|
2834
|
+
}
|
|
2835
|
+
sanitizeUrl(value) {
|
|
2836
|
+
return this.secrets.sanitizeUrl(value);
|
|
2837
|
+
}
|
|
2838
|
+
setStep(index) {
|
|
2839
|
+
this.eventCapture.setStep(index);
|
|
2840
|
+
}
|
|
2841
|
+
nextEventSequence() {
|
|
2842
|
+
return this.eventCapture.nextSequence();
|
|
2843
|
+
}
|
|
2844
|
+
lastEventSequence() {
|
|
2845
|
+
return this.eventCapture.lastSequence();
|
|
2846
|
+
}
|
|
2847
|
+
events() {
|
|
2848
|
+
return this.eventCapture.result();
|
|
2849
|
+
}
|
|
2850
|
+
/** Preserve event coverage gaps for the aggregate capture's completeness. */
|
|
2851
|
+
eventLimitations() {
|
|
2852
|
+
return this.eventCapture.limitations();
|
|
2853
|
+
}
|
|
2854
|
+
async perform(action, signal) {
|
|
2855
|
+
await withPlaywrightExecutionBoundary(() => performPlaywrightScenarioAction({
|
|
2856
|
+
page: this.opened.page,
|
|
2857
|
+
action,
|
|
2858
|
+
secrets: this.secrets
|
|
2859
|
+
}), "timeout_ms" in action ? action.timeout_ms : undefined, signal);
|
|
2860
|
+
await withPlaywrightExecutionBoundary(() => this.storage?.settle() ?? Promise.resolve(), undefined, signal);
|
|
2861
|
+
}
|
|
2862
|
+
async capture(requested, signal) {
|
|
2863
|
+
await withPlaywrightExecutionBoundary(() => this.serviceWorkers?.assertBlocked() ?? Promise.resolve(), undefined, signal);
|
|
2864
|
+
await withPlaywrightExecutionBoundary(() => this.storage?.settle() ?? Promise.resolve(), undefined, signal);
|
|
2865
|
+
return withPlaywrightExecutionBoundary(() => capturePlaywrightStepArtifacts({
|
|
2866
|
+
context: this.opened.context,
|
|
2867
|
+
page: this.opened.page,
|
|
2868
|
+
secrets: this.secrets,
|
|
2869
|
+
requested
|
|
2870
|
+
}), undefined, signal);
|
|
2871
|
+
}
|
|
2872
|
+
async close(stopLoading = this.signal?.aborted === true) {
|
|
2873
|
+
let storageFailure;
|
|
2874
|
+
let policyFailure;
|
|
2875
|
+
let browserFailure;
|
|
2876
|
+
if (!this.#storageReleased) {
|
|
2877
|
+
try {
|
|
2878
|
+
await this.storage?.close(stopLoading);
|
|
2879
|
+
} catch (failure) {
|
|
2880
|
+
storageFailure = { cause: failure };
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
try {
|
|
2884
|
+
if (!this.opened.cleanup.browserClosed) await this.serviceWorkers?.close(stopLoading);
|
|
2885
|
+
} catch (failure) {
|
|
2886
|
+
policyFailure = { cause: failure };
|
|
2887
|
+
}
|
|
2888
|
+
if (policyFailure === undefined) {
|
|
2889
|
+
try {
|
|
2890
|
+
await this.opened.cleanup.close(() => this.eventCapture.finish());
|
|
2891
|
+
} catch (failure) {
|
|
2892
|
+
browserFailure = { cause: failure };
|
|
2893
|
+
}
|
|
2894
|
+
} else {
|
|
2895
|
+
try {
|
|
2896
|
+
await this.eventCapture.finish();
|
|
2897
|
+
} catch (failure) {
|
|
2898
|
+
browserFailure = { cause: failure };
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
if (this.opened.cleanup.browserClosed) this.#storageReleased = true;
|
|
2902
|
+
throwCleanupFailures([
|
|
2903
|
+
...policyFailure === undefined ? [] : [policyFailure.cause],
|
|
2904
|
+
...this.#storageReleased || storageFailure === undefined ? [] : [storageFailure.cause],
|
|
2905
|
+
...browserFailure === undefined ? [] : [browserFailure.cause]
|
|
2906
|
+
]);
|
|
2907
|
+
return this.mode === "launch" ? "terminated-owned-process" : "disconnected-external";
|
|
2908
|
+
}
|
|
2909
|
+
redactError(error) {
|
|
2910
|
+
return this.secrets.redact(error instanceof Error ? error.message : "browser action failed");
|
|
2911
|
+
}
|
|
2912
|
+
};
|
|
2913
|
+
})))();
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
//#endregion
|
|
2917
|
+
//#region dist/composition/browserScenario.js
|
|
2918
|
+
var createBrowserScenarioProvider;
|
|
2919
|
+
function init_browserScenario() {
|
|
2920
|
+
return (init_browserScenario = __esmMin((() => {
|
|
2921
|
+
init_PlaywrightBrowserScenarioProvider();
|
|
2922
|
+
init_PlaywrightScenarioSession();
|
|
2923
|
+
createBrowserScenarioProvider = (environment) => new PlaywrightBrowserScenarioProvider((scenario, options) => PlaywrightScenarioSession.open(scenario, environment, options));
|
|
2924
|
+
})))();
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
//#endregion
|
|
2928
|
+
init_browserScenario();
|
|
2929
|
+
export { createBrowserScenarioProvider };
|