rea-agents 6.5.0 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/bridge/android/ReaJadxBridge.java +167 -23
- package/bridge/cutter/rea_bridge.py +19 -10
- package/bridge/ghidra/ReaGhidraBridge.java +98 -66
- package/bridge/hopper_bridge.py +9 -1
- package/bridge/native/rea_lldb_tracer.py +48 -4
- package/bridge/pwndbg/core_context.py +15 -2
- package/dist/adb/AdbCommand.js +148 -0
- package/dist/adb/AdbConfiguration.js +26 -4
- package/dist/adb/AdbInputSnapshot.js +126 -0
- package/dist/adb/AdbProvider.js +765 -248
- package/dist/adb/AdbShellOutput.js +92 -21
- package/dist/android/AndroidTargetSnapshot.js +7 -7
- package/dist/android/JadxAnalysis.js +27 -32
- package/dist/android/JadxConfiguration.js +173 -125
- package/dist/android/JadxDoctor.js +11 -3
- package/dist/android/JadxFailure.js +154 -0
- package/dist/android/JadxInterruption.js +13 -0
- package/dist/android/JadxJavaProbe.js +246 -0
- package/dist/android/JadxMcpTransport.js +48 -15
- package/dist/android/JadxProtocol.js +29 -2
- package/dist/android/JadxProvider.js +171 -96
- package/dist/android/JadxRelease.js +5 -1
- package/dist/android/JadxSession.js +35 -14
- package/dist/apktool/ApktoolCommandCleanup.js +134 -0
- package/dist/apktool/ApktoolCommandOutput.js +22 -0
- package/dist/apktool/ApktoolConfiguration.js +162 -44
- package/dist/apktool/ApktoolDecodeOutput.js +29 -23
- package/dist/apktool/ApktoolDecodedInventory.js +52 -0
- package/dist/apktool/ApktoolProvider.js +254 -335
- package/dist/apktool/ApktoolStringTables.js +178 -0
- package/dist/apktool/ApktoolWorkspace.js +162 -0
- package/dist/application/AnalysisDocument.js +19 -4
- package/dist/application/AnalysisProvider.js +15 -1
- package/dist/application/AppBundleExecutable.js +11 -4
- package/dist/application/BinaryTargetResolver.js +9 -2
- package/dist/application/BrowserObservationService.js +54 -20
- package/dist/application/BrowserScenarioCaptureService.js +26 -6
- package/dist/application/CapabilityInventory.js +14 -8
- package/dist/application/ClaudeDesktopConfigLocation.js +5 -5
- package/dist/application/ClientConfigurationCleanup.js +73 -0
- package/dist/application/ClientConfigurationDocument.js +170 -128
- package/dist/application/ClientConfigurationPublication.js +167 -0
- package/dist/application/ClientRegistrationEnvironment.js +31 -1
- package/dist/application/ClientRegistrationIdentity.js +54 -39
- package/dist/application/ClientRegistrationStatus.js +123 -48
- package/dist/application/DirectAnalysis.js +15 -2
- package/dist/application/DirectAnalysisCleanup.js +5 -1
- package/dist/application/DirectAnalysisStatus.js +1 -1
- package/dist/application/Doctor.js +83 -9
- package/dist/application/DoctorDiagnostics.js +25 -4
- package/dist/application/DoctorProviderIds.js +7 -1
- package/dist/application/DshCordisPatch.js +1 -1
- package/dist/application/EnhancedTools.js +9 -21
- package/dist/application/HermesClientHome.js +20 -0
- package/dist/application/HermesConfigurationYaml.js +43 -3
- package/dist/application/HopperDownload.js +11 -3
- package/dist/application/HopperReleaseFeed.js +71 -0
- package/dist/application/InvestigationProviders.js +4 -3
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LinuxHopper.js +96 -71
- package/dist/application/LinuxHopperPublisher.js +656 -0
- package/dist/application/MacHopper.js +182 -66
- package/dist/application/MipsElfMetadata.js +1 -1
- package/dist/application/MsixPackageStorage.js +13 -6
- package/dist/application/ProviderOperationExecution.js +13 -20
- package/dist/application/ReconstructionObligationCandidates.js +17 -2
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +4 -0
- package/dist/application/ReconstructionObligationLedgerService.js +5 -3
- package/dist/application/ReconstructionObligationOriginalCases.js +8 -0
- package/dist/application/ReferenceSourceImportEntries.js +160 -18
- package/dist/application/ReferenceSourceImportPolicy.js +5 -3
- package/dist/application/ReferenceSourceVcsAdapter.js +3 -1
- package/dist/application/RegularFileRead.js +107 -88
- package/dist/application/Setup.js +23 -11
- package/dist/application/SetupClientConfiguration.js +155 -89
- package/dist/application/SetupClients.js +22 -13
- package/dist/application/SetupHost.js +90 -34
- package/dist/application/SetupInstallFailure.js +18 -3
- package/dist/application/SetupPlan.js +15 -5
- package/dist/application/SetupRecoveryBackup.js +40 -13
- package/dist/application/SetupRegistrationEnvironment.js +12 -0
- package/dist/application/SetupSkill.js +10 -30
- package/dist/application/SourceLimitations.js +35 -0
- package/dist/application/SupportedClients.js +4 -4
- package/dist/application/Uninstall.js +91 -36
- package/dist/application/UpdateCommandProgress.js +66 -0
- package/dist/application/UpdateMaintenance.js +7 -2
- package/dist/application/UpdateRuntime.js +60 -30
- package/dist/application/WebModuleTraceService.js +35 -22
- package/dist/application/WebNetworkCaptureService.js +8 -5
- package/dist/application/WebRuntimeService.js +41 -8
- package/dist/application/WebScriptExportService.js +6 -4
- package/dist/application/WebSourceLocationService.js +3 -4
- package/dist/application/WorkflowEvidence.js +11 -4
- package/dist/application/analysisView/AnalysisViewService.js +9 -52
- package/dist/application/android/AndroidAnalysisService.js +5 -4
- package/dist/application/android/AndroidSearchEvidenceSummary.js +6 -8
- package/dist/application/artifacts/ArtifactComparisonEvidence.js +32 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +14 -11
- package/dist/application/binary/AnalysisProviderRegistry.js +340 -50
- package/dist/application/binary/BinarySession.js +73 -34
- package/dist/application/binary/BinarySessionRecords.js +3 -0
- package/dist/application/binary/BinarySessionStatus.js +3 -4
- package/dist/application/binary/CompositeProvider.js +75 -30
- package/dist/application/binary/LazyAnalysisProvider.js +6 -68
- package/dist/application/binary/SessionProviderRouter.js +11 -2
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +3 -4
- package/dist/application/binaryDiagnostics/PeResourcesService.js +22 -5
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +3 -4
- package/dist/application/captures/PacketCaptureService.js +3 -2
- package/dist/application/closeOwnedWebResources.js +32 -2
- package/dist/application/electron/ElectronFuseService.js +8 -43
- package/dist/application/evm/EvmInterfaceEvidence.js +11 -0
- package/dist/application/evm/EvmInterfaceService.js +4 -15
- package/dist/application/firmware/FirmwareAnalysisService.js +4 -3
- package/dist/application/go/GoBinaryService.js +4 -5
- package/dist/application/investigation/EvidenceLedger.js +3 -4
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +14 -2
- package/dist/application/javascript/ElectronEvidence.js +1 -2
- package/dist/application/javascript/ElectronObservationService.js +41 -7
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +6 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +35 -17
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +30 -1
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +3 -2
- package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +3 -3
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +41 -11
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +18 -8
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +84 -24
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +15 -3
- package/dist/application/javascript/JavaScriptModuleRelationships.js +1 -1
- package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +1 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +33 -10
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +4 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +103 -24
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +13 -4
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +23 -3
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +18 -5
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +4 -6
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +5 -8
- package/dist/application/native/NativeCallRoutes.js +40 -23
- package/dist/application/native/NativeUiActionTrace.js +8 -0
- package/dist/application/native/NativeValueTrace.js +8 -0
- package/dist/application/reverse/ReverseEngineeringService.js +2 -2
- package/dist/application/rust/RustBinaryService.js +6 -4
- package/dist/application/signals/SignalRecordingService.js +3 -2
- package/dist/application/wasm/WasmArtifactService.js +4 -5
- package/dist/artifacts/AnalysisCleanupLease.js +119 -0
- package/dist/artifacts/ArtifactFileOperation.js +150 -0
- package/dist/artifacts/ArtifactHash.js +2 -1
- package/dist/artifacts/ArtifactProvider.js +16 -5
- package/dist/artifacts/ArtifactReader.js +50 -4
- package/dist/artifacts/ArtifactResourceScope.js +80 -6
- package/dist/artifacts/AsarArtifactReader.js +12 -11
- package/dist/artifacts/AsarEntryStream.js +49 -17
- package/dist/artifacts/DirectoryArtifactReader.js +28 -7
- package/dist/artifacts/MachOSliceArtifactReader.js +70 -13
- package/dist/artifacts/NativeDmgArtifactReader.js +112 -13
- package/dist/artifacts/SafeOutputTree.js +5 -3
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +1 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +10 -16
- package/dist/artifacts/ZipArtifactReader.js +34 -14
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +3 -1
- package/dist/artifacts/apple/DylibFileAccess.js +106 -0
- package/dist/artifacts/apple/DylibResolutionReader.js +64 -155
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +52 -9
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +25 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +20 -11
- package/dist/artifacts/apple/MachoLoadCommandReader.js +17 -2
- package/dist/artifacts/apple/PlistNumberLiterals.js +104 -116
- package/dist/artifacts/extraction/ArtifactExtraction.js +15 -12
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +9 -11
- package/dist/artifacts/inventory/ArtifactInventory.js +2 -2
- package/dist/artifacts/inventory/classify.js +4 -2
- package/dist/artifacts/inventory/hashStableRootArtifact.js +14 -7
- package/dist/artifacts/inventory/scanCanonical.js +3 -4
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +3 -1
- package/dist/artifacts/readArtifactFileChunks.js +9 -0
- package/dist/artifacts/readStableArtifact.js +12 -34
- package/dist/browser/BrowserScenarioPartialObservation.js +14 -48
- package/dist/browser/CdpBrowserProvider.js +81 -30
- package/dist/browser/CdpCaptureDocuments.js +99 -131
- package/dist/browser/CdpCaptureDomSvg.js +31 -60
- package/dist/browser/CdpCaptureValues.js +12 -0
- package/dist/browser/CdpConnection.js +133 -27
- package/dist/browser/CdpElectronInspection.js +60 -60
- package/dist/browser/CdpElectronProvider.js +56 -4
- package/dist/browser/CdpElectronScriptEvents.js +4 -1
- package/dist/browser/CdpElectronScripts.js +2 -5
- package/dist/browser/CdpElectronWorkers.js +13 -2
- package/dist/browser/CdpPageCapture.js +2 -1
- package/dist/browser/CdpPageCaptureScripts.js +14 -10
- package/dist/browser/CdpPageCaptureWorkers.js +45 -14
- package/dist/browser/CdpSafeMetadata.js +23 -19
- package/dist/browser/CdpSnapshotNodes.js +103 -0
- package/dist/browser/CdpSnapshotStrings.js +0 -6
- package/dist/browser/CdpTargetSession.js +52 -10
- package/dist/browser/CdpTargetSessionOwner.js +198 -0
- package/dist/browser/ElectronCaptureCleanup.js +82 -0
- package/dist/browser/ElectronProcessCleanup.js +91 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +71 -16
- package/dist/browser/PlaywrightElectronActiveActions.js +53 -5
- package/dist/browser/PlaywrightElectronActiveFuses.js +86 -0
- package/dist/browser/PlaywrightElectronActiveProjection.js +5 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +140 -151
- package/dist/browser/PlaywrightExecutionBoundary.js +4 -2
- package/dist/browser/PlaywrightScenarioBrowser.js +236 -90
- package/dist/browser/PlaywrightScenarioEvents.js +135 -48
- package/dist/browser/PlaywrightScenarioServiceWorkers.js +121 -34
- package/dist/browser/PlaywrightScenarioSession.js +95 -22
- package/dist/browser/PlaywrightScenarioStorage.js +15 -7
- package/dist/browser/StructuredFieldToken.js +53 -0
- package/dist/browser/WebArtifactCleanup.js +53 -0
- package/dist/browser/WebSourceMapFetcher.js +19 -10
- package/dist/browser/assets/WebArtifactReads.js +6 -2
- package/dist/browser/assets/WebSourceLocationArtifacts.js +12 -3
- package/dist/browser/execution/CdpRuntimeSession.js +36 -7
- package/dist/browser/execution/CdpWebRuntimeProvider.js +22 -4
- package/dist/browser/history/CaptureFailures.js +7 -2
- package/dist/browser/history/HarCapture.js +42 -11
- package/dist/browser/history/SazMetadata.js +10 -47
- package/dist/browser/modules/NativeModuleResolver.js +108 -58
- package/dist/browser/modules/WebModuleArtifacts.js +12 -3
- package/dist/browser/network/PlaywrightNetworkContent.js +40 -17
- package/dist/browser/network/PlaywrightScenarioNetwork.js +182 -73
- package/dist/captures/TsharkCaptureProvider.js +13 -6
- package/dist/catalogIdentity.js +19 -14
- package/dist/cli/adbCommands.js +18 -19
- package/dist/cli/androidCommands.js +2 -14
- package/dist/cli/apktoolCommands.js +4 -14
- package/dist/cli/binaryDiagnosticsCommands.js +5 -5
- package/dist/cli/browserAdvancedCommands.js +11 -4
- package/dist/cli/browserCommands.js +21 -12
- package/dist/cli/captureCommands.js +4 -4
- package/dist/cli/cliResultOutput.js +175 -89
- package/dist/cli/coreBinaryCommands.js +4 -3
- package/dist/cli/cutterCommands.js +51 -13
- package/dist/cli/electronCommands.js +34 -13
- package/dist/cli/evmCommands.js +6 -15
- package/dist/cli/finishAnalysisCommand.js +10 -2
- package/dist/cli/firmwareCommands.js +6 -14
- package/dist/cli/flutterCommands.js +2 -18
- package/dist/cli/fridaCommands.js +8 -0
- package/dist/cli/goCommands.js +2 -2
- package/dist/cli/javascriptRecoveryCommands.js +14 -26
- package/dist/cli/jebCommands.js +2 -14
- package/dist/cli/options.js +6 -0
- package/dist/cli/pcapCommands.js +2 -20
- package/dist/cli/rustCommands.js +6 -7
- package/dist/cli/setupCommands.js +4 -3
- package/dist/cli/signalCommands.js +4 -4
- package/dist/cli/sqliteCommands.js +17 -44
- package/dist/cli/wasmCommands.js +7 -18
- package/dist/cli/webModuleCommands.js +19 -34
- package/dist/cli/webNetworkCaptureCommands.js +3 -2
- package/dist/cli/webRuntimeCommands.js +15 -6
- package/dist/cli/webSourceLocationCommands.js +14 -33
- package/dist/cli-runtime/AnalysisCleanupLease-CWfTGYKd.js +103 -0
- package/dist/cli-runtime/{AnalysisProvider-D0Us2OTk.js → AnalysisProvider-BGrYaMVo.js} +14 -3
- package/dist/cli-runtime/{AnalysisSnapshotCache-BXS0wRd2.js → AnalysisSnapshotCache-BjRlXeUS.js} +14 -13
- package/dist/cli-runtime/ArtifactFileOperation-Dg4BcoEM.js +122 -0
- package/dist/cli-runtime/{ArtifactReader-BXkffc1D.js → ArtifactReader-DMwm42bk.js} +29 -6
- package/dist/cli-runtime/ArtifactResourceScope-CokZGcII.js +175 -0
- package/dist/cli-runtime/{AsarHeader-CnzOzYEH.js → AsarHeader-BxwU17DJ.js} +1 -1
- package/dist/cli-runtime/{BinarySessionStatus-DnMxMk-r.js → BinarySessionStatus-DRhjr7Vb.js} +4 -3
- package/dist/cli-runtime/{BinaryTargetResolver-CVIJ_s1A.js → BinaryTargetResolver-tuCTjBlQ.js} +38 -108
- package/dist/cli-runtime/{BoundedFileBytes-BU30odTm.js → BoundedFileBytes-DRtiQNAQ.js} +7 -3
- package/dist/cli-runtime/{CdpTargetSession-DGX5pV9w.js → CdpTargetSession-CQ08KHbh.js} +318 -43
- package/dist/cli-runtime/ClientConfigPath-Dn-V_GUf.js +255 -0
- package/dist/cli-runtime/{ClientConfigurationDocument-ffQ9X0Se.js → ClientConfigurationDocument-C9T8MNGc.js} +206 -142
- package/dist/cli-runtime/{ClientRegistrationStatus-DszCyPEU.js → ClientRegistrationStatus-PnD29RTX.js} +112 -36
- package/dist/cli-runtime/{CurrentEntrypointPath-D5FRNdkq.js → CurrentEntrypointPath-m7QCIVN0.js} +1 -1
- package/dist/cli-runtime/{DirectAnalysis-BgvAtpN3.js → DirectAnalysis-C5NyUryV.js} +76 -23
- package/dist/cli-runtime/DirectoryArtifactReader-CokAJ8vo.js +448 -0
- package/dist/cli-runtime/{Doctor-DIpf_I7N.js → Doctor-DrkWsav4.js} +105 -25
- package/dist/cli-runtime/{ElectronFileScope-dpHm2nrS.js → ElectronFileScope-AP7VoVr7.js} +204 -149
- package/dist/cli-runtime/ElectronFuseFailures-DsjXR7Xp.js +609 -0
- package/dist/cli-runtime/{ExecFileOutput-BEQs-lDD.js → ExecFileOutput-D6KLYTve.js} +11 -9
- package/dist/cli-runtime/{InterfaceBuilderDecodeBudget-D4omRUe4.js → InterfaceBuilderDecodeBudget-CW1IO3dG.js} +40 -21
- package/dist/cli-runtime/{InventoryProjectionEvidence-DIsI4DJ6.js → InventoryProjectionEvidence-DTH5QAqL.js} +3 -3
- package/dist/cli-runtime/{InvestigationProviders-DoQRIHii.js → InvestigationProviders-CFh4a64d.js} +3 -2
- package/dist/cli-runtime/{JavaScriptApplicationEvidenceGraph-D5aI_FSJ.js → JavaScriptApplicationEvidenceGraph-gOmPB2L6.js} +6 -6
- package/dist/cli-runtime/{JavaScriptApplicationWorkflowEvidence-Bz4-V0Ct.js → JavaScriptApplicationWorkflowEvidence-WZgtK_Ok.js} +2 -2
- package/dist/cli-runtime/JebMcpEndpoint-BEalGZh9.js +710 -0
- package/dist/cli-runtime/{JsonFiles-DQa1PRKy.js → JsonFiles-uvd6ZyQi.js} +10 -118
- package/dist/cli-runtime/KunaInstallation-P0j3x851.js +1781 -0
- package/dist/cli-runtime/MacHopperPaths-bGzqjF1Z.js +34 -0
- package/dist/cli-runtime/{MachoLoadCommandReader-C7e074Ze.js → MachoLoadCommandReader-CZm6N5vF.js} +12 -192
- package/dist/cli-runtime/{ManagedSnapshot-rqyBHcdL.js → ManagedSnapshot-CPE9C3OD.js} +406 -110
- package/dist/cli-runtime/OwnedCommandCleanup-BN_V6Erc.js +187 -0
- package/dist/cli-runtime/OwnedRegularFile-D1f5nUCx.js +256 -0
- package/dist/cli-runtime/OwnedStagedOutput-D31dOozz.js +126 -0
- package/dist/cli-runtime/{PrivateRuntimeRoot-DAy0PiBM.js → PrivateRuntimeRoot-Cd23u6jd.js} +39 -6
- package/dist/cli-runtime/ProcessOwnership-CtrNr6ee.js +545 -0
- package/dist/cli-runtime/{ProcessOwnership-DXC5-UWt.js → ProcessOwnershipObservation-C006iCtZ.js} +149 -607
- package/dist/cli-runtime/{ProviderDeadline-8m2pFRDc.js → ProviderDeadline-rSuH4Pm8.js} +27 -1
- package/dist/cli-runtime/ProviderOperationExecution-CmU-XrQr.js +38 -0
- package/dist/cli-runtime/{snapshotEnvironment-D_tWyOub.js → ProviderProcess-D87A7ctp.js} +117 -160
- package/dist/cli-runtime/RegularFileRead-mbgGYtxe.js +125 -0
- package/dist/cli-runtime/{SafeOutputTree-D6U15GXd.js → SafeOutputTree-i904hd_2.js} +21 -20
- package/dist/cli-runtime/{SetupHost-FkYWswsq.js → SetupHost-CMPmPraB.js} +365 -195
- package/dist/cli-runtime/SharedStartupAttempt-BxKyf3Uv.js +1424 -0
- package/dist/cli-runtime/StableFileHash-Ame_h3lY.js +61 -0
- package/dist/cli-runtime/{SupportedClients-DaX6Lt2d.js → SupportedClients-DMafjitv.js} +89 -72
- package/dist/cli-runtime/{Update-CbTC_eg1.js → Update-DAsASWlE.js} +1 -1
- package/dist/cli-runtime/{AbortablePromise-BVBemxbD.js → WindowsBatchCommand-Cx9kaVNf.js} +2 -28
- package/dist/cli-runtime/WindowsNativeLoader-BqyZO0ZD.js +142 -0
- package/dist/cli-runtime/{ZipArtifactReader-B8ZgNe4D.js → ZipArtifactReader-Jed69LEL.js} +20 -16
- package/dist/cli-runtime/{analysisErrorCleanup-Do6YeeoD.js → analysisErrorCleanup-COdAmDsb.js} +4 -3
- package/dist/cli-runtime/{appleArchiveFormat-tVoI2ykA.js → appleArchiveFormat-Bb3G5CCI.js} +13 -7
- package/dist/cli-runtime/{application__DirectAnalysisStatus-DpOejOf0.js → application__DirectAnalysisStatus-F74bu9oy.js} +10 -10
- package/dist/cli-runtime/{application__EnhancedTools-oFE2bOjs.js → application__EnhancedTools-Bg51b0Yp.js} +84 -51
- package/dist/cli-runtime/{application__FunctionAnalysisEvidence-B6osuhvW.js → application__FunctionAnalysisEvidence-DBWIaYCh.js} +3 -3
- package/dist/cli-runtime/{application__ReconstructionCoverageService-DN3wTFQj.js → application__ReconstructionCoverageService-AEPNpZqJ.js} +3 -3
- package/dist/cli-runtime/{application__ReconstructionObligationLedgerService-CKcTppX9.js → application__ReconstructionObligationLedgerService-Cl9cPEZf.js} +22 -9
- package/dist/cli-runtime/{application__Setup-XpMaRNjy.js → application__Setup-DwQzEewK.js} +30 -18
- package/dist/cli-runtime/{application__Uninstall-_23pU2yB.js → application__Uninstall-BOf9oyvQ.js} +78 -37
- package/dist/cli-runtime/{application__UpdateRuntime-DPvY8ohd.js → application__UpdateRuntime-CzWkRJHa.js} +119 -29
- package/dist/cli-runtime/{application__android__AndroidApplicationService-CFgIFPM4.js → application__android__AndroidApplicationService-shW_aKlj.js} +3 -3
- package/dist/cli-runtime/{application__apple__AppleApplicationService-Db6QCsun.js → application__apple__AppleApplicationService-DIv6d3wB.js} +3 -3
- package/dist/cli-runtime/{application__harmony__HarmonyApplicationService-CFjocHoK.js → application__harmony__HarmonyApplicationService-OIUFVQFV.js} +3 -3
- package/dist/cli-runtime/{application__javascript__ElectronActiveObservationService-CmVDUI_Z.js → application__javascript__ElectronActiveObservationService-wvCh72hK.js} +3 -3
- package/dist/cli-runtime/application__javascript__ElectronObservationService-SydXPCwM.js +88 -0
- package/dist/cli-runtime/{application__javascript__JavaScriptApplicationService-CCkp8KBh.js → application__javascript__JavaScriptApplicationService-o0uEsjEc.js} +1120 -316
- package/dist/cli-runtime/{application__javascript__JavaScriptApplicationWorkflowService-lPy0tzr3.js → application__javascript__JavaScriptApplicationWorkflowService-BAheG_71.js} +51 -44
- package/dist/cli-runtime/{application__javascript__JavaScriptRuntimeReconciliationService-DWleA8K9.js → application__javascript__JavaScriptRuntimeReconciliationService-Cnn4GP8q.js} +5 -5
- package/dist/cli-runtime/{application__javascript__JavaScriptSemanticTraceService-DkALH4rL.js → application__javascript__JavaScriptSemanticTraceService-CmvLfV1A.js} +6 -6
- package/dist/cli-runtime/{artifacts__ArtifactProvider-zXI0QjSL.js → artifacts__ArtifactProvider-wx2K0F2I.js} +377 -359
- package/dist/cli-runtime/{binary-BVOr2mgE.js → binary-CWVNJhAC.js} +8561 -3159
- package/dist/cli-runtime/{catalogIdentity-DLoXgfIR.js → catalogIdentity-DAEEsOdX.js} +260 -81
- package/dist/cli-runtime/cli.js +6177 -3556
- package/dist/cli-runtime/{cliOutput-BC1BdAcB.js → cliOutput-CgSuw782.js} +47 -6
- package/dist/cli-runtime/cliOutput.js +2 -2
- package/dist/cli-runtime/cliResultOutput-10sd6xGx.js +1453 -0
- package/dist/cli-runtime/cliResultOutput.js +2 -1
- package/dist/cli-runtime/{composition__browserScenario-DHXC1a8n.js → composition__browserScenario-BtPb1c1y.js} +843 -356
- package/dist/cli-runtime/{composition__electronObservation-GecK2EID.js → composition__electronObservation-Bk8R6DJo.js} +128 -69
- package/dist/cli-runtime/{composition__electronScenario-CEZnVrAL.js → composition__electronScenario-BVF0qStH.js} +398 -135
- package/dist/cli-runtime/{cutterToolContracts-TZH9EHr5.js → cutterToolContracts-BQtG_Nzo.js} +195 -62
- package/dist/cli-runtime/{doctorRuntime-BE5ZX8it.js → doctorRuntime-B__SIpm-.js} +241 -21
- package/dist/cli-runtime/{dotnet__ManagedStaticProvider-C8_yZCDc.js → dotnet__ManagedStaticProvider-DO5Yzcp4.js} +1 -1
- package/dist/cli-runtime/{errorSchemas-CTRmvMl3.js → errorSchemas-Ixz_q7qt.js} +58 -4
- package/dist/cli-runtime/homeDirectory-DC_DeJIg.js +18 -0
- package/dist/cli-runtime/{javascriptApplicationAnalysis-HgMzVMQw.js → javascriptApplicationAnalysis-Dk6yBV8g.js} +688 -668
- package/dist/cli-runtime/{javascriptExportReturnShapeProjection-Dg00g35t.js → javascriptExportReturnShapeProjection-CObOIiQ6.js} +3 -3
- package/dist/cli-runtime/{javascriptExportShapeComparisonSchemas-BYnoIqIk.js → javascriptExportShapeComparisonSchemas-DpwuBenh.js} +5 -3
- package/dist/cli-runtime/{javascriptRuntimeReconciliation-DNjDoL3S.js → javascriptRuntimeReconciliation-C6ZgWMys.js} +61 -59
- package/dist/cli-runtime/{javascriptRuntimeReconciliationSchemas-BWpGWNcI.js → javascriptRuntimeReconciliationSchemas-D6tZKUQs.js} +2 -2
- package/dist/cli-runtime/{javascriptSemanticTraceSchemas-BTCNcvbc.js → javascriptSemanticTraceSchemas-C7m0b6_w.js} +3 -3
- package/dist/cli-runtime/{lipo-DSWP6fv-.js → lipo-DPQ6qurH.js} +9 -11
- package/dist/cli-runtime/{logger-CQQCI4a2.js → logger-BuDJ9xxO.js} +2 -2
- package/dist/cli-runtime/{machoContainer-C8BIkkq3.js → machoContainer-Cy98bkFm.js} +180 -0
- package/dist/cli-runtime/{managedApplicationGraph-B08jb3jq.js → managedApplicationGraph-BazVqpJv.js} +16 -10
- package/dist/cli-runtime/{managedToolContracts-D60QmIYj.js → managedToolContracts-BuFkMBH5.js} +2 -2
- package/dist/cli-runtime/mcpDoctor.js +8 -6
- package/dist/cli-runtime/mcpStartupPolicy-imCbM3qo.js +28 -0
- package/dist/cli-runtime/{native__NativeMacOSProvider-YBTvUeJO.js → native__NativeMacOSProvider-DTcRhuGA.js} +1384 -757
- package/dist/cli-runtime/{officialToolContracts-CCFF0an9.js → officialToolContracts-CzzVLx8I.js} +74 -53
- package/dist/cli-runtime/peMachine-B9ggfSJJ.js +95 -0
- package/dist/cli-runtime/propertyListKeys-D5dSASEy.js +355 -0
- package/dist/cli-runtime/{providerCleanupError-Ceq8f0wK.js → providerCleanupError-BhsJyAhk.js} +3 -5
- package/dist/cli-runtime/readArtifactFileChunks-BbTL_PtB.js +129 -0
- package/dist/cli-runtime/{reconstructionObligationLedgerSchemas-Bao0xMr-.js → reconstructionObligationLedgerSchemas-Bi6sect1.js} +6329 -3651
- package/dist/cli-runtime/{scanCanonical-KP4T9jSl.js → scanCanonical-CcDFUr-w.js} +233 -363
- package/dist/cli-runtime/snapshotEnvironment-Yvx5qwsl.js +196 -0
- package/dist/cli-runtime/{toolContracts-D2FOG_Nb.js → toolContracts-CJzEyZ38.js} +126 -52
- package/dist/cli-runtime/{toolOutputSchemaGroups-DRiYs1je.js → toolOutputSchemaGroups-BqdSzySu.js} +768 -589
- package/dist/cli-runtime/{workflowInputError-n8Oo-bLA.js → workflowInputError-BP8z9Wxl.js} +2 -2
- package/dist/cli.js +10 -0
- package/dist/cliBrowserScenarioCommands.js +2 -3
- package/dist/cliLogging.js +22 -7
- package/dist/cliObservationOptions.js +3 -0
- package/dist/cliOutput.js +68 -3
- package/dist/composition/binary.js +15 -2
- package/dist/composition/directAnalysis.js +8 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +4 -5
- package/dist/composition/jeb.js +32 -21
- package/dist/config/environment.js +36 -2
- package/dist/config/mcpInputSchemaProfile.js +1 -1
- package/dist/config/parseConfig.js +7 -3
- package/dist/contracts/adb/adbToolContracts.js +2 -2
- package/dist/contracts/analysisViewApiSurfaceExample.js +4 -4
- package/dist/contracts/analysisViewToolContracts.js +42 -1
- package/dist/contracts/android/androidToolContracts.js +1 -1
- package/dist/contracts/apktool/apktoolToolContracts.js +5 -1
- package/dist/contracts/artifactComparisonExample.js +18 -14
- package/dist/contracts/artifactToolContracts.js +2 -1
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +12 -1
- package/dist/contracts/compactInputSchema.js +13 -6
- package/dist/contracts/fridaToolContracts.js +5 -4
- package/dist/contracts/gdbToolContracts.js +2 -3
- package/dist/contracts/inputSchemaPresentation.js +173 -79
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +1 -0
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +1 -0
- package/dist/contracts/jsonSchemaKeywords.js +29 -0
- package/dist/contracts/managed/managedWorkflowExamples.js +3 -0
- package/dist/contracts/managed/managedWorkflowToolContracts.js +1 -1
- package/dist/contracts/mobileApplicationGraphExamples.js +15 -12
- package/dist/contracts/officialToolContracts.js +2 -2
- package/dist/contracts/rizinDebugToolContracts.js +3 -2
- package/dist/contracts/sessionToolContracts.js +3 -3
- package/dist/contracts/toolEffects.js +6 -2
- package/dist/contracts/toolOutputSchemaGroups.js +7 -4
- package/dist/contracts/toolOutputSchemaPrimitives.js +7 -0
- package/dist/contracts/toolSchemaMetadata.js +99 -27
- package/dist/cutter/CutterBridgeClient.js +206 -67
- package/dist/cutter/CutterBridgeService.js +52 -4
- package/dist/doctorRuntime.js +25 -4
- package/dist/domain/adb/adbDeviceAnalysis.js +19 -1
- package/dist/domain/analysisErrorBase.js +59 -2
- package/dist/domain/analysisErrorCleanup.js +3 -1
- package/dist/domain/analysisErrorCore.js +13 -0
- package/dist/domain/analysisErrorPresentation.js +23 -4
- package/dist/domain/analysisErrorProjection.js +44 -28
- package/dist/domain/analysisSearch.js +26 -0
- package/dist/domain/analysisSnapshot.js +11 -11
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +4 -65
- package/dist/domain/analysisView/analysisView.js +25 -0
- package/dist/domain/analysisView/analysisViewDataAdmission.js +86 -0
- package/dist/domain/analysisView/artifactInventoryView.js +4 -18
- package/dist/domain/analysisView/javascriptApplicationCoverage.js +27 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +100 -27
- package/dist/domain/analysisView/javascriptFactsView.js +92 -0
- package/dist/domain/analysisView/javascriptModuleReferences.js +37 -0
- package/dist/domain/analysisView/managedMemberView.js +6 -0
- package/dist/domain/android/androidApplication.js +8 -7
- package/dist/domain/apktool/apktoolResourceAnalysis.js +52 -2
- package/dist/domain/apple/appleApplication.js +41 -60
- package/dist/domain/apple/appleBundleAnatomy.js +56 -68
- package/dist/domain/apple/dylibResolution.js +5 -1
- package/dist/domain/apple/interfaceBuilderGraph.js +29 -8
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +11 -4
- package/dist/domain/apple/jvmClassFile.js +226 -0
- package/dist/domain/apple/keyedArchive.js +39 -17
- package/dist/domain/apple/machoContainer.js +3 -0
- package/dist/domain/apple/plistNumbers.js +67 -5
- package/dist/domain/apple/plistValue.js +89 -18
- package/dist/domain/artifactComparison.js +7 -5
- package/dist/domain/artifactGraph.js +4 -12
- package/dist/domain/artifactInspection.js +6 -17
- package/dist/domain/artifactInventoryEvidence.js +68 -60
- package/dist/domain/binaryTarget.js +11 -26
- package/dist/domain/binaryTargetTypes.js +10 -0
- package/dist/domain/browserNetworkEvidence.js +20 -3
- package/dist/domain/browserObservation.js +5 -28
- package/dist/domain/browserObservationError.js +4 -4
- package/dist/domain/browserScenarioCapture.js +11 -2
- package/dist/domain/browserScenarioCaptureLimits.js +34 -0
- package/dist/domain/browserScenarioCaptureValues.js +50 -0
- package/dist/domain/browserScenarioDiffEvidence.js +1 -3
- package/dist/domain/browserScenarioValues.js +5 -1
- package/dist/domain/captures/packetCapture.js +2 -1
- package/dist/domain/dosMz.js +14 -5
- package/dist/domain/electron/electronFuseEvidence.js +42 -0
- package/dist/domain/elfFixedHeader.js +24 -0
- package/dist/domain/evidence.js +7 -6
- package/dist/domain/evidenceBundle.js +9 -2
- package/dist/domain/explicitSensitiveFailure.js +3 -0
- package/dist/domain/fileSnapshotObservation.js +25 -0
- package/dist/domain/fixedTupleSchema.js +9 -0
- package/dist/domain/functionCallCoverage.js +6 -6
- package/dist/domain/functionComparisonDimensions.js +38 -11
- package/dist/domain/functionComparisonNormalization.js +17 -9
- package/dist/domain/functionDossierEvidence.js +4 -3
- package/dist/domain/harmony/harmonyApplication.js +8 -8
- package/dist/domain/hopperErrors.js +4 -2
- package/dist/domain/hopperValues.js +27 -4
- package/dist/domain/javascript/electronActiveObservation.js +1 -0
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +80 -20
- package/dist/domain/javascript/electronStaticAnalysisValues.js +0 -20
- package/dist/domain/javascript/electronStaticOptionObjects.js +45 -0
- package/dist/domain/javascript/electronWrappedCallPaths.js +70 -17
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +20 -4
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -0
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +3 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +3 -1
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +49 -21
- package/dist/domain/javascript/javascriptAstFingerprint.js +41 -10
- package/dist/domain/javascript/javascriptAstValues.js +83 -5
- package/dist/domain/javascript/javascriptBundledRequireOrigin.js +23 -36
- package/dist/domain/javascript/javascriptCommonJsExportReceivers.js +231 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +14 -4
- package/dist/domain/javascript/javascriptFeatureSeed.js +1 -1
- package/dist/domain/javascript/javascriptGraphqlOperations.js +382 -0
- package/dist/domain/javascript/javascriptModuleDeclaration.js +20 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +7 -11
- package/dist/domain/javascript/javascriptRpcEndpoints.js +7 -171
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +9 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +35 -12
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +50 -45
- package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +284 -24
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +452 -182
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +37 -20
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +55 -27
- package/dist/domain/javascript/javascriptSemanticCalls.js +4 -4
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +134 -50
- package/dist/domain/javascript/javascriptSemanticCoverage.js +5 -1
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -13
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +33 -10
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +1 -1
- package/dist/domain/javascript/javascriptSemanticEvaluationOrder.js +126 -0
- package/dist/domain/javascript/javascriptSemanticExpressionShapes.js +111 -0
- package/dist/domain/javascript/javascriptSemanticGetterQueries.js +147 -0
- package/dist/domain/javascript/javascriptSemanticGetterResults.js +264 -0
- package/dist/domain/javascript/javascriptSemanticGraph.js +18 -1
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +13 -0
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +3 -2
- package/dist/domain/javascript/javascriptSemanticMapOperations.js +51 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +215 -81
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +395 -118
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +241 -328
- package/dist/domain/javascript/javascriptSemanticObjects.js +33 -27
- package/dist/domain/javascript/javascriptSemanticOpaqueEffects.js +163 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +11 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +44 -67
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +2 -1
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +1 -1
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +45 -7
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +3 -19
- package/dist/domain/javascript/javascriptSemanticResources.js +27 -4
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +78 -37
- package/dist/domain/javascript/javascriptSemanticReturns.js +2 -2
- package/dist/domain/javascript/javascriptSemanticState.js +191 -42
- package/dist/domain/javascript/javascriptSemanticValues.js +167 -41
- package/dist/domain/javascript/javascriptSourceParser.js +54 -9
- package/dist/domain/javascript/javascriptStaticAnalysis.js +24 -13
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +276 -16
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +33 -25
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +3 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +1 -1
- package/dist/domain/javascript/javascriptSymbolicBindings.js +424 -142
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +4 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +12 -1
- package/dist/domain/javascript/sourceToBundleSignals.js +3 -0
- package/dist/domain/managed/managedApplicationGraphNodes.js +14 -9
- package/dist/domain/managed/managedArtifact.js +26 -0
- package/dist/domain/managed/managedMemberComparison.js +3 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +14 -1
- package/dist/domain/managed/managedMemberComparisonItems.js +124 -52
- package/dist/domain/managed/managedMemberComparisonMatch.js +76 -72
- package/dist/domain/managed/managedMemberSignatureIdentity.js +40 -0
- package/dist/domain/managed/managedNativeVerificationMatch.js +5 -5
- package/dist/domain/managed/managedNativeVerificationSchemas.js +2 -2
- package/dist/domain/mobileApplicationGraphProjection.js +33 -18
- package/dist/domain/native/bytePattern.js +21 -0
- package/dist/domain/native/nativeAotPe.js +29 -2
- package/dist/domain/native/nativeAotSnapshotObservation.js +18 -0
- package/dist/domain/native/nativeCallPartialObservation.js +14 -12
- package/dist/domain/native/nativeLoadImage.js +13 -0
- package/dist/domain/native/objcSwiftMetadata.js +15 -8
- package/dist/domain/native/peResources.js +6 -2
- package/dist/domain/peMachine.js +2 -0
- package/dist/domain/process/processComparison.js +3 -3
- package/dist/domain/process/processTraceDimensionProjection.js +1 -1
- package/dist/domain/process/processTraceEvaluation.js +65 -24
- package/dist/domain/propertyListKeys.js +84 -69
- package/dist/domain/propertyListXml.js +149 -0
- package/dist/domain/providerAdapterError.js +2 -0
- package/dist/domain/providerCleanupError.js +2 -4
- package/dist/domain/rawBinary.js +11 -2
- package/dist/domain/reconstructionCoverage.js +35 -23
- package/dist/domain/reconstructionCoverageEvaluation.js +36 -36
- package/dist/domain/reconstructionCoverageEvidence.js +26 -0
- package/dist/domain/reconstructionVerification.js +40 -26
- package/dist/domain/referenceSourceImportParsing.js +4 -0
- package/dist/domain/referenceSourcePathIdentity.js +2 -0
- package/dist/domain/referenceSourceRequireBindings.js +40 -101
- package/dist/domain/relationshipCoverage.js +4 -5
- package/dist/domain/sqlite/sqliteDatabase.js +2 -1
- package/dist/domain/symbolAnalysis.js +9 -8
- package/dist/domain/webBundleAnalyzerInspection.js +65 -25
- package/dist/domain/webCaptureDiff.js +124 -41
- package/dist/domain/webInventory.js +28 -14
- package/dist/domain/webModuleTrace.js +22 -0
- package/dist/domain/webScriptExportError.js +2 -3
- package/dist/domain/xmlDocument.js +41 -0
- package/dist/domain/zipPackageFormat.js +0 -4
- package/dist/dotnet/ManagedArtifactInspector.js +2 -4
- package/dist/dotnet/ManagedDecodeBudget.js +21 -1
- package/dist/dotnet/ManagedMemberInspector.js +31 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +63 -12
- package/dist/dotnet/ManagedMemberRows.js +8 -8
- package/dist/dotnet/ManagedMetadataHeaps.js +0 -1
- package/dist/dotnet/ManagedMetadataLayout.js +17 -15
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +20 -19
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +7 -8
- package/dist/dotnet/ManagedPeReader.js +5 -0
- package/dist/dotnet/ManagedSnapshot.js +25 -20
- package/dist/dotnet/ManagedTypeNameDigests.js +177 -0
- package/dist/dotnet/ManagedTypeNames.js +6 -46
- package/dist/dotnet/ManagedTypeNesting.js +25 -0
- package/dist/dotnet/ManagedTypeReferences.js +94 -0
- package/dist/electron/ElectronFuseFailures.js +105 -0
- package/dist/electron/ElectronFusePath.js +4 -3
- package/dist/electron/ElectronFuseProvider.js +67 -92
- package/dist/electron/ElectronFuseReader.js +46 -30
- package/dist/evm/EvmoleFailures.js +1 -0
- package/dist/evm/EvmoleInterfaceProvider.js +13 -16
- package/dist/filesystem/OwnedRegularFile.js +116 -0
- package/dist/filesystem/OwnedStagedOutput.js +28 -11
- package/dist/filesystem/RegularFile.js +20 -8
- package/dist/filesystem/StableFileHash.js +56 -38
- package/dist/filesystem/callerPath.js +26 -0
- package/dist/filesystem/readFileHandleChunks.js +55 -5
- package/dist/filesystem/readStableFileBytes.js +85 -0
- package/dist/firmware/FirmwareCommand.js +13 -7
- package/dist/firmware/FirmwareFailures.js +56 -0
- package/dist/firmware/FirmwareFiles.js +128 -98
- package/dist/firmware/FirmwareProvider.js +120 -65
- package/dist/firmware/FirmwarePublication.js +26 -11
- package/dist/flutter/DartElf.js +27 -0
- package/dist/flutter/FlutterBuildProvider.js +44 -4
- package/dist/gdb/GdbSessionManager.js +202 -14
- package/dist/generatedPackageMetadata.js +1 -1
- package/dist/ghidra/GhidraAnalysisProfile.js +24 -10
- package/dist/ghidra/GhidraAnalysisSeeds.js +39 -55
- package/dist/ghidra/GhidraBridgeSources.js +12 -0
- package/dist/ghidra/GhidraClient.js +362 -148
- package/dist/ghidra/GhidraClientStartup.js +5 -3
- package/dist/ghidra/GhidraClientWire.js +5 -2
- package/dist/ghidra/GhidraDiagnostics.js +16 -5
- package/dist/ghidra/GhidraDoctor.js +45 -14
- package/dist/ghidra/GhidraDosSnapshot.js +83 -0
- package/dist/ghidra/GhidraExecutableHeader.js +54 -0
- package/dist/ghidra/GhidraFileArtifacts.js +93 -0
- package/dist/ghidra/GhidraFunctionValues.js +1 -0
- package/dist/ghidra/GhidraInstallation.js +143 -142
- package/dist/ghidra/GhidraInstallationPolicy.js +20 -79
- package/dist/ghidra/GhidraInstallationProperties.js +57 -0
- package/dist/ghidra/GhidraInventoryValues.js +22 -6
- package/dist/ghidra/GhidraJavaLaunch.js +11 -4
- package/dist/ghidra/GhidraJavaProbe.js +267 -0
- package/dist/ghidra/GhidraJavaProperties.js +9 -7
- package/dist/ghidra/GhidraLanguageCatalog.js +12 -7
- package/dist/ghidra/GhidraLauncher.js +128 -65
- package/dist/ghidra/GhidraLoadImageAttest.js +75 -78
- package/dist/ghidra/GhidraLoadImageValues.js +39 -29
- package/dist/ghidra/GhidraMipsProfile.js +13 -5
- package/dist/ghidra/GhidraNativeAotSnapshotOwner.js +221 -0
- package/dist/ghidra/GhidraPeProfile.js +88 -18
- package/dist/ghidra/GhidraProvider.js +219 -32
- package/dist/ghidra/GhidraProviderCapabilities.js +17 -4
- package/dist/ghidra/GhidraProviderClient.js +199 -239
- package/dist/ghidra/GhidraPspExtension.js +104 -34
- package/dist/ghidra/GhidraPspProfile.js +4 -1
- package/dist/ghidra/GhidraRawBinaryLanguage.js +13 -4
- package/dist/ghidra/GhidraReleasePolicy.js +93 -0
- package/dist/ghidra/GhidraRequestQueue.js +64 -40
- package/dist/ghidra/GhidraSessionError.js +152 -19
- package/dist/ghidra/GhidraSessionValues.js +13 -3
- package/dist/ghidra/GhidraSocketConnection.js +25 -11
- package/dist/ghidra/GhidraTargetSnapshot.js +67 -50
- package/dist/ghidra/GhidraTransport.js +86 -63
- package/dist/ghidra/extensions/GhidraExtensions.js +30 -45
- package/dist/go/GoBinaryProvider.js +89 -60
- package/dist/go/GoElfImage.js +3 -3
- package/dist/hopper/BridgeLauncher.js +43 -4
- package/dist/hopper/HopperAnalysisProfile.js +4 -2
- package/dist/hopper/HopperCleanup.js +14 -1
- package/dist/hopper/HopperClient.js +135 -63
- package/dist/hopper/HopperProvider.js +4 -7
- package/dist/hopper/HopperProviderCapabilities.js +2 -1
- package/dist/hopper/HopperRegexSearch.js +21 -60
- package/dist/ida/IdaBusyHealth.js +36 -2
- package/dist/ida/IdaMcpConnection.js +17 -11
- package/dist/ida/IdaNativeProtocol.js +1 -9
- package/dist/ida/IdaOperationRunner.js +8 -26
- package/dist/ida/IdaProtocolValues.js +2 -1
- package/dist/ida/IdaProvider.js +18 -2
- package/dist/ida/IdaSessionClient.js +54 -12
- package/dist/inspector/V8InspectorCaptureProjection.js +7 -0
- package/dist/inspector/V8InspectorProvider.js +2 -0
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +25 -4
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +4 -3
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +3 -2
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +7 -1
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +1 -1
- package/dist/javascript/recovery/RecoveryFiles.js +57 -8
- package/dist/jeb/JebMcpConnection.js +129 -70
- package/dist/jeb/JebMcpConnectionOwner.js +116 -0
- package/dist/jeb/JebMcpDeadline.js +46 -0
- package/dist/jeb/JebProvider.js +77 -51
- package/dist/kuna/KunaAddress.js +11 -0
- package/dist/kuna/KunaCommand.js +217 -0
- package/dist/kuna/KunaConfiguration.js +90 -0
- package/dist/kuna/KunaDoctor.js +198 -0
- package/dist/kuna/KunaInstallation.js +137 -0
- package/dist/kuna/KunaJson.js +23 -0
- package/dist/kuna/KunaJsonStream.js +433 -0
- package/dist/kuna/KunaLimits.js +5 -0
- package/dist/kuna/KunaProjectCache.js +804 -0
- package/dist/kuna/KunaProjectExport.js +202 -0
- package/dist/kuna/KunaProjectFiles.js +191 -0
- package/dist/kuna/KunaProjectReader.js +115 -0
- package/dist/kuna/KunaProvider.js +217 -0
- package/dist/kuna/KunaProviderCapabilities.js +102 -0
- package/dist/kuna/KunaQueryErrors.js +12 -0
- package/dist/kuna/KunaQueryWork.js +113 -0
- package/dist/kuna/KunaReferenceFiles.js +258 -0
- package/dist/kuna/KunaReferenceQueries.js +211 -0
- package/dist/kuna/KunaRelease.js +10 -0
- package/dist/kuna/KunaRunSlots.js +56 -0
- package/dist/kuna/KunaSessionClient.js +1162 -0
- package/dist/kuna/KunaStringInventory.js +145 -0
- package/dist/kuna/KunaStringQueries.js +133 -0
- package/dist/kuna/KunaTargetCommands.js +205 -0
- package/dist/kuna/KunaUnavailable.js +11 -0
- package/dist/main/processShutdown.js +17 -0
- package/dist/main/transport.js +21 -1
- package/dist/main.js +2 -12
- package/dist/mcp/AnalysisProvider-BABWbLoM.js +38 -0
- package/dist/mcp/{AnalysisSnapshotFiles-BAbiJQOc.js → AnalysisSnapshotFiles-BXz0c37-.js} +39 -28
- package/dist/mcp/{ProcessOwnership-Bl_3ejLe.js → ArtifactFileOperation-64cQKI7B.js} +274 -72
- package/dist/mcp/{ArtifactProvider-DViCU_rn.js → ArtifactProvider-Dx6pmil1.js} +371 -354
- package/dist/mcp/ArtifactProviderMetadata-UCJr2oZW.js +167 -0
- package/dist/mcp/{ArtifactReader-OyM03Gjn.js → ArtifactReader-BrnwNaKY.js} +29 -6
- package/dist/mcp/ArtifactResourceScope-zi3Dkqzy.js +175 -0
- package/dist/mcp/{AsarHeader-WsPgoooH.js → AsarHeader-B_IbppTz.js} +1 -1
- package/dist/mcp/{BinarySessionStatus-B4P9gf-S.js → BinarySessionStatus-CZ9nnXMt.js} +5 -4
- package/dist/mcp/{BinaryTargetResolver-BMaE_0H1.js → BinaryTargetResolver-BUncASDP.js} +146 -215
- package/dist/mcp/BoundedFileBytes-DYt5q9G2.js +43 -0
- package/dist/mcp/{CdpCaptureDocuments-HDiF2O7k.js → CdpCaptureDocuments-Y2uFcBpl.js} +194 -145
- package/dist/mcp/{CdpCaptureValues-M-j6CIh1.js → CdpCaptureValues-tNIg-gQK.js} +12 -5
- package/dist/mcp/{CdpConnection-BpDfz4MK.js → CdpEndpoint-BrhMhpSi.js} +352 -281
- package/dist/mcp/{CdpOptionalCommand-BPjRD9Kz.js → CdpOptionalCommand-PZZhlqxv.js} +2 -2
- package/dist/mcp/CdpTargetSession-BmmDC3XO.js +290 -0
- package/dist/mcp/{DirectAnalysis-DrafbXke.js → DirectAnalysis-B9KuCHTG.js} +29 -21
- package/dist/mcp/{DirectAnalysisStatus-CjjeDLzW.js → DirectAnalysisStatus-BgzopkIt.js} +7 -7
- package/dist/mcp/{ElectronFileScope-BPG_YoyU.js → ElectronFileScope-FXtK0d6I.js} +1 -1
- package/dist/mcp/ElectronFuseFailures-uZ_wOV6T.js +610 -0
- package/dist/mcp/MachoLoadCommandReader-C2VGgHA3.js +330 -0
- package/dist/mcp/{ManagedStaticProvider-BthZbKyZ.js → ManagedStaticProvider-CZuoPme2.js} +429 -131
- package/dist/mcp/{NativeMacOSProvider-Bh79k8dI.js → NativeMacOSProvider-CMguKrvN.js} +1376 -748
- package/dist/mcp/{NativeMacOSProviderMetadata-N1lPOaY_.js → NativeMacOSProviderMetadata-B_RH4KXF.js} +97 -7
- package/dist/mcp/{ProviderDeadline-DskQ94YD.js → OwnedCommand-BW1jBSt9.js} +436 -127
- package/dist/mcp/ProcedureAddressResolution-H6Qwpb_Y.js +59 -0
- package/dist/mcp/{WorkflowEvidence-umWrB_wm.js → WorkflowEvidence-CO4C7ALz.js} +16 -9
- package/dist/mcp/analysisErrorCleanup-Q344SnTO.js +34 -0
- package/dist/mcp/analysisErrorCore-BIEP7tvF.js +509 -0
- package/dist/mcp/{analysisErrorProjection-BN0EPM-3.js → analysisErrorProjection-B8teQwwD.js} +80 -30
- package/dist/mcp/{artifactToolContracts-Di4qZlEt.js → artifactToolContracts-C9dRDo-D.js} +6 -4
- package/dist/mcp/{browserObservation-C0s4i8UI.js → browserObservation-DUraZs62.js} +272 -107
- package/dist/mcp/{browserObservationError-CyLugqX4.js → browserObservationError-C5okJ5el.js} +27 -4
- package/dist/mcp/{browserObservationSchemas-tgqjH7aA.js → browserObservationSchemas-DwGGxBpu.js} +3 -3
- package/dist/mcp/{browserScenario-CAQ8Fns9.js → browserScenario-BRUz7yN0.js} +844 -358
- package/dist/mcp/{browserScenarioCapture-CTNFN-FI.js → browserScenarioCapture-CiMAsMx8.js} +127 -11
- package/dist/mcp/{InterfaceBuilderDecodeBudget-5F2AkxJT.js → callerPath-CpPnMZyN.js} +91 -65
- package/dist/mcp/{electronActiveObservation-lDvQTMR0.js → electronActiveObservation-DV0Ffy9X.js} +1 -0
- package/dist/mcp/electronFuses-D5SS7XXw.js +367 -0
- package/dist/mcp/{electronObservation-i7LcILQ-.js → electronObservation-DsN-NqY1.js} +134 -75
- package/dist/mcp/{electronObservation-DFOFEood.js → electronObservation-wOYWwqgF.js} +3 -3
- package/dist/mcp/{electronScenario-nCzE6IfJ.js → electronScenario-CYrt2zBK.js} +395 -135
- package/dist/mcp/{emptyArraySchema-tL6Qymyd.js → emptyArraySchema-C0o2Sxwp.js} +2 -2
- package/dist/mcp/{enhancedInputs-DgdEnzHy.js → enhancedInputs-6CCgB3VB.js} +1 -1
- package/dist/mcp/{javascriptRuntimeObservation-61NhCf7H.js → javascriptRuntimeObservation-BVbhkO2-.js} +12 -9
- package/dist/mcp/{javascriptRuntimeObservation-PIUoLfX6.js → javascriptRuntimeObservation-Cu0Yedqq.js} +2 -2
- package/dist/mcp/{lipo-Bnkoq_6W.js → lipo-DSTgUqL1.js} +11 -118
- package/dist/mcp/{logger-BQY5ulYv.js → logger-BGdGHadX.js} +2 -2
- package/dist/mcp/machoContainer-CMSxUBlK.js +605 -0
- package/dist/mcp/{main-kBXHZ8S5.js → main-Cx-Z7m_n.js} +16788 -5902
- package/dist/mcp/main.js +1 -1
- package/dist/mcp/{managedToolContracts-CK--I_s7.js → managedToolContracts-CSlbKJP-.js} +3 -3
- package/dist/mcp/{nativeValueTrace-DR9UE62L.js → nativeValueTrace-BEZbDieM.js} +2630 -2468
- package/dist/mcp/{officialToolContracts-B67NJ2tC.js → officialToolContracts-CauCcSsc.js} +74 -55
- package/dist/mcp/peMachine-aP1iYnHq.js +95 -0
- package/dist/mcp/propertyListKeys-BfCo0k4w.js +356 -0
- package/dist/mcp/providerCleanupError-DIRHxzWo.js +125 -0
- package/dist/mcp/{providerOperationHealth-CTYa3iLf.js → providerOperationHealth-9DRSGM8N.js} +24 -1
- package/dist/mcp/{scanCanonical-CRXSpule.js → scanCanonical-CF3ATd1V.js} +269 -463
- package/dist/mcp/{serverIdentity-Cio4iFV3.js → serverIdentity-BK0Ejd_Y.js} +262 -83
- package/dist/mcp/{sourceMapEnvelope-C0uJlrOh.js → sourceMapEnvelope-DAaRUIGj.js} +4 -4
- package/dist/mcp/{toolContracts-BW05wpcr.js → toolContracts-BPoHQdlC.js} +541 -327
- package/dist/mcp/{toolOutputSchemaGroups-ColvNZ1r.js → toolOutputSchemaGroups-MJ_f-PMK.js} +2551 -2354
- package/dist/mcp/{webContentArtifact-Dzjc1z-R.js → webContentArtifact-DfGkgDcI.js} +2 -17
- package/dist/mcp/{webRuntime-K__NYzXm.js → webRuntime-ccyhkRru.js} +2 -2
- package/dist/mcp/{webSourceLocation-DbMAT2J9.js → webSourceLocation-DKIum0vJ.js} +6451 -4414
- package/dist/mcpDoctor.js +4 -2
- package/dist/mcpStartupPolicy.js +18 -3
- package/dist/native/AppleDispatchMetadata.js +76 -27
- package/dist/native/AppleMachoFixups.js +20 -10
- package/dist/native/AppleObjcCategories.js +12 -1
- package/dist/native/AppleObjcDispatchFacets.js +21 -12
- package/dist/native/AppleObjcProperties.js +61 -17
- package/dist/native/AppleObjcProtocols.js +25 -7
- package/dist/native/AppleSwiftVtables.js +2 -0
- package/dist/native/CommandRunner.js +13 -9
- package/dist/native/LldbCallTracer.js +232 -178
- package/dist/native/LldbReadbackFiles.js +70 -0
- package/dist/native/LldbRetainedObservations.js +28 -56
- package/dist/native/NativeCallObservation.js +53 -52
- package/dist/native/NativeCallTarget.js +95 -0
- package/dist/native/NativeMacOSProvider.js +240 -171
- package/dist/native/NativeMachoInspection.js +21 -7
- package/dist/native/NativePlistSource.js +179 -0
- package/dist/native/NativeUiCleanupError.js +30 -0
- package/dist/native/NativeUiHelperRuntime.js +48 -35
- package/dist/native/NativeUiObservation.js +67 -45
- package/dist/native/SignatureTargetBinding.js +72 -53
- package/dist/native/parsers/demangle.js +16 -12
- package/dist/native/parsers/machoUuid.js +4 -4
- package/dist/native/parsers/otool.js +57 -17
- package/dist/native/parsers/plist.js +40 -25
- package/dist/native/pe/PeResourceLayout.js +22 -7
- package/dist/native/pe/PeResourceParser.js +10 -9
- package/dist/native/pe/PeResourcesProvider.js +63 -16
- package/dist/native/pwndbg/CoreFileMappingAuthority.js +51 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +26 -15
- package/dist/native/pwntools/PwntoolsDecoder.js +116 -53
- package/dist/native/pwntools/PwntoolsFailures.js +17 -3
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +11 -1
- package/dist/objdump/ObjdumpCommand.js +5 -2
- package/dist/pcap/PcapOutput.js +38 -2
- package/dist/pcap/PcapProvider.js +45 -15
- package/dist/pcap/PcapSnapshot.js +24 -4
- package/dist/process/ArtifactAnalysisResources.js +145 -52
- package/dist/process/BoundedFileBytes.js +8 -3
- package/dist/process/CurrentEntrypointPath.js +3 -1
- package/dist/process/DarwinProcessRunTokenReader.js +174 -63
- package/dist/process/DetachedPgpSignature.js +57 -0
- package/dist/process/ExecFileOutput.js +14 -11
- package/dist/{hopper/HopperTargetLease.js → process/HopperLease.js} +10 -0
- package/dist/process/LinuxResourceLimits.js +4 -24
- package/dist/process/OwnedCommand.js +109 -14
- package/dist/process/ProviderProcess.js +129 -10
- package/dist/process/RegexMatcher.js +96 -0
- package/dist/process/SharedStartupAttempt.js +59 -0
- package/dist/process/WindowsAuthority.js +1 -1
- package/dist/process/capture/FilesystemSnapshot.js +3 -2
- package/dist/process/capture/ProcessCaptureError.js +55 -17
- package/dist/process/capture/ProcessCaptureLifecycle.js +17 -20
- package/dist/process/capture/ProcessCaptureProgress.js +5 -3
- package/dist/process/capture/ProcessHarness.js +17 -3
- package/dist/process/snapshotEnvironment.js +8 -8
- package/dist/{application/binary → providers}/AnalysisClientCleanup.js +3 -3
- package/dist/providers/AnalysisClientCreation.js +193 -0
- package/dist/providers/AnalysisClientFailure.js +191 -0
- package/dist/providers/DeferredAnalysisClient.js +48 -0
- package/dist/providers/OwnedCommandCleanup.js +65 -0
- package/dist/providers/ProviderInspectionScope.js +10 -0
- package/dist/recordedCatalogDigests.js +2 -0
- package/dist/reference/ReferenceSourceReader.js +64 -0
- package/dist/reference/ReferenceSourceReaderEntries.js +12 -3
- package/dist/reference/ReferenceSourceReaderFile.js +2 -1
- package/dist/rizin/RizinCommand.js +2 -2
- package/dist/rizin/RizinDebugSessionManager.js +249 -210
- package/dist/rust/RustBinaryProvider.js +55 -23
- package/dist/server/EvidenceMcpServer.js +2 -2
- package/dist/server/contractToolHandler.js +17 -11
- package/dist/server/createServer.js +27 -8
- package/dist/server/promptCompletion.js +24 -22
- package/dist/server/registerArtifactComparisonTool.js +13 -2
- package/dist/server/registerBrowserScenarioTool.js +7 -5
- package/dist/server/registerBrowserTools.js +2 -4
- package/dist/server/registerCutterTools.js +2 -3
- package/dist/server/registerElectronTools.js +2 -13
- package/dist/server/registerFridaTools.js +8 -12
- package/dist/server/registerInvestigationTools.js +20 -20
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -4
- package/dist/server/registerManagedWorkflowTools/evidence.js +14 -7
- package/dist/server/registerProcessComparisonTool.js +3 -0
- package/dist/server/registerSessionStatusTool.js +13 -6
- package/dist/server/registerSessionTools.js +16 -29
- package/dist/server/runDerivedOperation.js +2 -0
- package/dist/signals/SigrokRecordingProvider.js +13 -6
- package/dist/sqlite/SqliteDatabaseFailures.js +25 -12
- package/dist/sqlite/SqliteDatabaseInspection.js +27 -12
- package/dist/sqlite/SqliteDatabaseSnapshot.js +58 -32
- package/dist/sqlite/SqliteDatabaseWorkerExecution.js +18 -3
- package/dist/wasm/WabtArtifactProvider.js +64 -42
- package/dist/wasm/WabtFailures.js +19 -1
- package/dist/wasm/WabtRuntime.js +58 -0
- package/dist/wasm/WasmGlueAdapter.js +20 -7
- package/dist/windows/WindowsNativeLoader.js +16 -2
- package/dist/windows/WindowsPrivateRuntime.js +44 -1
- package/licenses/npm-dependencies.txt +146 -1
- package/licenses/npm-runtime-notices.txt +175 -1
- package/native/windows/README.md +44 -7
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +11 -3
- package/scripts/electron-active-hook-boundaries.cjs +15 -2
- package/scripts/electron-active-hook.cjs +408 -46
- package/scripts/hopper-demo-x11.py +12 -10
- package/scripts/rea.mjs +62 -15
- package/skills/reverse-engineer-anything/SKILL.md +21 -7
- package/skills/reverse-engineer-anything/references/android-applications.md +3 -1
- package/skills/reverse-engineer-anything/references/javascript-applications.md +44 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +30 -10
- package/dist/cli-runtime/ArtifactResourceScope-DQWTcUwE.js +0 -114
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +0 -36
- package/dist/cli-runtime/IdaConfiguration-CtGP7EKo.js +0 -1094
- package/dist/cli-runtime/JebMcpEndpoint-DUytrn5G.js +0 -428
- package/dist/cli-runtime/MacHopperPaths-CwL5lYPX.js +0 -434
- package/dist/cli-runtime/OwnedCommand-Cj9GhmPR.js +0 -112
- package/dist/cli-runtime/RegularFile-B_6KPCNQ.js +0 -139
- package/dist/cli-runtime/RegularFileRead-DVlC5faM.js +0 -125
- package/dist/cli-runtime/analysisErrorPresentation-DGt7TdsH.js +0 -497
- package/dist/cli-runtime/application__javascript__ElectronObservationService-DEsR8KDN.js +0 -63
- package/dist/cli-runtime/artifactOperationError-B7n03FbD.js +0 -27
- package/dist/cli-runtime/browserObservationError-Dx6xRTjb.js +0 -40
- package/dist/cli-runtime/cliResultOutput-DsRMI8CJ.js +0 -780
- package/dist/cli-runtime/mcpStartupPolicy-CVVSOmRc.js +0 -21
- package/dist/cli-runtime/propertyListKeys-G8e74YWb.js +0 -248
- package/dist/cli-runtime/providerAdapterError-DAjhICdr.js +0 -25
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +0 -38
- package/dist/hopper/HopperRegexWorker.js +0 -27
- package/dist/mcp/ArtifactProviderMetadata-b7pOK5_t.js +0 -76
- package/dist/mcp/ArtifactResourceScope-P3tq5z8Z.js +0 -162
- package/dist/mcp/BoundedFileBytes-DuczXiQZ.js +0 -68
- package/dist/mcp/CdpTargetSession-BsPoKhEU.js +0 -86
- package/dist/mcp/ProcedureAddressResolution-CQpuwm1h.js +0 -19
- package/dist/mcp/analysisErrorCore-DXRTvF_m.js +0 -235
- package/dist/mcp/artifactOperationError-CkHMMaf7.js +0 -27
- package/dist/mcp/digests-BFoWUT_-.js +0 -223
- package/dist/mcp/propertyListKeys-DD25WsjI.js +0 -553
- package/dist/mcp/providerAdapterError-sDxToNal.js +0 -25
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +0 -26
|
@@ -1,31 +1,86 @@
|
|
|
1
1
|
import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { c as init_browserObservation, d as isLiteralLoopbackHostname, m as sanitizeBrowserUrl, o as browserObservationEndpointSchema } from "./webContentArtifact-
|
|
7
|
-
import { a as
|
|
2
|
+
import { A as err, D as AnalysisError, M as ok, O as init_analysisErrorBase, f as init_analysisErrorCore, i as AnalysisCancelledError, j as init_result, u as AnalysisTimeoutError } from "./analysisErrorCore-BIEP7tvF.js";
|
|
3
|
+
import { a as init_AnalysisCleanupLease, i as AnalysisCleanupLeaseGroup, n as init_providerCleanupError, r as AnalysisCleanupLease, t as ProviderCleanupError } from "./providerCleanupError-DIRHxzWo.js";
|
|
4
|
+
import { i as init_providerAdapterError, n as init_browserObservationError, r as ProviderAdapterError, t as BrowserObservationError } from "./browserObservationError-C5okJ5el.js";
|
|
5
|
+
import { n as init_analysisErrorCleanup, t as analysisErrorWithCleanupFailure } from "./analysisErrorCleanup-Q344SnTO.js";
|
|
6
|
+
import { c as init_browserObservation, d as isLiteralLoopbackHostname, m as sanitizeBrowserUrl, o as browserObservationEndpointSchema } from "./webContentArtifact-DfGkgDcI.js";
|
|
7
|
+
import { a as init_browserScenarioCaptureLimits, c as browserScenarioEventSchema, d as classifyBrowserScenarioCompleteness, f as init_browserScenarioCaptureValues, h as init_browserNetworkEvidence, l as browserScenarioStepSchema, n as init_browserScenarioCapture, p as PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION, r as DEFAULT_BROWSER_SCENARIO_CAPTURE_LIMITS, t as browserScenarioCaptureSchema, u as browserStepArtifactsSchema } from "./browserScenarioCapture-CiMAsMx8.js";
|
|
8
8
|
import { a as init_providerIdentities, r as PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY } from "./providerIdentities--ptAh481.js";
|
|
9
|
-
import {
|
|
10
|
-
import { i as openCdpEndpoint, r as init_CdpTargetSession, t as attachCdpTargetSession } from "./CdpTargetSession-
|
|
9
|
+
import { a as init_CdpEndpoint, c as withCdpDiscoveryDeadline, l as CdpConnection, u as init_CdpConnection } from "./CdpEndpoint-BrhMhpSi.js";
|
|
10
|
+
import { i as openCdpEndpoint, r as init_CdpTargetSession, t as attachCdpTargetSession } from "./CdpTargetSession-BmmDC3XO.js";
|
|
11
11
|
import { join, resolve } from "node:path";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
15
14
|
import { chmod, mkdtemp, rm } from "node:fs/promises";
|
|
15
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
16
|
+
|
|
17
|
+
//#region dist/browser/PlaywrightExecutionBoundary.js
|
|
18
|
+
var OPERATION$5, PLAYWRIGHT_CLEANUP_CONFIRMATION_TIMEOUT_MS, withPlaywrightExecutionBoundary;
|
|
19
|
+
function init_PlaywrightExecutionBoundary() {
|
|
20
|
+
return (init_PlaywrightExecutionBoundary = __esmMin((() => {
|
|
21
|
+
init_analysisErrorCore();
|
|
22
|
+
OPERATION$5 = "capture_browser_scenario";
|
|
23
|
+
PLAYWRIGHT_CLEANUP_CONFIRMATION_TIMEOUT_MS = 3e4;
|
|
24
|
+
withPlaywrightExecutionBoundary = (work, timeoutMs, signal) => {
|
|
25
|
+
if (timeoutMs !== undefined && timeoutMs <= 0) return Promise.reject(new AnalysisTimeoutError(OPERATION$5, timeoutMs));
|
|
26
|
+
if (signal?.aborted === true) return Promise.reject(new AnalysisCancelledError(OPERATION$5, { cause: signal.reason }));
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
let settled = false;
|
|
29
|
+
let timer;
|
|
30
|
+
const deadline = timeoutMs === undefined ? undefined : performance.now() + timeoutMs;
|
|
31
|
+
const scheduleTimeout = () => {
|
|
32
|
+
if (deadline === undefined) return;
|
|
33
|
+
const remaining = deadline - performance.now();
|
|
34
|
+
if (remaining <= 0) {
|
|
35
|
+
fail(new AnalysisTimeoutError(OPERATION$5, timeoutMs ?? 0));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
timer = setTimeout(scheduleTimeout, Math.min(remaining, 2147483647));
|
|
39
|
+
timer.unref();
|
|
40
|
+
};
|
|
41
|
+
const cleanup = () => {
|
|
42
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
43
|
+
signal?.removeEventListener("abort", onAbort);
|
|
44
|
+
};
|
|
45
|
+
const succeed = (value) => {
|
|
46
|
+
if (settled) return;
|
|
47
|
+
settled = true;
|
|
48
|
+
cleanup();
|
|
49
|
+
resolve(value);
|
|
50
|
+
};
|
|
51
|
+
const fail = (error) => {
|
|
52
|
+
if (settled) return;
|
|
53
|
+
settled = true;
|
|
54
|
+
cleanup();
|
|
55
|
+
reject(error);
|
|
56
|
+
};
|
|
57
|
+
const onAbort = () => {
|
|
58
|
+
fail(new AnalysisCancelledError(OPERATION$5, { cause: signal?.reason }));
|
|
59
|
+
};
|
|
60
|
+
scheduleTimeout();
|
|
61
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
62
|
+
if (signal?.aborted === true) {
|
|
63
|
+
onAbort();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
void work().then(succeed, fail);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
})))();
|
|
70
|
+
}
|
|
16
71
|
|
|
72
|
+
//#endregion
|
|
17
73
|
//#region dist/browser/BrowserScenarioPartialObservation.js
|
|
18
|
-
var OPERATION$
|
|
74
|
+
var OPERATION$4, browserScenarioLimitations, browserScenarioCaptureData, browserScenarioCleanupObservation, browserScenarioOperationFailure;
|
|
19
75
|
function init_BrowserScenarioPartialObservation() {
|
|
20
76
|
return (init_BrowserScenarioPartialObservation = __esmMin((() => {
|
|
21
77
|
init_browserNetworkEvidence();
|
|
22
78
|
init_analysisErrorBase();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
init_browserObservationError();
|
|
79
|
+
init_analysisErrorCleanup();
|
|
80
|
+
init_providerCleanupError();
|
|
26
81
|
init_providerAdapterError();
|
|
27
82
|
init_providerIdentities();
|
|
28
|
-
OPERATION$
|
|
83
|
+
OPERATION$4 = "capture_browser_scenario";
|
|
29
84
|
browserScenarioLimitations = (session, scenario, events) => {
|
|
30
85
|
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
86
|
return [
|
|
@@ -38,7 +93,11 @@ function init_BrowserScenarioPartialObservation() {
|
|
|
38
93
|
"Storage values are hashed only after declared-secret redaction.",
|
|
39
94
|
...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
95
|
...session.eventLimitations?.() ?? [],
|
|
41
|
-
...session.mode === "connect" ? [
|
|
96
|
+
...session.mode === "connect" ? [
|
|
97
|
+
"CDP attachment cannot recover pre-attach events or guarantee launch-time context options.",
|
|
98
|
+
`Attached locale ${scenario.environment.locale} applies to Intl formatting only; navigator.language(s) and Accept-Language remain caller-controlled. Use launch mode for matching page and request languages.`,
|
|
99
|
+
"Detaching a CDP page session may clear caller-owned navigator.platform emulation. REA cannot snapshot the caller's complete user-agent/client-hint state before attachment; use launch mode to avoid mutating that external browser."
|
|
100
|
+
] : []
|
|
42
101
|
];
|
|
43
102
|
};
|
|
44
103
|
browserScenarioCaptureData = (input) => {
|
|
@@ -56,7 +115,8 @@ function init_BrowserScenarioPartialObservation() {
|
|
|
56
115
|
action_count: input.scenario.actions.length,
|
|
57
116
|
secret_references: input.scenario.secrets.map(({ secret_id: id }) => id).sort(),
|
|
58
117
|
network_content: input.scenario.capture.network,
|
|
59
|
-
event_families: [...new Set(input.scenario.capture.events)].sort()
|
|
118
|
+
event_families: [...new Set(input.scenario.capture.events)].sort(),
|
|
119
|
+
limits: input.scenario.capture.limits
|
|
60
120
|
},
|
|
61
121
|
duration_ms: Math.max(0, Math.round(performance.now() - input.startedAt)),
|
|
62
122
|
steps: [...input.steps],
|
|
@@ -69,53 +129,39 @@ function init_BrowserScenarioPartialObservation() {
|
|
|
69
129
|
resources: cause instanceof AnalysisError && cause.cleanupResources.length > 0 ? cause.cleanupResources : ["browser_transport"]
|
|
70
130
|
};
|
|
71
131
|
browserScenarioOperationFailure = (cause, partialObservation, cleanupFailure) => {
|
|
72
|
-
const primary = cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
}
|
|
132
|
+
const primary = cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$4, { cause });
|
|
133
|
+
primary.retainPartialObservation(partialObservation);
|
|
134
|
+
if (cleanupFailure === undefined) return primary;
|
|
135
|
+
const observation = browserScenarioCleanupObservation(cleanupFailure.cause);
|
|
136
|
+
const cleanup = cleanupFailure.cause instanceof AnalysisError && cleanupFailure.cause.cleanupIncomplete ? cleanupFailure.cause : new ProviderCleanupError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, observation.resources, { reason: observation.reason }, {
|
|
137
|
+
operation: "close_browser_scenario",
|
|
138
|
+
cause: cleanupFailure.cause
|
|
100
139
|
});
|
|
140
|
+
return analysisErrorWithCleanupFailure(primary, cleanup, OPERATION$4).bindCleanupDependencies([primary, cleanup]);
|
|
101
141
|
};
|
|
102
142
|
})))();
|
|
103
143
|
}
|
|
104
144
|
|
|
105
145
|
//#endregion
|
|
106
146
|
//#region dist/browser/PlaywrightBrowserScenarioProvider.js
|
|
107
|
-
var OPERATION$
|
|
147
|
+
var OPERATION$3, signalIsAborted, SNAPSHOT_KINDS, requestedForStep, unavailableArtifacts, stepCompleteness, createStep, initialStep, executeStep, globalCompleteness, runScenario, PlaywrightBrowserScenarioProvider;
|
|
108
148
|
function init_PlaywrightBrowserScenarioProvider() {
|
|
109
149
|
return (init_PlaywrightBrowserScenarioProvider = __esmMin((() => {
|
|
150
|
+
init_PlaywrightExecutionBoundary();
|
|
151
|
+
init_analysisErrorCleanup();
|
|
152
|
+
init_AnalysisCleanupLease();
|
|
153
|
+
init_providerCleanupError();
|
|
110
154
|
init_browserScenarioCapture();
|
|
111
155
|
init_browserScenarioCaptureValues();
|
|
112
156
|
init_analysisErrorBase();
|
|
157
|
+
init_analysisErrorCore();
|
|
113
158
|
init_browserObservationError();
|
|
114
159
|
init_providerAdapterError();
|
|
115
160
|
init_result();
|
|
116
161
|
init_BrowserScenarioPartialObservation();
|
|
117
162
|
init_providerIdentities();
|
|
118
|
-
OPERATION$
|
|
163
|
+
OPERATION$3 = "capture_browser_scenario";
|
|
164
|
+
signalIsAborted = (signal) => signal?.aborted === true;
|
|
119
165
|
SNAPSHOT_KINDS = [
|
|
120
166
|
"screenshot",
|
|
121
167
|
"dom",
|
|
@@ -238,7 +284,7 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
238
284
|
return classifyBrowserScenarioCompleteness(missing, truncated);
|
|
239
285
|
};
|
|
240
286
|
runScenario = async (openSession, scenario, options, retainCleanup) => {
|
|
241
|
-
if (options.signal?.aborted
|
|
287
|
+
if (options.signal?.aborted) throw new BrowserObservationError(OPERATION$3, "cancelled", { cause: options.signal.reason });
|
|
242
288
|
const startedAt = performance.now();
|
|
243
289
|
const session = await openSession(scenario, {
|
|
244
290
|
...options.signal === undefined ? {} : { signal: options.signal },
|
|
@@ -279,13 +325,23 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
279
325
|
cleanup: await session.close()
|
|
280
326
|
};
|
|
281
327
|
} catch (cause) {
|
|
328
|
+
const cleanup = browserScenarioCleanupObservation(cause);
|
|
329
|
+
const failure = new BrowserObservationError(OPERATION$3, "cleanup_failed", {
|
|
330
|
+
cause,
|
|
331
|
+
cleanup
|
|
332
|
+
});
|
|
333
|
+
retainCleanup(session.cleanupLease);
|
|
334
|
+
new AnalysisCleanupLeaseGroup(failure, [session.cleanupLease]);
|
|
282
335
|
cleanupOutcome = {
|
|
283
336
|
ok: false,
|
|
284
|
-
cause
|
|
337
|
+
cause: failure
|
|
285
338
|
};
|
|
286
|
-
retainCleanup(() => session.close());
|
|
287
339
|
}
|
|
288
340
|
if (!cleanupOutcome.ok) {
|
|
341
|
+
if (operationOutcome.ok && options.signal?.aborted) operationOutcome = {
|
|
342
|
+
ok: false,
|
|
343
|
+
cause: new AnalysisCancelledError(OPERATION$3, { cause: options.signal.reason })
|
|
344
|
+
};
|
|
289
345
|
const cleanup = browserScenarioCleanupObservation(cleanupOutcome.cause);
|
|
290
346
|
const partialObservation = {
|
|
291
347
|
kind: "browser-scenario-observation",
|
|
@@ -299,12 +355,14 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
299
355
|
})
|
|
300
356
|
};
|
|
301
357
|
if (!operationOutcome.ok) throw browserScenarioOperationFailure(operationOutcome.cause, partialObservation, { cause: cleanupOutcome.cause });
|
|
302
|
-
|
|
358
|
+
const failure = new BrowserObservationError(OPERATION$3, "cleanup_failed", {
|
|
303
359
|
cause: cleanupOutcome.cause,
|
|
304
360
|
cleanup,
|
|
305
361
|
partialObservation,
|
|
306
362
|
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
363
|
});
|
|
364
|
+
if (cleanupOutcome.cause instanceof AnalysisError && cleanupOutcome.cause.cleanupIncomplete) failure.bindCleanupDependencies([cleanupOutcome.cause]);
|
|
365
|
+
throw failure;
|
|
308
366
|
}
|
|
309
367
|
if (!operationOutcome.ok) throw browserScenarioOperationFailure(operationOutcome.cause, {
|
|
310
368
|
kind: "browser-scenario-observation",
|
|
@@ -318,7 +376,7 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
318
376
|
})
|
|
319
377
|
});
|
|
320
378
|
const completeness = globalCompleteness(scenario, session, steps);
|
|
321
|
-
|
|
379
|
+
const capture = browserScenarioCaptureSchema.parse({
|
|
322
380
|
...browserScenarioCaptureData({
|
|
323
381
|
session,
|
|
324
382
|
scenario,
|
|
@@ -328,6 +386,17 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
328
386
|
}),
|
|
329
387
|
completeness
|
|
330
388
|
});
|
|
389
|
+
if (signalIsAborted(options.signal)) throw new AnalysisCancelledError(OPERATION$3, {
|
|
390
|
+
cause: options.signal?.reason,
|
|
391
|
+
partialObservation: {
|
|
392
|
+
kind: "browser-scenario-observation",
|
|
393
|
+
capture: {
|
|
394
|
+
...capture,
|
|
395
|
+
limitations: [...capture.limitations, "Scenario capture was cancelled; collected steps, observations, and cleanup state are retained."]
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
return capture;
|
|
331
400
|
};
|
|
332
401
|
PlaywrightBrowserScenarioProvider = class {
|
|
333
402
|
openSession;
|
|
@@ -350,13 +419,21 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
350
419
|
async #captureScenario(scenario, options) {
|
|
351
420
|
const pending = await this.#retryCleanup();
|
|
352
421
|
if (pending !== undefined) return err(pending);
|
|
422
|
+
const retained = [];
|
|
353
423
|
try {
|
|
354
|
-
return ok(await runScenario(this.openSession, scenario, options, (
|
|
355
|
-
this.#pendingCleanup.add(
|
|
424
|
+
return ok(await runScenario(this.openSession, scenario, options, (lease) => {
|
|
425
|
+
this.#pendingCleanup.add(lease);
|
|
426
|
+
retained.push(lease);
|
|
356
427
|
}));
|
|
357
428
|
} catch (cause) {
|
|
358
|
-
|
|
359
|
-
|
|
429
|
+
const primary = cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$3, { cause });
|
|
430
|
+
if (retained.length === 0) return err(primary);
|
|
431
|
+
const cleanup = new ProviderCleanupError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, retained.flatMap((lease) => lease.cleanupResources ?? []), { reason: "Browser scenario cleanup capabilities remain retained." }, {
|
|
432
|
+
operation: OPERATION$3,
|
|
433
|
+
cause
|
|
434
|
+
});
|
|
435
|
+
new AnalysisCleanupLeaseGroup(cleanup, retained);
|
|
436
|
+
return err(analysisErrorWithCleanupFailure(primary, cleanup, OPERATION$3).bindCleanupDependencies([primary, cleanup]));
|
|
360
437
|
}
|
|
361
438
|
}
|
|
362
439
|
async close() {
|
|
@@ -371,7 +448,7 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
371
448
|
return this.#closePromise;
|
|
372
449
|
}
|
|
373
450
|
#closedError() {
|
|
374
|
-
return new BrowserObservationError(OPERATION$
|
|
451
|
+
return new BrowserObservationError(OPERATION$3, "cleanup_failed", {
|
|
375
452
|
detail: "Browser scenario provider is closing.",
|
|
376
453
|
cleanup: {
|
|
377
454
|
reason: "Provider is closing",
|
|
@@ -380,15 +457,26 @@ function init_PlaywrightBrowserScenarioProvider() {
|
|
|
380
457
|
});
|
|
381
458
|
}
|
|
382
459
|
async #retryCleanup() {
|
|
460
|
+
const failures = [];
|
|
383
461
|
for (const pending of this.#pendingCleanup) {
|
|
384
462
|
try {
|
|
385
|
-
await pending();
|
|
463
|
+
await withPlaywrightExecutionBoundary(() => pending.release(), PLAYWRIGHT_CLEANUP_CONFIRMATION_TIMEOUT_MS);
|
|
386
464
|
this.#pendingCleanup.delete(pending);
|
|
387
465
|
} catch (cause) {
|
|
388
|
-
|
|
466
|
+
const failure = new ProviderCleanupError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, pending.cleanupResources ?? [], { reason: cause instanceof Error ? cause.message : String(cause) }, {
|
|
467
|
+
operation: OPERATION$3,
|
|
468
|
+
cause
|
|
469
|
+
});
|
|
470
|
+
new AnalysisCleanupLeaseGroup(failure, [pending]);
|
|
471
|
+
failures.push(failure);
|
|
389
472
|
}
|
|
390
473
|
}
|
|
391
|
-
return undefined;
|
|
474
|
+
if (failures.length === 0) return undefined;
|
|
475
|
+
if (failures.length === 1) return failures[0];
|
|
476
|
+
return new ProviderCleanupError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, failures.flatMap((failure) => failure.cleanupResources), { reason: "One or more browser scenario resources remain owned." }, {
|
|
477
|
+
operation: OPERATION$3,
|
|
478
|
+
cause: new AggregateError(failures, "Browser scenario cleanup failed")
|
|
479
|
+
}).bindCleanupDependencies(failures);
|
|
392
480
|
}
|
|
393
481
|
};
|
|
394
482
|
})))();
|
|
@@ -613,120 +701,80 @@ function init_BrowserScenarioSecrets() {
|
|
|
613
701
|
})))();
|
|
614
702
|
}
|
|
615
703
|
|
|
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
704
|
//#endregion
|
|
672
705
|
//#region dist/browser/PlaywrightScenarioBrowser.js
|
|
673
|
-
var OPERATION$2,
|
|
706
|
+
var OPERATION$2, throwIfScenarioCancelled$1, PlaywrightScenarioBrowserCleanupOwner, attachedScenarioAdmissions, releaseAttachedScenario, createAttachedScenarioRelease, attachedScenarioLeaseKey, acquireAttachedScenario, allowedBrowserEnvironment, findConnectedPage, AttachedScenarioEnvironmentOwner, failBrowserScenarioOperation, openAttachedScenarioBrowser, openPlaywrightScenarioBrowser;
|
|
674
707
|
function init_PlaywrightScenarioBrowser() {
|
|
675
708
|
return (init_PlaywrightScenarioBrowser = __esmMin((() => {
|
|
709
|
+
init_providerIdentities();
|
|
710
|
+
init_analysisErrorCleanup();
|
|
711
|
+
init_providerAdapterError();
|
|
712
|
+
init_AnalysisCleanupLease();
|
|
676
713
|
init_analysisErrorBase();
|
|
677
714
|
init_browserObservation();
|
|
678
715
|
init_browserObservationError();
|
|
679
716
|
init_PlaywrightExecutionBoundary();
|
|
680
717
|
OPERATION$2 = "capture_browser_scenario";
|
|
681
|
-
CLEANUP_CONFIRMATION_TIMEOUT_MS = 3e4;
|
|
682
718
|
throwIfScenarioCancelled$1 = (signal) => {
|
|
683
|
-
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION$2, "cancelled");
|
|
719
|
+
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION$2, "cancelled", { cause: signal?.reason });
|
|
684
720
|
};
|
|
685
721
|
PlaywrightScenarioBrowserCleanupOwner = class {
|
|
686
722
|
resources;
|
|
687
723
|
#browserClosed = false;
|
|
688
724
|
#profileRemoved;
|
|
689
|
-
#closePromise;
|
|
690
725
|
#eventFinalizationPromise;
|
|
726
|
+
#eventsFinalized = false;
|
|
727
|
+
cleanupLease;
|
|
691
728
|
/** Keep the narrow provider actions needed to release one opened browser. */
|
|
692
729
|
constructor(resources) {
|
|
693
730
|
this.resources = resources;
|
|
694
731
|
this.#profileRemoved = resources.removeProfile === undefined;
|
|
732
|
+
this.cleanupLease = new AnalysisCleanupLease(() => this.#closeResources().finally(() => this.resources.onSettled?.(this.#browserClosed)), this);
|
|
695
733
|
}
|
|
696
734
|
get browserClosed() {
|
|
697
735
|
return this.#browserClosed;
|
|
698
736
|
}
|
|
737
|
+
get cleanupResources() {
|
|
738
|
+
return [
|
|
739
|
+
...!this.#eventsFinalized ? ["browser_events"] : [],
|
|
740
|
+
...!this.#browserClosed ? ["browser_transport"] : [],
|
|
741
|
+
...!this.#profileRemoved ? ["browser_profile"] : []
|
|
742
|
+
];
|
|
743
|
+
}
|
|
744
|
+
/** Await actual resource release, including a late browser acknowledgement. */
|
|
745
|
+
release(finishEvents) {
|
|
746
|
+
this.#prepareEvents(finishEvents);
|
|
747
|
+
return this.cleanupLease.release();
|
|
748
|
+
}
|
|
699
749
|
close(finishEvents) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}
|
|
708
|
-
return this.#awaitCleanup(cleanup);
|
|
750
|
+
return this.#awaitCleanup(this.release(finishEvents));
|
|
751
|
+
}
|
|
752
|
+
#prepareEvents(finishEvents) {
|
|
753
|
+
this.#eventFinalizationPromise ??= Promise.resolve().then(async () => {
|
|
754
|
+
await finishEvents?.();
|
|
755
|
+
this.#eventsFinalized = true;
|
|
756
|
+
});
|
|
709
757
|
}
|
|
710
758
|
async #awaitCleanup(cleanup) {
|
|
711
759
|
try {
|
|
712
|
-
await withPlaywrightExecutionBoundary(() => cleanup,
|
|
760
|
+
await withPlaywrightExecutionBoundary(() => cleanup, PLAYWRIGHT_CLEANUP_CONFIRMATION_TIMEOUT_MS);
|
|
713
761
|
} catch (cause) {
|
|
714
|
-
|
|
762
|
+
const failure = new BrowserObservationError(OPERATION$2, "cleanup_failed", {
|
|
715
763
|
cause,
|
|
716
764
|
cleanup: {
|
|
717
765
|
reason: cause instanceof Error ? cause.message : String(cause),
|
|
718
|
-
resources:
|
|
766
|
+
resources: this.cleanupResources
|
|
719
767
|
}
|
|
720
768
|
});
|
|
769
|
+
new AnalysisCleanupLeaseGroup(failure, [this.cleanupLease]);
|
|
770
|
+
throw failure;
|
|
721
771
|
}
|
|
722
772
|
}
|
|
723
|
-
async #closeResources(
|
|
773
|
+
async #closeResources() {
|
|
724
774
|
const failures = [];
|
|
725
|
-
|
|
726
|
-
await finishEvents?.();
|
|
727
|
-
});
|
|
775
|
+
this.#prepareEvents();
|
|
728
776
|
try {
|
|
729
|
-
await
|
|
777
|
+
await this.#eventFinalizationPromise;
|
|
730
778
|
} catch (cause) {
|
|
731
779
|
failures.push(cause);
|
|
732
780
|
}
|
|
@@ -760,7 +808,7 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
760
808
|
}
|
|
761
809
|
if (waiter.onAbort !== undefined) waiter.signal?.removeEventListener("abort", waiter.onAbort);
|
|
762
810
|
if (waiter.signal?.aborted === true) {
|
|
763
|
-
waiter.reject(new BrowserObservationError(OPERATION$2, "cancelled"));
|
|
811
|
+
waiter.reject(new BrowserObservationError(OPERATION$2, "cancelled", { cause: waiter.signal.reason }));
|
|
764
812
|
releaseAttachedScenario(key, admission);
|
|
765
813
|
return;
|
|
766
814
|
}
|
|
@@ -780,7 +828,7 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
780
828
|
return JSON.stringify([discovery.href, targetId]);
|
|
781
829
|
};
|
|
782
830
|
acquireAttachedScenario = (scenario, signal) => {
|
|
783
|
-
if (signal?.aborted === true) return Promise.reject(new BrowserObservationError(OPERATION$2, "cancelled"));
|
|
831
|
+
if (signal?.aborted === true) return Promise.reject(new BrowserObservationError(OPERATION$2, "cancelled", { cause: signal?.reason }));
|
|
784
832
|
const key = attachedScenarioLeaseKey(scenario.cdp_endpoint, scenario.target_id);
|
|
785
833
|
const admission = attachedScenarioAdmissions.get(key) ?? {
|
|
786
834
|
active: false,
|
|
@@ -811,7 +859,7 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
811
859
|
if (index < 0) return;
|
|
812
860
|
admission.waiters.splice(index, 1);
|
|
813
861
|
signal.removeEventListener("abort", onAbort);
|
|
814
|
-
reject(new BrowserObservationError(OPERATION$2, "cancelled"));
|
|
862
|
+
reject(new BrowserObservationError(OPERATION$2, "cancelled", { cause: signal?.reason }));
|
|
815
863
|
if (!admission.active && admission.waiters.length === 0) releaseAttachedScenario(key, admission);
|
|
816
864
|
};
|
|
817
865
|
waiter.onAbort = onAbort;
|
|
@@ -867,51 +915,156 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
867
915
|
}
|
|
868
916
|
throw new BrowserObservationError(OPERATION$2, "target_not_found");
|
|
869
917
|
};
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
918
|
+
AttachedScenarioEnvironmentOwner = class AttachedScenarioEnvironmentOwner {
|
|
919
|
+
page;
|
|
920
|
+
session;
|
|
921
|
+
#mediaOverride = false;
|
|
922
|
+
#deviceMetricsOverride = false;
|
|
923
|
+
#localeOverride = false;
|
|
924
|
+
#timezoneOverride = false;
|
|
925
|
+
#detached = false;
|
|
926
|
+
#application;
|
|
927
|
+
constructor(page, session) {
|
|
928
|
+
this.page = page;
|
|
929
|
+
this.session = session;
|
|
930
|
+
}
|
|
931
|
+
static async create(context, page) {
|
|
932
|
+
return new AttachedScenarioEnvironmentOwner(page, await context.newCDPSession(page));
|
|
933
|
+
}
|
|
934
|
+
get restored() {
|
|
935
|
+
return !this.#mediaOverride && !this.#deviceMetricsOverride && !this.#localeOverride && !this.#timezoneOverride;
|
|
936
|
+
}
|
|
937
|
+
get targetClosed() {
|
|
938
|
+
return this.page.isClosed();
|
|
939
|
+
}
|
|
940
|
+
apply(environment, signal) {
|
|
941
|
+
const application = this.#application ?? this.#applyEnvironment(environment, signal);
|
|
942
|
+
this.#application = application;
|
|
943
|
+
return application;
|
|
944
|
+
}
|
|
945
|
+
async #applyEnvironment(environment, signal) {
|
|
946
|
+
await this.page.emulateMedia({
|
|
947
|
+
colorScheme: environment.color_scheme,
|
|
948
|
+
reducedMotion: environment.reduced_motion
|
|
949
|
+
});
|
|
950
|
+
this.#mediaOverride = true;
|
|
951
|
+
throwIfScenarioCancelled$1(signal);
|
|
952
|
+
await this.session.send("Emulation.setDeviceMetricsOverride", {
|
|
953
|
+
width: environment.viewport.width,
|
|
954
|
+
height: environment.viewport.height,
|
|
955
|
+
deviceScaleFactor: environment.viewport.device_scale_factor,
|
|
956
|
+
mobile: false,
|
|
957
|
+
dontSetVisibleSize: true
|
|
958
|
+
});
|
|
959
|
+
this.#deviceMetricsOverride = true;
|
|
960
|
+
throwIfScenarioCancelled$1(signal);
|
|
961
|
+
await this.session.send("Emulation.setLocaleOverride", { locale: environment.locale });
|
|
962
|
+
this.#localeOverride = true;
|
|
963
|
+
throwIfScenarioCancelled$1(signal);
|
|
964
|
+
await this.session.send("Emulation.setTimezoneOverride", { timezoneId: environment.timezone });
|
|
965
|
+
this.#timezoneOverride = true;
|
|
966
|
+
throwIfScenarioCancelled$1(signal);
|
|
967
|
+
}
|
|
968
|
+
async close() {
|
|
969
|
+
if (this.#detached) return;
|
|
970
|
+
try {
|
|
971
|
+
await this.#application;
|
|
972
|
+
} catch {}
|
|
973
|
+
const failures = [];
|
|
974
|
+
if (this.#timezoneOverride) {
|
|
975
|
+
try {
|
|
976
|
+
await this.session.send("Emulation.setTimezoneOverride", { timezoneId: "" });
|
|
977
|
+
this.#timezoneOverride = false;
|
|
978
|
+
} catch (cause) {
|
|
979
|
+
failures.push(cause);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (this.#localeOverride) {
|
|
983
|
+
try {
|
|
984
|
+
await this.session.send("Emulation.setLocaleOverride", { locale: "" });
|
|
985
|
+
this.#localeOverride = false;
|
|
986
|
+
} catch (cause) {
|
|
987
|
+
failures.push(cause);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if (this.#deviceMetricsOverride) {
|
|
991
|
+
try {
|
|
992
|
+
await this.session.send("Emulation.clearDeviceMetricsOverride");
|
|
993
|
+
this.#deviceMetricsOverride = false;
|
|
994
|
+
} catch (cause) {
|
|
995
|
+
failures.push(cause);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
if (this.#mediaOverride) {
|
|
999
|
+
try {
|
|
1000
|
+
await this.page.emulateMedia({
|
|
1001
|
+
colorScheme: null,
|
|
1002
|
+
reducedMotion: null
|
|
1003
|
+
});
|
|
1004
|
+
this.#mediaOverride = false;
|
|
1005
|
+
} catch (cause) {
|
|
1006
|
+
failures.push(cause);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
if (failures.length === 1) throw failures[0];
|
|
1010
|
+
if (failures.length > 1) throw new AggregateError(failures, "Attached browser environment restoration failed");
|
|
1011
|
+
await this.session.detach();
|
|
1012
|
+
this.#detached = true;
|
|
1013
|
+
}
|
|
889
1014
|
};
|
|
890
|
-
failBrowserScenarioOperation = async (cleanup, primaryFailure
|
|
1015
|
+
failBrowserScenarioOperation = async (cleanup, primaryFailure) => {
|
|
891
1016
|
try {
|
|
892
|
-
await cleanup();
|
|
893
|
-
} catch (
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1017
|
+
await withPlaywrightExecutionBoundary(() => cleanup.release(), PLAYWRIGHT_CLEANUP_CONFIRMATION_TIMEOUT_MS);
|
|
1018
|
+
} catch (cause) {
|
|
1019
|
+
const primary = primaryFailure instanceof AnalysisError ? primaryFailure : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$2, { cause: primaryFailure });
|
|
1020
|
+
const failure = new BrowserObservationError(OPERATION$2, "cleanup_failed", {
|
|
1021
|
+
cause,
|
|
1022
|
+
cleanup: {
|
|
1023
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
1024
|
+
resources: cleanup.cleanupResources ?? []
|
|
1025
|
+
}
|
|
901
1026
|
});
|
|
1027
|
+
new AnalysisCleanupLeaseGroup(failure, [cleanup]);
|
|
1028
|
+
throw analysisErrorWithCleanupFailure(primary, failure, OPERATION$2).bindCleanupDependencies([primary, failure]);
|
|
902
1029
|
}
|
|
903
1030
|
throw primaryFailure;
|
|
904
1031
|
};
|
|
905
1032
|
openAttachedScenarioBrowser = async (browserRequest, environment, launcher, signal, retainCleanup) => {
|
|
906
1033
|
const lease = await acquireAttachedScenario(browserRequest, signal);
|
|
907
1034
|
let cleanupOwner;
|
|
1035
|
+
let environmentOwner;
|
|
908
1036
|
try {
|
|
909
1037
|
const priorOwner = lease.admission.cleanupOwner;
|
|
910
1038
|
if (priorOwner !== undefined) await priorOwner.close();
|
|
911
1039
|
throwIfScenarioCancelled$1(signal);
|
|
912
1040
|
const browser = await launcher.connectOverCDP(browserRequest.cdp_endpoint);
|
|
913
1041
|
const cleanup = new PlaywrightScenarioBrowserCleanupOwner({
|
|
914
|
-
closeBrowser: () =>
|
|
1042
|
+
closeBrowser: async () => {
|
|
1043
|
+
let environmentFailure;
|
|
1044
|
+
const ownedEnvironment = environmentOwner;
|
|
1045
|
+
if (ownedEnvironment !== undefined) {
|
|
1046
|
+
try {
|
|
1047
|
+
await ownedEnvironment.close();
|
|
1048
|
+
environmentOwner = undefined;
|
|
1049
|
+
} catch (cause) {
|
|
1050
|
+
environmentFailure = cause;
|
|
1051
|
+
const browserConnected = browser.isConnected();
|
|
1052
|
+
if (ownedEnvironment.targetClosed || !browserConnected) {
|
|
1053
|
+
environmentOwner = undefined;
|
|
1054
|
+
if (!browserConnected) return;
|
|
1055
|
+
} else if (!ownedEnvironment.restored) {
|
|
1056
|
+
throw cause;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
try {
|
|
1061
|
+
await browser.close();
|
|
1062
|
+
environmentOwner = undefined;
|
|
1063
|
+
} catch (browserFailure) {
|
|
1064
|
+
if (environmentFailure !== undefined) throw new AggregateError([environmentFailure, browserFailure], "Attached browser environment cleanup failed");
|
|
1065
|
+
throw browserFailure;
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
915
1068
|
onSettled: (browserClosed) => {
|
|
916
1069
|
if (browserClosed && lease.admission.cleanupOwner === cleanup) lease.admission.cleanupOwner = undefined;
|
|
917
1070
|
lease.release();
|
|
@@ -923,7 +1076,9 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
923
1076
|
throwIfScenarioCancelled$1(signal);
|
|
924
1077
|
const target = await withPlaywrightExecutionBoundary(() => findConnectedPage(browser, browserRequest.target_id, signal), undefined, signal);
|
|
925
1078
|
throwIfScenarioCancelled$1(signal);
|
|
926
|
-
await withPlaywrightExecutionBoundary(() =>
|
|
1079
|
+
const configuredEnvironment = await withPlaywrightExecutionBoundary(() => AttachedScenarioEnvironmentOwner.create(target.context, target.page), undefined, signal);
|
|
1080
|
+
environmentOwner = configuredEnvironment;
|
|
1081
|
+
await withPlaywrightExecutionBoundary(() => configuredEnvironment.apply(environment, signal), undefined, signal);
|
|
927
1082
|
return {
|
|
928
1083
|
...target,
|
|
929
1084
|
browser,
|
|
@@ -936,11 +1091,11 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
936
1091
|
throw cause;
|
|
937
1092
|
}
|
|
938
1093
|
const cleanup = cleanupOwner;
|
|
939
|
-
const
|
|
1094
|
+
const recovery = cleanup.cleanupLease;
|
|
940
1095
|
try {
|
|
941
|
-
return await failBrowserScenarioOperation(
|
|
1096
|
+
return await failBrowserScenarioOperation(recovery, cause);
|
|
942
1097
|
} catch (failure) {
|
|
943
|
-
if (failure !== cause) retainCleanup?.(
|
|
1098
|
+
if (failure !== cause) retainCleanup?.(recovery);
|
|
944
1099
|
throw failure;
|
|
945
1100
|
}
|
|
946
1101
|
}
|
|
@@ -974,13 +1129,13 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
974
1129
|
args: process.platform === "android" ? ["--no-sandbox", "--single-process"] : []
|
|
975
1130
|
});
|
|
976
1131
|
} catch (cause) {
|
|
977
|
-
const cleanup = () => rm(profilePath, {
|
|
1132
|
+
const cleanup = new AnalysisCleanupLease(() => rm(profilePath, {
|
|
978
1133
|
recursive: true,
|
|
979
1134
|
force: true,
|
|
980
1135
|
maxRetries: 3
|
|
981
|
-
});
|
|
1136
|
+
}), ["browser_profile"]);
|
|
982
1137
|
try {
|
|
983
|
-
return await failBrowserScenarioOperation(cleanup, cause
|
|
1138
|
+
return await failBrowserScenarioOperation(cleanup, cause);
|
|
984
1139
|
} catch (failure) {
|
|
985
1140
|
if (failure !== cause) options.retainCleanup?.(cleanup);
|
|
986
1141
|
throw failure;
|
|
@@ -1006,11 +1161,11 @@ function init_PlaywrightScenarioBrowser() {
|
|
|
1006
1161
|
cleanup
|
|
1007
1162
|
};
|
|
1008
1163
|
} catch (cause) {
|
|
1009
|
-
const
|
|
1164
|
+
const recovery = cleanup.cleanupLease;
|
|
1010
1165
|
try {
|
|
1011
|
-
return await failBrowserScenarioOperation(
|
|
1166
|
+
return await failBrowserScenarioOperation(recovery, cause);
|
|
1012
1167
|
} catch (failure) {
|
|
1013
|
-
if (failure !== cause) options.retainCleanup?.(
|
|
1168
|
+
if (failure !== cause) options.retainCleanup?.(recovery);
|
|
1014
1169
|
throw failure;
|
|
1015
1170
|
}
|
|
1016
1171
|
}
|
|
@@ -1269,9 +1424,9 @@ function init_PlaywrightNetworkContent() {
|
|
|
1269
1424
|
"cookie",
|
|
1270
1425
|
"set-cookie"
|
|
1271
1426
|
]);
|
|
1272
|
-
errorMessage = (cause, secrets) => {
|
|
1427
|
+
errorMessage = (cause, secrets, maxMetadataAllocationBytes) => {
|
|
1273
1428
|
const message = cause instanceof Error && cause.message !== "" ? cause.message : "Network read failed";
|
|
1274
|
-
return secrets.redactionAllocationCost(message.length) <=
|
|
1429
|
+
return secrets.redactionAllocationCost(message.length) <= maxMetadataAllocationBytes ? secrets.redact(message) : "Network read failed; diagnostic exceeds the allocation budget.";
|
|
1275
1430
|
};
|
|
1276
1431
|
captureNetworkHeaders = async (source, secrets, options) => {
|
|
1277
1432
|
try {
|
|
@@ -1279,9 +1434,9 @@ function init_PlaywrightNetworkContent() {
|
|
|
1279
1434
|
let cost = 0;
|
|
1280
1435
|
for (const { name, value } of headers) {
|
|
1281
1436
|
cost += secrets.redactionAllocationCost(name.length + value.length) + 128;
|
|
1282
|
-
if (cost >
|
|
1437
|
+
if (cost > options.maxHeaderAllocationBytes) return {
|
|
1283
1438
|
state: "unavailable",
|
|
1284
|
-
message:
|
|
1439
|
+
message: `Headers exceed the ${String(options.maxHeaderAllocationBytes)}-byte allocation budget.`
|
|
1285
1440
|
};
|
|
1286
1441
|
}
|
|
1287
1442
|
return {
|
|
@@ -1300,31 +1455,51 @@ function init_PlaywrightNetworkContent() {
|
|
|
1300
1455
|
} catch (cause) {
|
|
1301
1456
|
return {
|
|
1302
1457
|
state: "unavailable",
|
|
1303
|
-
message: errorMessage(cause, secrets)
|
|
1458
|
+
message: errorMessage(cause, secrets, options.maxMetadataAllocationBytes)
|
|
1304
1459
|
};
|
|
1305
1460
|
}
|
|
1306
1461
|
};
|
|
1307
|
-
captureNetworkBody = async (read, phase, source, secrets, options) => {
|
|
1462
|
+
captureNetworkBody = async (read, phase, source, secrets, options, preflight) => {
|
|
1308
1463
|
try {
|
|
1309
1464
|
const observed = await withPlaywrightExecutionBoundary(read, options.timeoutMs, options.signal);
|
|
1310
1465
|
if (observed === null) return { state: "not_exposed" };
|
|
1311
|
-
|
|
1466
|
+
const maxBodyBytes = options.maxBodyBytes;
|
|
1467
|
+
if (observed.length > maxBodyBytes) return {
|
|
1312
1468
|
state: "unavailable",
|
|
1313
|
-
reason: "body-
|
|
1314
|
-
message:
|
|
1469
|
+
reason: "body-size-limit",
|
|
1470
|
+
message: `Playwright materialized the body before its ${String(maxBodyBytes)}-byte retained-body budget was checked.`,
|
|
1471
|
+
limit_bytes: maxBodyBytes,
|
|
1472
|
+
observed_bytes: observed.length
|
|
1315
1473
|
};
|
|
1316
|
-
|
|
1474
|
+
const bodyAllocationCost = secrets.redactionAllocationCost(observed.length);
|
|
1475
|
+
const base64AllocationCost = Math.ceil(observed.length / 3) * 4 * 8 + 2;
|
|
1476
|
+
const maxBodyAllocationBytes = options.maxBodyAllocationBytes;
|
|
1477
|
+
const observedBodyAllocationBytes = Math.max(bodyAllocationCost, base64AllocationCost);
|
|
1478
|
+
if (observedBodyAllocationBytes > maxBodyAllocationBytes) return {
|
|
1317
1479
|
state: "unavailable",
|
|
1318
|
-
reason: "body-
|
|
1319
|
-
message: "Body redaction exceeds the allocation budget."
|
|
1480
|
+
reason: "body-allocation-limit",
|
|
1481
|
+
message: "Body redaction exceeds the selected network body allocation budget.",
|
|
1482
|
+
limit_allocation_bytes: maxBodyAllocationBytes,
|
|
1483
|
+
observed_allocation_bytes: observedBodyAllocationBytes
|
|
1320
1484
|
};
|
|
1321
|
-
const retained = secrets.redactBytes(observed);
|
|
1322
1485
|
const contentType = source.headers()["content-type"];
|
|
1323
|
-
if (contentType !== undefined && secrets.redactionAllocationCost(contentType.length) >
|
|
1486
|
+
if (contentType !== undefined && secrets.redactionAllocationCost(contentType.length) > options.maxHeaderAllocationBytes) return {
|
|
1324
1487
|
state: "unavailable",
|
|
1325
|
-
reason: "body-
|
|
1326
|
-
message: "Content type exceeds the
|
|
1488
|
+
reason: "body-allocation-limit",
|
|
1489
|
+
message: "Content type exceeds the selected network header allocation budget.",
|
|
1490
|
+
limit_allocation_bytes: options.maxHeaderAllocationBytes,
|
|
1491
|
+
observed_allocation_bytes: secrets.redactionAllocationCost(contentType.length)
|
|
1327
1492
|
};
|
|
1493
|
+
const admission = preflight?.({
|
|
1494
|
+
observedBytes: observed.length,
|
|
1495
|
+
allocationBytes: observedBodyAllocationBytes,
|
|
1496
|
+
mediaType: contentType
|
|
1497
|
+
});
|
|
1498
|
+
if (admission?.status === "omitted") return {
|
|
1499
|
+
state: "omitted",
|
|
1500
|
+
reason: admission.reason
|
|
1501
|
+
};
|
|
1502
|
+
const retained = secrets.redactBytes(observed);
|
|
1328
1503
|
return {
|
|
1329
1504
|
state: "captured",
|
|
1330
1505
|
representation: phase === "request" ? "browser-exposed-request-bytes" : "playwright-response-body-bytes",
|
|
@@ -1339,7 +1514,7 @@ function init_PlaywrightNetworkContent() {
|
|
|
1339
1514
|
return {
|
|
1340
1515
|
state: "unavailable",
|
|
1341
1516
|
reason: cause instanceof AnalysisCancelledError ? "cancelled" : cause instanceof AnalysisTimeoutError ? "body-read-timeout" : "body-read-failed",
|
|
1342
|
-
message: errorMessage(cause, secrets)
|
|
1517
|
+
message: errorMessage(cause, secrets, options.maxMetadataAllocationBytes)
|
|
1343
1518
|
};
|
|
1344
1519
|
}
|
|
1345
1520
|
};
|
|
@@ -1355,15 +1530,29 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1355
1530
|
PlaywrightScenarioNetwork = class {
|
|
1356
1531
|
options;
|
|
1357
1532
|
transactions = new Map();
|
|
1533
|
+
omittedRequests = new WeakSet();
|
|
1534
|
+
omittedPhases = new WeakMap();
|
|
1535
|
+
totalTransactions = 0;
|
|
1536
|
+
omittedTransactionCount = 0;
|
|
1537
|
+
firstOmittedTransaction = 0;
|
|
1538
|
+
lastOmittedTransaction = 0;
|
|
1539
|
+
/** One request and one response-content job at most per admitted transaction. */
|
|
1358
1540
|
pending = [];
|
|
1541
|
+
queuedReads = [];
|
|
1359
1542
|
gaps = new Set();
|
|
1360
1543
|
accepting = true;
|
|
1361
1544
|
activeReads = 0;
|
|
1362
1545
|
readOptions;
|
|
1546
|
+
limits;
|
|
1363
1547
|
constructor(options) {
|
|
1364
1548
|
this.options = options;
|
|
1549
|
+
this.limits = options.limits;
|
|
1365
1550
|
this.readOptions = {
|
|
1366
1551
|
timeoutMs: options.readTimeoutMs ?? 5e3,
|
|
1552
|
+
maxBodyBytes: this.limits.max_network_body_bytes,
|
|
1553
|
+
maxBodyAllocationBytes: this.limits.max_network_body_allocation_bytes,
|
|
1554
|
+
maxHeaderAllocationBytes: this.limits.max_network_header_allocation_bytes,
|
|
1555
|
+
maxMetadataAllocationBytes: this.limits.max_network_metadata_allocation_bytes,
|
|
1367
1556
|
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1368
1557
|
};
|
|
1369
1558
|
}
|
|
@@ -1371,28 +1560,50 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1371
1560
|
request(request) {
|
|
1372
1561
|
if (!this.accepting) return;
|
|
1373
1562
|
const transaction = this.transaction(request);
|
|
1374
|
-
if (transaction === undefined
|
|
1375
|
-
|
|
1563
|
+
if (transaction === undefined) {
|
|
1564
|
+
this.omitOmittedTransactionPhase(request, "request");
|
|
1565
|
+
if (this.options.selection.request_body || this.options.selection.header_values) this.omitOmittedTransactionContent(request, "request");
|
|
1566
|
+
return;
|
|
1567
|
+
}
|
|
1568
|
+
if (transaction.requestObserved) return;
|
|
1569
|
+
if (!this.admitMetadata(transaction, "request", request)) return;
|
|
1376
1570
|
transaction.requestObserved = true;
|
|
1377
|
-
const
|
|
1571
|
+
const admission = this.options.emit({
|
|
1378
1572
|
...this.metadata(request, transaction),
|
|
1379
1573
|
kind: "request",
|
|
1380
1574
|
status: null,
|
|
1381
1575
|
failure: null
|
|
1382
1576
|
});
|
|
1383
|
-
if (
|
|
1384
|
-
|
|
1577
|
+
if (admission.status === "omitted") {
|
|
1578
|
+
this.options.omitNetwork(transaction.id, "request", admission.reason);
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
const sequence = admission.sequence;
|
|
1582
|
+
if (this.options.selection.request_body || this.options.selection.header_values) this.collect(transaction, sequence, "request", request, (headers) => this.options.selection.request_body ? captureNetworkBody(async () => request.postDataBuffer(), "request", request, this.options.secrets, this.readOptions, (body) => this.options.admitContentBody({
|
|
1583
|
+
transactionId: transaction.id,
|
|
1584
|
+
sourceEventSequence: sequence,
|
|
1585
|
+
phase: "request",
|
|
1586
|
+
headers,
|
|
1587
|
+
observedBytes: body.observedBytes,
|
|
1588
|
+
allocationBytes: body.allocationBytes,
|
|
1589
|
+
mediaType: body.mediaType
|
|
1590
|
+
})) : Promise.resolve({ state: "not_requested" }), this.options.selection.header_values);
|
|
1385
1591
|
}
|
|
1386
1592
|
/** Observe response metadata without starting a potentially unfinished body read. */
|
|
1387
1593
|
response(response) {
|
|
1388
1594
|
if (!this.accepting) return;
|
|
1389
1595
|
const request = response.request();
|
|
1390
1596
|
const transaction = this.transaction(request);
|
|
1391
|
-
if (transaction === undefined
|
|
1597
|
+
if (transaction === undefined) {
|
|
1598
|
+
this.omitOmittedTransactionPhase(request, "response");
|
|
1599
|
+
this.observeOmittedTransactionPhase(request, "response");
|
|
1600
|
+
return;
|
|
1601
|
+
}
|
|
1602
|
+
if (!this.admitMetadata(transaction, "response", request, undefined, [], [{
|
|
1392
1603
|
source: response,
|
|
1393
1604
|
url: response.url()
|
|
1394
1605
|
}])) return;
|
|
1395
|
-
const
|
|
1606
|
+
const admission = this.options.emit({
|
|
1396
1607
|
...this.metadata(request, transaction),
|
|
1397
1608
|
kind: "response",
|
|
1398
1609
|
url: this.options.secrets.sanitizeUrl(response.url()),
|
|
@@ -1400,7 +1611,11 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1400
1611
|
header_names: this.headerNames(response),
|
|
1401
1612
|
failure: null
|
|
1402
1613
|
});
|
|
1403
|
-
if (
|
|
1614
|
+
if (admission.status === "omitted") {
|
|
1615
|
+
this.options.omitNetwork(transaction.id, "response", admission.reason);
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1618
|
+
const sequence = admission.sequence;
|
|
1404
1619
|
transaction.response = {
|
|
1405
1620
|
source: response,
|
|
1406
1621
|
sequence
|
|
@@ -1410,15 +1625,22 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1410
1625
|
finished(request) {
|
|
1411
1626
|
if (!this.accepting) return;
|
|
1412
1627
|
const transaction = this.transaction(request);
|
|
1413
|
-
if (transaction === undefined
|
|
1628
|
+
if (transaction === undefined) {
|
|
1629
|
+
this.omitOmittedTransactionPhase(request, "request-finished");
|
|
1630
|
+
const observed = this.omittedPhases.get(request);
|
|
1631
|
+
if (observed?.has("response") && (this.options.selection.response_body || this.options.selection.header_values)) this.omitOmittedTransactionContent(request, "response");
|
|
1632
|
+
return;
|
|
1633
|
+
}
|
|
1634
|
+
if (!this.admitMetadata(transaction, "request-finished", request)) return;
|
|
1414
1635
|
transaction.terminal = "finished";
|
|
1415
|
-
const
|
|
1636
|
+
const admission = this.options.emit({
|
|
1416
1637
|
...this.metadata(request, transaction),
|
|
1417
1638
|
kind: "request-finished",
|
|
1418
1639
|
status: null,
|
|
1419
1640
|
failure: null
|
|
1420
1641
|
});
|
|
1421
|
-
if (
|
|
1642
|
+
if (admission.status === "omitted") {
|
|
1643
|
+
this.options.omitNetwork(transaction.id, "request-finished", admission.reason);
|
|
1422
1644
|
transaction.responseScheduled = true;
|
|
1423
1645
|
return;
|
|
1424
1646
|
}
|
|
@@ -1428,18 +1650,22 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1428
1650
|
failed(request) {
|
|
1429
1651
|
if (!this.accepting) return;
|
|
1430
1652
|
const transaction = this.transaction(request);
|
|
1431
|
-
if (transaction === undefined)
|
|
1653
|
+
if (transaction === undefined) {
|
|
1654
|
+
this.omitOmittedTransactionPhase(request, "request-failed");
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1432
1657
|
transaction.terminal = "failed";
|
|
1433
1658
|
const failure = request.failure()?.errorText || "Unknown request failure";
|
|
1434
|
-
if (!this.admitMetadata(request, undefined, [failure])) return;
|
|
1659
|
+
if (!this.admitMetadata(transaction, "request-failed", request, undefined, [failure])) return;
|
|
1435
1660
|
const message = this.options.secrets.redact(failure);
|
|
1436
|
-
const
|
|
1661
|
+
const admission = this.options.emit({
|
|
1437
1662
|
...this.metadata(request, transaction),
|
|
1438
1663
|
kind: "request-failed",
|
|
1439
1664
|
status: null,
|
|
1440
1665
|
failure: message
|
|
1441
1666
|
});
|
|
1442
|
-
if (
|
|
1667
|
+
if (admission.status === "omitted") {
|
|
1668
|
+
this.options.omitNetwork(transaction.id, "request-failed", admission.reason);
|
|
1443
1669
|
transaction.responseScheduled = true;
|
|
1444
1670
|
return;
|
|
1445
1671
|
}
|
|
@@ -1449,25 +1675,26 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1449
1675
|
message
|
|
1450
1676
|
});
|
|
1451
1677
|
}
|
|
1452
|
-
/** Stop observing, mark unfinished transactions, and
|
|
1678
|
+
/** Stop observing, mark unfinished transactions, and drain admitted content reads. */
|
|
1453
1679
|
async finish() {
|
|
1454
1680
|
if (!this.accepting) {
|
|
1455
|
-
await
|
|
1681
|
+
await this.settlePendingReads();
|
|
1456
1682
|
return;
|
|
1457
1683
|
}
|
|
1458
1684
|
this.accepting = false;
|
|
1459
1685
|
for (const [request, transaction] of this.transactions) {
|
|
1460
1686
|
if (transaction.terminal === undefined) {
|
|
1461
|
-
if (!this.admitMetadata(request)) continue;
|
|
1687
|
+
if (!this.admitMetadata(transaction, "request-unfinished", request)) continue;
|
|
1462
1688
|
this.gaps.add("Some network requests had not completed when capture ended; later activity is unknown.");
|
|
1463
|
-
const
|
|
1689
|
+
const admission = this.options.emit({
|
|
1464
1690
|
...this.metadata(request, transaction),
|
|
1465
1691
|
kind: "request-unfinished",
|
|
1466
1692
|
status: null,
|
|
1467
1693
|
failure: null,
|
|
1468
1694
|
reason: this.options.signal?.aborted === true ? "cancelled" : "capture-ended"
|
|
1469
1695
|
});
|
|
1470
|
-
if (
|
|
1696
|
+
if (admission.status === "omitted") {
|
|
1697
|
+
this.options.omitNetwork(transaction.id, "request-unfinished", admission.reason);
|
|
1471
1698
|
transaction.responseScheduled = true;
|
|
1472
1699
|
continue;
|
|
1473
1700
|
}
|
|
@@ -1478,23 +1705,43 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1478
1705
|
});
|
|
1479
1706
|
}
|
|
1480
1707
|
}
|
|
1481
|
-
await
|
|
1708
|
+
await this.settlePendingReads();
|
|
1709
|
+
}
|
|
1710
|
+
async settlePendingReads() {
|
|
1711
|
+
const results = await Promise.allSettled(this.pending);
|
|
1712
|
+
const failed = results.find((result) => result.status === "rejected");
|
|
1713
|
+
if (failed !== undefined) throw failed.reason;
|
|
1482
1714
|
}
|
|
1483
1715
|
/** Missing selected content contributes to aggregate completeness. */
|
|
1484
1716
|
limitations() {
|
|
1485
1717
|
return [...this.gaps];
|
|
1486
1718
|
}
|
|
1719
|
+
omittedTransactionRange() {
|
|
1720
|
+
return this.omittedTransactionCount === 0 ? null : {
|
|
1721
|
+
first_transaction_id: `request-${String(this.firstOmittedTransaction)}`,
|
|
1722
|
+
last_transaction_id: `request-${String(this.lastOmittedTransaction)}`,
|
|
1723
|
+
count: this.omittedTransactionCount,
|
|
1724
|
+
reason: "max-network-transactions"
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1487
1727
|
transaction(request) {
|
|
1488
1728
|
const known = this.transactions.get(request);
|
|
1489
1729
|
if (known !== undefined) return known;
|
|
1490
|
-
if (this.
|
|
1491
|
-
|
|
1730
|
+
if (this.omittedRequests.has(request)) return undefined;
|
|
1731
|
+
this.totalTransactions += 1;
|
|
1732
|
+
const id = `request-${String(this.totalTransactions)}`;
|
|
1733
|
+
if (this.transactions.size >= this.limits.max_network_transactions) {
|
|
1734
|
+
this.omittedRequests.add(request);
|
|
1735
|
+
if (this.omittedTransactionCount === 0) this.firstOmittedTransaction = this.totalTransactions;
|
|
1736
|
+
this.lastOmittedTransaction = this.totalTransactions;
|
|
1737
|
+
this.omittedTransactionCount += 1;
|
|
1738
|
+
this.gaps.add(`Network collection reached its ${String(this.limits.max_network_transactions)}-transaction resource budget; omitted transaction IDs are listed in events.omissions.network_transaction_range.`);
|
|
1492
1739
|
return undefined;
|
|
1493
1740
|
}
|
|
1494
1741
|
const predecessor = request.redirectedFrom();
|
|
1495
1742
|
const predecessorTransaction = predecessor === null ? undefined : this.transactions.get(predecessor);
|
|
1496
1743
|
const transaction = {
|
|
1497
|
-
id
|
|
1744
|
+
id,
|
|
1498
1745
|
redirectedFrom: predecessorTransaction?.id ?? null,
|
|
1499
1746
|
redirectedFromState: predecessor === null ? "root" : predecessorTransaction === undefined ? "unknown" : undefined,
|
|
1500
1747
|
responseScheduled: false,
|
|
@@ -1503,23 +1750,35 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1503
1750
|
this.transactions.set(request, transaction);
|
|
1504
1751
|
return transaction;
|
|
1505
1752
|
}
|
|
1506
|
-
admitProducerStrings(values) {
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
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.");
|
|
1753
|
+
admitProducerStrings(transaction, kind, values) {
|
|
1754
|
+
const admission = this.options.admitText(kind, values);
|
|
1755
|
+
if (admission.status === "retained") return true;
|
|
1756
|
+
this.options.omitNetwork(transaction.id, kind, admission.reason);
|
|
1757
|
+
this.gaps.add(`Network ${kind} metadata was omitted for ${transaction.id} because ${admission.reason} was reached; network coverage is incomplete.`);
|
|
1519
1758
|
return false;
|
|
1520
1759
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1760
|
+
omitOmittedTransactionPhase(request, kind) {
|
|
1761
|
+
if (!this.omittedRequests.has(request)) return;
|
|
1762
|
+
if (!this.observeOmittedTransactionPhase(request, kind)) return;
|
|
1763
|
+
this.options.omitEvent(kind, "max-network-transactions");
|
|
1764
|
+
}
|
|
1765
|
+
observeOmittedTransactionPhase(request, phase) {
|
|
1766
|
+
let observed = this.omittedPhases.get(request);
|
|
1767
|
+
if (observed === undefined) {
|
|
1768
|
+
observed = new Set();
|
|
1769
|
+
this.omittedPhases.set(request, observed);
|
|
1770
|
+
}
|
|
1771
|
+
if (observed.has(phase)) return false;
|
|
1772
|
+
observed.add(phase);
|
|
1773
|
+
return true;
|
|
1774
|
+
}
|
|
1775
|
+
omitOmittedTransactionContent(request, phase) {
|
|
1776
|
+
if (!this.omittedRequests.has(request)) return;
|
|
1777
|
+
if (!this.observeOmittedTransactionPhase(request, `network-content:${phase}`)) return;
|
|
1778
|
+
this.options.omitEvent("network-content", "max-network-transactions");
|
|
1779
|
+
}
|
|
1780
|
+
admitMetadata(transaction, kind, source, url, additionalStrings = [], additionalSources = []) {
|
|
1781
|
+
return this.admitProducerStrings(transaction, kind, this.metadataStrings(source, url, additionalStrings, additionalSources));
|
|
1523
1782
|
}
|
|
1524
1783
|
*metadataStrings(source, url, additionalStrings, additionalSources) {
|
|
1525
1784
|
yield* this.retainedMetadataStrings(source, source.headers(), url);
|
|
@@ -1558,34 +1817,26 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1558
1817
|
const response = transaction.response;
|
|
1559
1818
|
if (response === undefined || transaction.responseScheduled || !this.options.selection.response_body && !this.options.selection.header_values) return;
|
|
1560
1819
|
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
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
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]) => {
|
|
1820
|
+
this.collect(transaction, response.sequence, "response", response.source, (headers) => this.options.selection.response_body ? unavailable === undefined ? captureNetworkBody(() => response.source.body(), "response", response.source, this.options.secrets, this.readOptions, (body) => this.options.admitContentBody({
|
|
1821
|
+
transactionId: transaction.id,
|
|
1822
|
+
sourceEventSequence: response.sequence,
|
|
1823
|
+
phase: "response",
|
|
1824
|
+
headers,
|
|
1825
|
+
observedBytes: body.observedBytes,
|
|
1826
|
+
allocationBytes: body.allocationBytes,
|
|
1827
|
+
mediaType: body.mediaType
|
|
1828
|
+
})) : Promise.resolve(unavailable) : Promise.resolve({ state: "not_requested" }), this.options.selection.header_values);
|
|
1829
|
+
}
|
|
1830
|
+
collect(transaction, sequence, phase, source, body, includeHeaders) {
|
|
1831
|
+
const collect = async () => {
|
|
1832
|
+
const retainedHeaders = includeHeaders ? await captureNetworkHeaders(source, this.options.secrets, this.readOptions) : { state: "not_requested" };
|
|
1833
|
+
const retainedBody = await body(retainedHeaders);
|
|
1834
|
+
if (retainedBody.state === "omitted") {
|
|
1835
|
+
this.options.omitNetwork(transaction.id, "network-content", retainedBody.reason);
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1587
1838
|
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({
|
|
1839
|
+
const admission = this.options.emit({
|
|
1589
1840
|
kind: "network-content",
|
|
1590
1841
|
transaction_id: transaction.id,
|
|
1591
1842
|
source_event_sequence: sequence,
|
|
@@ -1593,24 +1844,40 @@ function init_PlaywrightScenarioNetwork() {
|
|
|
1593
1844
|
headers: retainedHeaders,
|
|
1594
1845
|
body: retainedBody
|
|
1595
1846
|
});
|
|
1596
|
-
|
|
1597
|
-
|
|
1847
|
+
if (admission.status === "omitted") this.options.omitNetwork(transaction.id, "network-content", admission.reason);
|
|
1848
|
+
};
|
|
1849
|
+
this.pending.push(new Promise((resolve, reject) => {
|
|
1850
|
+
this.queuedReads.push({
|
|
1851
|
+
run: collect,
|
|
1852
|
+
resolve,
|
|
1853
|
+
reject
|
|
1854
|
+
});
|
|
1855
|
+
this.pumpContentReads();
|
|
1598
1856
|
}));
|
|
1599
1857
|
}
|
|
1858
|
+
pumpContentReads() {
|
|
1859
|
+
while (this.activeReads < 16 && this.queuedReads.length > 0) {
|
|
1860
|
+
const job = this.queuedReads.shift();
|
|
1861
|
+
if (job === undefined) return;
|
|
1862
|
+
this.activeReads += 1;
|
|
1863
|
+
void job.run().then(job.resolve, job.reject).finally(() => {
|
|
1864
|
+
this.activeReads -= 1;
|
|
1865
|
+
this.pumpContentReads();
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1600
1869
|
};
|
|
1601
1870
|
})))();
|
|
1602
1871
|
}
|
|
1603
1872
|
|
|
1604
1873
|
//#endregion
|
|
1605
1874
|
//#region dist/browser/PlaywrightScenarioEvents.js
|
|
1606
|
-
var
|
|
1875
|
+
var MAX_LISTENER_OWNERS, allocationCost, PlaywrightScenarioEvents;
|
|
1607
1876
|
function init_PlaywrightScenarioEvents() {
|
|
1608
1877
|
return (init_PlaywrightScenarioEvents = __esmMin((() => {
|
|
1609
1878
|
init_browserScenarioCaptureValues();
|
|
1879
|
+
init_browserScenarioCaptureLimits();
|
|
1610
1880
|
init_PlaywrightScenarioNetwork();
|
|
1611
|
-
MAX_EVENT_COST = 4 * 1024 * 1024;
|
|
1612
|
-
MAX_CAPTURE_COST = 16 * 1024 * 1024;
|
|
1613
|
-
MAX_EVENTS = 1e4;
|
|
1614
1881
|
MAX_LISTENER_OWNERS = 2048;
|
|
1615
1882
|
allocationCost = (value, remaining) => {
|
|
1616
1883
|
if (typeof value === "string") return value.length * 8 + 2;
|
|
@@ -1628,10 +1895,13 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1628
1895
|
items = [];
|
|
1629
1896
|
retainedCost = 0;
|
|
1630
1897
|
dropped = 0;
|
|
1898
|
+
omittedKinds = new Map();
|
|
1899
|
+
omittedNetwork = new Map();
|
|
1631
1900
|
stepIndex = 0;
|
|
1632
1901
|
sequence = 0;
|
|
1633
1902
|
enabled;
|
|
1634
1903
|
secrets;
|
|
1904
|
+
limits;
|
|
1635
1905
|
ownsContext;
|
|
1636
1906
|
pages = new WeakSet();
|
|
1637
1907
|
incompleteFamilies = new Set();
|
|
@@ -1648,6 +1918,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1648
1918
|
this.enabled = new Set(options.enabled);
|
|
1649
1919
|
if (network.request_body || network.response_body || network.header_values) this.enabled = new Set([...this.enabled, "network"]);
|
|
1650
1920
|
this.secrets = options.secrets;
|
|
1921
|
+
this.limits = options.limits ?? DEFAULT_BROWSER_SCENARIO_CAPTURE_LIMITS;
|
|
1651
1922
|
this.ownsContext = options.ownsContext === true;
|
|
1652
1923
|
this.pages.add(options.page);
|
|
1653
1924
|
if (this.ownsContext && this.enabled.size > 0) {
|
|
@@ -1660,9 +1931,13 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1660
1931
|
const context = options.context ?? options.page.context();
|
|
1661
1932
|
const collector = new PlaywrightScenarioNetwork({
|
|
1662
1933
|
selection: network,
|
|
1934
|
+
limits: this.limits,
|
|
1663
1935
|
secrets: options.secrets,
|
|
1664
1936
|
emit: (event) => this.push(event),
|
|
1665
|
-
admitText: (values) => this.admitProducerText(values),
|
|
1937
|
+
admitText: (kind, values) => this.admitProducerText(kind, values, true),
|
|
1938
|
+
admitContentBody: (input) => this.admitContentBody(input),
|
|
1939
|
+
omitNetwork: (id, kind, reason) => this.omitNetwork(id, kind, reason),
|
|
1940
|
+
omitEvent: (kind, reason) => this.omitEvent(kind, reason),
|
|
1666
1941
|
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1667
1942
|
});
|
|
1668
1943
|
this.network = collector;
|
|
@@ -1725,27 +2000,45 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1725
2000
|
limitations() {
|
|
1726
2001
|
const popupGaps = [...this.incompleteFamilies].map((family) => `Popup ${family} events before Page discovery are unavailable; later events are retained.`);
|
|
1727
2002
|
const gaps = [...popupGaps, ...this.network?.limitations() ?? []];
|
|
1728
|
-
if (this.dropped > 0) gaps.push("Browser event collection reached
|
|
2003
|
+
if (this.dropped > 0) gaps.push("Browser event collection reached a selected resource budget; per-kind omissions and affected network transaction IDs are listed in events.omissions, and event coverage is incomplete.");
|
|
1729
2004
|
return this.enabled.has("network") && !this.ownsContext ? ["Shared-context network capture excludes requests without a known root or descendant Page frame.", ...gaps] : gaps;
|
|
1730
2005
|
}
|
|
1731
2006
|
result() {
|
|
2007
|
+
const omittedKinds = new Map([...this.omittedKinds].map(([kind, omission]) => [kind, {
|
|
2008
|
+
count: omission.count,
|
|
2009
|
+
reasons: new Set(omission.reasons)
|
|
2010
|
+
}]));
|
|
1732
2011
|
return {
|
|
1733
2012
|
retained: this.items.length,
|
|
1734
2013
|
dropped: this.dropped,
|
|
1735
|
-
items: this.items
|
|
2014
|
+
items: this.items,
|
|
2015
|
+
omissions: {
|
|
2016
|
+
by_kind: [...omittedKinds].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([kind, omission]) => ({
|
|
2017
|
+
kind,
|
|
2018
|
+
count: omission.count,
|
|
2019
|
+
reasons: [...omission.reasons].sort()
|
|
2020
|
+
})),
|
|
2021
|
+
network_transactions: [...this.omittedNetwork].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([transaction_id, omission]) => ({
|
|
2022
|
+
transaction_id,
|
|
2023
|
+
omitted_kinds: [...omission.kinds].sort(),
|
|
2024
|
+
reasons: [...omission.reasons].sort()
|
|
2025
|
+
})),
|
|
2026
|
+
network_transaction_range: this.network?.omittedTransactionRange() ?? null
|
|
2027
|
+
}
|
|
1736
2028
|
};
|
|
1737
2029
|
}
|
|
1738
2030
|
push(event) {
|
|
1739
|
-
if (this.sealed) return 0;
|
|
1740
2031
|
this.sequence += 1;
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
2032
|
+
const cost = allocationCost(event, this.limits.max_event_allocation_bytes) + 128;
|
|
2033
|
+
const reason = this.admissionReason(cost);
|
|
2034
|
+
if (this.sealed || reason !== undefined) {
|
|
2035
|
+
const finalReason = reason ?? "max-events";
|
|
2036
|
+
this.omitEvent(event.kind, finalReason);
|
|
2037
|
+
return {
|
|
2038
|
+
status: "omitted",
|
|
2039
|
+
sequence: this.sequence,
|
|
2040
|
+
reason: finalReason
|
|
2041
|
+
};
|
|
1749
2042
|
}
|
|
1750
2043
|
this.retainedCost += cost;
|
|
1751
2044
|
const parsed = browserScenarioEventSchema.parse({
|
|
@@ -1754,34 +2047,106 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1754
2047
|
step_index: this.stepIndex
|
|
1755
2048
|
});
|
|
1756
2049
|
this.items.push(parsed);
|
|
1757
|
-
return
|
|
2050
|
+
return {
|
|
2051
|
+
status: "retained",
|
|
2052
|
+
sequence: this.sequence
|
|
2053
|
+
};
|
|
1758
2054
|
}
|
|
1759
|
-
admitText(...values) {
|
|
1760
|
-
return this.admitProducerText(values);
|
|
2055
|
+
admitText(kind, ...values) {
|
|
2056
|
+
return this.admitProducerText(kind, values, false).status === "retained";
|
|
1761
2057
|
}
|
|
1762
2058
|
/** Admit conservative output cost before running redaction or cloning. */
|
|
1763
|
-
admitProducerText(values) {
|
|
1764
|
-
if (this.sealed) return false;
|
|
2059
|
+
admitProducerText(kind, values, networkMetadata) {
|
|
1765
2060
|
let cost = 4096;
|
|
1766
2061
|
for (const value of values) {
|
|
1767
2062
|
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
2063
|
}
|
|
1774
|
-
|
|
2064
|
+
const reason = networkMetadata && cost > this.limits.max_network_metadata_allocation_bytes ? "max-network-metadata-allocation-bytes" : this.admissionReason(cost);
|
|
2065
|
+
if (reason !== undefined) {
|
|
1775
2066
|
this.sequence += 1;
|
|
1776
|
-
this.
|
|
1777
|
-
return
|
|
2067
|
+
this.omitEvent(kind, reason);
|
|
2068
|
+
return {
|
|
2069
|
+
status: "omitted",
|
|
2070
|
+
sequence: this.sequence,
|
|
2071
|
+
reason
|
|
2072
|
+
};
|
|
1778
2073
|
}
|
|
1779
|
-
return
|
|
2074
|
+
return {
|
|
2075
|
+
status: "retained",
|
|
2076
|
+
sequence: this.sequence + 1
|
|
2077
|
+
};
|
|
1780
2078
|
}
|
|
1781
|
-
|
|
1782
|
-
if (this.sealed) return
|
|
1783
|
-
if (this.
|
|
2079
|
+
admissionReason(cost) {
|
|
2080
|
+
if (this.sealed || this.items.length >= this.limits.max_events) return "max-events";
|
|
2081
|
+
if (cost > this.limits.max_event_allocation_bytes) return "max-event-allocation-bytes";
|
|
2082
|
+
if (cost > this.limits.max_total_event_allocation_bytes - this.retainedCost) return "max-total-event-allocation-bytes";
|
|
2083
|
+
return undefined;
|
|
2084
|
+
}
|
|
2085
|
+
admitContentBody(input) {
|
|
2086
|
+
const kind = "network-content";
|
|
2087
|
+
const eventCost = allocationCost({
|
|
2088
|
+
kind,
|
|
2089
|
+
sequence: this.sequence + 1,
|
|
2090
|
+
step_index: this.stepIndex,
|
|
2091
|
+
transaction_id: input.transactionId,
|
|
2092
|
+
source_event_sequence: input.sourceEventSequence,
|
|
2093
|
+
phase: input.phase,
|
|
2094
|
+
headers: input.headers,
|
|
2095
|
+
body: {
|
|
2096
|
+
state: "captured",
|
|
2097
|
+
representation: input.phase === "request" ? "browser-exposed-request-bytes" : "playwright-response-body-bytes",
|
|
2098
|
+
encoding: "base64",
|
|
2099
|
+
content: null,
|
|
2100
|
+
bytes: input.observedBytes,
|
|
2101
|
+
sha256: "0".repeat(64),
|
|
2102
|
+
media_type: null,
|
|
2103
|
+
redacted: false
|
|
2104
|
+
}
|
|
2105
|
+
}, this.limits.max_event_allocation_bytes) - 64 + input.allocationBytes + (input.mediaType === undefined ? 0 : Math.max(input.mediaType.length * 8 + 2, this.secrets.redactionAllocationCost(input.mediaType.length))) + 128;
|
|
2106
|
+
const reason = this.admissionReason(eventCost);
|
|
2107
|
+
if (reason !== undefined) {
|
|
2108
|
+
this.sequence += 1;
|
|
2109
|
+
this.omitEvent(kind, reason);
|
|
2110
|
+
return {
|
|
2111
|
+
status: "omitted",
|
|
2112
|
+
sequence: this.sequence,
|
|
2113
|
+
reason
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
return {
|
|
2117
|
+
status: "retained",
|
|
2118
|
+
sequence: this.sequence + 1
|
|
2119
|
+
};
|
|
2120
|
+
}
|
|
2121
|
+
omitEvent(kind, reason) {
|
|
1784
2122
|
this.dropped += 1;
|
|
2123
|
+
let omission = this.omittedKinds.get(kind);
|
|
2124
|
+
if (omission === undefined) {
|
|
2125
|
+
omission = {
|
|
2126
|
+
count: 0,
|
|
2127
|
+
reasons: new Set()
|
|
2128
|
+
};
|
|
2129
|
+
this.omittedKinds.set(kind, omission);
|
|
2130
|
+
}
|
|
2131
|
+
omission.count += 1;
|
|
2132
|
+
omission.reasons.add(reason);
|
|
2133
|
+
}
|
|
2134
|
+
omitNetwork(transactionId, kind, reason) {
|
|
2135
|
+
let omission = this.omittedNetwork.get(transactionId);
|
|
2136
|
+
if (omission === undefined) {
|
|
2137
|
+
omission = {
|
|
2138
|
+
kinds: new Set(),
|
|
2139
|
+
reasons: new Set()
|
|
2140
|
+
};
|
|
2141
|
+
this.omittedNetwork.set(transactionId, omission);
|
|
2142
|
+
}
|
|
2143
|
+
omission.kinds.add(kind);
|
|
2144
|
+
omission.reasons.add(reason);
|
|
2145
|
+
}
|
|
2146
|
+
admitOwner(kind) {
|
|
2147
|
+
if (this.stopListeners.size < MAX_LISTENER_OWNERS) return true;
|
|
2148
|
+
this.sequence += 1;
|
|
2149
|
+
this.omitEvent(kind, "max-listener-owners");
|
|
1785
2150
|
return false;
|
|
1786
2151
|
}
|
|
1787
2152
|
retainListener(owner, stop) {
|
|
@@ -1812,7 +2177,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1812
2177
|
}
|
|
1813
2178
|
if (this.enabled.has("page-errors")) {
|
|
1814
2179
|
const onError = (error) => {
|
|
1815
|
-
if (!this.admitText(error.message, error.stack ?? "")) return;
|
|
2180
|
+
if (!this.admitText("page-error", error.message, error.stack ?? "")) return;
|
|
1816
2181
|
this.push({
|
|
1817
2182
|
kind: "page-error",
|
|
1818
2183
|
message: this.secrets.redact(error.message),
|
|
@@ -1860,7 +2225,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1860
2225
|
console(message) {
|
|
1861
2226
|
const rawText = message.text();
|
|
1862
2227
|
const location = message.location();
|
|
1863
|
-
if (!this.admitText(rawText, location.url, message.type())) return;
|
|
2228
|
+
if (!this.admitText("console", rawText, location.url, message.type())) return;
|
|
1864
2229
|
this.push({
|
|
1865
2230
|
kind: "console",
|
|
1866
2231
|
level: this.secrets.redact(message.type()),
|
|
@@ -1869,8 +2234,8 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1869
2234
|
});
|
|
1870
2235
|
}
|
|
1871
2236
|
webSocket(socket) {
|
|
1872
|
-
if (!this.admitOwner()) return;
|
|
1873
|
-
if (!this.admitText(socket.url())) return;
|
|
2237
|
+
if (!this.admitOwner("websocket-opened")) return;
|
|
2238
|
+
if (!this.admitText("websocket-opened", socket.url())) return;
|
|
1874
2239
|
const url = this.safeUrl(socket.url());
|
|
1875
2240
|
this.push({
|
|
1876
2241
|
kind: "websocket-opened",
|
|
@@ -1906,7 +2271,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1906
2271
|
});
|
|
1907
2272
|
return;
|
|
1908
2273
|
}
|
|
1909
|
-
if (!this.admitText(payload)) return;
|
|
2274
|
+
if (!this.admitText(kind, payload)) return;
|
|
1910
2275
|
const text = this.secrets.redact(payload);
|
|
1911
2276
|
this.push({
|
|
1912
2277
|
kind,
|
|
@@ -1918,7 +2283,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1918
2283
|
});
|
|
1919
2284
|
}
|
|
1920
2285
|
frame(kind, frame) {
|
|
1921
|
-
if (!this.admitText(frame.url(), frame.name())) return;
|
|
2286
|
+
if (!this.admitText(kind, frame.url(), frame.name())) return;
|
|
1922
2287
|
this.push({
|
|
1923
2288
|
kind,
|
|
1924
2289
|
url: frame.url() === "" ? null : this.safeUrl(frame.url()),
|
|
@@ -1926,7 +2291,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1926
2291
|
});
|
|
1927
2292
|
}
|
|
1928
2293
|
worker(worker) {
|
|
1929
|
-
if (!this.admitOwner() || !this.admitText(worker.url())) return;
|
|
2294
|
+
if (!this.admitOwner("worker-created") || !this.admitText("worker-created", worker.url())) return;
|
|
1930
2295
|
const details = {
|
|
1931
2296
|
url: this.safeUrl(worker.url()),
|
|
1932
2297
|
name: null
|
|
@@ -1947,7 +2312,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1947
2312
|
}
|
|
1948
2313
|
popup(page) {
|
|
1949
2314
|
if (this.pages.has(page)) return;
|
|
1950
|
-
if (!this.admitOwner() || !this.admitText(page.url())) return;
|
|
2315
|
+
if (!this.admitOwner("popup-opened") || !this.admitText("popup-opened", page.url())) return;
|
|
1951
2316
|
this.pages.add(page);
|
|
1952
2317
|
for (const family of [
|
|
1953
2318
|
"frames",
|
|
@@ -1965,7 +2330,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1965
2330
|
...opened
|
|
1966
2331
|
});
|
|
1967
2332
|
const onClose = () => {
|
|
1968
|
-
if (!this.admitText(page.url())) return;
|
|
2333
|
+
if (!this.admitText("popup-closed", page.url())) return;
|
|
1969
2334
|
this.push({
|
|
1970
2335
|
kind: "popup-closed",
|
|
1971
2336
|
url: page.url() === "" ? null : this.safeUrl(page.url()),
|
|
@@ -1978,7 +2343,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1978
2343
|
this.observePage(page);
|
|
1979
2344
|
}
|
|
1980
2345
|
download(download) {
|
|
1981
|
-
if (this.admitText(download.suggestedFilename(), download.url())) this.push({
|
|
2346
|
+
if (this.admitText("download-cancelled", download.suggestedFilename(), download.url())) this.push({
|
|
1982
2347
|
kind: "download-cancelled",
|
|
1983
2348
|
suggested_filename: this.secrets.redact(download.suggestedFilename()),
|
|
1984
2349
|
url: this.safeUrl(download.url())
|
|
@@ -1996,6 +2361,7 @@ function init_PlaywrightScenarioEvents() {
|
|
|
1996
2361
|
var breakpointResponse, scriptIdentifierResponse, storageKeyResponse, targetInfoResponse, STORAGE_EVENT_METHODS, attachedTargetEvent, targetSessionEvent, nestedMessageEvent, nestedProtocolMessage, executionContextEvent, scriptParsedEvent, pausedEvent, evaluationResponse, STORAGE_CLEANUP_TIMEOUT_MS, PlaywrightScenarioStorage;
|
|
1997
2362
|
function init_PlaywrightScenarioStorage() {
|
|
1998
2363
|
return (init_PlaywrightScenarioStorage = __esmMin((() => {
|
|
2364
|
+
init_AnalysisCleanupLease();
|
|
1999
2365
|
init_browserObservationError();
|
|
2000
2366
|
init_PlaywrightExecutionBoundary();
|
|
2001
2367
|
breakpointResponse = z.object({ breakpointId: z.string() });
|
|
@@ -2062,6 +2428,7 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2062
2428
|
#generation = 0;
|
|
2063
2429
|
#closed = false;
|
|
2064
2430
|
#cleanupCompleted = false;
|
|
2431
|
+
#loadingStopped = false;
|
|
2065
2432
|
#failure;
|
|
2066
2433
|
#closePromise;
|
|
2067
2434
|
#detachPromise;
|
|
@@ -2095,8 +2462,9 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2095
2462
|
detached = true;
|
|
2096
2463
|
}
|
|
2097
2464
|
};
|
|
2098
|
-
|
|
2099
|
-
|
|
2465
|
+
const cleanup = new AnalysisCleanupLease(lateCleanup, ["browser_storage_transport"]);
|
|
2466
|
+
retainCleanup?.(cleanup);
|
|
2467
|
+
void withPlaywrightExecutionBoundary(() => cleanup.release(), STORAGE_CLEANUP_TIMEOUT_MS).catch(() => undefined);
|
|
2100
2468
|
}
|
|
2101
2469
|
throw cause;
|
|
2102
2470
|
}
|
|
@@ -2112,9 +2480,9 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2112
2480
|
}
|
|
2113
2481
|
async initializeRoot(page, context) {
|
|
2114
2482
|
const rootInfo = targetInfoResponse.parse(await this.cdp.send("Target.getTargetInfo"));
|
|
2483
|
+
if (this.#closed) return;
|
|
2115
2484
|
const root = this.createTarget(undefined, rootInfo.targetInfo.targetId, (method, params) => this.cdp.send(method, params));
|
|
2116
2485
|
this.#targets.set("", root);
|
|
2117
|
-
if (this.#closed) return;
|
|
2118
2486
|
this.listen(page, context);
|
|
2119
2487
|
const ready = this.initializeTarget(root);
|
|
2120
2488
|
root.ready = ready;
|
|
@@ -2361,7 +2729,7 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2361
2729
|
}
|
|
2362
2730
|
}
|
|
2363
2731
|
close(stopLoading = false) {
|
|
2364
|
-
if (this.#cleanupCompleted) return Promise.resolve();
|
|
2732
|
+
if (this.#cleanupCompleted) return Promise.resolve({ loadingStopped: this.#loadingStopped });
|
|
2365
2733
|
if (this.#closePromise !== undefined) return this.#closePromise;
|
|
2366
2734
|
const closing = this.closeResources(stopLoading).catch((cause) => {
|
|
2367
2735
|
throw new BrowserObservationError("capture_browser_scenario", "cleanup_failed", {
|
|
@@ -2381,10 +2749,13 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2381
2749
|
async closeResources(stopLoading) {
|
|
2382
2750
|
this.#closed = true;
|
|
2383
2751
|
let stopLoadingFailure;
|
|
2384
|
-
if (stopLoading) {
|
|
2752
|
+
if (stopLoading && !this.#loadingStopped) {
|
|
2385
2753
|
try {
|
|
2386
2754
|
const root = this.#targets.get("");
|
|
2387
|
-
if (root !== undefined)
|
|
2755
|
+
if (root !== undefined) {
|
|
2756
|
+
await withPlaywrightExecutionBoundary(() => root.send("Page.stopLoading"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2757
|
+
this.#loadingStopped = true;
|
|
2758
|
+
}
|
|
2388
2759
|
} catch (cause) {
|
|
2389
2760
|
stopLoadingFailure = { cause };
|
|
2390
2761
|
}
|
|
@@ -2415,6 +2786,7 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2415
2786
|
this.#replies.clear();
|
|
2416
2787
|
this.#cleanupCompleted = true;
|
|
2417
2788
|
if (stopLoadingFailure !== undefined) throw stopLoadingFailure.cause;
|
|
2789
|
+
return { loadingStopped: this.#loadingStopped };
|
|
2418
2790
|
}
|
|
2419
2791
|
};
|
|
2420
2792
|
})))();
|
|
@@ -2422,7 +2794,7 @@ function init_PlaywrightScenarioStorage() {
|
|
|
2422
2794
|
|
|
2423
2795
|
//#endregion
|
|
2424
2796
|
//#region dist/browser/PlaywrightScenarioServiceWorkers.js
|
|
2425
|
-
var OPERATION$1, scriptResponse, attachedEvent, detachedEvent, PlaywrightScenarioServiceWorkers;
|
|
2797
|
+
var OPERATION$1, POLICY_CLEANUP_CONFIRMATION_TIMEOUT_MS, scriptResponse, restorationResponse, attachedEvent, detachedEvent, PlaywrightScenarioServiceWorkers;
|
|
2426
2798
|
function init_PlaywrightScenarioServiceWorkers() {
|
|
2427
2799
|
return (init_PlaywrightScenarioServiceWorkers = __esmMin((() => {
|
|
2428
2800
|
init_browserObservation();
|
|
@@ -2432,7 +2804,9 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2432
2804
|
init_CdpTargetSession();
|
|
2433
2805
|
init_PlaywrightExecutionBoundary();
|
|
2434
2806
|
OPERATION$1 = "capture_browser_scenario";
|
|
2807
|
+
POLICY_CLEANUP_CONFIRMATION_TIMEOUT_MS = 5e3;
|
|
2435
2808
|
scriptResponse = z.object({ identifier: z.string() });
|
|
2809
|
+
restorationResponse = z.object({ result: z.object({ value: z.literal("policy_owned").nullable() }) });
|
|
2436
2810
|
attachedEvent = z.object({
|
|
2437
2811
|
sessionId: z.string(),
|
|
2438
2812
|
targetInfo: z.object({ type: z.string() })
|
|
@@ -2452,6 +2826,7 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2452
2826
|
#closed = false;
|
|
2453
2827
|
#released = false;
|
|
2454
2828
|
#detached = false;
|
|
2829
|
+
#loadingStopped = false;
|
|
2455
2830
|
#removeListener;
|
|
2456
2831
|
#setup = new AbortController();
|
|
2457
2832
|
constructor(page, endpoint, targetId) {
|
|
@@ -2481,6 +2856,7 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2481
2856
|
if (targetInfo.type === "iframe") this.addTarget(sessionId);
|
|
2482
2857
|
} else if (event.method === "Target.detachedFromTarget") {
|
|
2483
2858
|
const id = detachedEvent.parse(event.params).sessionId;
|
|
2859
|
+
this.#targets.get(id)?.markDetached();
|
|
2484
2860
|
this.#targets.delete(id);
|
|
2485
2861
|
if (id === this.#session?.sessionId) this.#detached = true;
|
|
2486
2862
|
}
|
|
@@ -2492,8 +2868,15 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2492
2868
|
await withPlaywrightExecutionBoundary(() => this.assertBlocked(), undefined, this.#setup.signal);
|
|
2493
2869
|
}
|
|
2494
2870
|
addTarget(id) {
|
|
2871
|
+
this.#targets.get(id)?.markDetached();
|
|
2872
|
+
let markDetached = () => undefined;
|
|
2873
|
+
const detached = new Promise((resolve) => {
|
|
2874
|
+
markDetached = resolve;
|
|
2875
|
+
});
|
|
2495
2876
|
const target = {
|
|
2496
2877
|
id,
|
|
2878
|
+
detached,
|
|
2879
|
+
markDetached,
|
|
2497
2880
|
ready: Promise.resolve()
|
|
2498
2881
|
};
|
|
2499
2882
|
this.#targets.set(id, target);
|
|
@@ -2549,35 +2932,79 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2549
2932
|
async settle() {
|
|
2550
2933
|
for (;;) {
|
|
2551
2934
|
const targets = [...this.#targets.values()];
|
|
2552
|
-
await Promise.all(targets.map(
|
|
2553
|
-
try {
|
|
2554
|
-
await target.ready;
|
|
2555
|
-
} catch (cause) {
|
|
2556
|
-
if (this.#targets.get(target.id) === target) throw cause;
|
|
2557
|
-
}
|
|
2558
|
-
}));
|
|
2935
|
+
await Promise.all(targets.map((target) => this.settleTarget(target)));
|
|
2559
2936
|
if (targets.length === this.#targets.size && targets.every((target) => this.#targets.get(target.id) === target)) return;
|
|
2560
2937
|
}
|
|
2561
2938
|
}
|
|
2939
|
+
async settleTarget(target) {
|
|
2940
|
+
try {
|
|
2941
|
+
await Promise.race([target.ready, target.detached]);
|
|
2942
|
+
} catch (cause) {
|
|
2943
|
+
if (this.#targets.get(target.id) === target) throw cause;
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
async settleTargetForRestore(target) {
|
|
2947
|
+
try {
|
|
2948
|
+
await Promise.race([target.ready, target.detached]);
|
|
2949
|
+
} catch {}
|
|
2950
|
+
}
|
|
2951
|
+
restorationScript() {
|
|
2952
|
+
return `(() => {
|
|
2953
|
+
const restore = globalThis[${this.restoreKey}];
|
|
2954
|
+
if (typeof restore === "function" && restore(${this.secret}) === true) return null;
|
|
2955
|
+
const register = globalThis.ServiceWorkerContainer?.prototype.register;
|
|
2956
|
+
return typeof register === "function" && Object.hasOwn(register, Symbol.for(${this.marker}))
|
|
2957
|
+
? "policy_owned"
|
|
2958
|
+
: null;
|
|
2959
|
+
})()`;
|
|
2960
|
+
}
|
|
2961
|
+
async restoreMainFrame(id) {
|
|
2962
|
+
const { result } = restorationResponse.parse(await this.send(id, "Runtime.evaluate", {
|
|
2963
|
+
expression: this.restorationScript(),
|
|
2964
|
+
returnByValue: true
|
|
2965
|
+
}));
|
|
2966
|
+
if (result.value === "policy_owned") throw new Error("service-worker policy restoration could not be confirmed");
|
|
2967
|
+
}
|
|
2968
|
+
async restorePlaywrightFrame(frame) {
|
|
2969
|
+
try {
|
|
2970
|
+
const failure = await frame.evaluate(this.restorationScript());
|
|
2971
|
+
if (failure === "policy_owned") throw new Error("service-worker policy restoration could not be confirmed");
|
|
2972
|
+
if (failure !== null) throw new BrowserObservationError(OPERATION$1, "protocol_error");
|
|
2973
|
+
} catch (cause) {
|
|
2974
|
+
if (!this.page.isClosed() && !frame.isDetached()) throw cause;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
async stopMainFrame(frame) {
|
|
2978
|
+
try {
|
|
2979
|
+
await frame.evaluate("globalThis.stop()");
|
|
2980
|
+
this.#loadingStopped = true;
|
|
2981
|
+
} catch (cause) {
|
|
2982
|
+
if (!this.page.isClosed() && !frame.isDetached()) throw cause;
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2562
2985
|
async assertBlocked() {
|
|
2563
2986
|
if (this.#session !== undefined) await this.settle();
|
|
2564
2987
|
for (const frame of this.page.frames()) {
|
|
2565
|
-
let
|
|
2988
|
+
let failure;
|
|
2566
2989
|
try {
|
|
2567
|
-
|
|
2568
|
-
if (!("serviceWorker" in navigator)) return
|
|
2990
|
+
failure = await frame.evaluate(`(async () => {
|
|
2991
|
+
if (!("serviceWorker" in navigator)) return null;
|
|
2569
2992
|
const serviceWorker = navigator.serviceWorker;
|
|
2570
2993
|
if (${this.#session !== undefined} &&
|
|
2571
2994
|
(!Object.hasOwn(serviceWorker.register, Symbol.for(${this.marker})) ||
|
|
2572
|
-
typeof globalThis[${this.restoreKey}] !== "function")) return
|
|
2573
|
-
if (serviceWorker.controller !== null) return
|
|
2574
|
-
return (await serviceWorker.getRegistrations()).length > 0
|
|
2995
|
+
typeof globalThis[${this.restoreKey}] !== "function")) return "policy_unprotected";
|
|
2996
|
+
if (serviceWorker.controller !== null) return "service_worker_blocked";
|
|
2997
|
+
return (await serviceWorker.getRegistrations()).length > 0
|
|
2998
|
+
? "service_worker_blocked"
|
|
2999
|
+
: null;
|
|
2575
3000
|
})()`);
|
|
2576
3001
|
} catch (cause) {
|
|
2577
3002
|
if (frame.isDetached()) continue;
|
|
2578
3003
|
throw cause;
|
|
2579
3004
|
}
|
|
2580
|
-
if (
|
|
3005
|
+
if (failure === "policy_unprotected") throw new BrowserObservationError(OPERATION$1, "target_not_allowed");
|
|
3006
|
+
if (failure === "service_worker_blocked") throw new BrowserObservationError(OPERATION$1, "service_worker_blocked");
|
|
3007
|
+
if (failure !== null) throw new BrowserObservationError(OPERATION$1, "protocol_error");
|
|
2581
3008
|
}
|
|
2582
3009
|
}
|
|
2583
3010
|
close(stopLoading = false) {
|
|
@@ -2589,7 +3016,7 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2589
3016
|
}, () => {
|
|
2590
3017
|
if (this.#restoration === restoration) this.#restoration = undefined;
|
|
2591
3018
|
});
|
|
2592
|
-
return withPlaywrightExecutionBoundary(() => restoration,
|
|
3019
|
+
return withPlaywrightExecutionBoundary(() => restoration, POLICY_CLEANUP_CONFIRMATION_TIMEOUT_MS);
|
|
2593
3020
|
}
|
|
2594
3021
|
async restore(stopLoading) {
|
|
2595
3022
|
await this.#initialization?.catch(() => undefined);
|
|
@@ -2597,8 +3024,16 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2597
3024
|
const session = this.#session;
|
|
2598
3025
|
if (session === undefined) return;
|
|
2599
3026
|
if (!this.page.isClosed()) {
|
|
2600
|
-
|
|
2601
|
-
|
|
3027
|
+
const mainFrame = this.page.mainFrame();
|
|
3028
|
+
if (stopLoading && !this.#loadingStopped) {
|
|
3029
|
+
if (!this.#detached && session.sessionId !== undefined) {
|
|
3030
|
+
await this.send(session.sessionId, "Page.stopLoading");
|
|
3031
|
+
this.#loadingStopped = true;
|
|
3032
|
+
} else {
|
|
3033
|
+
await this.stopMainFrame(mainFrame);
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
await Promise.all([...this.#targets.values()].map((target) => this.settleTargetForRestore(target)));
|
|
2602
3037
|
for (const target of this.#targets.values()) {
|
|
2603
3038
|
if (!this.#detached && target.identifier !== undefined) {
|
|
2604
3039
|
try {
|
|
@@ -2609,19 +3044,16 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2609
3044
|
delete target.identifier;
|
|
2610
3045
|
}
|
|
2611
3046
|
}
|
|
3047
|
+
if (!this.#detached && session.sessionId !== undefined) {
|
|
3048
|
+
await this.restoreMainFrame(session.sessionId);
|
|
3049
|
+
} else {
|
|
3050
|
+
await this.restorePlaywrightFrame(mainFrame);
|
|
3051
|
+
}
|
|
2612
3052
|
for (const frame of this.page.frames()) {
|
|
3053
|
+
if (frame === mainFrame) continue;
|
|
2613
3054
|
if (frame.isDetached()) continue;
|
|
2614
|
-
|
|
2615
|
-
|
|
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
|
-
}
|
|
3055
|
+
if (frame.url().length === 0) continue;
|
|
3056
|
+
await this.restorePlaywrightFrame(frame);
|
|
2625
3057
|
}
|
|
2626
3058
|
}
|
|
2627
3059
|
if (!this.page.isClosed() && !this.#detached && session.sessionId !== undefined) {
|
|
@@ -2641,6 +3073,8 @@ function init_PlaywrightScenarioServiceWorkers() {
|
|
|
2641
3073
|
var OPERATION, throwIfScenarioCancelled, throwCleanupFailures, installCookies, initializePage, PlaywrightScenarioSession;
|
|
2642
3074
|
function init_PlaywrightScenarioSession() {
|
|
2643
3075
|
return (init_PlaywrightScenarioSession = __esmMin((() => {
|
|
3076
|
+
init_AnalysisCleanupLease();
|
|
3077
|
+
init_analysisErrorBase();
|
|
2644
3078
|
init_browserObservationError();
|
|
2645
3079
|
init_BrowserScenarioSecrets();
|
|
2646
3080
|
init_PlaywrightScenarioBrowser();
|
|
@@ -2653,7 +3087,7 @@ function init_PlaywrightScenarioSession() {
|
|
|
2653
3087
|
init_BrowserScenarioPartialObservation();
|
|
2654
3088
|
OPERATION = "capture_browser_scenario";
|
|
2655
3089
|
throwIfScenarioCancelled = (signal) => {
|
|
2656
|
-
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION, "cancelled");
|
|
3090
|
+
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION, "cancelled", { cause: signal?.reason });
|
|
2657
3091
|
};
|
|
2658
3092
|
throwCleanupFailures = (failures) => {
|
|
2659
3093
|
if (failures.length === 1) throw failures[0];
|
|
@@ -2687,6 +3121,9 @@ function init_PlaywrightScenarioSession() {
|
|
|
2687
3121
|
serviceWorkers;
|
|
2688
3122
|
signal;
|
|
2689
3123
|
#storageReleased = false;
|
|
3124
|
+
#stopLoading = false;
|
|
3125
|
+
cleanupLease;
|
|
3126
|
+
#policyStopsLoading = false;
|
|
2690
3127
|
constructor(opened, options) {
|
|
2691
3128
|
this.opened = opened;
|
|
2692
3129
|
this.mode = options.mode;
|
|
@@ -2698,25 +3135,48 @@ function init_PlaywrightScenarioSession() {
|
|
|
2698
3135
|
this.signal = options.signal;
|
|
2699
3136
|
this.version = opened.browser.version();
|
|
2700
3137
|
this.initialUrl = opened.page.url();
|
|
3138
|
+
this.cleanupLease = new AnalysisCleanupLease(async () => {
|
|
3139
|
+
await this.#closeResources();
|
|
3140
|
+
}, { get cleanupResources() {
|
|
3141
|
+
return opened.cleanup.cleanupResources;
|
|
3142
|
+
} });
|
|
2701
3143
|
}
|
|
2702
3144
|
static async open(scenario, environment, options) {
|
|
2703
3145
|
throwIfScenarioCancelled(options.signal);
|
|
2704
3146
|
const secrets = BrowserScenarioSecrets.resolve(scenario, environment);
|
|
2705
3147
|
if (secrets === undefined) throw new BrowserObservationError(OPERATION, "secret_unavailable");
|
|
2706
3148
|
const startedAt = performance.now();
|
|
3149
|
+
const openingCleanup = new Set();
|
|
2707
3150
|
const opening = openPlaywrightScenarioBrowser(scenario, environment, {
|
|
2708
3151
|
signal: options.signal,
|
|
2709
|
-
|
|
3152
|
+
retainCleanup: (lease) => {
|
|
3153
|
+
openingCleanup.add(lease);
|
|
3154
|
+
options.retainCleanup?.(lease);
|
|
3155
|
+
}
|
|
2710
3156
|
});
|
|
2711
3157
|
let opened;
|
|
2712
3158
|
try {
|
|
2713
3159
|
opened = await withPlaywrightExecutionBoundary(() => opening, undefined, options.signal);
|
|
2714
3160
|
} catch (cause) {
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
3161
|
+
let lateOpened;
|
|
3162
|
+
let openingFailure;
|
|
3163
|
+
const cleanup = new AnalysisCleanupLease(async () => {
|
|
3164
|
+
try {
|
|
3165
|
+
lateOpened = await opening;
|
|
3166
|
+
} catch (cause) {
|
|
3167
|
+
openingFailure = cause instanceof AnalysisError && !(options.signal?.aborted === true && cause === options.signal.reason) ? cause : undefined;
|
|
3168
|
+
const results = await Promise.allSettled([...openingCleanup].map((lease) => lease.release()));
|
|
3169
|
+
const failures = results.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
|
|
3170
|
+
throwCleanupFailures(failures);
|
|
3171
|
+
if (openingFailure?.cleanupIncomplete === true) throw openingFailure;
|
|
3172
|
+
return;
|
|
3173
|
+
}
|
|
3174
|
+
await lateOpened.cleanup.release();
|
|
3175
|
+
}, { get cleanupResources() {
|
|
3176
|
+
return lateOpened?.cleanup.cleanupResources ?? openingFailure?.cleanupResources;
|
|
3177
|
+
} });
|
|
3178
|
+
options.retainCleanup?.(cleanup);
|
|
3179
|
+
void withPlaywrightExecutionBoundary(() => cleanup.release(), 1e3).catch(() => undefined);
|
|
2720
3180
|
throw cause;
|
|
2721
3181
|
}
|
|
2722
3182
|
const session = await this.initializeSession(opened, scenario, secrets, options);
|
|
@@ -2736,7 +3196,7 @@ function init_PlaywrightScenarioSession() {
|
|
|
2736
3196
|
} catch (failure) {
|
|
2737
3197
|
cleanup = "incomplete";
|
|
2738
3198
|
cleanupFailure = { cause: failure };
|
|
2739
|
-
options.retainCleanup?.(
|
|
3199
|
+
options.retainCleanup?.(session.cleanupLease);
|
|
2740
3200
|
}
|
|
2741
3201
|
throw browserScenarioOperationFailure(cause, {
|
|
2742
3202
|
kind: "browser-scenario-observation",
|
|
@@ -2773,6 +3233,7 @@ function init_PlaywrightScenarioSession() {
|
|
|
2773
3233
|
enabled: new Set(scenario.capture.events),
|
|
2774
3234
|
secrets,
|
|
2775
3235
|
network: scenario.capture.network,
|
|
3236
|
+
limits: scenario.capture.limits,
|
|
2776
3237
|
...options.signal === undefined ? {} : { signal: options.signal }
|
|
2777
3238
|
});
|
|
2778
3239
|
return new PlaywrightScenarioSession(opened, {
|
|
@@ -2785,25 +3246,29 @@ function init_PlaywrightScenarioSession() {
|
|
|
2785
3246
|
});
|
|
2786
3247
|
} catch (cause) {
|
|
2787
3248
|
let storageReleased = false;
|
|
3249
|
+
const storageStopsLoading = storage !== undefined && options.signal?.aborted === true;
|
|
3250
|
+
let policyStopsLoading = !storageStopsLoading;
|
|
2788
3251
|
const cleanup = async () => {
|
|
2789
3252
|
let storageFailure;
|
|
2790
3253
|
let policyFailure;
|
|
2791
3254
|
let browserFailure;
|
|
2792
3255
|
if (!storageReleased) {
|
|
2793
3256
|
try {
|
|
2794
|
-
await storage?.close(
|
|
3257
|
+
const result = await storage?.close(storageStopsLoading);
|
|
3258
|
+
if (storageStopsLoading && result?.loadingStopped !== true) policyStopsLoading = true;
|
|
2795
3259
|
} catch (failure) {
|
|
2796
3260
|
storageFailure = { cause: failure };
|
|
3261
|
+
policyStopsLoading = true;
|
|
2797
3262
|
}
|
|
2798
3263
|
}
|
|
2799
3264
|
try {
|
|
2800
|
-
if (!opened.cleanup.browserClosed) await serviceWorkers?.close(
|
|
3265
|
+
if (!opened.cleanup.browserClosed) await serviceWorkers?.close(policyStopsLoading);
|
|
2801
3266
|
} catch (failure) {
|
|
2802
3267
|
policyFailure = { cause: failure };
|
|
2803
3268
|
}
|
|
2804
3269
|
if (policyFailure === undefined) {
|
|
2805
3270
|
try {
|
|
2806
|
-
await opened.cleanup.
|
|
3271
|
+
await opened.cleanup.release(events === undefined ? undefined : () => events?.finish() ?? Promise.resolve());
|
|
2807
3272
|
} catch (failure) {
|
|
2808
3273
|
browserFailure = { cause: failure };
|
|
2809
3274
|
}
|
|
@@ -2821,10 +3286,11 @@ function init_PlaywrightScenarioSession() {
|
|
|
2821
3286
|
...browserFailure === undefined ? [] : [browserFailure.cause]
|
|
2822
3287
|
]);
|
|
2823
3288
|
};
|
|
3289
|
+
const recovery = new AnalysisCleanupLease(cleanup, opened.cleanup);
|
|
2824
3290
|
try {
|
|
2825
|
-
return await failBrowserScenarioOperation(
|
|
3291
|
+
return await failBrowserScenarioOperation(recovery, cause);
|
|
2826
3292
|
} catch (failure) {
|
|
2827
|
-
if (failure !== cause) options.retainCleanup?.(
|
|
3293
|
+
if (failure !== cause) options.retainCleanup?.(recovery);
|
|
2828
3294
|
throw failure;
|
|
2829
3295
|
}
|
|
2830
3296
|
}
|
|
@@ -2870,24 +3336,45 @@ function init_PlaywrightScenarioSession() {
|
|
|
2870
3336
|
}), undefined, signal);
|
|
2871
3337
|
}
|
|
2872
3338
|
async close(stopLoading = this.signal?.aborted === true) {
|
|
3339
|
+
this.#stopLoading ||= stopLoading;
|
|
3340
|
+
try {
|
|
3341
|
+
await withPlaywrightExecutionBoundary(() => this.cleanupLease.release(), PLAYWRIGHT_CLEANUP_CONFIRMATION_TIMEOUT_MS);
|
|
3342
|
+
} catch (cause) {
|
|
3343
|
+
const error = new BrowserObservationError(OPERATION, "cleanup_failed", {
|
|
3344
|
+
cause,
|
|
3345
|
+
cleanup: {
|
|
3346
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
3347
|
+
resources: this.cleanupLease.cleanupResources ?? []
|
|
3348
|
+
}
|
|
3349
|
+
});
|
|
3350
|
+
new AnalysisCleanupLeaseGroup(error, [this.cleanupLease]);
|
|
3351
|
+
throw error;
|
|
3352
|
+
}
|
|
3353
|
+
return this.mode === "launch" ? "terminated-owned-process" : "disconnected-external";
|
|
3354
|
+
}
|
|
3355
|
+
async #closeResources() {
|
|
3356
|
+
const stopLoading = this.#stopLoading || this.signal?.aborted === true;
|
|
2873
3357
|
let storageFailure;
|
|
2874
3358
|
let policyFailure;
|
|
2875
3359
|
let browserFailure;
|
|
3360
|
+
if (stopLoading && this.storage === undefined) this.#policyStopsLoading = true;
|
|
2876
3361
|
if (!this.#storageReleased) {
|
|
2877
3362
|
try {
|
|
2878
|
-
await this.storage?.close(stopLoading);
|
|
3363
|
+
const result = await this.storage?.close(stopLoading);
|
|
3364
|
+
if (stopLoading && result?.loadingStopped !== true) this.#policyStopsLoading = true;
|
|
2879
3365
|
} catch (failure) {
|
|
2880
3366
|
storageFailure = { cause: failure };
|
|
3367
|
+
if (stopLoading) this.#policyStopsLoading = true;
|
|
2881
3368
|
}
|
|
2882
3369
|
}
|
|
2883
3370
|
try {
|
|
2884
|
-
if (!this.opened.cleanup.browserClosed) await this.serviceWorkers?.close(
|
|
3371
|
+
if (!this.opened.cleanup.browserClosed) await this.serviceWorkers?.close(this.#policyStopsLoading);
|
|
2885
3372
|
} catch (failure) {
|
|
2886
3373
|
policyFailure = { cause: failure };
|
|
2887
3374
|
}
|
|
2888
3375
|
if (policyFailure === undefined) {
|
|
2889
3376
|
try {
|
|
2890
|
-
await this.opened.cleanup.
|
|
3377
|
+
await this.opened.cleanup.release(() => this.eventCapture.finish());
|
|
2891
3378
|
} catch (failure) {
|
|
2892
3379
|
browserFailure = { cause: failure };
|
|
2893
3380
|
}
|
|
@@ -2904,7 +3391,6 @@ function init_PlaywrightScenarioSession() {
|
|
|
2904
3391
|
...this.#storageReleased || storageFailure === undefined ? [] : [storageFailure.cause],
|
|
2905
3392
|
...browserFailure === undefined ? [] : [browserFailure.cause]
|
|
2906
3393
|
]);
|
|
2907
|
-
return this.mode === "launch" ? "terminated-owned-process" : "disconnected-external";
|
|
2908
3394
|
}
|
|
2909
3395
|
redactError(error) {
|
|
2910
3396
|
return this.secrets.redact(error instanceof Error ? error.message : "browser action failed");
|