reverseport 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DISCLAIMER.md +136 -0
- package/LICENSE +22 -0
- package/README.md +289 -2
- package/RESPONSIBLE-USE.md +22 -0
- package/THIRD_PARTY_NOTICES.md +130 -0
- package/bin/reverseport.mjs +136 -0
- package/bridge/android/ReaJadxBridge.java +270 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +3858 -0
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +36 -0
- package/bridge/hopper_bridge.py +1162 -0
- package/bridge/mitmproxy/capture.py +208 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +171 -0
- package/bridge/native/rea_lldb_tracer.py +839 -0
- package/bridge/process/ProcessRunTokenReader.swift +339 -0
- package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
- package/bridge/pwndbg/core_context.py +101 -0
- package/bridge/pwndbg/launch.py +39 -0
- package/bridge/pwndbg/launch_impl.py +34 -0
- package/bridge/pwntools/decoder_runtime.py +59 -0
- package/bridge/pwntools/layout.py +39 -0
- package/bridge/pwntools/layout_impl.py +314 -0
- package/bridge/pwntools/recorded_crash.py +39 -0
- package/bridge/pwntools/recorded_crash_impl.py +147 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +191 -0
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbProvider.js +1227 -0
- package/dist/adb/AdbShellOutput.js +267 -0
- package/dist/android/AndroidTargetSnapshot.js +118 -0
- package/dist/android/JadxAnalysis.js +201 -0
- package/dist/android/JadxConfiguration.js +320 -0
- package/dist/android/JadxMcpTransport.js +188 -0
- package/dist/android/JadxProtocol.js +115 -0
- package/dist/android/JadxProvider.js +337 -0
- package/dist/android/JadxRelease.js +27 -0
- package/dist/android/JadxSession.js +172 -0
- package/dist/apktool/ApktoolConfiguration.js +120 -0
- package/dist/apktool/ApktoolDecodeOutput.js +142 -0
- package/dist/apktool/ApktoolProvider.js +522 -0
- package/dist/application/AnalysisContextQueries.js +128 -0
- package/dist/application/AnalysisDocument.js +32 -0
- package/dist/application/AnalysisProvider.js +27 -0
- package/dist/application/AppBundleExecutable.js +192 -0
- package/dist/application/BinaryTargetResolver.js +356 -0
- package/dist/application/BrowserEvidence.js +127 -0
- package/dist/application/BrowserObservationPort.js +1 -0
- package/dist/application/BrowserObservationService.js +86 -0
- package/dist/application/BrowserScenarioCapturePort.js +1 -0
- package/dist/application/BrowserScenarioCaptureService.js +17 -0
- package/dist/application/BrowserScenarioEvidence.js +28 -0
- package/dist/application/CallPathTracing.js +182 -0
- package/dist/application/CapabilityClientRequirements.js +17 -0
- package/dist/application/CapabilityInventory.js +525 -0
- package/dist/application/ClientConfigPath.js +35 -0
- package/dist/application/ClientConfigurationDocument.js +1196 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +39 -0
- package/dist/application/ClientRegistrationIdentity.js +80 -0
- package/dist/application/ClientRegistrationStatus.js +233 -0
- package/dist/application/DirectAnalysis.js +371 -0
- package/dist/application/DirectAnalysisCleanup.js +71 -0
- package/dist/application/DirectAnalysisDependencies.js +1 -0
- package/dist/application/DirectAnalysisStatus.js +22 -0
- package/dist/application/Doctor.js +349 -0
- package/dist/application/DoctorDiagnostics.js +169 -0
- package/dist/application/DoctorProviderIds.js +2 -0
- package/dist/application/DoctorScope.js +113 -0
- package/dist/application/DshCordisPatch.js +342 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +88 -0
- package/dist/application/EnhancedToolTypes.js +4 -0
- package/dist/application/EnhancedTools.js +428 -0
- package/dist/application/EvidenceBundleCommands.js +70 -0
- package/dist/application/EvidenceBundleFiles.js +79 -0
- package/dist/application/EvidenceInputResolver.js +30 -0
- package/dist/application/FunctionAnalysisEvidence.js +34 -0
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InventoryProjectionEvidence.js +44 -0
- package/dist/application/InvestigationProviders.js +130 -0
- package/dist/application/JsonFiles.js +225 -0
- package/dist/application/JsonInputFile.js +410 -0
- package/dist/application/LinuxHopper.js +232 -0
- package/dist/application/MacHopper.js +235 -0
- package/dist/application/MipsElfMetadata.js +175 -0
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcedureAddressResolution.js +11 -0
- package/dist/application/ProgressReporter.js +30 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/RealHopperAssertions.js +135 -0
- package/dist/application/ReconstructionCoverageService.js +22 -0
- package/dist/application/ReconstructionObligationAuthority.js +72 -0
- package/dist/application/ReconstructionObligationCandidates.js +286 -0
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +47 -0
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +238 -0
- package/dist/application/ReconstructionObligationLedgerProjection.js +15 -0
- package/dist/application/ReconstructionObligationLedgerService.js +54 -0
- package/dist/application/ReconstructionObligationOriginalCases.js +34 -0
- package/dist/application/ReconstructionObligationPolicies.js +132 -0
- package/dist/application/ReferenceSourceImport.js +200 -0
- package/dist/application/ReferenceSourceImportEntries.js +151 -0
- package/dist/application/ReferenceSourceImportPolicy.js +125 -0
- package/dist/application/ReferenceSourceImportTypes.js +47 -0
- package/dist/application/ReferenceSourceVcsAdapter.js +180 -0
- package/dist/application/RegularFileRead.js +120 -0
- package/dist/application/Setup.js +408 -0
- package/dist/application/SetupClientConfiguration.js +314 -0
- package/dist/application/SetupClients.js +44 -0
- package/dist/application/SetupHost.js +203 -0
- package/dist/application/SetupInstallFailure.js +77 -0
- package/dist/application/SetupPlan.js +210 -0
- package/dist/application/SetupRegistrationEnvironment.js +5 -0
- package/dist/application/SetupSkill.js +248 -0
- package/dist/application/SetupTypes.js +17 -0
- package/dist/application/SupportedClients.js +469 -0
- package/dist/application/TypeScriptEmittedSourceCandidates.js +23 -0
- package/dist/application/Uninstall.js +452 -0
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +137 -0
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +111 -0
- package/dist/application/UpdateRuntime.js +264 -0
- package/dist/application/Utf8JsonInput.js +71 -0
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModulePorts.js +1 -0
- package/dist/application/WebModuleTraceService.js +214 -0
- package/dist/application/WebNetworkCapturePort.js +1 -0
- package/dist/application/WebNetworkCaptureService.js +134 -0
- package/dist/application/WebRuntimePort.js +1 -0
- package/dist/application/WebRuntimeService.js +75 -0
- package/dist/application/WebScriptArtifactPort.js +1 -0
- package/dist/application/WebScriptExportService.js +214 -0
- package/dist/application/WebSourceLocationPorts.js +1 -0
- package/dist/application/WebSourceLocationService.js +177 -0
- package/dist/application/WindowsCapabilities.js +87 -0
- package/dist/application/WorkflowEvidence.js +105 -0
- package/dist/application/XrefsAddressResolution.js +45 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +133 -0
- package/dist/application/android/AndroidAnalysisPort.js +1 -0
- package/dist/application/android/AndroidAnalysisService.js +37 -0
- package/dist/application/android/AndroidApplicationService.js +17 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/apple/AppleApplicationService.js +17 -0
- package/dist/application/artifacts/ArtifactExtractionDestination.js +5 -0
- package/dist/application/binary/AbortablePromise.js +28 -0
- package/dist/application/binary/AnalysisClientCleanup.js +15 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +77 -0
- package/dist/application/binary/AnalysisProviderRegistry.js +235 -0
- package/dist/application/binary/AnalysisSnapshotCache.js +232 -0
- package/dist/application/binary/AnalysisSnapshotFiles.js +96 -0
- package/dist/application/binary/BinarySession.js +605 -0
- package/dist/application/binary/BinarySessionComposition.js +9 -0
- package/dist/application/binary/BinarySessionExecution.js +66 -0
- package/dist/application/binary/BinarySessionOpen.js +66 -0
- package/dist/application/binary/BinarySessionPort.js +1 -0
- package/dist/application/binary/BinarySessionRecords.js +216 -0
- package/dist/application/binary/BinarySessionStatus.js +219 -0
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +103 -0
- package/dist/application/binary/LazyAnalysisProvider.js +105 -0
- package/dist/application/binary/SessionProviderRouter.js +118 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +60 -0
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +63 -0
- package/dist/application/evm/EvmInterfacePort.js +1 -0
- package/dist/application/evm/EvmInterfaceService.js +67 -0
- package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +38 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +77 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/homebrew.js +67 -0
- package/dist/application/investigation/EvidenceLedger.js +338 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/investigation/InvestigationRecordPort.js +1 -0
- package/dist/application/investigation/InvestigationRecords.js +65 -0
- package/dist/application/investigation/UnknownEvidence.js +37 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +29 -0
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/javascript/ElectronActiveObservationService.js +51 -0
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +118 -0
- package/dist/application/javascript/ElectronBoundaryGraph.js +11 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +134 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +63 -0
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +261 -0
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +102 -0
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +224 -0
- package/dist/application/javascript/ElectronEvidence.js +37 -0
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/javascript/ElectronObservationService.js +26 -0
- package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +49 -0
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +173 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +170 -0
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +67 -0
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +194 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +431 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +89 -0
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +193 -0
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +229 -0
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +194 -0
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +160 -0
- package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +85 -0
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +349 -0
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +424 -0
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +836 -0
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +245 -0
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +12 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +40 -0
- package/dist/application/javascript/JavaScriptModuleRelationships.js +304 -0
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +77 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +36 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +28 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationEvidence.js +24 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +52 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +163 -0
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +527 -0
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +165 -0
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +156 -0
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +216 -0
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +61 -0
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +86 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +25 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +183 -0
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +112 -0
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +58 -0
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +136 -0
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +41 -0
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +55 -0
- package/dist/application/managed/ManagedMemberComparisonService.js +125 -0
- package/dist/application/managed/ManagedNativeVerificationService.js +40 -0
- package/dist/application/managed/ManagedReconstructionService.js +59 -0
- package/dist/application/native/NativeApiInspection.js +77 -0
- package/dist/application/native/NativeCallRoutes.js +73 -0
- package/dist/application/native/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/native/NativeUiActionTrace.js +427 -0
- package/dist/application/native/NativeValueTrace.js +340 -0
- package/dist/application/process/ProcessCli.js +190 -0
- package/dist/application/process/ProcessEvidence.js +30 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +72 -0
- package/dist/application/workflowInputError.js +18 -0
- package/dist/artifacts/ArtifactHash.js +29 -0
- package/dist/artifacts/ArtifactPaths.js +167 -0
- package/dist/artifacts/ArtifactProvider.js +280 -0
- package/dist/artifacts/ArtifactProviderMetadata.js +34 -0
- package/dist/artifacts/ArtifactReader.js +77 -0
- package/dist/artifacts/ArtifactResourceScope.js +103 -0
- package/dist/artifacts/AsarArtifactReader.js +518 -0
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +292 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +342 -0
- package/dist/artifacts/NativeDmgArtifactReader.js +508 -0
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +394 -0
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/StreamBytes.js +10 -0
- package/dist/artifacts/ZipArtifactReader.js +222 -0
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +190 -0
- package/dist/artifacts/apple/DylibResolutionReader.js +269 -0
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +500 -0
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +233 -0
- package/dist/artifacts/apple/KeyedArchiveReader.js +163 -0
- package/dist/artifacts/apple/MachoLoadCommandReader.js +393 -0
- package/dist/artifacts/apple/NibArchive.js +338 -0
- package/dist/artifacts/apple/NibViewHierarchy.js +157 -0
- package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
- package/dist/artifacts/extraction/ArtifactExtraction.js +253 -0
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +343 -0
- package/dist/artifacts/inventory/ArtifactInventory.js +16 -0
- package/dist/artifacts/inventory/classify.js +94 -0
- package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
- package/dist/artifacts/inventory/reader.js +40 -0
- package/dist/artifacts/inventory/scanCanonical.js +213 -0
- package/dist/artifacts/inventory/scanReader.js +169 -0
- package/dist/artifacts/inventory/types.js +3 -0
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +317 -0
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/artifacts/readStableArtifact.js +68 -0
- package/dist/browser/BrowserProcessStartup.js +89 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +127 -0
- package/dist/browser/BrowserScenarioSecrets.js +137 -0
- package/dist/browser/BrowserScenarioSessionPort.js +1 -0
- package/dist/browser/CdpAuthorizedMainFrame.js +16 -0
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +276 -0
- package/dist/browser/CdpCaptureCompleteness.js +92 -0
- package/dist/browser/CdpCaptureDocuments.js +375 -0
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +55 -0
- package/dist/browser/CdpCaptureEventHandlers.js +463 -0
- package/dist/browser/CdpCaptureEventHelpers.js +84 -0
- package/dist/browser/CdpCaptureEventState.js +1 -0
- package/dist/browser/CdpCaptureEventTypes.js +5 -0
- package/dist/browser/CdpCaptureEvents.js +199 -0
- package/dist/browser/CdpCaptureStorage.js +86 -0
- package/dist/browser/CdpCaptureStorageFingerprints.js +320 -0
- package/dist/browser/CdpCaptureValues.js +91 -0
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +303 -0
- package/dist/browser/CdpElectronInspection.js +253 -0
- package/dist/browser/CdpElectronProvider.js +115 -0
- package/dist/browser/CdpElectronScriptEvents.js +55 -0
- package/dist/browser/CdpElectronScripts.js +65 -0
- package/dist/browser/CdpElectronWorkers.js +57 -0
- package/dist/browser/CdpEndpoint.js +217 -0
- package/dist/browser/CdpObservationSession.js +332 -0
- package/dist/browser/CdpOptionalCommand.js +14 -0
- package/dist/browser/CdpPageCapture.js +278 -0
- package/dist/browser/CdpPageCaptureScripts.js +79 -0
- package/dist/browser/CdpPageCaptureWorkers.js +46 -0
- package/dist/browser/CdpSafeMetadata.js +284 -0
- package/dist/browser/CdpScreenshot.js +110 -0
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +65 -0
- package/dist/browser/CdpWebMcpDiscovery.js +361 -0
- package/dist/browser/ElectronFileScope.js +135 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +301 -0
- package/dist/browser/PlaywrightElectronActiveActions.js +257 -0
- package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +293 -0
- package/dist/browser/PlaywrightExecutionBoundary.js +53 -0
- package/dist/browser/PlaywrightScenarioActions.js +58 -0
- package/dist/browser/PlaywrightScenarioArtifacts.js +162 -0
- package/dist/browser/PlaywrightScenarioBrowser.js +412 -0
- package/dist/browser/PlaywrightScenarioEvents.js +253 -0
- package/dist/browser/PlaywrightScenarioSession.js +279 -0
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +380 -0
- package/dist/browser/WebSourceMapFetcher.js +718 -0
- package/dist/browser/assets/LocalWebScriptArtifacts.js +89 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +140 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +73 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +78 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +41 -0
- package/dist/browser/execution/CdpEventListeners.js +79 -0
- package/dist/browser/execution/CdpExecutionCapture.js +135 -0
- package/dist/browser/execution/CdpExecutionCollection.js +57 -0
- package/dist/browser/execution/CdpExecutionWindow.js +100 -0
- package/dist/browser/execution/CdpListenerSelector.js +22 -0
- package/dist/browser/execution/CdpPreciseCoverage.js +45 -0
- package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
- package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
- package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
- package/dist/browser/execution/CdpRuntimeSession.js +163 -0
- package/dist/browser/execution/CdpRuntimeSources.js +223 -0
- package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
- package/dist/browser/history/CaptureFailures.js +153 -0
- package/dist/browser/history/CaptureFormatError.js +10 -0
- package/dist/browser/history/CaptureRedaction.js +68 -0
- package/dist/browser/history/CaptureRelease.js +23 -0
- package/dist/browser/history/HarCapture.js +179 -0
- package/dist/browser/history/HarCaptureAdapter.js +23 -0
- package/dist/browser/history/HarCaptureProcess.js +49 -0
- package/dist/browser/history/HarJson.js +92 -0
- package/dist/browser/history/HarSchema.js +72 -0
- package/dist/browser/history/HistoricalCaptureDecoder.js +198 -0
- package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
- package/dist/browser/history/MitmproxyCaptureAdapter.js +46 -0
- package/dist/browser/modules/NativeModuleResolver.js +277 -0
- package/dist/browser/modules/WebModuleArtifacts.js +41 -0
- package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
- package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
- package/dist/browser/providerIdentities.js +24 -0
- package/dist/catalogIdentity.js +65 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisSelector.js +23 -0
- package/dist/cli/analysisViewCommands.js +74 -0
- package/dist/cli/androidCommands.js +91 -0
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/applicationCommands.js +173 -0
- package/dist/cli/artifactCommands.js +160 -0
- package/dist/cli/binaryDiagnosticsCommands.js +57 -0
- package/dist/cli/browserAdvancedCommands.js +189 -0
- package/dist/cli/browserCommands.js +125 -0
- package/dist/cli/commandCancellation.js +24 -0
- package/dist/cli/coreAnalysisCommands.js +7 -0
- package/dist/cli/coreBinaryCommands.js +283 -0
- package/dist/cli/coreNativeCommands.js +269 -0
- package/dist/cli/electronCommands.js +150 -0
- package/dist/cli/evmCommands.js +33 -0
- package/dist/cli/firmwareCommands.js +61 -0
- package/dist/cli/goCommands.js +21 -0
- package/dist/cli/interactiveSetup.js +236 -0
- package/dist/cli/javascriptApplicationAnalysis.js +34 -0
- package/dist/cli/javascriptRecoveryCommands.js +59 -0
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +46 -0
- package/dist/cli/managedCommands.js +129 -0
- package/dist/cli/managedProjectGraphCommand.js +24 -0
- package/dist/cli/nativeCallCommands.js +33 -0
- package/dist/cli/omittableDefaults.js +50 -0
- package/dist/cli/options.js +33 -0
- package/dist/cli/processCommands.js +25 -0
- package/dist/cli/referenceSourceImportStatus.js +22 -0
- package/dist/cli/setupCommands.js +189 -0
- package/dist/cli/streamedJsonOutput.js +134 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utilityCommands.js +226 -0
- package/dist/cli/wasmCommands.js +44 -0
- package/dist/cli/webModuleCommands.js +60 -0
- package/dist/cli/webNetworkCaptureCommands.js +40 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +50 -0
- package/dist/cli/webSourceLocationCommands.js +54 -0
- package/dist/cli-runtime/AnalysisProvider-CeyX2u-b.js +25 -0
- package/dist/cli-runtime/AnalysisSnapshotFiles-BuK_ymw5.js +523 -0
- package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
- package/dist/cli-runtime/ArtifactResourceScope-CZqLEfbb.js +108 -0
- package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
- package/dist/cli-runtime/BinaryTargetResolver-CKRfFhLj.js +965 -0
- package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
- package/dist/cli-runtime/ClientConfigurationDocument-D0ZqgTCv.js +1522 -0
- package/dist/cli-runtime/ClientRegistrationStatus-DGpwJ4ry.js +422 -0
- package/dist/cli-runtime/DirectAnalysis-DW3MvxW0.js +500 -0
- package/dist/cli-runtime/Doctor-CzwYS9nB.js +862 -0
- package/dist/cli-runtime/ElectronFileScope-C1hUEp36.js +1419 -0
- package/dist/cli-runtime/ExecFileOutput-Czbj-HpV.js +106 -0
- package/dist/cli-runtime/IdaConfiguration-rEjpuRQ1.js +854 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-DT74BY9z.js +225 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-Dt4Og45O.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-D-QCy-4c.js +117 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-CODAjVru.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-CCtwSg8r.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-CJeBSMPx.js +83 -0
- package/dist/cli-runtime/JsonFiles-Ce_O5NcH.js +708 -0
- package/dist/cli-runtime/ManagedSnapshot-DthWfmy9.js +3622 -0
- package/dist/cli-runtime/OwnedCommand-CnK8-h3N.js +106 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-KNg6qLwo.js +237 -0
- package/dist/cli-runtime/ProcessOwnership-AOJaszxt.js +1310 -0
- package/dist/cli-runtime/ProviderDeadline-BSbNOmuW.js +89 -0
- package/dist/cli-runtime/RegularFile-CL6meBxi.js +114 -0
- package/dist/cli-runtime/RegularFileRead-BMh5FMXd.js +115 -0
- package/dist/cli-runtime/SafeOutputTree-D8z2Zrnu.js +512 -0
- package/dist/cli-runtime/SetupHost-CzzRF89z.js +842 -0
- package/dist/cli-runtime/SupportedClients-BrZ2qZVg.js +671 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-DF55X_N2.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/WindowsBatchCommand-5gT-d7O4.js +45 -0
- package/dist/cli-runtime/ZipArtifactReader-Db65WuM_.js +380 -0
- package/dist/cli-runtime/analysisErrorCleanup-DaUQNiQd.js +32 -0
- package/dist/cli-runtime/analysisErrorPresentation-DZrKL8kS.js +331 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-OZFIFjZr.js +93 -0
- package/dist/cli-runtime/application__EnhancedTools-C__HAdqG.js +1728 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-fWSgvV74.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-DlNt-4TY.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CEpbUv-7.js +813 -0
- package/dist/cli-runtime/application__Setup-BExVGpqG.js +540 -0
- package/dist/cli-runtime/application__Uninstall-BVgWDCPN.js +349 -0
- package/dist/cli-runtime/application__UpdateRuntime-Dj6UIhHQ.js +358 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-CyynwW6Z.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-BNPcWeL8.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-W66PwMvx.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-D8VbeCxz.js +85 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-FmXFG4f2.js +63 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-D-dVrmAY.js +10467 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-Cb0jmh8J.js +2284 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-D55gO7Gq.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DivM-Ym-.js +298 -0
- package/dist/cli-runtime/artifactOperationError-Wd0PRLIZ.js +27 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-B_4h3RAw.js +2091 -0
- package/dist/cli-runtime/binary-9Gt3vJ1P.js +12990 -0
- package/dist/cli-runtime/browserObservationError-D73SM55P.js +40 -0
- package/dist/cli-runtime/browserScenario-CTNr5ISp.js +5543 -0
- package/dist/cli-runtime/catalogIdentity-EYVhBUYJ.js +339 -0
- package/dist/cli-runtime/cli.js +28528 -0
- package/dist/cli-runtime/cliOutput-CoDmWVu5.js +98 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/composition__browserScenario-DNr3A_BM.js +2318 -0
- package/dist/cli-runtime/composition__electronObservation-DNw1f38M.js +550 -0
- package/dist/cli-runtime/composition__electronScenario-Cu7PX270.js +586 -0
- package/dist/cli-runtime/configurationErrors-ByuF6gMR.js +49 -0
- package/dist/cli-runtime/doctorRuntime-D5y43lEp.js +162 -0
- package/dist/cli-runtime/dosMz-pwwUuxyC.js +65 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-BSnWggeb.js +5 -0
- package/dist/cli-runtime/enhancedInputs-K8C_o3b4.js +56 -0
- package/dist/cli-runtime/javascriptApplicationGraph-DUWeec4O.js +940 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-BVbnAdOd.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BzSil7ft.js +1153 -0
- package/dist/cli-runtime/javascriptRuntimeObservation-9xTNoKY2.js +1215 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-CneBtMvx.js +1437 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D1Mrb_Y0.js +245 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-BHItrqIA.js +126 -0
- package/dist/cli-runtime/lipo-BCA3wVyN.js +365 -0
- package/dist/cli-runtime/logger-CKq3JfbZ.js +34 -0
- package/dist/cli-runtime/machoContainer-DxxkB2b0.js +52 -0
- package/dist/cli-runtime/managedApplicationGraph-BqOr01E6.js +1116 -0
- package/dist/cli-runtime/managedToolContracts-BSy4TRaK.js +80 -0
- package/dist/cli-runtime/mcpDoctor.js +342 -0
- package/dist/cli-runtime/mcpStartupPolicy-Bb7TMLzn.js +18 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-BIG9iCcj.js +4415 -0
- package/dist/cli-runtime/plistValue-KM-SqiXe.js +47 -0
- package/dist/cli-runtime/propertyListKeys-DejfMb-U.js +86 -0
- package/dist/cli-runtime/providerAdapterError-SRSE_gzN.js +27 -0
- package/dist/cli-runtime/providerCleanupError-Do66qCEp.js +27 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerOperationHealth-DSTcYPJe.js +577 -0
- package/dist/cli-runtime/providerStartupTimeout-Be8B1Ro8.js +16 -0
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-dvp6PEnZ.js +15839 -0
- package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
- package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
- package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
- package/dist/cli-runtime/scanCanonical-Bi6si9nb.js +2773 -0
- package/dist/cli-runtime/snapshotEnvironment-B5Ai0mha.js +678 -0
- package/dist/cli-runtime/streamedJsonOutput-VYlQZsM7.js +654 -0
- package/dist/cli-runtime/streamedJsonOutput.js +5 -0
- package/dist/cli-runtime/toolContracts-C7pvYKxF.js +4516 -0
- package/dist/cli-runtime/toolEffects-DW31yTSx.js +7004 -0
- package/dist/cli-runtime/workflowInputError-26EGiDpx.js +26 -0
- package/dist/cli.js +91 -0
- package/dist/cliBrowserContext.js +11 -0
- package/dist/cliBrowserScenarioCommands.js +73 -0
- package/dist/cliCommandNames.js +205 -0
- package/dist/cliEvidenceCommands.js +51 -0
- package/dist/cliJavaScriptRuntimeCommands.js +69 -0
- package/dist/cliJsonInput.js +129 -0
- package/dist/cliLogging.js +48 -0
- package/dist/cliObservationOptions.js +73 -0
- package/dist/cliOutput.js +97 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/android.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +35 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/binaryDiagnostics.js +12 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +4 -0
- package/dist/composition/directAnalysis.js +44 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/evm.js +4 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/composition/optionalObservationProviders.js +54 -0
- package/dist/composition/wasm.js +4 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webNetworkCaptures.js +6 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/environment.js +73 -0
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/homeDirectory.js +12 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/mcpResponseBudget.js +30 -0
- package/dist/config/parseConfig.js +93 -0
- package/dist/config/parsers.js +30 -0
- package/dist/config/providerStartupTimeout.js +13 -0
- package/dist/config/types.js +1 -0
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +13 -0
- package/dist/contracts/analysisSearchContract.js +14 -0
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +76 -0
- package/dist/contracts/android/androidToolContracts.js +77 -0
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/applicationToolContracts.js +261 -0
- package/dist/contracts/artifactComparisonExample.js +86 -0
- package/dist/contracts/artifactToolContracts.js +68 -0
- package/dist/contracts/browserProviderToolContracts.js +7 -0
- package/dist/contracts/browserScenarioToolContracts.js +32 -0
- package/dist/contracts/browserToolContracts.js +256 -0
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/enhancedInputs.js +74 -0
- package/dist/contracts/enhancedToolContracts.js +32 -0
- package/dist/contracts/errorSchemas.js +87 -0
- package/dist/contracts/evidenceInputContracts.js +13 -0
- package/dist/contracts/evm/evmToolContracts.js +20 -0
- package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
- package/dist/contracts/functionComparisonExample.js +51 -0
- package/dist/contracts/functionInstructionContract.js +6 -0
- package/dist/contracts/functionWorkflowToolContracts.js +29 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +19 -0
- package/dist/contracts/inputSchemaPresentation.js +181 -0
- package/dist/contracts/investigationExamples.js +116 -0
- package/dist/contracts/javascript/applicationWorkflowInputContracts.js +52 -0
- package/dist/contracts/javascript/electronToolContracts.js +118 -0
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +85 -0
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +35 -0
- package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +40 -0
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +242 -0
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +87 -0
- package/dist/contracts/managed/managedWorkflowExamples.js +281 -0
- package/dist/contracts/managed/managedWorkflowToolContracts.js +165 -0
- package/dist/contracts/mobileApplicationGraphExamples.js +117 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +65 -0
- package/dist/contracts/native/nativeToolContracts.js +77 -0
- package/dist/contracts/officialToolContracts.js +69 -0
- package/dist/contracts/promptContracts.js +253 -0
- package/dist/contracts/providerSelection.js +29 -0
- package/dist/contracts/reconstructionReadinessExample.js +438 -0
- package/dist/contracts/sessionLifecycleInputs.js +63 -0
- package/dist/contracts/sessionStatusContract.js +17 -0
- package/dist/contracts/sessionToolContracts.js +61 -0
- package/dist/contracts/sessionToolSchemas.js +51 -0
- package/dist/contracts/toolContractExamples.js +77 -0
- package/dist/contracts/toolContractHelpers.js +22 -0
- package/dist/contracts/toolContractTypes.js +18 -0
- package/dist/contracts/toolContracts.js +60 -0
- package/dist/contracts/toolEffects.js +544 -0
- package/dist/contracts/toolOutputSchemaGroups.js +411 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +532 -0
- package/dist/contracts/toolSchemaMetadata.js +197 -0
- package/dist/contracts/unknownContractExamples.js +31 -0
- package/dist/contracts/wasm/wasmToolContracts.js +24 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/doctorRuntime.js +53 -0
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorBase.js +58 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorCore.js +123 -0
- package/dist/domain/analysisErrorPresentation.js +372 -0
- package/dist/domain/analysisErrorProjection.js +454 -0
- package/dist/domain/analysisProfile.js +50 -0
- package/dist/domain/analysisSnapshot.js +538 -0
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +362 -0
- package/dist/domain/analysisView/analysisView.js +340 -0
- package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
- package/dist/domain/analysisView/binaryLayoutView.js +161 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +245 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +108 -0
- package/dist/domain/android/androidAnalysis.js +143 -0
- package/dist/domain/android/androidApplication.js +144 -0
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apktool/apktoolResourceAnalysis.js +75 -0
- package/dist/domain/apple/appleApplication.js +315 -0
- package/dist/domain/apple/appleAssetCatalog.js +127 -0
- package/dist/domain/apple/appleBundleAnatomy.js +303 -0
- package/dist/domain/apple/dyldEnvironment.js +73 -0
- package/dist/domain/apple/dyldPaths.js +89 -0
- package/dist/domain/apple/dylibResolution.js +485 -0
- package/dist/domain/apple/dylibResolutionFindings.js +77 -0
- package/dist/domain/apple/interfaceBuilderGraph.js +403 -0
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +430 -0
- package/dist/domain/apple/keyedArchive.js +214 -0
- package/dist/domain/apple/machoContainer.js +54 -0
- package/dist/domain/apple/plistNumbers.js +76 -0
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactComparison.js +348 -0
- package/dist/domain/artifactGraph.js +213 -0
- package/dist/domain/artifactIdentity.js +57 -0
- package/dist/domain/artifactInspection.js +279 -0
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +166 -0
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +20 -0
- package/dist/domain/artifactPartialObservation.js +1 -0
- package/dist/domain/artifactPathSyntax.js +75 -0
- package/dist/domain/binaryTarget.js +233 -0
- package/dist/domain/binaryTargetTypes.js +10 -0
- package/dist/domain/bridgeCandidateProjection.js +71 -0
- package/dist/domain/browserCaptureComparison.js +21 -0
- package/dist/domain/browserCompleteness.js +103 -0
- package/dist/domain/browserNetworkEvidence.js +92 -0
- package/dist/domain/browserObservation.js +187 -0
- package/dist/domain/browserObservationError.js +44 -0
- package/dist/domain/browserObservationErrors.js +1 -0
- package/dist/domain/browserObservationSchemas.js +327 -0
- package/dist/domain/browserScenario.js +61 -0
- package/dist/domain/browserScenarioCapture.js +76 -0
- package/dist/domain/browserScenarioCaptureValues.js +292 -0
- package/dist/domain/browserScenarioDiff.js +266 -0
- package/dist/domain/browserScenarioDiffEvidence.js +73 -0
- package/dist/domain/browserScenarioDiffValues.js +140 -0
- package/dist/domain/browserScenarioNormalization.js +40 -0
- package/dist/domain/browserScenarioValues.js +268 -0
- package/dist/domain/browserSession.js +55 -0
- package/dist/domain/bundleComparison.js +243 -0
- package/dist/domain/callPath.js +301 -0
- package/dist/domain/callPathSchemas.js +89 -0
- package/dist/domain/canonicalDigest.js +83 -0
- package/dist/domain/canonicalJsonDigestSteps.js +155 -0
- package/dist/domain/canonicalOrdering.js +3 -0
- package/dist/domain/changedBehavior.js +282 -0
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSemantics.js +12 -0
- package/dist/domain/comparisonSourceEvidence.js +40 -0
- package/dist/domain/comparisonStatus.js +11 -0
- package/dist/domain/completionLedgerGeneration.js +186 -0
- package/dist/domain/configurationErrors.js +37 -0
- package/dist/domain/conformancePackage.js +200 -0
- package/dist/domain/conformanceReplay.js +132 -0
- package/dist/domain/conformanceTrustGate.js +319 -0
- package/dist/domain/digests.js +27 -0
- package/dist/domain/dosCom.js +8 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/evidence.js +305 -0
- package/dist/domain/evidenceBundle.js +413 -0
- package/dist/domain/evidenceCompletionLedger.js +113 -0
- package/dist/domain/evidenceErrors.js +46 -0
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/evm/evmInterface.js +61 -0
- package/dist/domain/explicitSensitiveFailure.js +108 -0
- package/dist/domain/explicitSensitiveValues.js +10 -0
- package/dist/domain/firmware/firmwareAnalysis.js +128 -0
- package/dist/domain/functionComparison.js +38 -0
- package/dist/domain/functionComparisonDimensions.js +199 -0
- package/dist/domain/functionComparisonNormalization.js +150 -0
- package/dist/domain/functionComparisonResults.js +54 -0
- package/dist/domain/functionComparisonSchemas.js +88 -0
- package/dist/domain/functionDossierEvidence.js +20 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +169 -0
- package/dist/domain/hopperErrors.js +98 -0
- package/dist/domain/hopperStartupFailure.js +64 -0
- package/dist/domain/hopperValues.js +368 -0
- package/dist/domain/immutableJson.js +114 -0
- package/dist/domain/inputIssueProjection.js +94 -0
- package/dist/domain/javascript/electronActiveObservation.js +237 -0
- package/dist/domain/javascript/electronObservation.js +122 -0
- package/dist/domain/javascript/electronStaticAnalysis.js +9 -0
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +187 -0
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +197 -0
- package/dist/domain/javascript/electronStaticAnalysisNative.js +199 -0
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/javascript/electronStaticAnalysisValues.js +134 -0
- package/dist/domain/javascript/electronWrappedCallPaths.js +399 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +146 -0
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +175 -0
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +400 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +378 -0
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +126 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +104 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +211 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +324 -0
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +199 -0
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/javascript/javascriptAstFingerprint.js +153 -0
- package/dist/domain/javascript/javascriptAstValues.js +99 -0
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +119 -0
- package/dist/domain/javascript/javascriptExportReturnShapeProjection.js +81 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +161 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +16 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +302 -0
- package/dist/domain/javascript/javascriptExportShapeSelection.js +130 -0
- package/dist/domain/javascript/javascriptExportShapeVariants.js +333 -0
- package/dist/domain/javascript/javascriptFeatureSeed.js +193 -0
- package/dist/domain/javascript/javascriptFeatureTrace.js +177 -0
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +131 -0
- package/dist/domain/javascript/javascriptFeatureTraversal.js +61 -0
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +93 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +617 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +90 -0
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +90 -0
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +98 -0
- package/dist/domain/javascript/javascriptRuntimeObservation.js +136 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +46 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +74 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +163 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +270 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +39 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +126 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +334 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +234 -0
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +206 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +910 -0
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +246 -0
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +127 -0
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +272 -0
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +224 -0
- package/dist/domain/javascript/javascriptSemanticCoverage.js +32 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +182 -0
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +299 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +52 -0
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +187 -0
- package/dist/domain/javascript/javascriptSemanticGraph.js +575 -0
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +316 -0
- package/dist/domain/javascript/javascriptSemanticGraphSerialization.js +12 -0
- package/dist/domain/javascript/javascriptSemanticIr.js +31 -0
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +865 -0
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +104 -0
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +164 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +38 -0
- package/dist/domain/javascript/javascriptSemanticProjection.js +571 -0
- package/dist/domain/javascript/javascriptSemanticPromises.js +321 -0
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +29 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +175 -0
- package/dist/domain/javascript/javascriptSemanticQueryAssessment.js +45 -0
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +63 -0
- package/dist/domain/javascript/javascriptSemanticQueryRelations.js +15 -0
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +95 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +34 -0
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
- package/dist/domain/javascript/javascriptSemanticResources.js +129 -0
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +159 -0
- package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
- package/dist/domain/javascript/javascriptSemanticState.js +116 -0
- package/dist/domain/javascript/javascriptSemanticTraceSchemas.js +15 -0
- package/dist/domain/javascript/javascriptSemanticTraversal.js +80 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +581 -0
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
- package/dist/domain/javascript/javascriptSourceParser.js +50 -0
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +142 -0
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +239 -0
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -0
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +86 -0
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +561 -0
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +21 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -0
- package/dist/domain/javascript/javascriptSymbolicBindings.js +795 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +261 -0
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +109 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +231 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonSerialization.js +163 -0
- package/dist/domain/jsonShape.js +141 -0
- package/dist/domain/jsonValue.js +96 -0
- package/dist/domain/localPath.js +24 -0
- package/dist/domain/managed/managedApplicationGraph.js +221 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +48 -0
- package/dist/domain/managed/managedApplicationGraphNodes.js +367 -0
- package/dist/domain/managed/managedArtifact.js +465 -0
- package/dist/domain/managed/managedInspectionEvidence.js +28 -0
- package/dist/domain/managed/managedMemberComparison.js +211 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +71 -0
- package/dist/domain/managed/managedMemberComparisonItems.js +304 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +204 -0
- package/dist/domain/managed/managedNativeVerification.js +35 -0
- package/dist/domain/managed/managedNativeVerificationMatch.js +276 -0
- package/dist/domain/managed/managedNativeVerificationSchemas.js +180 -0
- package/dist/domain/managed/managedReconstruction.js +190 -0
- package/dist/domain/mobileApplicationGraphProjection.js +61 -0
- package/dist/domain/native/binaryLayout.js +354 -0
- package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeApiBoundary.js +140 -0
- package/dist/domain/native/nativeCallObservation.js +186 -0
- package/dist/domain/native/nativeCallPartialObservation.js +33 -0
- package/dist/domain/native/nativeDataType.js +53 -0
- package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
- package/dist/domain/native/nativeInspection.js +174 -0
- package/dist/domain/native/nativeInstruction.js +125 -0
- package/dist/domain/native/nativeInvestigationGraph.js +364 -0
- package/dist/domain/native/nativeLoadImage.js +112 -0
- package/dist/domain/native/nativeMetadataRecovery.js +128 -0
- package/dist/domain/native/nativeUiObservation.js +137 -0
- package/dist/domain/native/nativeValueFlow.js +72 -0
- package/dist/domain/native/nativeValueTrace.js +64 -0
- package/dist/domain/native/objcSwiftMetadata.js +419 -0
- package/dist/domain/native/peResources.js +100 -0
- package/dist/domain/native/recordedCrash.js +263 -0
- package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/offsetDateTime.js +17 -0
- package/dist/domain/peMachine.js +36 -0
- package/dist/domain/process/processCapture.js +412 -0
- package/dist/domain/process/processCaptureCoverage.js +70 -0
- package/dist/domain/process/processCaptureExample.js +132 -0
- package/dist/domain/process/processCaptureParsing.js +21 -0
- package/dist/domain/process/processCaptureValidation.js +246 -0
- package/dist/domain/process/processComparison.js +315 -0
- package/dist/domain/process/processEvidenceProvider.js +11 -0
- package/dist/domain/process/processObservation.js +140 -0
- package/dist/domain/process/processScenario.js +247 -0
- package/dist/domain/process/processTraceComparison.js +34 -0
- package/dist/domain/process/processTraceDimensionProjection.js +35 -0
- package/dist/domain/process/processTraceEvaluation.js +320 -0
- package/dist/domain/process/processTraceSpecification.js +382 -0
- package/dist/domain/propertyListKeys.js +107 -0
- package/dist/domain/propertyListXmlText.js +19 -0
- package/dist/domain/providerAdapterError.js +19 -0
- package/dist/domain/providerCleanupError.js +18 -0
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerOperationHealth.js +54 -0
- package/dist/domain/providerSelectionError.js +46 -0
- package/dist/domain/rawBinary.js +93 -0
- package/dist/domain/reconstructionCoverage.js +325 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +234 -0
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +347 -0
- package/dist/domain/reconstructionReadiness.js +116 -0
- package/dist/domain/reconstructionReadinessFindingHelpers.js +17 -0
- package/dist/domain/reconstructionReadinessIntegrityFindings.js +118 -0
- package/dist/domain/reconstructionReadinessJourneyFindings.js +193 -0
- package/dist/domain/reconstructionReadinessSchemas.js +268 -0
- package/dist/domain/reconstructionUnknowns.js +91 -0
- package/dist/domain/reconstructionVerification.js +218 -0
- package/dist/domain/reconstructionVerificationSchemas.js +141 -0
- package/dist/domain/recordedTransportUrl.js +51 -0
- package/dist/domain/referenceSourceClassification.js +385 -0
- package/dist/domain/referenceSourceGraph.js +380 -0
- package/dist/domain/referenceSourceImportParsing.js +238 -0
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourcePolicy.js +1 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/relationshipCoverage.js +20 -0
- package/dist/domain/residualUnknown.js +252 -0
- package/dist/domain/result.js +4 -0
- package/dist/domain/runtimeVersion.js +15 -0
- package/dist/domain/safeJson.js +13 -0
- package/dist/domain/sourceMapContents.js +6 -0
- package/dist/domain/sourceMapEnvelope.js +44 -0
- package/dist/domain/staticRuntimeCorrelation.js +334 -0
- package/dist/domain/stringPatterns.js +6 -0
- package/dist/domain/swiftSymbolClassification.js +66 -0
- package/dist/domain/symbolAnalysis.js +122 -0
- package/dist/domain/unicodeCodePointOrder.js +23 -0
- package/dist/domain/unknownRegistryError.js +10 -0
- package/dist/domain/wasm/wasmArtifact.js +105 -0
- package/dist/domain/webBundleAnalysis.js +192 -0
- package/dist/domain/webBundleAnalyzer.js +15 -0
- package/dist/domain/webBundleAnalyzerAst.js +49 -0
- package/dist/domain/webBundleAnalyzerInspection.js +315 -0
- package/dist/domain/webBundleAnalyzerResult.js +142 -0
- package/dist/domain/webCaptureDiff.js +423 -0
- package/dist/domain/webCaptureDiffSchemas.js +84 -0
- package/dist/domain/webContentArtifact.js +38 -0
- package/dist/domain/webEventListeners.js +29 -0
- package/dist/domain/webExecution.js +75 -0
- package/dist/domain/webInventory.js +62 -0
- package/dist/domain/webMcpDiscovery.js +53 -0
- package/dist/domain/webModuleImports.js +99 -0
- package/dist/domain/webModuleTrace.js +101 -0
- package/dist/domain/webNetworkCapture.js +142 -0
- package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
- package/dist/domain/webRuntime.js +80 -0
- package/dist/domain/webScreenshot.js +132 -0
- package/dist/domain/webScriptArtifacts.js +37 -0
- package/dist/domain/webScriptExport.js +84 -0
- package/dist/domain/webScriptExportError.js +19 -0
- package/dist/domain/webScriptExportPlan.js +104 -0
- package/dist/domain/webSourceLocation.js +118 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/domain/zipPackageFormat.js +52 -0
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +308 -0
- package/dist/dotnet/ManagedDecodeBudget.js +138 -0
- package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
- package/dist/dotnet/ManagedMemberInspector.js +173 -0
- package/dist/dotnet/ManagedMemberInspectorCore.js +446 -0
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +468 -0
- package/dist/dotnet/ManagedMemberOwnership.js +71 -0
- package/dist/dotnet/ManagedMemberPointers.js +62 -0
- package/dist/dotnet/ManagedMemberRows.js +227 -0
- package/dist/dotnet/ManagedMetadataHeaps.js +179 -0
- package/dist/dotnet/ManagedMetadataInventory.js +99 -0
- package/dist/dotnet/ManagedMetadataInventoryRows.js +295 -0
- package/dist/dotnet/ManagedMetadataLayout.js +270 -0
- package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +155 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +314 -0
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +128 -0
- package/dist/dotnet/ManagedPeReader.js +233 -0
- package/dist/dotnet/ManagedReaderFailure.js +27 -0
- package/dist/dotnet/ManagedSnapshot.js +88 -0
- package/dist/dotnet/ManagedStaticProvider.js +158 -0
- package/dist/dotnet/ManagedStaticProviderMetadata.js +33 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
- package/dist/evaluation/AgentEvaluationReport.js +32 -0
- package/dist/evaluation/CodexAgentEval.js +188 -0
- package/dist/evaluation/KnownAnswerEvaluation.js +323 -0
- package/dist/evm/EvmBytecodeCarrier.js +21 -0
- package/dist/evm/EvmWorkerLimits.js +40 -0
- package/dist/evm/EvmoleFailures.js +124 -0
- package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
- package/dist/evm/EvmoleInterfaceProvider.js +339 -0
- package/dist/evm/EvmoleInterfaceWorker.js +87 -0
- package/dist/evm/EvmoleRelease.js +16 -0
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/OwnedStagedOutput.js +138 -0
- package/dist/filesystem/RegularFile.js +73 -0
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +35 -0
- package/dist/firmware/FirmwareCommand.js +190 -0
- package/dist/firmware/FirmwareFiles.js +206 -0
- package/dist/firmware/FirmwareProvider.js +388 -0
- package/dist/firmware/FirmwarePublication.js +105 -0
- package/dist/firmware/FirmwareRelease.js +33 -0
- package/dist/firmware/FirmwareReports.js +287 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedPackageMetadata.js +9 -0
- package/dist/ghidra/GhidraAnalysisProfile.js +219 -0
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +725 -0
- package/dist/ghidra/GhidraClientStartup.js +27 -0
- package/dist/ghidra/GhidraClientTypes.js +1 -0
- package/dist/ghidra/GhidraClientWire.js +38 -0
- package/dist/ghidra/GhidraDiagnostics.js +53 -0
- package/dist/ghidra/GhidraDoctor.js +88 -0
- package/dist/ghidra/GhidraFunctionValues.js +328 -0
- package/dist/ghidra/GhidraInstallation.js +443 -0
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +262 -0
- package/dist/ghidra/GhidraJavaLaunch.js +66 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +490 -0
- package/dist/ghidra/GhidraLoadImageAttest.js +103 -0
- package/dist/ghidra/GhidraLoadImageValues.js +260 -0
- package/dist/ghidra/GhidraMipsProfile.js +187 -0
- package/dist/ghidra/GhidraProvider.js +250 -0
- package/dist/ghidra/GhidraProviderCapabilities.js +208 -0
- package/dist/ghidra/GhidraProviderClient.js +613 -0
- package/dist/ghidra/GhidraPspExtension.js +144 -0
- package/dist/ghidra/GhidraPspProfile.js +50 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +18 -0
- package/dist/ghidra/GhidraRequestQueue.js +115 -0
- package/dist/ghidra/GhidraResponseBuffer.js +31 -0
- package/dist/ghidra/GhidraResponseRouter.js +24 -0
- package/dist/ghidra/GhidraSessionError.js +180 -0
- package/dist/ghidra/GhidraSessionRoot.js +39 -0
- package/dist/ghidra/GhidraSessionValues.js +86 -0
- package/dist/ghidra/GhidraSocketConnection.js +83 -0
- package/dist/ghidra/GhidraTargetSnapshot.js +79 -0
- package/dist/ghidra/GhidraTransport.js +101 -0
- package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +177 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +27 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
- package/dist/ghidra/protocol.js +46 -0
- package/dist/go/GoBinaryContainer.js +125 -0
- package/dist/go/GoBinaryImage.js +172 -0
- package/dist/go/GoBinaryProvider.js +137 -0
- package/dist/go/GoElfImage.js +149 -0
- package/dist/go/GoMachoImage.js +113 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +102 -0
- package/dist/hopper/BridgeLauncher.js +305 -0
- package/dist/hopper/HopperAnalysisProfile.js +168 -0
- package/dist/hopper/HopperCleanup.js +245 -0
- package/dist/hopper/HopperClient.js +767 -0
- package/dist/hopper/HopperDiagnostics.js +14 -0
- package/dist/hopper/HopperFileOffset.js +237 -0
- package/dist/hopper/HopperMachOImage.js +200 -0
- package/dist/hopper/HopperOperationStage.js +6 -0
- package/dist/hopper/HopperProcessDiagnostic.js +26 -0
- package/dist/hopper/HopperProvider.js +269 -0
- package/dist/hopper/HopperProviderCapabilities.js +91 -0
- package/dist/hopper/HopperRegexSearch.js +134 -0
- package/dist/hopper/HopperRegexWorker.js +27 -0
- package/dist/hopper/HopperRequestQueue.js +261 -0
- package/dist/hopper/HopperResponseStream.js +44 -0
- package/dist/hopper/HopperSessionValues.js +30 -0
- package/dist/hopper/HopperSocketConnection.js +31 -0
- package/dist/hopper/HopperTargetLease.js +233 -0
- package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +64 -0
- package/dist/hopper/LinuxPrivateDisplayProbe.js +224 -0
- package/dist/hopper/protocol.js +88 -0
- package/dist/ida/IdaBusyHealth.js +44 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +61 -0
- package/dist/ida/IdaDoctor.js +53 -0
- package/dist/ida/IdaInput.js +56 -0
- package/dist/ida/IdaMcpConnection.js +115 -0
- package/dist/ida/IdaOperationRunner.js +376 -0
- package/dist/ida/IdaProtocolValues.js +208 -0
- package/dist/ida/IdaProvider.js +136 -0
- package/dist/ida/IdaProviderCapabilities.js +64 -0
- package/dist/ida/IdaSessionClient.js +444 -0
- package/dist/ida/IdaWorkspace.js +55 -0
- package/dist/identity.js +25 -0
- package/dist/inspector/JavaScriptRuntimeScope.js +89 -0
- package/dist/inspector/V8InspectorCaptureProjection.js +197 -0
- package/dist/inspector/V8InspectorEndpoint.js +70 -0
- package/dist/inspector/V8InspectorProvider.js +378 -0
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +574 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +64 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +558 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +121 -0
- package/dist/javascript/recovery/RecoveryFiles.js +175 -0
- package/dist/javascript/recovery/WakaruCommand.js +137 -0
- package/dist/javascript/recovery/WakaruExecution.js +115 -0
- package/dist/javascript/recovery/WakaruProvider.js +218 -0
- package/dist/javascript/recovery/WakaruPublication.js +126 -0
- package/dist/javascript/recovery/WakaruRelease.js +36 -0
- package/dist/javascript/recovery/WakaruReport.js +140 -0
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +223 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +135 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +238 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +152 -0
- package/dist/jeb/JebMcpConnection.js +186 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +297 -0
- package/dist/logger.js +14 -0
- package/dist/main/messages.js +4 -0
- package/dist/main/shutdown.js +102 -0
- package/dist/main/startup.js +21 -0
- package/dist/main/transport.js +72 -0
- package/dist/main/types.js +1 -0
- package/dist/main.js +92 -0
- package/dist/mcp/AnalysisSnapshotFiles-DbgHi36O.js +1225 -0
- package/dist/mcp/ArtifactProvider-BNxKlaKX.js +2090 -0
- package/dist/mcp/ArtifactProviderMetadata--hy-wyJK.js +76 -0
- package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
- package/dist/mcp/ArtifactResourceScope-CBR5q4aK.js +108 -0
- package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
- package/dist/mcp/BinaryTargetResolver-DbiUzRLh.js +1073 -0
- package/dist/mcp/BoundedFileBytes-CJPW_TzE.js +68 -0
- package/dist/mcp/CdpConnection-CM0tkVfW.js +557 -0
- package/dist/mcp/CdpOptionalCommand-H8_fL7Q_.js +120 -0
- package/dist/mcp/CdpTargetSession-OYD1d6XM.js +647 -0
- package/dist/mcp/DirectAnalysis-BWAu8Ro5.js +395 -0
- package/dist/mcp/DirectAnalysisStatus-DofNPhKd.js +33 -0
- package/dist/mcp/ElectronFileScope-DEayib6K.js +110 -0
- package/dist/mcp/InterfaceBuilderDecodeBudget-CUrOtfNo.js +401 -0
- package/dist/mcp/ManagedStaticProvider-CXE93Bow.js +4460 -0
- package/dist/mcp/NativeMacOSProvider-BbITFLHW.js +4408 -0
- package/dist/mcp/NativeMacOSProviderMetadata-mxDhaNJf.js +281 -0
- package/dist/mcp/ProcedureAddressResolution-Gnjf9Hya.js +19 -0
- package/dist/mcp/ProcessOwnership-nOFZsmD3.js +1411 -0
- package/dist/mcp/WorkflowEvidence-DJyEy3K0.js +94 -0
- package/dist/mcp/analysisErrorCore-BqyeMw3_.js +201 -0
- package/dist/mcp/analysisErrorProjection-B7pHef2y.js +724 -0
- package/dist/mcp/artifactOperationError-B_jxO8at.js +27 -0
- package/dist/mcp/artifactToolContracts-TXegBBr1.js +159 -0
- package/dist/mcp/browserObservation-BCgaDRyQ.js +4398 -0
- package/dist/mcp/browserObservationError-BKBEX85K.js +40 -0
- package/dist/mcp/browserObservationSchemas-yzRJ90-E.js +573 -0
- package/dist/mcp/browserScenario-z7jveI9P.js +2319 -0
- package/dist/mcp/browserScenarioCapture-BvnKTmtZ.js +460 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/digests-Dugt3H71.js +199 -0
- package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
- package/dist/mcp/electronObservation-DjQQYGw4.js +556 -0
- package/dist/mcp/electronObservation-DuhMHCmQ.js +112 -0
- package/dist/mcp/electronScenario-9mLG6h-g.js +586 -0
- package/dist/mcp/emptyArraySchema-DEEefG2V.js +140 -0
- package/dist/mcp/enhancedInputs-CLdEXv88.js +56 -0
- package/dist/mcp/interfaceBuilderGraph-BOKqQzjK.js +2613 -0
- package/dist/mcp/javascriptRuntimeObservation-C_wglsz_.js +661 -0
- package/dist/mcp/javascriptRuntimeObservation-CxQ1UT_y.js +121 -0
- package/dist/mcp/lipo-Do-2eBrl.js +465 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-CZ4Hlc6u.js +34 -0
- package/dist/mcp/machoContainer-9En6pSkd.js +813 -0
- package/dist/mcp/main-WQSCuTNt.js +52791 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-o5LHFwHc.js +81 -0
- package/dist/mcp/plistValue-DsU7z4yF.js +47 -0
- package/dist/mcp/propertyListKeys-cX-BUv2y.js +197 -0
- package/dist/mcp/providerAdapterError-CdPaQ6-Z.js +27 -0
- package/dist/mcp/providerCleanupError-DvE79aUX.js +49 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-CUeCJZiP.js +212 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-2GN0h-BE.js +3647 -0
- package/dist/mcp/serverIdentity-rOY69sxc.js +633 -0
- package/dist/mcp/sourceMapEnvelope-D8Zezqyi.js +252 -0
- package/dist/mcp/toolContracts-CrfYDTUz.js +14561 -0
- package/dist/mcp/toolOutputSchemaGroups-ChxVLGoy.js +11114 -0
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
- package/dist/mcp/webContentArtifact-DUBgMzVO.js +185 -0
- package/dist/mcp/webRuntime-C2Tx-fgS.js +74 -0
- package/dist/mcp/webSourceLocation-Dnkpf0R2.js +8532 -0
- package/dist/mcpDoctor.js +360 -0
- package/dist/mcpStartupPolicy.js +14 -0
- package/dist/native/AppleDispatchCoverage.js +112 -0
- package/dist/native/AppleDispatchDecodeFacts.js +6 -0
- package/dist/native/AppleDispatchMetadata.js +176 -0
- package/dist/native/AppleMachoFixups.js +372 -0
- package/dist/native/AppleMachoSelection.js +234 -0
- package/dist/native/AppleObjcCategories.js +63 -0
- package/dist/native/AppleObjcDispatchFacets.js +260 -0
- package/dist/native/AppleObjcProperties.js +79 -0
- package/dist/native/AppleObjcProtocols.js +89 -0
- package/dist/native/AppleSwiftDispatchFacets.js +156 -0
- package/dist/native/AppleSwiftVtables.js +92 -0
- package/dist/native/CommandRunner.js +240 -0
- package/dist/native/LldbCallTracer.js +713 -0
- package/dist/native/LldbRetainedObservations.js +178 -0
- package/dist/native/NativeCallObservation.js +195 -0
- package/dist/native/NativeMacOSProvider.js +701 -0
- package/dist/native/NativeMacOSProviderMetadata.js +46 -0
- package/dist/native/NativeMachoInspection.js +273 -0
- package/dist/native/NativeUiHelperRuntime.js +66 -0
- package/dist/native/NativeUiObservation.js +183 -0
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/SignatureTargetBinding.js +155 -0
- package/dist/native/parsers/codesign.js +93 -0
- package/dist/native/parsers/demangle.js +30 -0
- package/dist/native/parsers/dyldInfo.js +60 -0
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +177 -0
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +379 -0
- package/dist/native/parsers/plist.js +187 -0
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
- package/dist/native/pwntools/PwntoolsDecoder.js +206 -0
- package/dist/native/pwntools/PwntoolsFailures.js +180 -0
- package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
- package/dist/native/pwntools/PwntoolsRelease.js +19 -0
- package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
- package/dist/process/BoundedFileBytes.js +40 -0
- package/dist/process/DarwinProcessRunTokenReader.js +376 -0
- package/dist/process/ExecFileOutput.js +124 -0
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/OwnedCommand.js +131 -0
- package/dist/process/PendingOperations.js +61 -0
- package/dist/process/PrivateRuntimeRoot.js +61 -0
- package/dist/process/ProcessCommandIdentity.js +19 -0
- package/dist/process/ProcessOwnership.js +636 -0
- package/dist/process/ProcessOwnershipIdentity.js +13 -0
- package/dist/process/ProcessOwnershipObservation.js +407 -0
- package/dist/process/ProcessOwnershipProcessTree.js +35 -0
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDeadline.js +91 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +381 -0
- package/dist/process/ProviderRunLineage.js +21 -0
- package/dist/process/WindowsAuthority.js +51 -0
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +268 -0
- package/dist/process/capture/ProcessCaptureCapability.js +65 -0
- package/dist/process/capture/ProcessCaptureEnvironment.js +9 -0
- package/dist/process/capture/ProcessCaptureError.js +74 -0
- package/dist/process/capture/ProcessCaptureJournal.js +61 -0
- package/dist/process/capture/ProcessCaptureLifecycle.js +1050 -0
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessFilesystemEffects.js +81 -0
- package/dist/process/capture/ProcessHarness.js +602 -0
- package/dist/process/capture/ProcessNormalization.js +88 -0
- package/dist/process/capture/ProcessSampling.js +415 -0
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +79 -0
- package/dist/process/capture/ProcessTimer.js +39 -0
- package/dist/process/capture/TerminalRenderer.js +124 -0
- package/dist/process/snapshotEnvironment.js +14 -0
- package/dist/reference/ReferenceSourceReader.js +73 -0
- package/dist/reference/ReferenceSourceReaderEntries.js +273 -0
- package/dist/reference/ReferenceSourceReaderErrors.js +54 -0
- package/dist/reference/ReferenceSourceReaderFile.js +147 -0
- package/dist/reference/ReferenceSourceReaderPaths.js +8 -0
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -0
- package/dist/reference/ReferenceSourceReaderValidate.js +81 -0
- package/dist/server/EvidenceMcpServer.js +216 -0
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +344 -0
- package/dist/server/lifecycleProgress.js +10 -0
- package/dist/server/mcpClientMetadata.js +42 -0
- package/dist/server/mcpProgress.js +26 -0
- package/dist/server/promptCompletion.js +141 -0
- package/dist/server/recordDerivedEvidence.js +10 -0
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +10 -0
- package/dist/server/registerAndroidTools.js +31 -0
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +29 -0
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +29 -0
- package/dist/server/registerApplicationTools/compareVersions.js +34 -0
- package/dist/server/registerApplicationTools/coverage.js +13 -0
- package/dist/server/registerApplicationTools/helpers.js +37 -0
- package/dist/server/registerApplicationTools/obligationLedger.js +23 -0
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +50 -0
- package/dist/server/registerApplicationTools/traceFeature.js +26 -0
- package/dist/server/registerApplicationTools/traceSemantics.js +25 -0
- package/dist/server/registerApplicationTools/types.js +1 -0
- package/dist/server/registerApplicationTools.js +19 -0
- package/dist/server/registerArtifactComparisonTool.js +71 -0
- package/dist/server/registerArtifactTools.js +14 -0
- package/dist/server/registerBinaryDiagnosticsTools.js +26 -0
- package/dist/server/registerBrowserScenarioTool.js +26 -0
- package/dist/server/registerBrowserTools.js +58 -0
- package/dist/server/registerBundleComparisonTool.js +54 -0
- package/dist/server/registerCloseLifecycleTool.js +55 -0
- package/dist/server/registerElectronTools.js +70 -0
- package/dist/server/registerEnhancedTools.js +169 -0
- package/dist/server/registerEvidenceTools.js +68 -0
- package/dist/server/registerEvmTools.js +9 -0
- package/dist/server/registerFirmwareTools.js +11 -0
- package/dist/server/registerFunctionComparisonTool.js +86 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +46 -0
- package/dist/server/registerInvestigationTools/types.js +1 -0
- package/dist/server/registerInvestigationTools.js +168 -0
- package/dist/server/registerJavaScriptRecoveryTool.js +9 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +27 -0
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +40 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +53 -0
- package/dist/server/registerManagedWorkflowTools/contract.js +7 -0
- package/dist/server/registerManagedWorkflowTools/evidence.js +27 -0
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +27 -0
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +41 -0
- package/dist/server/registerManagedWorkflowTools/types.js +1 -0
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +62 -0
- package/dist/server/registerManagedWorkflowTools.js +11 -0
- package/dist/server/registerOfficialTools.js +74 -0
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +156 -0
- package/dist/server/registerPrompts.js +73 -0
- package/dist/server/registerRecordedCrashTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +90 -0
- package/dist/server/registerSessionStatusTool.js +61 -0
- package/dist/server/registerSessionTools.js +217 -0
- package/dist/server/registerWasmTools.js +9 -0
- package/dist/server/registerWebModuleTool.js +9 -0
- package/dist/server/registerWebNetworkCaptureTool.js +20 -0
- package/dist/server/registerWebRuntimeTools.js +27 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +9 -0
- package/dist/server/runDerivedOperation.js +55 -0
- package/dist/server/sessionAvailabilityPolicy.js +29 -0
- package/dist/server/sessionEvidence.js +11 -0
- package/dist/server/toolLogging.js +11 -0
- package/dist/server/toolRegistrationOptions.js +9 -0
- package/dist/server/toolResult.js +119 -0
- package/dist/server/toolResultEncoding.js +34 -0
- package/dist/serverIdentity.js +69 -0
- package/dist/wasm/WabtArtifactProvider.js +313 -0
- package/dist/wasm/WabtFailures.js +62 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtWat.js +184 -0
- package/dist/wasm/WasmGlueAdapter.js +51 -0
- package/dist/windows/WindowsNativeLoader.js +124 -0
- package/dist/windows/WindowsOwnedProcess.js +265 -0
- package/dist/windows/WindowsPrivateRuntime.js +143 -0
- package/hooks/hooks.json +17 -0
- package/install.sh +172 -0
- package/licenses/Apache-2.0.txt +202 -0
- package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/licenses/GPL-3.0.txt +674 -0
- package/licenses/MIT-template.txt +18 -0
- package/licenses/MinGW-w64-runtime.txt +240 -0
- package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
- package/licenses/README.md +54 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/digfox-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
- package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
- package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/licenses/npm-dependencies.txt +2812 -0
- package/licenses/npm-runtime-notices.txt +6632 -0
- package/licenses/rea-jev-MIT.txt +21 -0
- package/licenses/rea-lab-MIT.txt +21 -0
- package/licenses/upstream-sources.json +62 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +156 -0
- package/native/windows/build/manifest.json +9 -0
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +371 -4
- package/port/cli.mjs +210 -0
- package/port/hooks/guard.mjs +140 -0
- package/port/knowledge/engines.json +67 -0
- package/port/knowledge/footprints.json +189 -0
- package/port/knowledge/maps/godot-godot-csharp.json +38 -0
- package/port/knowledge/maps/godot-threejs.json +42 -0
- package/port/knowledge/maps/godot-unity.json +62 -0
- package/port/knowledge/maps/godot-unreal.json +48 -0
- package/port/knowledge/maps/unity-godot.json +52 -0
- package/port/knowledge/maps/unity-unreal.json +33 -0
- package/port/knowledge/systems.json +1554 -0
- package/port/mcp.mjs +62 -0
- package/port/plugin/mcp-launch.mjs +19 -0
- package/port/server.mjs +129 -0
- package/port/src/agent.mjs +257 -0
- package/port/src/archive.mjs +324 -0
- package/port/src/binary.mjs +606 -0
- package/port/src/blueprint.mjs +225 -0
- package/port/src/compare.mjs +165 -0
- package/port/src/connect.mjs +58 -0
- package/port/src/convert.mjs +134 -0
- package/port/src/formats.mjs +229 -0
- package/port/src/graph.mjs +275 -0
- package/port/src/knowledge.mjs +90 -0
- package/port/src/lookup.mjs +615 -0
- package/port/src/main-module.mjs +10 -0
- package/port/src/plan.mjs +606 -0
- package/port/src/porters.mjs +360 -0
- package/port/src/proofcase.mjs +343 -0
- package/port/src/relay.mjs +493 -0
- package/port/src/scan.mjs +189 -0
- package/port/src/scene.mjs +338 -0
- package/port/src/stashpad.mjs +114 -0
- package/port/src/symbols.mjs +201 -0
- package/port/src/tools.mjs +198 -0
- package/port/src/util.mjs +162 -0
- package/port/src/workspace.mjs +39 -0
- package/port/templates/unity/ReversePortSceneBuilder.cs +258 -0
- package/scripts/electron-active-hook-boundaries.cjs +392 -0
- package/scripts/electron-active-hook.cjs +673 -0
- package/scripts/hopper-demo-x11.py +787 -0
- package/scripts/prepack.mjs +60 -0
- package/scripts/prepare.mjs +28 -0
- package/scripts/rea.mjs +110 -0
- package/scripts/verify-windows-native-artifact.mjs +39 -0
- package/skills/build-inspector/SKILL.md +44 -0
- package/skills/godot-port/SKILL.md +42 -0
- package/skills/port-project/SKILL.md +59 -0
- package/skills/port-verify/SKILL.md +35 -0
- package/skills/proof-case/SKILL.md +52 -0
- package/skills/rebuild/SKILL.md +66 -0
- package/skills/reverse-engineer/SKILL.md +67 -0
- package/skills/reverse-engineer-anything/SKILL.md +204 -0
- package/skills/reverse-engineer-anything/references/android-applications.md +34 -0
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +130 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +54 -0
- package/skills/reverse-engineer-anything/references/godot-source.md +37 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +175 -0
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +252 -0
- package/skills/reverse-engineer-anything/references/porting-and-rebuilds.md +92 -0
- package/skills/reverse-engineer-anything/references/runtime-observation.md +28 -0
- package/skills/reverse-engineer-anything/references/unity-source.md +32 -0
- package/skills/troubleshoot/SKILL.md +27 -0
- package/skills/unity-to-godot/SKILL.md +37 -0
- package/third_party/README.md +60 -0
- package/third_party/evmole/LICENSE +21 -0
- package/third_party/evmole/README.md +22 -0
- package/third_party/pwndbg/LICENSE.md +21 -0
- package/third_party/pwndbg/README.md +23 -0
- package/third_party/pwntools/README.md +40 -0
- package/third_party/wabt/README.md +24 -0
|
@@ -0,0 +1,2319 @@
|
|
|
1
|
+
import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
|
|
2
|
+
import { d as init_analysisErrorCore, f as err, g as init_analysisErrorBase, h as AnalysisError, l as AnalysisTimeoutError, m as ok, p as init_result, r as AnalysisCancelledError } from "./analysisErrorCore-BqyeMw3_.js";
|
|
3
|
+
import { n as projectAnalysisError, t as init_analysisErrorProjection } from "./analysisErrorProjection-B7pHef2y.js";
|
|
4
|
+
import { n as init_providerAdapterError, t as ProviderAdapterError } from "./providerAdapterError-CdPaQ6-Z.js";
|
|
5
|
+
import { n as init_browserObservationError, t as BrowserObservationError } from "./browserObservationError-BKBEX85K.js";
|
|
6
|
+
import { f as sanitizeBrowserUrl, s as init_browserObservation, u as isLiteralLoopbackHostname } from "./webContentArtifact-DUBgMzVO.js";
|
|
7
|
+
import { a as browserScenarioStepSchema, c as init_browserScenarioCaptureValues, d as init_browserNetworkEvidence, i as browserScenarioEventSchema, l as PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION, n as init_browserScenarioCapture, o as browserStepArtifactsSchema, s as classifyBrowserScenarioCompleteness, t as browserScenarioCaptureSchema } from "./browserScenarioCapture-BvnKTmtZ.js";
|
|
8
|
+
import { a as init_providerIdentities, r as PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY } from "./providerIdentities--ptAh481.js";
|
|
9
|
+
import { join, resolve } from "node:path";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { tmpdir } from "node:os";
|
|
12
|
+
import { chmod, mkdtemp, rm } from "node:fs/promises";
|
|
13
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
14
|
+
|
|
15
|
+
//#region dist/browser/BrowserScenarioPartialObservation.js
|
|
16
|
+
var OPERATION$4, browserScenarioLimitations, browserScenarioCaptureData, browserScenarioCleanupObservation, browserScenarioOperationFailure;
|
|
17
|
+
function init_BrowserScenarioPartialObservation() {
|
|
18
|
+
return (init_BrowserScenarioPartialObservation = __esmMin((() => {
|
|
19
|
+
init_browserNetworkEvidence();
|
|
20
|
+
init_analysisErrorBase();
|
|
21
|
+
init_analysisErrorCore();
|
|
22
|
+
init_analysisErrorProjection();
|
|
23
|
+
init_browserObservationError();
|
|
24
|
+
init_providerAdapterError();
|
|
25
|
+
init_providerIdentities();
|
|
26
|
+
OPERATION$4 = "capture_browser_scenario";
|
|
27
|
+
browserScenarioLimitations = (session, scenario, events) => {
|
|
28
|
+
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"));
|
|
29
|
+
return [
|
|
30
|
+
"Event sequence records provider receipt order; simultaneous browser causality is not inferred.",
|
|
31
|
+
"Network content is retained only when selected; Playwright response-body bytes are API results and are not guaranteed to match wire bytes.",
|
|
32
|
+
"Request bytes are limited to what Playwright exposes; not_exposed does not establish body absence or multipart file coverage.",
|
|
33
|
+
"Network content reads settle within 5 seconds each and the observer does not request bodies from unfinished responses.",
|
|
34
|
+
...capturedResponseBody ? [PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION] : [],
|
|
35
|
+
"Playwright scenario events do not expose request initiator stacks; receipt order does not prove causality.",
|
|
36
|
+
"Storage values are hashed only after declared-secret redaction.",
|
|
37
|
+
...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."],
|
|
38
|
+
...session.eventLimitations?.() ?? [],
|
|
39
|
+
...session.mode === "connect" ? ["CDP attachment cannot recover pre-attach events or guarantee launch-time context options."] : []
|
|
40
|
+
];
|
|
41
|
+
};
|
|
42
|
+
browserScenarioCaptureData = (input) => {
|
|
43
|
+
const events = input.session.events();
|
|
44
|
+
return {
|
|
45
|
+
browser: {
|
|
46
|
+
mode: input.session.mode,
|
|
47
|
+
process_ownership: input.session.processOwnership,
|
|
48
|
+
cleanup: input.cleanup,
|
|
49
|
+
product: input.session.product,
|
|
50
|
+
version: input.session.version
|
|
51
|
+
},
|
|
52
|
+
scenario: {
|
|
53
|
+
start_origin: new URL(input.scenario.start_url.url).origin,
|
|
54
|
+
action_count: input.scenario.actions.length,
|
|
55
|
+
secret_references: input.scenario.secrets.map(({ secret_id: id }) => id).sort(),
|
|
56
|
+
network_content: input.scenario.capture.network
|
|
57
|
+
},
|
|
58
|
+
duration_ms: Date.now() - input.startedAt,
|
|
59
|
+
steps: [...input.steps],
|
|
60
|
+
events,
|
|
61
|
+
limitations: [...browserScenarioLimitations(input.session, input.scenario, events.items), ...input.limitations ?? []]
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
browserScenarioCleanupObservation = (cause) => cause instanceof AnalysisError && cause.cleanup !== undefined ? cause.cleanup : {
|
|
65
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
66
|
+
resources: cause instanceof AnalysisError && cause.cleanupResources.length > 0 ? cause.cleanupResources : ["browser_transport"]
|
|
67
|
+
};
|
|
68
|
+
browserScenarioOperationFailure = (cause, partialObservation, cleanupFailure) => {
|
|
69
|
+
const primary = cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$4, { cause });
|
|
70
|
+
const primaryProjection = projectAnalysisError(primary);
|
|
71
|
+
const cleanupCause = cleanupFailure === undefined ? undefined : cleanupFailure.cause instanceof AnalysisError ? cleanupFailure.cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, "close_browser_scenario", { cause: cleanupFailure.cause });
|
|
72
|
+
const cleanupObservation = cleanupFailure === undefined ? undefined : browserScenarioCleanupObservation(cleanupFailure.cause);
|
|
73
|
+
const retainedOptions = {
|
|
74
|
+
cause: primary,
|
|
75
|
+
partialObservation,
|
|
76
|
+
...primary.capturedOutput === undefined ? {} : { capturedOutput: primary.capturedOutput },
|
|
77
|
+
...primary.cleanup === undefined ? {} : { cleanup: primary.cleanup }
|
|
78
|
+
};
|
|
79
|
+
if (cleanupCause === undefined) {
|
|
80
|
+
if (primary instanceof AnalysisCancelledError) return new AnalysisCancelledError(primary.operation, retainedOptions);
|
|
81
|
+
if (primary instanceof AnalysisTimeoutError) return new AnalysisTimeoutError(primary.operation, primary.timeoutMs, retainedOptions);
|
|
82
|
+
if (primary instanceof BrowserObservationError) return new BrowserObservationError(primary.operation, primary.reason, {
|
|
83
|
+
...retainedOptions,
|
|
84
|
+
...primary.userMessage === undefined ? {} : { detail: primary.userMessage }
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const cleanup = cleanupObservation ?? primary.cleanup;
|
|
88
|
+
return new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$4, {
|
|
89
|
+
...retainedOptions,
|
|
90
|
+
cause: cleanupCause === undefined ? primary : new AggregateError([primary, cleanupCause], "Browser scenario operation and cleanup both failed", { cause: primary }),
|
|
91
|
+
userMessage: primaryProjection.message,
|
|
92
|
+
...cleanup === undefined ? {} : { cleanup },
|
|
93
|
+
diagnostics: {
|
|
94
|
+
primary_error: primaryProjection,
|
|
95
|
+
...cleanupCause === undefined ? {} : { cleanup_error: projectAnalysisError(cleanupCause) }
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
})))();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region dist/browser/PlaywrightBrowserScenarioProvider.js
|
|
104
|
+
var OPERATION$3, SNAPSHOT_KINDS, requestedForStep, unavailableArtifacts, stepCompleteness, createStep, initialStep, executeStep, globalCompleteness, runScenario, PlaywrightBrowserScenarioProvider;
|
|
105
|
+
function init_PlaywrightBrowserScenarioProvider() {
|
|
106
|
+
return (init_PlaywrightBrowserScenarioProvider = __esmMin((() => {
|
|
107
|
+
init_browserScenarioCapture();
|
|
108
|
+
init_browserScenarioCaptureValues();
|
|
109
|
+
init_analysisErrorBase();
|
|
110
|
+
init_browserObservationError();
|
|
111
|
+
init_providerAdapterError();
|
|
112
|
+
init_result();
|
|
113
|
+
init_BrowserScenarioPartialObservation();
|
|
114
|
+
init_providerIdentities();
|
|
115
|
+
OPERATION$3 = "capture_browser_scenario";
|
|
116
|
+
SNAPSHOT_KINDS = [
|
|
117
|
+
"screenshot",
|
|
118
|
+
"dom",
|
|
119
|
+
"accessibility",
|
|
120
|
+
"url",
|
|
121
|
+
"history",
|
|
122
|
+
"storage"
|
|
123
|
+
];
|
|
124
|
+
requestedForStep = (scenario, stepIndex) => new Set([...scenario.capture.after_each_step, ...stepIndex === scenario.actions.length ? scenario.capture.at_end : []]);
|
|
125
|
+
unavailableArtifacts = (requested, reason) => {
|
|
126
|
+
const state = (kind) => requested.has(kind) ? {
|
|
127
|
+
state: "missing",
|
|
128
|
+
reason
|
|
129
|
+
} : { state: "not_requested" };
|
|
130
|
+
return browserStepArtifactsSchema.parse({
|
|
131
|
+
screenshot: state("screenshot"),
|
|
132
|
+
dom: state("dom"),
|
|
133
|
+
accessibility: state("accessibility"),
|
|
134
|
+
url: state("url"),
|
|
135
|
+
history: state("history"),
|
|
136
|
+
storage: state("storage")
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
stepCompleteness = (artifacts, status) => {
|
|
140
|
+
const missing = SNAPSHOT_KINDS.filter((section) => artifacts[section].state === "missing");
|
|
141
|
+
const truncated = SNAPSHOT_KINDS.filter((section) => artifacts[section].state === "truncated");
|
|
142
|
+
if (status !== "completed") missing.push("action");
|
|
143
|
+
return classifyBrowserScenarioCompleteness(missing, truncated);
|
|
144
|
+
};
|
|
145
|
+
createStep = (input) => browserScenarioStepSchema.parse({
|
|
146
|
+
step_index: input.stepIndex,
|
|
147
|
+
step_id: input.stepId,
|
|
148
|
+
action: input.action,
|
|
149
|
+
status: input.status,
|
|
150
|
+
elapsed_ms: input.elapsedMs,
|
|
151
|
+
before_url: input.beforeUrl,
|
|
152
|
+
after_url: input.afterUrl,
|
|
153
|
+
error: input.error,
|
|
154
|
+
event_sequence_start: input.eventStart,
|
|
155
|
+
event_sequence_end: input.eventEnd,
|
|
156
|
+
artifacts: input.artifacts,
|
|
157
|
+
completeness: stepCompleteness(input.artifacts, input.status)
|
|
158
|
+
});
|
|
159
|
+
initialStep = async (input) => {
|
|
160
|
+
const { session, scenario, elapsedMs, signal } = input;
|
|
161
|
+
const artifacts = await session.capture(requestedForStep(scenario, 0), signal);
|
|
162
|
+
return createStep({
|
|
163
|
+
stepIndex: 0,
|
|
164
|
+
stepId: "scenario_start",
|
|
165
|
+
action: "goto_start",
|
|
166
|
+
status: "completed",
|
|
167
|
+
elapsedMs,
|
|
168
|
+
beforeUrl: session.sanitizeUrl(session.initialUrl),
|
|
169
|
+
afterUrl: session.sanitizeUrl(session.currentUrl()),
|
|
170
|
+
error: null,
|
|
171
|
+
eventStart: 1,
|
|
172
|
+
eventEnd: session.lastEventSequence(),
|
|
173
|
+
artifacts
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
executeStep = async (input) => {
|
|
177
|
+
const { session, scenario, action, stepIndex, priorFailure, signal } = input;
|
|
178
|
+
const beforeUrl = session.sanitizeUrl(session.currentUrl());
|
|
179
|
+
const eventStart = session.nextEventSequence();
|
|
180
|
+
const requested = requestedForStep(scenario, stepIndex);
|
|
181
|
+
if (priorFailure) return createStep({
|
|
182
|
+
stepIndex,
|
|
183
|
+
stepId: action.step_id,
|
|
184
|
+
action: action.action,
|
|
185
|
+
status: "cancelled",
|
|
186
|
+
elapsedMs: 0,
|
|
187
|
+
beforeUrl,
|
|
188
|
+
afterUrl: beforeUrl,
|
|
189
|
+
error: "not executed after an earlier action failure",
|
|
190
|
+
eventStart,
|
|
191
|
+
eventEnd: session.lastEventSequence(),
|
|
192
|
+
artifacts: unavailableArtifacts(requested, "action was not executed after an earlier failure")
|
|
193
|
+
});
|
|
194
|
+
const actionStartedAt = Date.now();
|
|
195
|
+
session.setStep(stepIndex);
|
|
196
|
+
const requestCancelled = () => signal?.aborted === true;
|
|
197
|
+
let outcome = {
|
|
198
|
+
status: "completed",
|
|
199
|
+
error: null
|
|
200
|
+
};
|
|
201
|
+
if (requestCancelled()) {
|
|
202
|
+
outcome = {
|
|
203
|
+
status: "cancelled",
|
|
204
|
+
error: "scenario request cancelled"
|
|
205
|
+
};
|
|
206
|
+
} else {
|
|
207
|
+
try {
|
|
208
|
+
await session.perform(action, signal);
|
|
209
|
+
} catch (cause) {
|
|
210
|
+
outcome = {
|
|
211
|
+
status: requestCancelled() ? "cancelled" : "failed",
|
|
212
|
+
error: session.redactError(cause)
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const artifacts = outcome.status === "cancelled" ? unavailableArtifacts(requested, "scenario request cancelled") : await session.capture(requested, signal);
|
|
217
|
+
return createStep({
|
|
218
|
+
stepIndex,
|
|
219
|
+
stepId: action.step_id,
|
|
220
|
+
action: action.action,
|
|
221
|
+
...outcome,
|
|
222
|
+
elapsedMs: Date.now() - actionStartedAt,
|
|
223
|
+
beforeUrl,
|
|
224
|
+
afterUrl: session.sanitizeUrl(session.currentUrl()),
|
|
225
|
+
eventStart,
|
|
226
|
+
eventEnd: session.lastEventSequence(),
|
|
227
|
+
artifacts
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
globalCompleteness = (scenario, session, steps) => {
|
|
231
|
+
const missing = steps.flatMap(({ completeness }) => completeness.missing_sections);
|
|
232
|
+
const truncated = steps.flatMap(({ completeness }) => completeness.truncated_sections);
|
|
233
|
+
if (session.mode === "connect") missing.push("events");
|
|
234
|
+
if ((session.eventLimitations?.().length ?? 0) > 0) missing.push("events");
|
|
235
|
+
return classifyBrowserScenarioCompleteness(missing, truncated);
|
|
236
|
+
};
|
|
237
|
+
runScenario = async (openSession, scenario, options, retainCleanup) => {
|
|
238
|
+
if (options.signal?.aborted === true) throw new BrowserObservationError(OPERATION$3, "cancelled");
|
|
239
|
+
const startedAt = Date.now();
|
|
240
|
+
const session = await openSession(scenario, {
|
|
241
|
+
...options.signal === undefined ? {} : { signal: options.signal },
|
|
242
|
+
retainCleanup
|
|
243
|
+
});
|
|
244
|
+
const steps = [];
|
|
245
|
+
let operationOutcome = { ok: true };
|
|
246
|
+
try {
|
|
247
|
+
steps.push(await initialStep({
|
|
248
|
+
session,
|
|
249
|
+
scenario,
|
|
250
|
+
elapsedMs: Date.now() - startedAt,
|
|
251
|
+
signal: options.signal
|
|
252
|
+
}));
|
|
253
|
+
let failed = false;
|
|
254
|
+
for (const [offset, action] of scenario.actions.entries()) {
|
|
255
|
+
const step = await executeStep({
|
|
256
|
+
session,
|
|
257
|
+
scenario,
|
|
258
|
+
action,
|
|
259
|
+
stepIndex: offset + 1,
|
|
260
|
+
priorFailure: failed,
|
|
261
|
+
signal: options.signal
|
|
262
|
+
});
|
|
263
|
+
steps.push(step);
|
|
264
|
+
failed ||= step.status !== "completed";
|
|
265
|
+
}
|
|
266
|
+
} catch (cause) {
|
|
267
|
+
operationOutcome = {
|
|
268
|
+
ok: false,
|
|
269
|
+
cause
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
let cleanupOutcome;
|
|
273
|
+
try {
|
|
274
|
+
cleanupOutcome = {
|
|
275
|
+
ok: true,
|
|
276
|
+
cleanup: await session.close()
|
|
277
|
+
};
|
|
278
|
+
} catch (cause) {
|
|
279
|
+
cleanupOutcome = {
|
|
280
|
+
ok: false,
|
|
281
|
+
cause
|
|
282
|
+
};
|
|
283
|
+
retainCleanup(() => session.close());
|
|
284
|
+
}
|
|
285
|
+
if (!cleanupOutcome.ok) {
|
|
286
|
+
const cleanup = browserScenarioCleanupObservation(cleanupOutcome.cause);
|
|
287
|
+
const partialObservation = {
|
|
288
|
+
kind: "browser-scenario-observation",
|
|
289
|
+
capture: browserScenarioCaptureData({
|
|
290
|
+
session,
|
|
291
|
+
scenario,
|
|
292
|
+
startedAt,
|
|
293
|
+
steps,
|
|
294
|
+
cleanup: "incomplete",
|
|
295
|
+
limitations: ["Scenario observations are partial because browser cleanup could not be confirmed."]
|
|
296
|
+
})
|
|
297
|
+
};
|
|
298
|
+
if (!operationOutcome.ok) throw browserScenarioOperationFailure(operationOutcome.cause, partialObservation, { cause: cleanupOutcome.cause });
|
|
299
|
+
throw new BrowserObservationError(OPERATION$3, "cleanup_failed", {
|
|
300
|
+
cause: cleanupOutcome.cause,
|
|
301
|
+
cleanup,
|
|
302
|
+
partialObservation,
|
|
303
|
+
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.`
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
if (!operationOutcome.ok) throw browserScenarioOperationFailure(operationOutcome.cause, {
|
|
307
|
+
kind: "browser-scenario-observation",
|
|
308
|
+
capture: browserScenarioCaptureData({
|
|
309
|
+
session,
|
|
310
|
+
scenario,
|
|
311
|
+
startedAt,
|
|
312
|
+
steps,
|
|
313
|
+
cleanup: cleanupOutcome.cleanup,
|
|
314
|
+
limitations: ["Scenario capture ended after an operation failed; uncollected steps are not represented."]
|
|
315
|
+
})
|
|
316
|
+
});
|
|
317
|
+
const completeness = globalCompleteness(scenario, session, steps);
|
|
318
|
+
return browserScenarioCaptureSchema.parse({
|
|
319
|
+
...browserScenarioCaptureData({
|
|
320
|
+
session,
|
|
321
|
+
scenario,
|
|
322
|
+
startedAt,
|
|
323
|
+
steps,
|
|
324
|
+
cleanup: cleanupOutcome.cleanup
|
|
325
|
+
}),
|
|
326
|
+
completeness
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
PlaywrightBrowserScenarioProvider = class {
|
|
330
|
+
openSession;
|
|
331
|
+
#tail = Promise.resolve();
|
|
332
|
+
#closing = false;
|
|
333
|
+
#closePromise;
|
|
334
|
+
#pendingCleanup = new Set();
|
|
335
|
+
constructor(openSession) {
|
|
336
|
+
this.openSession = openSession;
|
|
337
|
+
}
|
|
338
|
+
identity() {
|
|
339
|
+
return PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY;
|
|
340
|
+
}
|
|
341
|
+
captureScenario(scenario, options = {}) {
|
|
342
|
+
if (this.#closing) return Promise.resolve(err(this.#closedError()));
|
|
343
|
+
const operation = this.#tail.then(() => this.#closing ? err(this.#closedError()) : this.#captureScenario(scenario, options));
|
|
344
|
+
this.#tail = operation.then(() => undefined, () => undefined);
|
|
345
|
+
return operation;
|
|
346
|
+
}
|
|
347
|
+
async #captureScenario(scenario, options) {
|
|
348
|
+
const pending = await this.#retryCleanup();
|
|
349
|
+
if (pending !== undefined) return err(pending);
|
|
350
|
+
try {
|
|
351
|
+
return ok(await runScenario(this.openSession, scenario, options, (close) => {
|
|
352
|
+
this.#pendingCleanup.add(close);
|
|
353
|
+
}));
|
|
354
|
+
} catch (cause) {
|
|
355
|
+
if (cause instanceof AnalysisError) return err(cause);
|
|
356
|
+
return err(new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$3, { cause }));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
async close() {
|
|
360
|
+
this.#closing = true;
|
|
361
|
+
this.#closePromise ??= this.#tail.then(async () => {
|
|
362
|
+
const failure = await this.#retryCleanup();
|
|
363
|
+
if (failure !== undefined) throw failure;
|
|
364
|
+
}).catch((cause) => {
|
|
365
|
+
this.#closePromise = undefined;
|
|
366
|
+
throw cause;
|
|
367
|
+
});
|
|
368
|
+
return this.#closePromise;
|
|
369
|
+
}
|
|
370
|
+
#closedError() {
|
|
371
|
+
return new BrowserObservationError(OPERATION$3, "cleanup_failed", {
|
|
372
|
+
detail: "Browser scenario provider is closing.",
|
|
373
|
+
cleanup: {
|
|
374
|
+
reason: "Provider is closing",
|
|
375
|
+
resources: []
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
async #retryCleanup() {
|
|
380
|
+
for (const pending of this.#pendingCleanup) {
|
|
381
|
+
try {
|
|
382
|
+
await pending();
|
|
383
|
+
this.#pendingCleanup.delete(pending);
|
|
384
|
+
} catch (cause) {
|
|
385
|
+
return cause instanceof AnalysisError ? cause : new ProviderAdapterError(PLAYWRIGHT_BROWSER_SCENARIO_PROVIDER_IDENTITY.id, OPERATION$3, { cause });
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
})))();
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region dist/browser/BrowserScenarioSecrets.js
|
|
396
|
+
var REDACTION_PREFIX, encodedSecretValues, secretSpellings, declaredLiterals, redactionMarker, replaceSecretLiterals, secretNeedles, BrowserScenarioSecrets;
|
|
397
|
+
function init_BrowserScenarioSecrets() {
|
|
398
|
+
return (init_BrowserScenarioSecrets = __esmMin((() => {
|
|
399
|
+
init_browserObservation();
|
|
400
|
+
REDACTION_PREFIX = "[REDACTED:";
|
|
401
|
+
encodedSecretValues = (secret) => new Set([
|
|
402
|
+
secret,
|
|
403
|
+
encodeURIComponent(secret),
|
|
404
|
+
new URLSearchParams([["value", secret]]).toString().slice("value=".length)
|
|
405
|
+
]);
|
|
406
|
+
secretSpellings = (secret, spellings) => {
|
|
407
|
+
if (secret === "") return [];
|
|
408
|
+
if (spellings === "raw") return [secret];
|
|
409
|
+
const values = [...encodedSecretValues(secret)];
|
|
410
|
+
if (spellings === "bytes") values.push(JSON.stringify(secret).slice(1, -1));
|
|
411
|
+
return [...new Set(values)].filter((value) => value !== "");
|
|
412
|
+
};
|
|
413
|
+
declaredLiterals = (values, spellings) => [...new Set([...values.values()].flatMap((secret) => secretSpellings(secret, spellings)))];
|
|
414
|
+
redactionMarker = (id, literals) => [
|
|
415
|
+
`${REDACTION_PREFIX}${id}]`,
|
|
416
|
+
"[REDACTED]",
|
|
417
|
+
"…",
|
|
418
|
+
""
|
|
419
|
+
].find((candidate) => literals.every((literal) => !candidate.includes(literal))) ?? "";
|
|
420
|
+
replaceSecretLiterals = (value, values, spellings, literals) => {
|
|
421
|
+
const replacements = [...values].flatMap(([id, secret]) => secretSpellings(secret, spellings).map((text) => ({
|
|
422
|
+
id,
|
|
423
|
+
text
|
|
424
|
+
}))).sort((left, right) => right.text.length - left.text.length || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
|
|
425
|
+
let output = value;
|
|
426
|
+
for (const replacement of replacements) output = output.replaceAll(replacement.text, redactionMarker(replacement.id, literals));
|
|
427
|
+
return output;
|
|
428
|
+
};
|
|
429
|
+
secretNeedles = (values, literals) => [...values].flatMap(([id, secret]) => secretSpellings(secret, "bytes").map((text) => ({
|
|
430
|
+
id,
|
|
431
|
+
needle: Buffer.from(text),
|
|
432
|
+
marker: Buffer.from(redactionMarker(id, literals))
|
|
433
|
+
})));
|
|
434
|
+
BrowserScenarioSecrets = class BrowserScenarioSecrets {
|
|
435
|
+
values;
|
|
436
|
+
constructor(values) {
|
|
437
|
+
this.values = values;
|
|
438
|
+
}
|
|
439
|
+
static resolve(scenario, environment) {
|
|
440
|
+
const values = new Map();
|
|
441
|
+
for (const declaration of scenario.secrets) {
|
|
442
|
+
const value = environment[declaration.environment_variable];
|
|
443
|
+
if (!Object.hasOwn(environment, declaration.environment_variable) || typeof value !== "string") return undefined;
|
|
444
|
+
values.set(declaration.secret_id, value);
|
|
445
|
+
}
|
|
446
|
+
return new BrowserScenarioSecrets(values);
|
|
447
|
+
}
|
|
448
|
+
value(source) {
|
|
449
|
+
if (source.source === "literal") return source.value;
|
|
450
|
+
const value = this.values.get(source.secret_id);
|
|
451
|
+
if (value === undefined) throw new Error("Validated browser secret was not resolved");
|
|
452
|
+
return value;
|
|
453
|
+
}
|
|
454
|
+
url(destination) {
|
|
455
|
+
const url = new URL(destination.url);
|
|
456
|
+
for (const { name, value } of destination.query) url.searchParams.append(name, this.value(value));
|
|
457
|
+
return url.href;
|
|
458
|
+
}
|
|
459
|
+
redact(value) {
|
|
460
|
+
const literals = declaredLiterals(this.values, "raw");
|
|
461
|
+
const output = replaceSecretLiterals(value, this.values, "raw", literals);
|
|
462
|
+
return literals.some((literal) => output.includes(literal)) ? "" : output;
|
|
463
|
+
}
|
|
464
|
+
/** Replace declared UTF-8, URI/form, and JSON-escaped secrets without decoding binary data. */
|
|
465
|
+
redactBytes(value) {
|
|
466
|
+
const literals = declaredLiterals(this.values, "bytes");
|
|
467
|
+
const candidates = secretNeedles(this.values, literals).map((candidate) => ({
|
|
468
|
+
...candidate,
|
|
469
|
+
index: value.indexOf(candidate.needle)
|
|
470
|
+
})).sort((left, right) => right.needle.length - left.needle.length || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
|
|
471
|
+
const parts = [];
|
|
472
|
+
let offset = 0;
|
|
473
|
+
while (true) {
|
|
474
|
+
let next;
|
|
475
|
+
for (const candidate of candidates) {
|
|
476
|
+
if (candidate.index >= 0 && candidate.index < offset) candidate.index = value.indexOf(candidate.needle, offset);
|
|
477
|
+
if (candidate.index >= 0 && (next === undefined || candidate.index < next.index)) next = candidate;
|
|
478
|
+
}
|
|
479
|
+
if (next === undefined) break;
|
|
480
|
+
parts.push(value.subarray(offset, next.index), next.marker);
|
|
481
|
+
offset = next.index + next.needle.length;
|
|
482
|
+
}
|
|
483
|
+
if (parts.length === 0) return value;
|
|
484
|
+
parts.push(value.subarray(offset));
|
|
485
|
+
const redacted = Buffer.concat(parts);
|
|
486
|
+
return literals.some((literal) => redacted.includes(Buffer.from(literal))) ? Buffer.alloc(0) : redacted;
|
|
487
|
+
}
|
|
488
|
+
/** Remove only declared secret values from one URL and report that action. */
|
|
489
|
+
sanitizeUrl(value) {
|
|
490
|
+
const literals = declaredLiterals(this.values, "url");
|
|
491
|
+
const output = replaceSecretLiterals(value, this.values, "url", literals);
|
|
492
|
+
if (literals.some((literal) => output.includes(literal))) return {
|
|
493
|
+
url: "",
|
|
494
|
+
origin: null,
|
|
495
|
+
query_parameter_names: [],
|
|
496
|
+
redacted: true
|
|
497
|
+
};
|
|
498
|
+
const sanitized = sanitizeBrowserUrl(output);
|
|
499
|
+
return {
|
|
500
|
+
...sanitized,
|
|
501
|
+
redacted: sanitized.redacted || output !== value
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
fingerprint(value) {
|
|
505
|
+
for (const secret of this.values.values()) if (secret !== "" && value.includes(secret)) return {
|
|
506
|
+
value_state: "redacted-secret",
|
|
507
|
+
value_sha256: null
|
|
508
|
+
};
|
|
509
|
+
return {
|
|
510
|
+
value_state: "hashed",
|
|
511
|
+
value_sha256: createHash("sha256").update(this.redact(value)).digest("hex")
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
})))();
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region dist/browser/PlaywrightExecutionBoundary.js
|
|
520
|
+
var OPERATION$2, withPlaywrightExecutionBoundary;
|
|
521
|
+
function init_PlaywrightExecutionBoundary() {
|
|
522
|
+
return (init_PlaywrightExecutionBoundary = __esmMin((() => {
|
|
523
|
+
init_analysisErrorCore();
|
|
524
|
+
OPERATION$2 = "capture_browser_scenario";
|
|
525
|
+
withPlaywrightExecutionBoundary = (work, timeoutMs, signal) => {
|
|
526
|
+
if (timeoutMs !== undefined && timeoutMs <= 0) return Promise.reject(new AnalysisTimeoutError(OPERATION$2, timeoutMs));
|
|
527
|
+
if (signal?.aborted === true) return Promise.reject(new AnalysisCancelledError(OPERATION$2));
|
|
528
|
+
return new Promise((resolve, reject) => {
|
|
529
|
+
let settled = false;
|
|
530
|
+
let timer;
|
|
531
|
+
const deadline = timeoutMs === undefined ? undefined : Date.now() + timeoutMs;
|
|
532
|
+
const scheduleTimeout = () => {
|
|
533
|
+
if (deadline === undefined) return;
|
|
534
|
+
const remaining = deadline - Date.now();
|
|
535
|
+
if (remaining <= 0) {
|
|
536
|
+
fail(new AnalysisTimeoutError(OPERATION$2, timeoutMs ?? 0));
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
timer = setTimeout(scheduleTimeout, Math.min(remaining, 2147483647));
|
|
540
|
+
timer.unref();
|
|
541
|
+
};
|
|
542
|
+
const cleanup = () => {
|
|
543
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
544
|
+
signal?.removeEventListener("abort", onAbort);
|
|
545
|
+
};
|
|
546
|
+
const succeed = (value) => {
|
|
547
|
+
if (settled) return;
|
|
548
|
+
settled = true;
|
|
549
|
+
cleanup();
|
|
550
|
+
resolve(value);
|
|
551
|
+
};
|
|
552
|
+
const fail = (error) => {
|
|
553
|
+
if (settled) return;
|
|
554
|
+
settled = true;
|
|
555
|
+
cleanup();
|
|
556
|
+
reject(error);
|
|
557
|
+
};
|
|
558
|
+
const onAbort = () => {
|
|
559
|
+
fail(new AnalysisCancelledError(OPERATION$2));
|
|
560
|
+
};
|
|
561
|
+
scheduleTimeout();
|
|
562
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
563
|
+
if (signal?.aborted === true) {
|
|
564
|
+
onAbort();
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
void work().then(succeed, fail);
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
})))();
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region dist/browser/PlaywrightScenarioBrowser.js
|
|
575
|
+
var OPERATION$1, throwIfScenarioCancelled$1, PlaywrightScenarioBrowserCleanupOwner, attachedScenarioAdmissions, releaseAttachedScenario, createAttachedScenarioRelease, attachedScenarioLeaseKey, acquireAttachedScenario, allowedBrowserEnvironment, findConnectedPage, configureAttachedEnvironment, failBrowserScenarioOperation, openAttachedScenarioBrowser, openPlaywrightScenarioBrowser;
|
|
576
|
+
function init_PlaywrightScenarioBrowser() {
|
|
577
|
+
return (init_PlaywrightScenarioBrowser = __esmMin((() => {
|
|
578
|
+
init_analysisErrorBase();
|
|
579
|
+
init_browserObservation();
|
|
580
|
+
init_browserObservationError();
|
|
581
|
+
init_PlaywrightExecutionBoundary();
|
|
582
|
+
OPERATION$1 = "capture_browser_scenario";
|
|
583
|
+
throwIfScenarioCancelled$1 = (signal) => {
|
|
584
|
+
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION$1, "cancelled");
|
|
585
|
+
};
|
|
586
|
+
PlaywrightScenarioBrowserCleanupOwner = class {
|
|
587
|
+
resources;
|
|
588
|
+
#browserClosed = false;
|
|
589
|
+
#profileRemoved;
|
|
590
|
+
#closePromise;
|
|
591
|
+
#eventFinalizationPromise;
|
|
592
|
+
/** Keep the narrow provider actions needed to release one opened browser. */
|
|
593
|
+
constructor(resources) {
|
|
594
|
+
this.resources = resources;
|
|
595
|
+
this.#profileRemoved = resources.removeProfile === undefined;
|
|
596
|
+
}
|
|
597
|
+
get browserClosed() {
|
|
598
|
+
return this.#browserClosed;
|
|
599
|
+
}
|
|
600
|
+
close(finishEvents, signal) {
|
|
601
|
+
const cleanup = this.#closePromise ?? this.#closeResources(finishEvents);
|
|
602
|
+
if (this.#closePromise === undefined) {
|
|
603
|
+
this.#closePromise = cleanup;
|
|
604
|
+
void cleanup.then(() => this.resources.onSettled?.(this.#browserClosed), () => {
|
|
605
|
+
if (this.#closePromise === cleanup) this.#closePromise = undefined;
|
|
606
|
+
this.resources.onSettled?.(this.#browserClosed);
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
return this.#awaitCleanup(cleanup, signal);
|
|
610
|
+
}
|
|
611
|
+
async #awaitCleanup(cleanup, signal) {
|
|
612
|
+
try {
|
|
613
|
+
await withPlaywrightExecutionBoundary(() => cleanup, 1e3, signal);
|
|
614
|
+
} catch (cause) {
|
|
615
|
+
throw new BrowserObservationError(OPERATION$1, "cleanup_failed", {
|
|
616
|
+
cause,
|
|
617
|
+
cleanup: {
|
|
618
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
619
|
+
resources: ["browser_transport", ...this.resources.removeProfile === undefined ? [] : ["browser_profile"]]
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
async #closeResources(finishEvents) {
|
|
625
|
+
const failures = [];
|
|
626
|
+
const eventFinalization = this.#eventFinalizationPromise ??= Promise.resolve().then(async () => {
|
|
627
|
+
await finishEvents?.();
|
|
628
|
+
});
|
|
629
|
+
try {
|
|
630
|
+
await eventFinalization;
|
|
631
|
+
} catch (cause) {
|
|
632
|
+
failures.push(cause);
|
|
633
|
+
}
|
|
634
|
+
if (!this.#browserClosed) {
|
|
635
|
+
try {
|
|
636
|
+
await this.resources.closeBrowser();
|
|
637
|
+
this.#browserClosed = true;
|
|
638
|
+
} catch (cause) {
|
|
639
|
+
failures.push(cause);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
if (this.#browserClosed && !this.#profileRemoved && this.resources.removeProfile !== undefined) {
|
|
643
|
+
try {
|
|
644
|
+
await this.resources.removeProfile();
|
|
645
|
+
this.#profileRemoved = true;
|
|
646
|
+
} catch (cause) {
|
|
647
|
+
failures.push(cause);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
if (failures.length === 1) throw failures[0];
|
|
651
|
+
if (failures.length > 1) throw new AggregateError(failures, "Browser session cleanup failed");
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
attachedScenarioAdmissions = new Map();
|
|
655
|
+
releaseAttachedScenario = (key, admission) => {
|
|
656
|
+
const waiter = admission.waiters.shift();
|
|
657
|
+
if (waiter === undefined) {
|
|
658
|
+
admission.active = false;
|
|
659
|
+
if (admission.cleanupOwner === undefined && attachedScenarioAdmissions.get(key) === admission) attachedScenarioAdmissions.delete(key);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (waiter.onAbort !== undefined) waiter.signal?.removeEventListener("abort", waiter.onAbort);
|
|
663
|
+
if (waiter.signal?.aborted === true) {
|
|
664
|
+
waiter.reject(new BrowserObservationError(OPERATION$1, "cancelled"));
|
|
665
|
+
releaseAttachedScenario(key, admission);
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
waiter.resolve(createAttachedScenarioRelease(key, admission));
|
|
669
|
+
};
|
|
670
|
+
createAttachedScenarioRelease = (key, admission) => {
|
|
671
|
+
let released = false;
|
|
672
|
+
return () => {
|
|
673
|
+
if (released) return;
|
|
674
|
+
released = true;
|
|
675
|
+
releaseAttachedScenario(key, admission);
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
attachedScenarioLeaseKey = (endpoint, targetId) => {
|
|
679
|
+
const discovery = new URL("/json/version", endpoint);
|
|
680
|
+
if (isLiteralLoopbackHostname(discovery.hostname)) discovery.hostname = "127.0.0.1";
|
|
681
|
+
return JSON.stringify([discovery.href, targetId]);
|
|
682
|
+
};
|
|
683
|
+
acquireAttachedScenario = (scenario, signal) => {
|
|
684
|
+
if (signal?.aborted === true) return Promise.reject(new BrowserObservationError(OPERATION$1, "cancelled"));
|
|
685
|
+
const key = attachedScenarioLeaseKey(scenario.cdp_endpoint, scenario.target_id);
|
|
686
|
+
const admission = attachedScenarioAdmissions.get(key) ?? {
|
|
687
|
+
active: false,
|
|
688
|
+
waiters: [],
|
|
689
|
+
cleanupOwner: undefined
|
|
690
|
+
};
|
|
691
|
+
attachedScenarioAdmissions.set(key, admission);
|
|
692
|
+
return new Promise((resolve, reject) => {
|
|
693
|
+
const grant = (release) => resolve({
|
|
694
|
+
admission,
|
|
695
|
+
release
|
|
696
|
+
});
|
|
697
|
+
if (!admission.active) {
|
|
698
|
+
admission.active = true;
|
|
699
|
+
grant(createAttachedScenarioRelease(key, admission));
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
const waiter = {
|
|
703
|
+
signal,
|
|
704
|
+
resolve: (release) => grant(release),
|
|
705
|
+
reject,
|
|
706
|
+
onAbort: undefined
|
|
707
|
+
};
|
|
708
|
+
admission.waiters.push(waiter);
|
|
709
|
+
if (signal !== undefined) {
|
|
710
|
+
const onAbort = () => {
|
|
711
|
+
const index = admission.waiters.indexOf(waiter);
|
|
712
|
+
if (index < 0) return;
|
|
713
|
+
admission.waiters.splice(index, 1);
|
|
714
|
+
signal.removeEventListener("abort", onAbort);
|
|
715
|
+
reject(new BrowserObservationError(OPERATION$1, "cancelled"));
|
|
716
|
+
if (!admission.active && admission.waiters.length === 0) releaseAttachedScenario(key, admission);
|
|
717
|
+
};
|
|
718
|
+
waiter.onAbort = onAbort;
|
|
719
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
720
|
+
if (signal.aborted) {
|
|
721
|
+
onAbort();
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
};
|
|
727
|
+
allowedBrowserEnvironment = (environment) => {
|
|
728
|
+
const allowed = [
|
|
729
|
+
"DBUS_SESSION_BUS_ADDRESS",
|
|
730
|
+
"DISPLAY",
|
|
731
|
+
"HOME",
|
|
732
|
+
"LANG",
|
|
733
|
+
"LD_LIBRARY_PATH",
|
|
734
|
+
"PATH",
|
|
735
|
+
"SystemRoot",
|
|
736
|
+
"TEMP",
|
|
737
|
+
"TMP",
|
|
738
|
+
"TMPDIR",
|
|
739
|
+
"WAYLAND_DISPLAY",
|
|
740
|
+
"XAUTHORITY",
|
|
741
|
+
"XDG_RUNTIME_DIR"
|
|
742
|
+
];
|
|
743
|
+
const selected = Object.fromEntries(allowed.map((name) => [name, environment[name]]).filter((entry) => entry[1] !== undefined));
|
|
744
|
+
if (process.platform !== "android") return selected;
|
|
745
|
+
const prefix = environment.PREFIX;
|
|
746
|
+
if (prefix === undefined) return selected;
|
|
747
|
+
return {
|
|
748
|
+
...selected,
|
|
749
|
+
LD_PRELOAD: `${prefix}/lib/libtermux-exec.so`,
|
|
750
|
+
TERMUX_EXEC__PROC_SELF_EXE: process.execPath
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
findConnectedPage = async (browser, targetId, signal) => {
|
|
754
|
+
for (const context of browser.contexts()) for (const page of context.pages()) {
|
|
755
|
+
const session = await context.newCDPSession(page);
|
|
756
|
+
try {
|
|
757
|
+
throwIfScenarioCancelled$1(signal);
|
|
758
|
+
const { targetInfo } = await session.send("Target.getTargetInfo");
|
|
759
|
+
throwIfScenarioCancelled$1(signal);
|
|
760
|
+
if (targetInfo.targetId !== targetId) continue;
|
|
761
|
+
return {
|
|
762
|
+
context,
|
|
763
|
+
page
|
|
764
|
+
};
|
|
765
|
+
} finally {
|
|
766
|
+
await session.detach();
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
throw new BrowserObservationError(OPERATION$1, "target_not_found");
|
|
770
|
+
};
|
|
771
|
+
configureAttachedEnvironment = async (context, page, environment, signal) => {
|
|
772
|
+
await page.emulateMedia({
|
|
773
|
+
colorScheme: environment.color_scheme,
|
|
774
|
+
reducedMotion: environment.reduced_motion
|
|
775
|
+
});
|
|
776
|
+
throwIfScenarioCancelled$1(signal);
|
|
777
|
+
const session = await context.newCDPSession(page);
|
|
778
|
+
throwIfScenarioCancelled$1(signal);
|
|
779
|
+
await session.send("Emulation.setDeviceMetricsOverride", {
|
|
780
|
+
width: environment.viewport.width,
|
|
781
|
+
height: environment.viewport.height,
|
|
782
|
+
deviceScaleFactor: environment.viewport.device_scale_factor,
|
|
783
|
+
mobile: false,
|
|
784
|
+
dontSetVisibleSize: true
|
|
785
|
+
});
|
|
786
|
+
throwIfScenarioCancelled$1(signal);
|
|
787
|
+
await session.send("Emulation.setLocaleOverride", { locale: environment.locale });
|
|
788
|
+
throwIfScenarioCancelled$1(signal);
|
|
789
|
+
await session.send("Emulation.setTimezoneOverride", { timezoneId: environment.timezone });
|
|
790
|
+
};
|
|
791
|
+
failBrowserScenarioOperation = async (cleanup, primaryFailure, fallbackCleanupResources = ["browser_transport"]) => {
|
|
792
|
+
try {
|
|
793
|
+
await cleanup();
|
|
794
|
+
} catch (cleanupFailure) {
|
|
795
|
+
const cleanupDetails = cleanupFailure instanceof AnalysisError && cleanupFailure.cleanup !== undefined ? cleanupFailure.cleanup : {
|
|
796
|
+
reason: cleanupFailure instanceof Error ? cleanupFailure.message : String(cleanupFailure),
|
|
797
|
+
resources: cleanupFailure instanceof AnalysisError ? cleanupFailure.cleanupResources : fallbackCleanupResources
|
|
798
|
+
};
|
|
799
|
+
throw new BrowserObservationError(OPERATION$1, "cleanup_failed", {
|
|
800
|
+
cause: new AggregateError([primaryFailure, cleanupFailure], "Browser scenario operation and cleanup both failed", { cause: primaryFailure }),
|
|
801
|
+
cleanup: cleanupDetails
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
throw primaryFailure;
|
|
805
|
+
};
|
|
806
|
+
openAttachedScenarioBrowser = async (browserRequest, environment, launcher, signal, retainCleanup) => {
|
|
807
|
+
const lease = await acquireAttachedScenario(browserRequest, signal);
|
|
808
|
+
let cleanupOwner;
|
|
809
|
+
try {
|
|
810
|
+
const priorOwner = lease.admission.cleanupOwner;
|
|
811
|
+
if (priorOwner !== undefined) await priorOwner.close();
|
|
812
|
+
throwIfScenarioCancelled$1(signal);
|
|
813
|
+
const browser = await launcher.connectOverCDP(browserRequest.cdp_endpoint);
|
|
814
|
+
const cleanup = new PlaywrightScenarioBrowserCleanupOwner({
|
|
815
|
+
closeBrowser: () => browser.close(),
|
|
816
|
+
onSettled: (browserClosed) => {
|
|
817
|
+
if (browserClosed && lease.admission.cleanupOwner === cleanup) lease.admission.cleanupOwner = undefined;
|
|
818
|
+
lease.release();
|
|
819
|
+
},
|
|
820
|
+
removeProfile: undefined
|
|
821
|
+
});
|
|
822
|
+
cleanupOwner = cleanup;
|
|
823
|
+
lease.admission.cleanupOwner = cleanup;
|
|
824
|
+
throwIfScenarioCancelled$1(signal);
|
|
825
|
+
const target = await withPlaywrightExecutionBoundary(() => findConnectedPage(browser, browserRequest.target_id, signal), undefined, signal);
|
|
826
|
+
throwIfScenarioCancelled$1(signal);
|
|
827
|
+
await withPlaywrightExecutionBoundary(() => configureAttachedEnvironment(target.context, target.page, environment, signal), undefined, signal);
|
|
828
|
+
return {
|
|
829
|
+
...target,
|
|
830
|
+
browser,
|
|
831
|
+
profilePath: undefined,
|
|
832
|
+
cleanup
|
|
833
|
+
};
|
|
834
|
+
} catch (cause) {
|
|
835
|
+
if (cleanupOwner === undefined) {
|
|
836
|
+
lease.release();
|
|
837
|
+
throw cause;
|
|
838
|
+
}
|
|
839
|
+
const cleanup = cleanupOwner;
|
|
840
|
+
const close = () => cleanup.close();
|
|
841
|
+
try {
|
|
842
|
+
return await failBrowserScenarioOperation(close, cause);
|
|
843
|
+
} catch (failure) {
|
|
844
|
+
if (failure !== cause) retainCleanup?.(close);
|
|
845
|
+
throw failure;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
openPlaywrightScenarioBrowser = async (scenario, environment, options = {}) => {
|
|
850
|
+
const launcher = options.launcher ?? (await import("playwright-core")).chromium;
|
|
851
|
+
if (scenario.browser.mode === "connect") return openAttachedScenarioBrowser(scenario.browser, scenario.environment, launcher, options.signal, options.retainCleanup);
|
|
852
|
+
const profilePath = await mkdtemp(join(tmpdir(), "rea-browser-scenario-"));
|
|
853
|
+
let context;
|
|
854
|
+
try {
|
|
855
|
+
await chmod(profilePath, 448);
|
|
856
|
+
context = await launcher.launchPersistentContext(profilePath, {
|
|
857
|
+
executablePath: resolve(scenario.browser.executable_path),
|
|
858
|
+
headless: scenario.browser.headless,
|
|
859
|
+
acceptDownloads: false,
|
|
860
|
+
viewport: {
|
|
861
|
+
width: scenario.environment.viewport.width,
|
|
862
|
+
height: scenario.environment.viewport.height
|
|
863
|
+
},
|
|
864
|
+
deviceScaleFactor: scenario.environment.viewport.device_scale_factor,
|
|
865
|
+
locale: scenario.environment.locale,
|
|
866
|
+
timezoneId: scenario.environment.timezone,
|
|
867
|
+
colorScheme: scenario.environment.color_scheme,
|
|
868
|
+
reducedMotion: scenario.environment.reduced_motion,
|
|
869
|
+
serviceWorkers: scenario.environment.service_workers,
|
|
870
|
+
env: allowedBrowserEnvironment(environment),
|
|
871
|
+
handleSIGHUP: false,
|
|
872
|
+
handleSIGINT: false,
|
|
873
|
+
handleSIGTERM: false,
|
|
874
|
+
timeout: 0,
|
|
875
|
+
args: process.platform === "android" ? ["--no-sandbox", "--single-process"] : []
|
|
876
|
+
});
|
|
877
|
+
} catch (cause) {
|
|
878
|
+
const cleanup = () => rm(profilePath, {
|
|
879
|
+
recursive: true,
|
|
880
|
+
force: true,
|
|
881
|
+
maxRetries: 3
|
|
882
|
+
});
|
|
883
|
+
try {
|
|
884
|
+
return await failBrowserScenarioOperation(cleanup, cause, ["browser_profile"]);
|
|
885
|
+
} catch (failure) {
|
|
886
|
+
if (failure !== cause) options.retainCleanup?.(cleanup);
|
|
887
|
+
throw failure;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
const cleanup = new PlaywrightScenarioBrowserCleanupOwner({
|
|
891
|
+
closeBrowser: () => context.close(),
|
|
892
|
+
removeProfile: () => rm(profilePath, {
|
|
893
|
+
recursive: true,
|
|
894
|
+
force: true,
|
|
895
|
+
maxRetries: 3
|
|
896
|
+
})
|
|
897
|
+
});
|
|
898
|
+
try {
|
|
899
|
+
const browser = context.browser();
|
|
900
|
+
if (browser === null) throw new BrowserObservationError(OPERATION$1, "protocol_error");
|
|
901
|
+
const page = context.pages()[0] ?? await context.newPage();
|
|
902
|
+
return {
|
|
903
|
+
context,
|
|
904
|
+
page,
|
|
905
|
+
browser,
|
|
906
|
+
profilePath,
|
|
907
|
+
cleanup
|
|
908
|
+
};
|
|
909
|
+
} catch (cause) {
|
|
910
|
+
const close = () => cleanup.close();
|
|
911
|
+
try {
|
|
912
|
+
return await failBrowserScenarioOperation(close, cause);
|
|
913
|
+
} catch (failure) {
|
|
914
|
+
if (failure !== cause) options.retainCleanup?.(close);
|
|
915
|
+
throw failure;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
})))();
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region dist/browser/PlaywrightScenarioActions.js
|
|
924
|
+
var resolveLocator, resolveValue, performPlaywrightScenarioAction;
|
|
925
|
+
function init_PlaywrightScenarioActions() {
|
|
926
|
+
return (init_PlaywrightScenarioActions = __esmMin((() => {
|
|
927
|
+
resolveLocator = (page, locator) => {
|
|
928
|
+
switch (locator.kind) {
|
|
929
|
+
case "test_id": return page.getByTestId(locator.value);
|
|
930
|
+
case "role": return page.getByRole(locator.role, {
|
|
931
|
+
name: locator.name,
|
|
932
|
+
exact: true
|
|
933
|
+
});
|
|
934
|
+
case "css": return page.locator(locator.selector);
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
resolveValue = (value, secrets) => secrets.value(value);
|
|
938
|
+
performPlaywrightScenarioAction = async (input) => {
|
|
939
|
+
const { page, action, secrets } = input;
|
|
940
|
+
const timeout = "timeout_ms" in action ? action.timeout_ms : undefined;
|
|
941
|
+
const options = timeout === undefined ? {} : { timeout };
|
|
942
|
+
switch (action.action) {
|
|
943
|
+
case "goto":
|
|
944
|
+
await page.goto(secrets.url(action.destination), {
|
|
945
|
+
...options,
|
|
946
|
+
waitUntil: action.wait_until
|
|
947
|
+
});
|
|
948
|
+
return;
|
|
949
|
+
case "click":
|
|
950
|
+
await resolveLocator(page, action.locator).click({
|
|
951
|
+
...options,
|
|
952
|
+
button: action.button,
|
|
953
|
+
clickCount: action.click_count
|
|
954
|
+
});
|
|
955
|
+
return;
|
|
956
|
+
case "fill":
|
|
957
|
+
await resolveLocator(page, action.locator).fill(resolveValue(action.value, secrets), options);
|
|
958
|
+
return;
|
|
959
|
+
case "press":
|
|
960
|
+
await resolveLocator(page, action.locator).press(action.key, options);
|
|
961
|
+
return;
|
|
962
|
+
case "select_option":
|
|
963
|
+
await resolveLocator(page, action.locator).selectOption(resolveValue(action.value, secrets), options);
|
|
964
|
+
return;
|
|
965
|
+
case "check":
|
|
966
|
+
await resolveLocator(page, action.locator).check(options);
|
|
967
|
+
return;
|
|
968
|
+
case "uncheck":
|
|
969
|
+
await resolveLocator(page, action.locator).uncheck(options);
|
|
970
|
+
return;
|
|
971
|
+
case "wait_for":
|
|
972
|
+
await resolveLocator(page, action.locator).waitFor({
|
|
973
|
+
...options,
|
|
974
|
+
state: action.state
|
|
975
|
+
});
|
|
976
|
+
return;
|
|
977
|
+
case "wait_for_timeout": await page.waitForTimeout(action.duration_ms);
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
})))();
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
//#endregion
|
|
984
|
+
//#region dist/browser/PlaywrightScenarioArtifacts.js
|
|
985
|
+
var historyValueSchema, storageValueSchema, notRequested, missing, textArtifact, captureScreenshot, captureDom, captureAccessibility, navigationType, captureHistory, captureStorage, capturePlaywrightStepArtifacts;
|
|
986
|
+
function init_PlaywrightScenarioArtifacts() {
|
|
987
|
+
return (init_PlaywrightScenarioArtifacts = __esmMin((() => {
|
|
988
|
+
init_browserScenarioCaptureValues();
|
|
989
|
+
historyValueSchema = z.strictObject({
|
|
990
|
+
length: z.number().int().min(0),
|
|
991
|
+
navigation_entries: z.array(z.strictObject({
|
|
992
|
+
type: z.string(),
|
|
993
|
+
name: z.string()
|
|
994
|
+
}))
|
|
995
|
+
});
|
|
996
|
+
storageValueSchema = z.strictObject({
|
|
997
|
+
local_storage: z.array(z.tuple([z.string(), z.string()])),
|
|
998
|
+
session_storage: z.array(z.tuple([z.string(), z.string()]))
|
|
999
|
+
});
|
|
1000
|
+
notRequested = () => ({ state: "not_requested" });
|
|
1001
|
+
missing = (reason) => ({
|
|
1002
|
+
state: "missing",
|
|
1003
|
+
reason
|
|
1004
|
+
});
|
|
1005
|
+
textArtifact = (text) => {
|
|
1006
|
+
const bytes = Buffer.from(text);
|
|
1007
|
+
return {
|
|
1008
|
+
state: "captured",
|
|
1009
|
+
value: {
|
|
1010
|
+
sha256: createHash("sha256").update(bytes).digest("hex"),
|
|
1011
|
+
bytes: bytes.byteLength,
|
|
1012
|
+
text
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
};
|
|
1016
|
+
captureScreenshot = async (page) => {
|
|
1017
|
+
try {
|
|
1018
|
+
const bytes = await page.screenshot({
|
|
1019
|
+
type: "png",
|
|
1020
|
+
fullPage: false,
|
|
1021
|
+
animations: "disabled",
|
|
1022
|
+
caret: "hide"
|
|
1023
|
+
});
|
|
1024
|
+
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
1025
|
+
return {
|
|
1026
|
+
state: "captured",
|
|
1027
|
+
value: {
|
|
1028
|
+
sha256,
|
|
1029
|
+
bytes: bytes.byteLength,
|
|
1030
|
+
media_type: "image/png",
|
|
1031
|
+
data_base64: bytes.toString("base64")
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
} catch (cause) {
|
|
1035
|
+
void cause;
|
|
1036
|
+
return missing("screenshot capture failed");
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
captureDom = async (input) => {
|
|
1040
|
+
const { page, secrets } = input;
|
|
1041
|
+
try {
|
|
1042
|
+
return textArtifact(secrets.redact(await page.content()));
|
|
1043
|
+
} catch (cause) {
|
|
1044
|
+
void cause;
|
|
1045
|
+
return missing("DOM capture failed");
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
captureAccessibility = async (input) => {
|
|
1049
|
+
const { page, secrets } = input;
|
|
1050
|
+
try {
|
|
1051
|
+
const text = await page.locator("html").ariaSnapshot();
|
|
1052
|
+
return textArtifact(secrets.redact(text));
|
|
1053
|
+
} catch (cause) {
|
|
1054
|
+
void cause;
|
|
1055
|
+
return missing("accessibility capture failed");
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
navigationType = (value) => {
|
|
1059
|
+
switch (value) {
|
|
1060
|
+
case "navigate":
|
|
1061
|
+
case "reload":
|
|
1062
|
+
case "back_forward":
|
|
1063
|
+
case "prerender": return value;
|
|
1064
|
+
default: return "unknown";
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
captureHistory = async (page, secrets) => {
|
|
1068
|
+
try {
|
|
1069
|
+
const raw = historyValueSchema.parse(await page.evaluate(`(() => ({
|
|
1070
|
+
length: window.history.length,
|
|
1071
|
+
navigation_entries: performance.getEntriesByType("navigation").map(
|
|
1072
|
+
entry => ({
|
|
1073
|
+
type: typeof entry.type === "string" ? entry.type : "unknown",
|
|
1074
|
+
name: entry.name
|
|
1075
|
+
})
|
|
1076
|
+
)
|
|
1077
|
+
}))()`));
|
|
1078
|
+
const value = {
|
|
1079
|
+
length: raw.length,
|
|
1080
|
+
current_url: secrets.sanitizeUrl(page.url()),
|
|
1081
|
+
navigation_entries: raw.navigation_entries.map(({ type, name }) => ({
|
|
1082
|
+
type: navigationType(type),
|
|
1083
|
+
name: secrets.sanitizeUrl(name)
|
|
1084
|
+
}))
|
|
1085
|
+
};
|
|
1086
|
+
return {
|
|
1087
|
+
state: "captured",
|
|
1088
|
+
value
|
|
1089
|
+
};
|
|
1090
|
+
} catch (cause) {
|
|
1091
|
+
void cause;
|
|
1092
|
+
return missing("history capture failed");
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
captureStorage = async (input) => {
|
|
1096
|
+
const { context, page, secrets } = input;
|
|
1097
|
+
try {
|
|
1098
|
+
const pageUrl = new URL(page.url());
|
|
1099
|
+
const cookies = pageUrl.protocol === "http:" || pageUrl.protocol === "https:" ? await context.cookies(pageUrl.href) : [];
|
|
1100
|
+
const pageStorage = storageValueSchema.parse(await page.evaluate(`(() => ({
|
|
1101
|
+
local_storage: Object.entries(window.localStorage),
|
|
1102
|
+
session_storage: Object.entries(window.sessionStorage)
|
|
1103
|
+
}))()`));
|
|
1104
|
+
const value = {
|
|
1105
|
+
cookies: cookies.map((cookie) => ({
|
|
1106
|
+
name: secrets.redact(cookie.name),
|
|
1107
|
+
domain: secrets.redact(cookie.domain),
|
|
1108
|
+
path: secrets.redact(cookie.path),
|
|
1109
|
+
secure: cookie.secure,
|
|
1110
|
+
http_only: cookie.httpOnly,
|
|
1111
|
+
same_site: cookie.sameSite,
|
|
1112
|
+
...secrets.fingerprint(cookie.value)
|
|
1113
|
+
})),
|
|
1114
|
+
local_storage: pageStorage.local_storage.map(([name, value]) => ({
|
|
1115
|
+
name: secrets.redact(name),
|
|
1116
|
+
...secrets.fingerprint(value)
|
|
1117
|
+
})),
|
|
1118
|
+
session_storage: pageStorage.session_storage.map(([name, value]) => ({
|
|
1119
|
+
name: secrets.redact(name),
|
|
1120
|
+
...secrets.fingerprint(value)
|
|
1121
|
+
}))
|
|
1122
|
+
};
|
|
1123
|
+
return {
|
|
1124
|
+
state: "captured",
|
|
1125
|
+
value
|
|
1126
|
+
};
|
|
1127
|
+
} catch (cause) {
|
|
1128
|
+
void cause;
|
|
1129
|
+
return missing("storage capture failed");
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
capturePlaywrightStepArtifacts = async (input) => {
|
|
1133
|
+
const { context, page, secrets, requested } = input;
|
|
1134
|
+
const state = (kind, capture) => !requested.has(kind) ? Promise.resolve(notRequested()) : capture();
|
|
1135
|
+
return browserStepArtifactsSchema.parse({
|
|
1136
|
+
screenshot: await state("screenshot", () => captureScreenshot(page)),
|
|
1137
|
+
dom: await state("dom", () => captureDom({
|
|
1138
|
+
page,
|
|
1139
|
+
secrets
|
|
1140
|
+
})),
|
|
1141
|
+
accessibility: await state("accessibility", () => captureAccessibility({
|
|
1142
|
+
page,
|
|
1143
|
+
secrets
|
|
1144
|
+
})),
|
|
1145
|
+
url: await state("url", async () => ({
|
|
1146
|
+
state: "captured",
|
|
1147
|
+
value: secrets.sanitizeUrl(page.url())
|
|
1148
|
+
})),
|
|
1149
|
+
history: await state("history", () => captureHistory(page, secrets)),
|
|
1150
|
+
storage: await state("storage", () => captureStorage({
|
|
1151
|
+
context,
|
|
1152
|
+
page,
|
|
1153
|
+
secrets
|
|
1154
|
+
}))
|
|
1155
|
+
});
|
|
1156
|
+
};
|
|
1157
|
+
})))();
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
//#endregion
|
|
1161
|
+
//#region dist/browser/network/PlaywrightNetworkContent.js
|
|
1162
|
+
var credentialHeaders, errorMessage, captureNetworkHeaders, captureNetworkBody;
|
|
1163
|
+
function init_PlaywrightNetworkContent() {
|
|
1164
|
+
return (init_PlaywrightNetworkContent = __esmMin((() => {
|
|
1165
|
+
init_analysisErrorCore();
|
|
1166
|
+
init_PlaywrightExecutionBoundary();
|
|
1167
|
+
credentialHeaders = new Set([
|
|
1168
|
+
"authorization",
|
|
1169
|
+
"proxy-authorization",
|
|
1170
|
+
"cookie",
|
|
1171
|
+
"set-cookie"
|
|
1172
|
+
]);
|
|
1173
|
+
errorMessage = (cause, secrets) => secrets.redact(cause instanceof Error && cause.message !== "" ? cause.message : "Network read failed");
|
|
1174
|
+
captureNetworkHeaders = async (source, secrets, options) => {
|
|
1175
|
+
try {
|
|
1176
|
+
const headers = await withPlaywrightExecutionBoundary(() => source.headersArray(), options.timeoutMs, options.signal);
|
|
1177
|
+
return {
|
|
1178
|
+
state: "captured",
|
|
1179
|
+
items: headers.map(({ name, value }) => {
|
|
1180
|
+
const safeName = secrets.redact(name);
|
|
1181
|
+
const credential = credentialHeaders.has(name.toLowerCase());
|
|
1182
|
+
const safeValue = credential ? null : secrets.redactBytes(Buffer.from(value)).toString("utf8");
|
|
1183
|
+
return {
|
|
1184
|
+
name: safeName,
|
|
1185
|
+
value: safeValue,
|
|
1186
|
+
redacted: credential || safeName !== name || safeValue !== value
|
|
1187
|
+
};
|
|
1188
|
+
})
|
|
1189
|
+
};
|
|
1190
|
+
} catch (cause) {
|
|
1191
|
+
return {
|
|
1192
|
+
state: "unavailable",
|
|
1193
|
+
message: errorMessage(cause, secrets)
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
captureNetworkBody = async (read, phase, source, secrets, options) => {
|
|
1198
|
+
try {
|
|
1199
|
+
const observed = await withPlaywrightExecutionBoundary(read, options.timeoutMs, options.signal);
|
|
1200
|
+
if (observed === null) return { state: "not_exposed" };
|
|
1201
|
+
const retained = secrets.redactBytes(observed);
|
|
1202
|
+
const contentType = source.headers()["content-type"];
|
|
1203
|
+
return {
|
|
1204
|
+
state: "captured",
|
|
1205
|
+
representation: phase === "request" ? "browser-exposed-request-bytes" : "playwright-response-body-bytes",
|
|
1206
|
+
encoding: "base64",
|
|
1207
|
+
content: retained.toString("base64"),
|
|
1208
|
+
bytes: retained.length,
|
|
1209
|
+
sha256: createHash("sha256").update(retained).digest("hex"),
|
|
1210
|
+
media_type: contentType === undefined ? null : secrets.redactBytes(Buffer.from(contentType)).toString("utf8"),
|
|
1211
|
+
redacted: !retained.equals(observed)
|
|
1212
|
+
};
|
|
1213
|
+
} catch (cause) {
|
|
1214
|
+
return {
|
|
1215
|
+
state: "unavailable",
|
|
1216
|
+
reason: cause instanceof AnalysisCancelledError ? "cancelled" : cause instanceof AnalysisTimeoutError ? "body-read-timeout" : "body-read-failed",
|
|
1217
|
+
message: errorMessage(cause, secrets)
|
|
1218
|
+
};
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1221
|
+
})))();
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
//#endregion
|
|
1225
|
+
//#region dist/browser/network/PlaywrightScenarioNetwork.js
|
|
1226
|
+
var PlaywrightScenarioNetwork;
|
|
1227
|
+
function init_PlaywrightScenarioNetwork() {
|
|
1228
|
+
return (init_PlaywrightScenarioNetwork = __esmMin((() => {
|
|
1229
|
+
init_PlaywrightNetworkContent();
|
|
1230
|
+
PlaywrightScenarioNetwork = class {
|
|
1231
|
+
options;
|
|
1232
|
+
transactions = new Map();
|
|
1233
|
+
pending = [];
|
|
1234
|
+
gaps = new Set();
|
|
1235
|
+
accepting = true;
|
|
1236
|
+
readOptions;
|
|
1237
|
+
constructor(options) {
|
|
1238
|
+
this.options = options;
|
|
1239
|
+
this.readOptions = {
|
|
1240
|
+
timeoutMs: options.readTimeoutMs ?? 5e3,
|
|
1241
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
/** Observe a request start, retaining the producer's redirect relationship when known. */
|
|
1245
|
+
request(request) {
|
|
1246
|
+
if (!this.accepting) return;
|
|
1247
|
+
const transaction = this.transaction(request);
|
|
1248
|
+
const sequence = this.options.emit({
|
|
1249
|
+
...this.metadata(request, transaction),
|
|
1250
|
+
kind: "request",
|
|
1251
|
+
status: null,
|
|
1252
|
+
failure: null
|
|
1253
|
+
});
|
|
1254
|
+
if (this.options.selection.request_body || this.options.selection.header_values) this.collect(transaction, sequence, "request", request, this.options.selection.request_body ? captureNetworkBody(async () => request.postDataBuffer(), "request", request, this.options.secrets, this.readOptions) : Promise.resolve({ state: "not_requested" }));
|
|
1255
|
+
}
|
|
1256
|
+
/** Observe response metadata without starting a potentially unfinished body read. */
|
|
1257
|
+
response(response) {
|
|
1258
|
+
if (!this.accepting) return;
|
|
1259
|
+
const request = response.request();
|
|
1260
|
+
const transaction = this.transaction(request);
|
|
1261
|
+
const sequence = this.options.emit({
|
|
1262
|
+
...this.metadata(request, transaction),
|
|
1263
|
+
kind: "response",
|
|
1264
|
+
url: this.options.secrets.sanitizeUrl(response.url()),
|
|
1265
|
+
status: response.status(),
|
|
1266
|
+
header_names: this.headerNames(response),
|
|
1267
|
+
failure: null
|
|
1268
|
+
});
|
|
1269
|
+
transaction.response = {
|
|
1270
|
+
source: response,
|
|
1271
|
+
sequence
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
/** Record completion and read selected content through the response API. */
|
|
1275
|
+
finished(request) {
|
|
1276
|
+
if (!this.accepting) return;
|
|
1277
|
+
const transaction = this.transaction(request);
|
|
1278
|
+
transaction.terminal = "finished";
|
|
1279
|
+
this.options.emit({
|
|
1280
|
+
...this.metadata(request, transaction),
|
|
1281
|
+
kind: "request-finished",
|
|
1282
|
+
status: null,
|
|
1283
|
+
failure: null
|
|
1284
|
+
});
|
|
1285
|
+
this.responseContent(transaction);
|
|
1286
|
+
}
|
|
1287
|
+
/** Preserve request failure separately from missing or unreadable response content. */
|
|
1288
|
+
failed(request) {
|
|
1289
|
+
if (!this.accepting) return;
|
|
1290
|
+
const transaction = this.transaction(request);
|
|
1291
|
+
transaction.terminal = "failed";
|
|
1292
|
+
const message = this.options.secrets.redact(request.failure()?.errorText || "Unknown request failure");
|
|
1293
|
+
this.options.emit({
|
|
1294
|
+
...this.metadata(request, transaction),
|
|
1295
|
+
kind: "request-failed",
|
|
1296
|
+
status: null,
|
|
1297
|
+
failure: message
|
|
1298
|
+
});
|
|
1299
|
+
this.responseContent(transaction, {
|
|
1300
|
+
state: "unavailable",
|
|
1301
|
+
reason: "request-failed",
|
|
1302
|
+
message
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
/** Stop observing, mark unfinished transactions, and settle bounded content reads. */
|
|
1306
|
+
async finish() {
|
|
1307
|
+
if (!this.accepting) {
|
|
1308
|
+
await Promise.all(this.pending);
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
this.accepting = false;
|
|
1312
|
+
for (const [request, transaction] of this.transactions) {
|
|
1313
|
+
if (transaction.terminal === undefined) {
|
|
1314
|
+
this.gaps.add("Some network requests had not completed when capture ended; later activity is unknown.");
|
|
1315
|
+
this.options.emit({
|
|
1316
|
+
...this.metadata(request, transaction),
|
|
1317
|
+
kind: "request-unfinished",
|
|
1318
|
+
status: null,
|
|
1319
|
+
failure: null,
|
|
1320
|
+
reason: this.options.signal?.aborted === true ? "cancelled" : "capture-ended"
|
|
1321
|
+
});
|
|
1322
|
+
this.responseContent(transaction, {
|
|
1323
|
+
state: "unavailable",
|
|
1324
|
+
reason: this.options.signal?.aborted === true ? "cancelled" : "response-unfinished",
|
|
1325
|
+
message: "The response had not finished at the capture cutoff; no body read or refetch was attempted."
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
await Promise.all(this.pending);
|
|
1330
|
+
}
|
|
1331
|
+
/** Missing selected content contributes to aggregate completeness. */
|
|
1332
|
+
limitations() {
|
|
1333
|
+
return [...this.gaps];
|
|
1334
|
+
}
|
|
1335
|
+
transaction(request) {
|
|
1336
|
+
const known = this.transactions.get(request);
|
|
1337
|
+
if (known !== undefined) return known;
|
|
1338
|
+
const predecessor = request.redirectedFrom();
|
|
1339
|
+
const transaction = {
|
|
1340
|
+
id: `request-${this.transactions.size + 1}`,
|
|
1341
|
+
redirectedFrom: predecessor === null ? null : this.transactions.get(predecessor)?.id ?? null,
|
|
1342
|
+
responseScheduled: false
|
|
1343
|
+
};
|
|
1344
|
+
this.transactions.set(request, transaction);
|
|
1345
|
+
return transaction;
|
|
1346
|
+
}
|
|
1347
|
+
headerNames(source) {
|
|
1348
|
+
return Object.keys(source.headers()).map((name) => this.options.secrets.redact(name)).sort();
|
|
1349
|
+
}
|
|
1350
|
+
metadata(request, transaction) {
|
|
1351
|
+
return {
|
|
1352
|
+
transaction_id: transaction.id,
|
|
1353
|
+
redirected_from_transaction_id: transaction.redirectedFrom,
|
|
1354
|
+
method: this.options.secrets.redact(request.method()),
|
|
1355
|
+
url: this.options.secrets.sanitizeUrl(request.url()),
|
|
1356
|
+
resource_type: this.options.secrets.redact(request.resourceType()),
|
|
1357
|
+
header_names: this.headerNames(request)
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
responseContent(transaction, unavailable) {
|
|
1361
|
+
const response = transaction.response;
|
|
1362
|
+
if (response === undefined || transaction.responseScheduled || !this.options.selection.response_body && !this.options.selection.header_values) return;
|
|
1363
|
+
transaction.responseScheduled = true;
|
|
1364
|
+
this.collect(transaction, response.sequence, "response", response.source, this.options.selection.response_body ? unavailable === undefined ? captureNetworkBody(() => response.source.body(), "response", response.source, this.options.secrets, this.readOptions) : Promise.resolve(unavailable) : Promise.resolve({ state: "not_requested" }));
|
|
1365
|
+
}
|
|
1366
|
+
collect(transaction, sequence, phase, source, body) {
|
|
1367
|
+
const headers = this.options.selection.header_values ? captureNetworkHeaders(source, this.options.secrets, this.readOptions) : Promise.resolve({ state: "not_requested" });
|
|
1368
|
+
this.pending.push(Promise.all([headers, body]).then(([retainedHeaders, retainedBody]) => {
|
|
1369
|
+
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.");
|
|
1370
|
+
this.options.emit({
|
|
1371
|
+
kind: "network-content",
|
|
1372
|
+
transaction_id: transaction.id,
|
|
1373
|
+
source_event_sequence: sequence,
|
|
1374
|
+
phase,
|
|
1375
|
+
headers: retainedHeaders,
|
|
1376
|
+
body: retainedBody
|
|
1377
|
+
});
|
|
1378
|
+
}));
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
})))();
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region dist/browser/PlaywrightScenarioEvents.js
|
|
1386
|
+
var PlaywrightScenarioEvents;
|
|
1387
|
+
function init_PlaywrightScenarioEvents() {
|
|
1388
|
+
return (init_PlaywrightScenarioEvents = __esmMin((() => {
|
|
1389
|
+
init_browserScenarioCaptureValues();
|
|
1390
|
+
init_PlaywrightScenarioNetwork();
|
|
1391
|
+
PlaywrightScenarioEvents = class {
|
|
1392
|
+
items = [];
|
|
1393
|
+
stepIndex = 0;
|
|
1394
|
+
sequence = 0;
|
|
1395
|
+
enabled;
|
|
1396
|
+
secrets;
|
|
1397
|
+
ownsContext;
|
|
1398
|
+
pages = new Set();
|
|
1399
|
+
incompleteFamilies = new Set();
|
|
1400
|
+
network;
|
|
1401
|
+
stopNetwork;
|
|
1402
|
+
sealed = false;
|
|
1403
|
+
constructor(options) {
|
|
1404
|
+
const network = options.network ?? {
|
|
1405
|
+
request_body: false,
|
|
1406
|
+
response_body: false,
|
|
1407
|
+
header_values: false
|
|
1408
|
+
};
|
|
1409
|
+
this.enabled = new Set(options.enabled);
|
|
1410
|
+
if (network.request_body || network.response_body || network.header_values) this.enabled = new Set([...this.enabled, "network"]);
|
|
1411
|
+
this.secrets = options.secrets;
|
|
1412
|
+
this.ownsContext = options.ownsContext === true;
|
|
1413
|
+
this.pages.add(options.page);
|
|
1414
|
+
if (this.ownsContext && this.enabled.size > 0) (options.context ?? options.page.context()).on("page", (page) => this.popup(page));
|
|
1415
|
+
if (this.enabled.has("network")) {
|
|
1416
|
+
const context = options.context ?? options.page.context();
|
|
1417
|
+
const collector = new PlaywrightScenarioNetwork({
|
|
1418
|
+
selection: network,
|
|
1419
|
+
secrets: options.secrets,
|
|
1420
|
+
emit: (event) => this.push(event),
|
|
1421
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1422
|
+
});
|
|
1423
|
+
this.network = collector;
|
|
1424
|
+
const inScope = (request) => {
|
|
1425
|
+
if (this.ownsContext) return true;
|
|
1426
|
+
try {
|
|
1427
|
+
return this.pages.has(request.frame().page());
|
|
1428
|
+
} catch (cause) {
|
|
1429
|
+
void cause;
|
|
1430
|
+
return false;
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
const onRequest = (request) => {
|
|
1434
|
+
if (inScope(request)) collector.request(request);
|
|
1435
|
+
};
|
|
1436
|
+
const onResponse = (response) => {
|
|
1437
|
+
if (inScope(response.request())) collector.response(response);
|
|
1438
|
+
};
|
|
1439
|
+
const onFailed = (request) => {
|
|
1440
|
+
if (inScope(request)) collector.failed(request);
|
|
1441
|
+
};
|
|
1442
|
+
const onFinished = (request) => {
|
|
1443
|
+
if (inScope(request)) collector.finished(request);
|
|
1444
|
+
};
|
|
1445
|
+
context.on("request", onRequest);
|
|
1446
|
+
context.on("response", onResponse);
|
|
1447
|
+
context.on("requestfailed", onFailed);
|
|
1448
|
+
context.on("requestfinished", onFinished);
|
|
1449
|
+
this.stopNetwork = () => {
|
|
1450
|
+
context.off("request", onRequest);
|
|
1451
|
+
context.off("response", onResponse);
|
|
1452
|
+
context.off("requestfailed", onFailed);
|
|
1453
|
+
context.off("requestfinished", onFinished);
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
this.observePage(options.page);
|
|
1457
|
+
}
|
|
1458
|
+
setStep(index) {
|
|
1459
|
+
this.stepIndex = index;
|
|
1460
|
+
}
|
|
1461
|
+
nextSequence() {
|
|
1462
|
+
return this.sequence + 1;
|
|
1463
|
+
}
|
|
1464
|
+
lastSequence() {
|
|
1465
|
+
return this.sequence;
|
|
1466
|
+
}
|
|
1467
|
+
/** Drain selected network content and freeze the result before browser teardown. */
|
|
1468
|
+
async finish() {
|
|
1469
|
+
this.stopNetwork?.();
|
|
1470
|
+
this.stopNetwork = undefined;
|
|
1471
|
+
try {
|
|
1472
|
+
await this.network?.finish();
|
|
1473
|
+
} finally {
|
|
1474
|
+
this.sealed = true;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
/** Report selected popup event families with unrecoverable pre-discovery gaps. */
|
|
1478
|
+
limitations() {
|
|
1479
|
+
const popupGaps = [...this.incompleteFamilies].map((family) => `Popup ${family} events before Page discovery are unavailable; later events are retained.`);
|
|
1480
|
+
const gaps = [...popupGaps, ...this.network?.limitations() ?? []];
|
|
1481
|
+
return this.enabled.has("network") && !this.ownsContext ? ["Shared-context network capture excludes requests without a known root or descendant Page frame.", ...gaps] : gaps;
|
|
1482
|
+
}
|
|
1483
|
+
result() {
|
|
1484
|
+
return {
|
|
1485
|
+
retained: this.items.length,
|
|
1486
|
+
dropped: 0,
|
|
1487
|
+
items: this.items
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
push(event) {
|
|
1491
|
+
if (this.sealed) return this.sequence;
|
|
1492
|
+
this.sequence += 1;
|
|
1493
|
+
const parsed = browserScenarioEventSchema.parse({
|
|
1494
|
+
...event,
|
|
1495
|
+
sequence: this.sequence,
|
|
1496
|
+
step_index: this.stepIndex
|
|
1497
|
+
});
|
|
1498
|
+
this.items.push(parsed);
|
|
1499
|
+
return this.sequence;
|
|
1500
|
+
}
|
|
1501
|
+
observePage(page) {
|
|
1502
|
+
if (this.enabled.has("console")) page.on("console", (message) => this.console(message));
|
|
1503
|
+
if (this.enabled.has("page-errors")) page.on("pageerror", (error) => {
|
|
1504
|
+
this.push({
|
|
1505
|
+
kind: "page-error",
|
|
1506
|
+
message: this.secrets.redact(error.message),
|
|
1507
|
+
stack: error.stack === undefined ? null : this.secrets.redact(error.stack)
|
|
1508
|
+
});
|
|
1509
|
+
});
|
|
1510
|
+
if (this.enabled.has("websockets")) page.on("websocket", (socket) => this.webSocket(socket));
|
|
1511
|
+
if (this.enabled.has("frames")) {
|
|
1512
|
+
page.on("frameattached", (frame) => this.frame("frame-attached", frame));
|
|
1513
|
+
page.on("framedetached", (frame) => this.frame("frame-detached", frame));
|
|
1514
|
+
page.on("framenavigated", (frame) => this.frame("frame-navigated", frame));
|
|
1515
|
+
}
|
|
1516
|
+
if (this.enabled.has("workers")) page.on("worker", (worker) => this.worker(worker));
|
|
1517
|
+
if (this.enabled.size > 0) page.on("popup", (popup) => this.popup(popup));
|
|
1518
|
+
if (this.enabled.has("downloads")) page.on("download", (download) => this.download(download));
|
|
1519
|
+
}
|
|
1520
|
+
safeUrl(value) {
|
|
1521
|
+
return this.secrets.sanitizeUrl(value);
|
|
1522
|
+
}
|
|
1523
|
+
console(message) {
|
|
1524
|
+
const location = message.location();
|
|
1525
|
+
this.push({
|
|
1526
|
+
kind: "console",
|
|
1527
|
+
level: this.secrets.redact(message.type()),
|
|
1528
|
+
text: this.secrets.redact(message.text()),
|
|
1529
|
+
url: location.url === "" ? null : this.safeUrl(location.url)
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
webSocket(socket) {
|
|
1533
|
+
const url = this.safeUrl(socket.url());
|
|
1534
|
+
this.push({
|
|
1535
|
+
kind: "websocket-opened",
|
|
1536
|
+
url
|
|
1537
|
+
});
|
|
1538
|
+
socket.on("framesent", ({ payload }) => this.webSocketFrame("websocket-frame-sent", url, payload));
|
|
1539
|
+
socket.on("framereceived", ({ payload }) => this.webSocketFrame("websocket-frame-received", url, payload));
|
|
1540
|
+
socket.on("close", () => this.push({
|
|
1541
|
+
kind: "websocket-closed",
|
|
1542
|
+
url
|
|
1543
|
+
}));
|
|
1544
|
+
}
|
|
1545
|
+
webSocketFrame(kind, url, payload) {
|
|
1546
|
+
const bytes = Buffer.byteLength(payload);
|
|
1547
|
+
const isText = typeof payload === "string";
|
|
1548
|
+
if (!isText) {
|
|
1549
|
+
this.push({
|
|
1550
|
+
kind,
|
|
1551
|
+
url,
|
|
1552
|
+
payload_type: "binary",
|
|
1553
|
+
payload_bytes: bytes,
|
|
1554
|
+
payload_text: null,
|
|
1555
|
+
truncated: false
|
|
1556
|
+
});
|
|
1557
|
+
return;
|
|
1558
|
+
}
|
|
1559
|
+
const text = this.secrets.redact(payload);
|
|
1560
|
+
this.push({
|
|
1561
|
+
kind,
|
|
1562
|
+
url,
|
|
1563
|
+
payload_type: "text",
|
|
1564
|
+
payload_bytes: bytes,
|
|
1565
|
+
payload_text: text,
|
|
1566
|
+
truncated: false
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1569
|
+
frame(kind, frame) {
|
|
1570
|
+
this.push({
|
|
1571
|
+
kind,
|
|
1572
|
+
url: frame.url() === "" ? null : this.safeUrl(frame.url()),
|
|
1573
|
+
name: frame.name() === "" ? null : this.secrets.redact(frame.name())
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
worker(worker) {
|
|
1577
|
+
const details = {
|
|
1578
|
+
url: this.safeUrl(worker.url()),
|
|
1579
|
+
name: null
|
|
1580
|
+
};
|
|
1581
|
+
this.push({
|
|
1582
|
+
kind: "worker-created",
|
|
1583
|
+
...details
|
|
1584
|
+
});
|
|
1585
|
+
worker.on("close", () => this.push({
|
|
1586
|
+
kind: "worker-closed",
|
|
1587
|
+
...details
|
|
1588
|
+
}));
|
|
1589
|
+
}
|
|
1590
|
+
popup(page) {
|
|
1591
|
+
if (this.pages.has(page)) return;
|
|
1592
|
+
this.pages.add(page);
|
|
1593
|
+
for (const family of [
|
|
1594
|
+
"frames",
|
|
1595
|
+
"workers",
|
|
1596
|
+
"websockets",
|
|
1597
|
+
"downloads"
|
|
1598
|
+
]) if (this.enabled.has(family)) this.incompleteFamilies.add(family);
|
|
1599
|
+
const opened = {
|
|
1600
|
+
url: page.url() === "" ? null : this.safeUrl(page.url()),
|
|
1601
|
+
name: null
|
|
1602
|
+
};
|
|
1603
|
+
if (this.enabled.has("popups")) {
|
|
1604
|
+
this.push({
|
|
1605
|
+
kind: "popup-opened",
|
|
1606
|
+
...opened
|
|
1607
|
+
});
|
|
1608
|
+
page.on("close", () => this.push({
|
|
1609
|
+
kind: "popup-closed",
|
|
1610
|
+
url: page.url() === "" ? null : this.safeUrl(page.url()),
|
|
1611
|
+
name: null
|
|
1612
|
+
}));
|
|
1613
|
+
}
|
|
1614
|
+
this.observePage(page);
|
|
1615
|
+
}
|
|
1616
|
+
download(download) {
|
|
1617
|
+
this.push({
|
|
1618
|
+
kind: "download-cancelled",
|
|
1619
|
+
suggested_filename: this.secrets.redact(download.suggestedFilename()),
|
|
1620
|
+
url: this.safeUrl(download.url())
|
|
1621
|
+
});
|
|
1622
|
+
void download.cancel().catch((cause) => {
|
|
1623
|
+
void cause;
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
})))();
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region dist/browser/PlaywrightScenarioStorage.js
|
|
1632
|
+
var breakpointResponse, scriptIdentifierResponse, storageKeyResponse, targetInfoResponse, STORAGE_EVENT_METHODS, attachedTargetEvent, targetSessionEvent, nestedMessageEvent, nestedProtocolMessage, executionContextEvent, scriptParsedEvent, pausedEvent, evaluationResponse, STORAGE_CLEANUP_TIMEOUT_MS, PlaywrightScenarioStorage;
|
|
1633
|
+
function init_PlaywrightScenarioStorage() {
|
|
1634
|
+
return (init_PlaywrightScenarioStorage = __esmMin((() => {
|
|
1635
|
+
init_browserObservationError();
|
|
1636
|
+
init_PlaywrightExecutionBoundary();
|
|
1637
|
+
breakpointResponse = z.object({ breakpointId: z.string() });
|
|
1638
|
+
scriptIdentifierResponse = z.object({ identifier: z.string() });
|
|
1639
|
+
storageKeyResponse = z.object({ storageKey: z.string() });
|
|
1640
|
+
targetInfoResponse = z.object({ targetInfo: z.object({ targetId: z.string() }) });
|
|
1641
|
+
STORAGE_EVENT_METHODS = new Set([
|
|
1642
|
+
"Runtime.executionContextCreated",
|
|
1643
|
+
"Runtime.executionContextDestroyed",
|
|
1644
|
+
"Runtime.executionContextsCleared",
|
|
1645
|
+
"Debugger.scriptParsed",
|
|
1646
|
+
"Debugger.paused",
|
|
1647
|
+
"Target.attachedToTarget",
|
|
1648
|
+
"Target.detachedFromTarget",
|
|
1649
|
+
"Target.receivedMessageFromTarget"
|
|
1650
|
+
]);
|
|
1651
|
+
attachedTargetEvent = z.object({
|
|
1652
|
+
sessionId: z.string(),
|
|
1653
|
+
targetInfo: z.object({
|
|
1654
|
+
type: z.string(),
|
|
1655
|
+
targetId: z.string()
|
|
1656
|
+
})
|
|
1657
|
+
});
|
|
1658
|
+
targetSessionEvent = z.object({ sessionId: z.string() });
|
|
1659
|
+
nestedMessageEvent = z.object({
|
|
1660
|
+
sessionId: z.string(),
|
|
1661
|
+
message: z.string()
|
|
1662
|
+
});
|
|
1663
|
+
nestedProtocolMessage = z.object({
|
|
1664
|
+
id: z.number().optional(),
|
|
1665
|
+
method: z.string().optional(),
|
|
1666
|
+
params: z.unknown().optional(),
|
|
1667
|
+
result: z.unknown().optional(),
|
|
1668
|
+
error: z.object({ message: z.string() }).optional()
|
|
1669
|
+
});
|
|
1670
|
+
executionContextEvent = z.object({ context: z.object({
|
|
1671
|
+
id: z.number(),
|
|
1672
|
+
origin: z.string(),
|
|
1673
|
+
name: z.string(),
|
|
1674
|
+
auxData: z.object({ frameId: z.string().optional() }).optional()
|
|
1675
|
+
}) });
|
|
1676
|
+
scriptParsedEvent = z.object({
|
|
1677
|
+
scriptId: z.string(),
|
|
1678
|
+
executionContextId: z.number(),
|
|
1679
|
+
url: z.string()
|
|
1680
|
+
});
|
|
1681
|
+
pausedEvent = z.object({ callFrames: z.array(z.object({
|
|
1682
|
+
callFrameId: z.string(),
|
|
1683
|
+
location: z.object({ scriptId: z.string() })
|
|
1684
|
+
})) });
|
|
1685
|
+
evaluationResponse = z.object({ exceptionDetails: z.unknown().optional() });
|
|
1686
|
+
STORAGE_CLEANUP_TIMEOUT_MS = 1e3;
|
|
1687
|
+
PlaywrightScenarioStorage = class PlaywrightScenarioStorage {
|
|
1688
|
+
cdp;
|
|
1689
|
+
signal;
|
|
1690
|
+
#seeds = new Map();
|
|
1691
|
+
#initializedLocal = new Set();
|
|
1692
|
+
#initializedSession = new Set();
|
|
1693
|
+
#targets = new Map();
|
|
1694
|
+
#replies = new Map();
|
|
1695
|
+
#sourceUrl = `rea-storage-${randomUUID()}`;
|
|
1696
|
+
#listeners = [];
|
|
1697
|
+
#sequence = 0;
|
|
1698
|
+
#generation = 0;
|
|
1699
|
+
#closed = false;
|
|
1700
|
+
#cleanupCompleted = false;
|
|
1701
|
+
#failure;
|
|
1702
|
+
#closePromise;
|
|
1703
|
+
#detachPromise;
|
|
1704
|
+
#rootInitialization;
|
|
1705
|
+
#work = Promise.resolve();
|
|
1706
|
+
#removeListeners = () => undefined;
|
|
1707
|
+
constructor(cdp, signal) {
|
|
1708
|
+
this.cdp = cdp;
|
|
1709
|
+
this.signal = signal;
|
|
1710
|
+
}
|
|
1711
|
+
static async create(storagePage, scenario, secrets, options = {}) {
|
|
1712
|
+
const { signal, retainCleanup } = options;
|
|
1713
|
+
const { context, page } = storagePage;
|
|
1714
|
+
if (scenario.storage.local_storage.length === 0 && scenario.storage.session_storage.length === 0) return undefined;
|
|
1715
|
+
const connection = context.newCDPSession(page);
|
|
1716
|
+
let cdp;
|
|
1717
|
+
try {
|
|
1718
|
+
cdp = await withPlaywrightExecutionBoundary(() => connection, undefined, signal);
|
|
1719
|
+
} catch (cause) {
|
|
1720
|
+
if (signal?.aborted === true) {
|
|
1721
|
+
let detached = false;
|
|
1722
|
+
const lateCleanup = async () => {
|
|
1723
|
+
let session;
|
|
1724
|
+
try {
|
|
1725
|
+
session = await connection;
|
|
1726
|
+
} catch {
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
if (!detached) {
|
|
1730
|
+
await session.detach();
|
|
1731
|
+
detached = true;
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
retainCleanup?.(lateCleanup);
|
|
1735
|
+
void withPlaywrightExecutionBoundary(lateCleanup, STORAGE_CLEANUP_TIMEOUT_MS).catch(() => undefined);
|
|
1736
|
+
}
|
|
1737
|
+
throw cause;
|
|
1738
|
+
}
|
|
1739
|
+
const owner = new PlaywrightScenarioStorage(cdp, signal);
|
|
1740
|
+
owner.addSeeds(scenario.storage.local_storage, "local", secrets);
|
|
1741
|
+
owner.addSeeds(scenario.storage.session_storage, "session", secrets);
|
|
1742
|
+
return owner;
|
|
1743
|
+
}
|
|
1744
|
+
async initialize(page, context) {
|
|
1745
|
+
const initialization = this.initializeRoot(page, context);
|
|
1746
|
+
this.#rootInitialization = initialization;
|
|
1747
|
+
await withPlaywrightExecutionBoundary(() => initialization, undefined, this.signal);
|
|
1748
|
+
}
|
|
1749
|
+
async initializeRoot(page, context) {
|
|
1750
|
+
const rootInfo = targetInfoResponse.parse(await this.cdp.send("Target.getTargetInfo"));
|
|
1751
|
+
const root = this.createTarget(undefined, rootInfo.targetInfo.targetId, (method, params) => this.cdp.send(method, params));
|
|
1752
|
+
this.#targets.set("", root);
|
|
1753
|
+
if (this.#closed) return;
|
|
1754
|
+
this.listen(page, context);
|
|
1755
|
+
const ready = this.initializeTarget(root);
|
|
1756
|
+
root.ready = ready;
|
|
1757
|
+
await ready;
|
|
1758
|
+
}
|
|
1759
|
+
addSeeds(blocks, kind, secrets) {
|
|
1760
|
+
for (const { origin, entries } of blocks) {
|
|
1761
|
+
const seed = this.#seeds.get(origin) ?? {
|
|
1762
|
+
local: [],
|
|
1763
|
+
session: []
|
|
1764
|
+
};
|
|
1765
|
+
seed[kind].push(...entries.map(({ name, value }) => [name, secrets.value(value)]));
|
|
1766
|
+
this.#seeds.set(origin, seed);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
listen(page, context) {
|
|
1770
|
+
const browser = context.browser();
|
|
1771
|
+
const detached = () => this.targetDetached("");
|
|
1772
|
+
page.on("close", detached);
|
|
1773
|
+
context.on("close", detached);
|
|
1774
|
+
browser?.on("disconnected", detached);
|
|
1775
|
+
this.#removeListeners = () => {
|
|
1776
|
+
page.off("close", detached);
|
|
1777
|
+
context.off("close", detached);
|
|
1778
|
+
browser?.off("disconnected", detached);
|
|
1779
|
+
};
|
|
1780
|
+
for (const method of [
|
|
1781
|
+
"Runtime.executionContextCreated",
|
|
1782
|
+
"Runtime.executionContextDestroyed",
|
|
1783
|
+
"Runtime.executionContextsCleared",
|
|
1784
|
+
"Debugger.scriptParsed",
|
|
1785
|
+
"Debugger.paused",
|
|
1786
|
+
"Target.attachedToTarget",
|
|
1787
|
+
"Target.detachedFromTarget",
|
|
1788
|
+
"Target.receivedMessageFromTarget"
|
|
1789
|
+
]) {
|
|
1790
|
+
const listener = (params) => this.event("", method, params);
|
|
1791
|
+
this.#listeners.push({
|
|
1792
|
+
method,
|
|
1793
|
+
listener
|
|
1794
|
+
});
|
|
1795
|
+
this.cdp.on(method, listener);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
createTarget(parentId, topLevelTargetId, send) {
|
|
1799
|
+
return {
|
|
1800
|
+
parentId,
|
|
1801
|
+
topLevelTargetId,
|
|
1802
|
+
send,
|
|
1803
|
+
contexts: new Map(),
|
|
1804
|
+
scripts: new Map(),
|
|
1805
|
+
ready: Promise.resolve(),
|
|
1806
|
+
waitingForDebugger: false
|
|
1807
|
+
};
|
|
1808
|
+
}
|
|
1809
|
+
async initializeTarget(target) {
|
|
1810
|
+
if (this.#closed) return;
|
|
1811
|
+
await target.send("Page.enable");
|
|
1812
|
+
if (this.#closed) return;
|
|
1813
|
+
await target.send("Runtime.enable");
|
|
1814
|
+
if (this.#closed) return;
|
|
1815
|
+
await target.send("Debugger.enable");
|
|
1816
|
+
if (this.#closed) return;
|
|
1817
|
+
breakpointResponse.parse(await target.send("Debugger.setBreakpointByUrl", {
|
|
1818
|
+
url: this.#sourceUrl,
|
|
1819
|
+
lineNumber: 1
|
|
1820
|
+
}));
|
|
1821
|
+
if (this.#closed) return;
|
|
1822
|
+
scriptIdentifierResponse.parse(await target.send("Page.addScriptToEvaluateOnNewDocument", {
|
|
1823
|
+
worldName: this.#sourceUrl,
|
|
1824
|
+
source: `(() => {\n void 0;\n})()\n//# sourceURL=${this.#sourceUrl}`
|
|
1825
|
+
}));
|
|
1826
|
+
if (this.#closed) return;
|
|
1827
|
+
await target.send("Target.setAutoAttach", {
|
|
1828
|
+
autoAttach: true,
|
|
1829
|
+
waitForDebuggerOnStart: true,
|
|
1830
|
+
flatten: false
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
sendObserved(target, method, params) {
|
|
1834
|
+
return withPlaywrightExecutionBoundary(() => target.send(method, params), undefined, this.signal);
|
|
1835
|
+
}
|
|
1836
|
+
event(sessionId, method, params) {
|
|
1837
|
+
if (this.#closed) return;
|
|
1838
|
+
const target = this.#targets.get(sessionId);
|
|
1839
|
+
if (target === undefined) return;
|
|
1840
|
+
try {
|
|
1841
|
+
if (method === "Runtime.executionContextCreated") {
|
|
1842
|
+
const { context } = executionContextEvent.parse(params);
|
|
1843
|
+
if (context.name === this.#sourceUrl) target.contexts.set(context.id, context);
|
|
1844
|
+
} else if (method === "Runtime.executionContextDestroyed") {
|
|
1845
|
+
const { executionContextId } = z.object({ executionContextId: z.number() }).parse(params);
|
|
1846
|
+
target.contexts.delete(executionContextId);
|
|
1847
|
+
} else if (method === "Runtime.executionContextsCleared") {
|
|
1848
|
+
target.contexts.clear();
|
|
1849
|
+
target.scripts.clear();
|
|
1850
|
+
} else if (method === "Debugger.scriptParsed") {
|
|
1851
|
+
const script = scriptParsedEvent.parse(params);
|
|
1852
|
+
if (script.url === this.#sourceUrl) target.scripts.set(script.scriptId, script.executionContextId);
|
|
1853
|
+
} else if (method === "Debugger.paused") {
|
|
1854
|
+
const pause = pausedEvent.parse(params);
|
|
1855
|
+
const frame = pause.callFrames[0];
|
|
1856
|
+
if (frame === undefined || !target.scripts.has(frame.location.scriptId)) return;
|
|
1857
|
+
this.#generation += 1;
|
|
1858
|
+
this.#work = this.#work.then(() => this.seed(target, pause)).catch((cause) => {
|
|
1859
|
+
if (sessionId === "" || this.#targets.get(sessionId) === target) this.fail(cause);
|
|
1860
|
+
});
|
|
1861
|
+
} else if (method === "Target.attachedToTarget") {
|
|
1862
|
+
this.#generation += 1;
|
|
1863
|
+
this.attach(sessionId, attachedTargetEvent.parse(params));
|
|
1864
|
+
} else if (method === "Target.detachedFromTarget") {
|
|
1865
|
+
this.#generation += 1;
|
|
1866
|
+
this.targetDetached(targetSessionEvent.parse(params).sessionId);
|
|
1867
|
+
} else if (method === "Target.receivedMessageFromTarget") {
|
|
1868
|
+
this.nestedMessage(nestedMessageEvent.parse(params));
|
|
1869
|
+
}
|
|
1870
|
+
} catch (cause) {
|
|
1871
|
+
this.fail(cause);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
nestedMessage(event) {
|
|
1875
|
+
const reply = nestedProtocolMessage.parse(JSON.parse(event.message));
|
|
1876
|
+
if (reply.id !== undefined) {
|
|
1877
|
+
const waiter = this.#replies.get(reply.id);
|
|
1878
|
+
if (waiter?.sessionId !== event.sessionId) return;
|
|
1879
|
+
this.#replies.delete(reply.id);
|
|
1880
|
+
if (reply.error !== undefined) waiter.reject(new Error(reply.error.message));
|
|
1881
|
+
else waiter.resolve(reply.result);
|
|
1882
|
+
return;
|
|
1883
|
+
}
|
|
1884
|
+
if (reply.method !== undefined && STORAGE_EVENT_METHODS.has(reply.method)) this.event(event.sessionId, reply.method, reply.params);
|
|
1885
|
+
}
|
|
1886
|
+
fail(cause) {
|
|
1887
|
+
this.#generation += 1;
|
|
1888
|
+
this.#failure ??= new BrowserObservationError("capture_browser_scenario", "protocol_error", { cause });
|
|
1889
|
+
}
|
|
1890
|
+
async seedPausedFrame(target, frame) {
|
|
1891
|
+
const contextId = target.scripts.get(frame.location.scriptId);
|
|
1892
|
+
const context = contextId === undefined ? undefined : target.contexts.get(contextId);
|
|
1893
|
+
const seed = context === undefined ? undefined : this.#seeds.get(context.origin);
|
|
1894
|
+
if (this.#closed || seed === undefined || context?.auxData?.frameId === undefined) return;
|
|
1895
|
+
const storageKey = storageKeyResponse.parse(await this.sendObserved(target, "Storage.getStorageKey", { frameId: context.auxData.frameId })).storageKey;
|
|
1896
|
+
const sessionKey = JSON.stringify([target.topLevelTargetId, storageKey]);
|
|
1897
|
+
const local = this.#initializedLocal.has(storageKey) || seed.local.length === 0 ? [] : seed.local;
|
|
1898
|
+
const session = this.#initializedSession.has(sessionKey) || seed.session.length === 0 ? [] : seed.session;
|
|
1899
|
+
if (local.length === 0 && session.length === 0) return;
|
|
1900
|
+
const payload = JSON.stringify({
|
|
1901
|
+
local,
|
|
1902
|
+
session
|
|
1903
|
+
}).replaceAll("<", "\\u003c");
|
|
1904
|
+
const response = evaluationResponse.parse(await this.sendObserved(target, "Debugger.evaluateOnCallFrame", {
|
|
1905
|
+
callFrameId: frame.callFrameId,
|
|
1906
|
+
expression: `(() => { const seed = ${payload}; for (const [name, value] of seed.local) localStorage.setItem(name, value); for (const [name, value] of seed.session) sessionStorage.setItem(name, value); })()`,
|
|
1907
|
+
returnByValue: true
|
|
1908
|
+
}));
|
|
1909
|
+
if (response.exceptionDetails !== undefined) throw new BrowserObservationError("capture_browser_scenario", "protocol_error", { detail: "The browser denied initial storage initialization." });
|
|
1910
|
+
if (local.length > 0) this.#initializedLocal.add(storageKey);
|
|
1911
|
+
if (session.length > 0) this.#initializedSession.add(sessionKey);
|
|
1912
|
+
}
|
|
1913
|
+
async seed(target, pause) {
|
|
1914
|
+
const frame = pause.callFrames[0];
|
|
1915
|
+
if (frame === undefined) return;
|
|
1916
|
+
let primaryFailure;
|
|
1917
|
+
let hasPrimaryFailure = false;
|
|
1918
|
+
try {
|
|
1919
|
+
await this.seedPausedFrame(target, frame);
|
|
1920
|
+
} catch (cause) {
|
|
1921
|
+
primaryFailure = cause;
|
|
1922
|
+
hasPrimaryFailure = true;
|
|
1923
|
+
}
|
|
1924
|
+
let resumeFailure;
|
|
1925
|
+
try {
|
|
1926
|
+
await withPlaywrightExecutionBoundary(() => target.send("Debugger.resume"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
1927
|
+
} catch (cause) {
|
|
1928
|
+
resumeFailure = cause;
|
|
1929
|
+
}
|
|
1930
|
+
if (hasPrimaryFailure && resumeFailure !== undefined) throw new AggregateError([primaryFailure, resumeFailure], "Storage initialization and debugger resume both failed", { cause: primaryFailure });
|
|
1931
|
+
if (this.signal?.aborted === true && resumeFailure === undefined) return;
|
|
1932
|
+
if (hasPrimaryFailure) throw primaryFailure;
|
|
1933
|
+
if (resumeFailure !== undefined) throw resumeFailure;
|
|
1934
|
+
}
|
|
1935
|
+
attach(parentId, event) {
|
|
1936
|
+
const parent = this.#targets.get(parentId);
|
|
1937
|
+
if (parent === undefined) return;
|
|
1938
|
+
const { sessionId, targetInfo } = event;
|
|
1939
|
+
const target = this.createTarget(parentId, event.targetInfo.type === "iframe" ? parent.topLevelTargetId : event.targetInfo.targetId, async (method, params = {}) => {
|
|
1940
|
+
const id = ++this.#sequence;
|
|
1941
|
+
const reply = new Promise((resolve, reject) => this.#replies.set(id, {
|
|
1942
|
+
sessionId,
|
|
1943
|
+
resolve,
|
|
1944
|
+
reject
|
|
1945
|
+
}));
|
|
1946
|
+
try {
|
|
1947
|
+
const sent = parent.send("Target.sendMessageToTarget", {
|
|
1948
|
+
sessionId,
|
|
1949
|
+
message: JSON.stringify({
|
|
1950
|
+
id,
|
|
1951
|
+
method,
|
|
1952
|
+
params
|
|
1953
|
+
})
|
|
1954
|
+
});
|
|
1955
|
+
const [, result] = await Promise.all([sent, reply]);
|
|
1956
|
+
return result;
|
|
1957
|
+
} finally {
|
|
1958
|
+
this.#replies.delete(id);
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
target.waitingForDebugger = true;
|
|
1962
|
+
this.#targets.set(sessionId, target);
|
|
1963
|
+
target.ready = (async () => {
|
|
1964
|
+
try {
|
|
1965
|
+
if (!this.#closed && (targetInfo.type === "iframe" || targetInfo.type === "page")) await this.initializeTarget(target);
|
|
1966
|
+
} catch (cause) {
|
|
1967
|
+
if (this.signal?.aborted !== true && !this.#closed && this.#targets.get(sessionId) === target) this.fail(cause);
|
|
1968
|
+
}
|
|
1969
|
+
if (this.#targets.get(sessionId) !== target) return;
|
|
1970
|
+
try {
|
|
1971
|
+
await withPlaywrightExecutionBoundary(() => target.send("Runtime.runIfWaitingForDebugger"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
1972
|
+
target.waitingForDebugger = false;
|
|
1973
|
+
} catch (cause) {
|
|
1974
|
+
if (this.signal?.aborted !== true && !this.#closed && this.#targets.get(sessionId) === target) this.fail(cause);
|
|
1975
|
+
}
|
|
1976
|
+
})();
|
|
1977
|
+
}
|
|
1978
|
+
targetDetached(sessionId) {
|
|
1979
|
+
for (const [id, target] of this.#targets) if (target.parentId === sessionId) this.targetDetached(id);
|
|
1980
|
+
this.#targets.delete(sessionId);
|
|
1981
|
+
for (const [id, reply] of this.#replies) if (reply.sessionId === sessionId) {
|
|
1982
|
+
this.#replies.delete(id);
|
|
1983
|
+
reply.reject(new BrowserObservationError("capture_browser_scenario", "disconnected"));
|
|
1984
|
+
}
|
|
1985
|
+
this.#generation += 1;
|
|
1986
|
+
}
|
|
1987
|
+
async settle() {
|
|
1988
|
+
for (;;) {
|
|
1989
|
+
const generation = this.#generation;
|
|
1990
|
+
const work = this.#work;
|
|
1991
|
+
const targets = [...this.#targets.entries()];
|
|
1992
|
+
await withPlaywrightExecutionBoundary(() => Promise.all(targets.map(([, target]) => target.ready)), undefined, this.signal);
|
|
1993
|
+
await withPlaywrightExecutionBoundary(() => work, undefined, this.signal);
|
|
1994
|
+
await Promise.resolve();
|
|
1995
|
+
if (this.#failure !== undefined) throw this.#failure;
|
|
1996
|
+
if (generation === this.#generation && work === this.#work && targets.every(([id, target]) => this.#targets.get(id) === target)) return;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
close(stopLoading = false) {
|
|
2000
|
+
if (this.#cleanupCompleted) return Promise.resolve();
|
|
2001
|
+
if (this.#closePromise !== undefined) return this.#closePromise;
|
|
2002
|
+
const closing = this.closeResources(stopLoading).catch((cause) => {
|
|
2003
|
+
throw new BrowserObservationError("capture_browser_scenario", "cleanup_failed", {
|
|
2004
|
+
cause,
|
|
2005
|
+
cleanup: {
|
|
2006
|
+
reason: cause instanceof Error ? cause.message : String(cause),
|
|
2007
|
+
resources: ["browser_transport", "browser_storage_bootstrap"]
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
});
|
|
2011
|
+
this.#closePromise = closing;
|
|
2012
|
+
void closing.catch(() => {
|
|
2013
|
+
if (this.#closePromise === closing) this.#closePromise = undefined;
|
|
2014
|
+
});
|
|
2015
|
+
return closing;
|
|
2016
|
+
}
|
|
2017
|
+
async closeResources(stopLoading) {
|
|
2018
|
+
this.#closed = true;
|
|
2019
|
+
let stopLoadingFailure;
|
|
2020
|
+
if (stopLoading) {
|
|
2021
|
+
try {
|
|
2022
|
+
const root = this.#targets.get("");
|
|
2023
|
+
if (root !== undefined) await withPlaywrightExecutionBoundary(() => root.send("Page.stopLoading"), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2024
|
+
} catch (cause) {
|
|
2025
|
+
stopLoadingFailure = { cause };
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
const work = this.#work;
|
|
2029
|
+
const rootInitialization = this.#rootInitialization;
|
|
2030
|
+
const targets = [...this.#targets.values()];
|
|
2031
|
+
try {
|
|
2032
|
+
await withPlaywrightExecutionBoundary(() => Promise.all([
|
|
2033
|
+
work.catch(() => undefined),
|
|
2034
|
+
...rootInitialization === undefined ? [] : [rootInitialization.catch(() => undefined)],
|
|
2035
|
+
...targets.map((target) => target.ready.catch(() => undefined))
|
|
2036
|
+
]), STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2037
|
+
} catch {}
|
|
2038
|
+
let detach = this.#detachPromise;
|
|
2039
|
+
if (detach === undefined) {
|
|
2040
|
+
detach = Promise.resolve().then(() => this.cdp.detach());
|
|
2041
|
+
this.#detachPromise = detach;
|
|
2042
|
+
void detach.catch(() => {
|
|
2043
|
+
if (this.#detachPromise === detach) this.#detachPromise = undefined;
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
await withPlaywrightExecutionBoundary(() => detach, STORAGE_CLEANUP_TIMEOUT_MS);
|
|
2047
|
+
for (const { method, listener } of this.#listeners) this.cdp.off(method, listener);
|
|
2048
|
+
this.#removeListeners();
|
|
2049
|
+
for (const reply of this.#replies.values()) reply.reject(new BrowserObservationError("capture_browser_scenario", "disconnected"));
|
|
2050
|
+
this.#targets.clear();
|
|
2051
|
+
this.#replies.clear();
|
|
2052
|
+
this.#cleanupCompleted = true;
|
|
2053
|
+
if (stopLoadingFailure !== undefined) throw stopLoadingFailure.cause;
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
})))();
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
//#endregion
|
|
2060
|
+
//#region dist/browser/PlaywrightScenarioSession.js
|
|
2061
|
+
var OPERATION, throwIfScenarioCancelled, throwCleanupFailures, installCookies, blockAttachedServiceWorkers, initializePage, PlaywrightScenarioSession;
|
|
2062
|
+
function init_PlaywrightScenarioSession() {
|
|
2063
|
+
return (init_PlaywrightScenarioSession = __esmMin((() => {
|
|
2064
|
+
init_browserObservationError();
|
|
2065
|
+
init_BrowserScenarioSecrets();
|
|
2066
|
+
init_PlaywrightScenarioBrowser();
|
|
2067
|
+
init_PlaywrightScenarioActions();
|
|
2068
|
+
init_PlaywrightScenarioArtifacts();
|
|
2069
|
+
init_PlaywrightScenarioEvents();
|
|
2070
|
+
init_PlaywrightScenarioStorage();
|
|
2071
|
+
init_PlaywrightExecutionBoundary();
|
|
2072
|
+
init_BrowserScenarioPartialObservation();
|
|
2073
|
+
OPERATION = "capture_browser_scenario";
|
|
2074
|
+
throwIfScenarioCancelled = (signal) => {
|
|
2075
|
+
if (signal?.aborted === true) throw new BrowserObservationError(OPERATION, "cancelled");
|
|
2076
|
+
};
|
|
2077
|
+
throwCleanupFailures = (failures) => {
|
|
2078
|
+
if (failures.length === 1) throw failures[0];
|
|
2079
|
+
if (failures.length > 1) throw new AggregateError(failures, "Browser scenario cleanup failed");
|
|
2080
|
+
};
|
|
2081
|
+
installCookies = async (context, scenario, secrets) => {
|
|
2082
|
+
await context.addCookies(scenario.storage.cookies.map((cookie) => ({
|
|
2083
|
+
name: cookie.name,
|
|
2084
|
+
value: secrets.value(cookie.value),
|
|
2085
|
+
url: secrets.url(cookie.destination),
|
|
2086
|
+
httpOnly: cookie.http_only,
|
|
2087
|
+
secure: cookie.secure,
|
|
2088
|
+
sameSite: cookie.same_site
|
|
2089
|
+
})));
|
|
2090
|
+
};
|
|
2091
|
+
blockAttachedServiceWorkers = async (page) => {
|
|
2092
|
+
const controller = await page.evaluate("Boolean(navigator.serviceWorker?.controller)");
|
|
2093
|
+
if (controller) throw new BrowserObservationError(OPERATION, "target_not_allowed");
|
|
2094
|
+
const blockRegistration = `(() => {
|
|
2095
|
+
if (!("serviceWorker" in navigator)) return;
|
|
2096
|
+
void navigator.serviceWorker.getRegistrations()
|
|
2097
|
+
.then((registrations) => Promise.all(registrations.map((item) => item.unregister())));
|
|
2098
|
+
Object.defineProperty(ServiceWorkerContainer.prototype, "register", {
|
|
2099
|
+
configurable: false,
|
|
2100
|
+
value: () => Promise.reject(new Error("service workers are blocked by scenario policy"))
|
|
2101
|
+
});
|
|
2102
|
+
})()`;
|
|
2103
|
+
await page.addInitScript(blockRegistration);
|
|
2104
|
+
await page.evaluate(blockRegistration);
|
|
2105
|
+
};
|
|
2106
|
+
initializePage = async (context, page, scenario, secrets) => {
|
|
2107
|
+
context.setDefaultTimeout(0);
|
|
2108
|
+
context.setDefaultNavigationTimeout(0);
|
|
2109
|
+
if (scenario.browser.mode === "connect") await blockAttachedServiceWorkers(page);
|
|
2110
|
+
await installCookies(context, scenario, secrets);
|
|
2111
|
+
};
|
|
2112
|
+
PlaywrightScenarioSession = class PlaywrightScenarioSession {
|
|
2113
|
+
opened;
|
|
2114
|
+
mode;
|
|
2115
|
+
processOwnership;
|
|
2116
|
+
product = "Chromium";
|
|
2117
|
+
version;
|
|
2118
|
+
initialUrl;
|
|
2119
|
+
secrets;
|
|
2120
|
+
eventCapture;
|
|
2121
|
+
storage;
|
|
2122
|
+
signal;
|
|
2123
|
+
#storageReleased = false;
|
|
2124
|
+
constructor(opened, options) {
|
|
2125
|
+
this.opened = opened;
|
|
2126
|
+
this.mode = options.mode;
|
|
2127
|
+
this.processOwnership = options.mode === "launch" ? "provider-owned" : "external";
|
|
2128
|
+
this.secrets = options.secrets;
|
|
2129
|
+
this.eventCapture = options.eventCapture;
|
|
2130
|
+
this.storage = options.storage;
|
|
2131
|
+
this.signal = options.signal;
|
|
2132
|
+
this.version = opened.browser.version();
|
|
2133
|
+
this.initialUrl = opened.page.url();
|
|
2134
|
+
}
|
|
2135
|
+
static async open(scenario, environment, options) {
|
|
2136
|
+
throwIfScenarioCancelled(options.signal);
|
|
2137
|
+
const secrets = BrowserScenarioSecrets.resolve(scenario, environment);
|
|
2138
|
+
if (secrets === undefined) throw new BrowserObservationError(OPERATION, "secret_unavailable");
|
|
2139
|
+
const startedAt = Date.now();
|
|
2140
|
+
const opening = openPlaywrightScenarioBrowser(scenario, environment, {
|
|
2141
|
+
signal: options.signal,
|
|
2142
|
+
...options.retainCleanup === undefined ? {} : { retainCleanup: options.retainCleanup }
|
|
2143
|
+
});
|
|
2144
|
+
let opened;
|
|
2145
|
+
try {
|
|
2146
|
+
opened = await withPlaywrightExecutionBoundary(() => opening, undefined, options.signal);
|
|
2147
|
+
} catch (cause) {
|
|
2148
|
+
const lateCleanup = () => opening.then((lateOpened) => lateOpened.cleanup.close(undefined, options.signal), () => undefined);
|
|
2149
|
+
options.retainCleanup?.(() => withPlaywrightExecutionBoundary(lateCleanup, 1e3));
|
|
2150
|
+
void lateCleanup().catch((cleanupCause) => {
|
|
2151
|
+
void cleanupCause;
|
|
2152
|
+
});
|
|
2153
|
+
throw cause;
|
|
2154
|
+
}
|
|
2155
|
+
const session = await this.initializeSession(opened, scenario, secrets, options);
|
|
2156
|
+
try {
|
|
2157
|
+
await withPlaywrightExecutionBoundary(() => opened.page.goto(secrets.url(scenario.start_url), {
|
|
2158
|
+
waitUntil: "load",
|
|
2159
|
+
timeout: 0
|
|
2160
|
+
}), undefined, options.signal);
|
|
2161
|
+
await withPlaywrightExecutionBoundary(() => session.storage?.settle() ?? Promise.resolve(), undefined, options.signal);
|
|
2162
|
+
return session;
|
|
2163
|
+
} catch (cause) {
|
|
2164
|
+
let cleanup;
|
|
2165
|
+
let cleanupFailure;
|
|
2166
|
+
try {
|
|
2167
|
+
cleanup = await session.close(true);
|
|
2168
|
+
} catch (failure) {
|
|
2169
|
+
cleanup = "incomplete";
|
|
2170
|
+
cleanupFailure = { cause: failure };
|
|
2171
|
+
options.retainCleanup?.(() => session.close());
|
|
2172
|
+
}
|
|
2173
|
+
throw browserScenarioOperationFailure(cause, {
|
|
2174
|
+
kind: "browser-scenario-observation",
|
|
2175
|
+
capture: browserScenarioCaptureData({
|
|
2176
|
+
session,
|
|
2177
|
+
scenario,
|
|
2178
|
+
startedAt,
|
|
2179
|
+
steps: [],
|
|
2180
|
+
cleanup,
|
|
2181
|
+
limitations: ["Scenario navigation failed before the initial state was captured."]
|
|
2182
|
+
})
|
|
2183
|
+
}, cleanupFailure);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
static async initializeSession(opened, scenario, secrets, options) {
|
|
2187
|
+
let events;
|
|
2188
|
+
let storage;
|
|
2189
|
+
try {
|
|
2190
|
+
await withPlaywrightExecutionBoundary(() => initializePage(opened.context, opened.page, scenario, secrets), undefined, options.signal);
|
|
2191
|
+
storage = await PlaywrightScenarioStorage.create(opened, scenario, secrets, {
|
|
2192
|
+
...options.signal === undefined ? {} : { signal: options.signal },
|
|
2193
|
+
...options.retainCleanup === undefined ? {} : { retainCleanup: options.retainCleanup }
|
|
2194
|
+
});
|
|
2195
|
+
await storage?.initialize(opened.page, opened.context);
|
|
2196
|
+
throwIfScenarioCancelled(options.signal);
|
|
2197
|
+
events = new PlaywrightScenarioEvents({
|
|
2198
|
+
page: opened.page,
|
|
2199
|
+
context: opened.context,
|
|
2200
|
+
ownsContext: scenario.browser.mode === "launch",
|
|
2201
|
+
enabled: new Set(scenario.capture.events),
|
|
2202
|
+
secrets,
|
|
2203
|
+
network: scenario.capture.network,
|
|
2204
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
2205
|
+
});
|
|
2206
|
+
return new PlaywrightScenarioSession(opened, {
|
|
2207
|
+
mode: scenario.browser.mode,
|
|
2208
|
+
secrets,
|
|
2209
|
+
eventCapture: events,
|
|
2210
|
+
storage,
|
|
2211
|
+
signal: options.signal
|
|
2212
|
+
});
|
|
2213
|
+
} catch (cause) {
|
|
2214
|
+
let storageReleased = false;
|
|
2215
|
+
const cleanup = async () => {
|
|
2216
|
+
let storageFailure;
|
|
2217
|
+
let browserFailure;
|
|
2218
|
+
if (!storageReleased) {
|
|
2219
|
+
try {
|
|
2220
|
+
await storage?.close(options.signal?.aborted === true);
|
|
2221
|
+
} catch (failure) {
|
|
2222
|
+
storageFailure = { cause: failure };
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
try {
|
|
2226
|
+
await opened.cleanup.close(events === undefined ? undefined : () => events?.finish() ?? Promise.resolve(), options.signal);
|
|
2227
|
+
} catch (failure) {
|
|
2228
|
+
browserFailure = { cause: failure };
|
|
2229
|
+
}
|
|
2230
|
+
if (opened.cleanup.browserClosed) storageReleased = true;
|
|
2231
|
+
throwCleanupFailures([...storageReleased || storageFailure === undefined ? [] : [storageFailure.cause], ...browserFailure === undefined ? [] : [browserFailure.cause]]);
|
|
2232
|
+
};
|
|
2233
|
+
try {
|
|
2234
|
+
return await failBrowserScenarioOperation(cleanup, cause);
|
|
2235
|
+
} catch (failure) {
|
|
2236
|
+
if (failure !== cause) options.retainCleanup?.(cleanup);
|
|
2237
|
+
throw failure;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
currentUrl() {
|
|
2242
|
+
return this.opened.page.url();
|
|
2243
|
+
}
|
|
2244
|
+
sanitizeUrl(value) {
|
|
2245
|
+
return this.secrets.sanitizeUrl(value);
|
|
2246
|
+
}
|
|
2247
|
+
setStep(index) {
|
|
2248
|
+
this.eventCapture.setStep(index);
|
|
2249
|
+
}
|
|
2250
|
+
nextEventSequence() {
|
|
2251
|
+
return this.eventCapture.nextSequence();
|
|
2252
|
+
}
|
|
2253
|
+
lastEventSequence() {
|
|
2254
|
+
return this.eventCapture.lastSequence();
|
|
2255
|
+
}
|
|
2256
|
+
events() {
|
|
2257
|
+
return this.eventCapture.result();
|
|
2258
|
+
}
|
|
2259
|
+
/** Preserve event coverage gaps for the aggregate capture's completeness. */
|
|
2260
|
+
eventLimitations() {
|
|
2261
|
+
return this.eventCapture.limitations();
|
|
2262
|
+
}
|
|
2263
|
+
async perform(action, signal) {
|
|
2264
|
+
await withPlaywrightExecutionBoundary(() => performPlaywrightScenarioAction({
|
|
2265
|
+
page: this.opened.page,
|
|
2266
|
+
action,
|
|
2267
|
+
secrets: this.secrets
|
|
2268
|
+
}), "timeout_ms" in action ? action.timeout_ms : undefined, signal);
|
|
2269
|
+
await withPlaywrightExecutionBoundary(() => this.storage?.settle() ?? Promise.resolve(), undefined, signal);
|
|
2270
|
+
}
|
|
2271
|
+
async capture(requested, signal) {
|
|
2272
|
+
await withPlaywrightExecutionBoundary(() => this.storage?.settle() ?? Promise.resolve(), undefined, signal);
|
|
2273
|
+
return withPlaywrightExecutionBoundary(() => capturePlaywrightStepArtifacts({
|
|
2274
|
+
context: this.opened.context,
|
|
2275
|
+
page: this.opened.page,
|
|
2276
|
+
secrets: this.secrets,
|
|
2277
|
+
requested
|
|
2278
|
+
}), undefined, signal);
|
|
2279
|
+
}
|
|
2280
|
+
async close(stopLoading = this.signal?.aborted === true) {
|
|
2281
|
+
let storageFailure;
|
|
2282
|
+
let browserFailure;
|
|
2283
|
+
if (!this.#storageReleased) {
|
|
2284
|
+
try {
|
|
2285
|
+
await this.storage?.close(stopLoading);
|
|
2286
|
+
} catch (failure) {
|
|
2287
|
+
storageFailure = { cause: failure };
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
try {
|
|
2291
|
+
await this.opened.cleanup.close(() => this.eventCapture.finish());
|
|
2292
|
+
} catch (failure) {
|
|
2293
|
+
browserFailure = { cause: failure };
|
|
2294
|
+
}
|
|
2295
|
+
if (this.opened.cleanup.browserClosed) this.#storageReleased = true;
|
|
2296
|
+
throwCleanupFailures([...this.#storageReleased || storageFailure === undefined ? [] : [storageFailure.cause], ...browserFailure === undefined ? [] : [browserFailure.cause]]);
|
|
2297
|
+
return this.mode === "launch" ? "terminated-owned-process" : "disconnected-external";
|
|
2298
|
+
}
|
|
2299
|
+
redactError(error) {
|
|
2300
|
+
return this.secrets.redact(error instanceof Error ? error.message : "browser action failed");
|
|
2301
|
+
}
|
|
2302
|
+
};
|
|
2303
|
+
})))();
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
//#endregion
|
|
2307
|
+
//#region dist/composition/browserScenario.js
|
|
2308
|
+
var createBrowserScenarioProvider;
|
|
2309
|
+
function init_browserScenario() {
|
|
2310
|
+
return (init_browserScenario = __esmMin((() => {
|
|
2311
|
+
init_PlaywrightBrowserScenarioProvider();
|
|
2312
|
+
init_PlaywrightScenarioSession();
|
|
2313
|
+
createBrowserScenarioProvider = (environment) => new PlaywrightBrowserScenarioProvider((scenario, options) => PlaywrightScenarioSession.open(scenario, environment, options));
|
|
2314
|
+
})))();
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2317
|
+
//#endregion
|
|
2318
|
+
init_browserScenario();
|
|
2319
|
+
export { createBrowserScenarioProvider };
|