prismcast 1.12.0 → 1.13.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/dist/app.d.ts +41 -1
- package/dist/app.js +164 -76
- package/dist/app.js.map +1 -1
- package/dist/browser/blockedPage.d.ts +0 -1
- package/dist/browser/browserSupervisor.d.ts +34 -5
- package/dist/browser/browserSupervisor.js +39 -12
- package/dist/browser/browserSupervisor.js.map +1 -1
- package/dist/browser/cdp.d.ts +58 -6
- package/dist/browser/cdp.js +147 -9
- package/dist/browser/cdp.js.map +1 -1
- package/dist/browser/channelSelection.d.ts +18 -6
- package/dist/browser/channelSelection.js +47 -36
- package/dist/browser/channelSelection.js.map +1 -1
- package/dist/browser/consent.d.ts +33 -4
- package/dist/browser/consent.js +87 -50
- package/dist/browser/consent.js.map +1 -1
- package/dist/browser/display.d.ts +0 -1
- package/dist/browser/hlsPlaylistObserver.d.ts +3 -2
- package/dist/browser/hlsPlaylistObserver.js +11 -6
- package/dist/browser/hlsPlaylistObserver.js.map +1 -1
- package/dist/browser/index.d.ts +273 -59
- package/dist/browser/index.js +768 -255
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/launchGovernor.d.ts +0 -1
- package/dist/browser/login.d.ts +11 -10
- package/dist/browser/login.js +42 -33
- package/dist/browser/login.js.map +1 -1
- package/dist/browser/manifestInterceptor.d.ts +14 -5
- package/dist/browser/manifestInterceptor.js +26 -13
- package/dist/browser/manifestInterceptor.js.map +1 -1
- package/dist/browser/navigation.d.ts +28 -0
- package/dist/browser/navigation.js +57 -0
- package/dist/browser/navigation.js.map +1 -0
- package/dist/browser/pageStaleness.d.ts +1 -2
- package/dist/browser/pageStaleness.js +9 -9
- package/dist/browser/pageStaleness.js.map +1 -1
- package/dist/browser/precaching.d.ts +27 -13
- package/dist/browser/precaching.js +219 -73
- package/dist/browser/precaching.js.map +1 -1
- package/dist/browser/tabCapture.d.ts +97 -0
- package/dist/browser/tabCapture.js +314 -0
- package/dist/browser/tabCapture.js.map +1 -0
- package/dist/browser/tabNetworkObserver.d.ts +0 -1
- package/dist/browser/tabSelection.d.ts +117 -0
- package/dist/browser/tabSelection.js +547 -0
- package/dist/browser/tabSelection.js.map +1 -0
- package/dist/browser/tuning/cache.d.ts +0 -1
- package/dist/browser/tuning/comcastPolymer.d.ts +0 -1
- package/dist/browser/tuning/comcastPolymer.js +18 -19
- package/dist/browser/tuning/comcastPolymer.js.map +1 -1
- package/dist/browser/tuning/cox.d.ts +0 -1
- package/dist/browser/tuning/directv.d.ts +0 -1
- package/dist/browser/tuning/directv.js +12 -13
- package/dist/browser/tuning/directv.js.map +1 -1
- package/dist/browser/tuning/fox.d.ts +0 -1
- package/dist/browser/tuning/fox.js +2 -2
- package/dist/browser/tuning/fox.js.map +1 -1
- package/dist/browser/tuning/gridSearch.d.ts +0 -1
- package/dist/browser/tuning/hbo.d.ts +0 -1
- package/dist/browser/tuning/hbo.js +2 -2
- package/dist/browser/tuning/hbo.js.map +1 -1
- package/dist/browser/tuning/hulu.d.ts +14 -2
- package/dist/browser/tuning/hulu.js +150 -24
- package/dist/browser/tuning/hulu.js.map +1 -1
- package/dist/browser/tuning/shared.d.ts +1 -2
- package/dist/browser/tuning/shared.js +1 -1
- package/dist/browser/tuning/sling.d.ts +0 -1
- package/dist/browser/tuning/sling.js +17 -22
- package/dist/browser/tuning/sling.js.map +1 -1
- package/dist/browser/tuning/spectrum.d.ts +0 -1
- package/dist/browser/tuning/thumbnailRow.d.ts +0 -1
- package/dist/browser/tuning/tileClick.d.ts +0 -1
- package/dist/browser/tuning/xfinity.d.ts +0 -1
- package/dist/browser/tuning/youtubeTv.d.ts +0 -1
- package/dist/browser/tuning/youtubeTv.js +1 -2
- package/dist/browser/tuning/youtubeTv.js.map +1 -1
- package/dist/browser/video.d.ts +55 -33
- package/dist/browser/video.js +213 -169
- package/dist/browser/video.js.map +1 -1
- package/dist/browser/windowSync.d.ts +45 -0
- package/dist/browser/windowSync.js +153 -0
- package/dist/browser/windowSync.js.map +1 -0
- package/dist/channels/index.d.ts +7 -1
- package/dist/channels/index.js +24 -8
- package/dist/channels/index.js.map +1 -1
- package/dist/config/channelForm.d.ts +0 -1
- package/dist/config/channelIdentity.d.ts +27 -0
- package/dist/config/channelIdentity.js +72 -0
- package/dist/config/channelIdentity.js.map +1 -0
- package/dist/config/channelSort.d.ts +25 -0
- package/dist/config/channelSort.js +101 -0
- package/dist/config/channelSort.js.map +1 -0
- package/dist/config/consistencyProbe.d.ts +0 -1
- package/dist/config/consistencyProbe.js +1 -1
- package/dist/config/consistencyProbe.js.map +1 -1
- package/dist/config/health.d.ts +3 -2
- package/dist/config/health.js +41 -31
- package/dist/config/health.js.map +1 -1
- package/dist/config/index.d.ts +12 -1
- package/dist/config/index.js +77 -31
- package/dist/config/index.js.map +1 -1
- package/dist/config/paths.d.ts +17 -2
- package/dist/config/paths.js +21 -1
- package/dist/config/paths.js.map +1 -1
- package/dist/config/persistence.context.d.ts +0 -1
- package/dist/config/persistence.d.ts +8 -4
- package/dist/config/persistence.js +143 -82
- package/dist/config/persistence.js.map +1 -1
- package/dist/config/presets.d.ts +0 -1
- package/dist/config/profiles.d.ts +9 -4
- package/dist/config/profiles.js +39 -6
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/providerLineups.d.ts +0 -1
- package/dist/config/providerLineups.js +0 -3
- package/dist/config/providerLineups.js.map +1 -1
- package/dist/config/reactivity.d.ts +0 -1
- package/dist/config/servicePacks.d.ts +0 -1
- package/dist/config/services.d.ts +1 -47
- package/dist/config/services.js +4 -135
- package/dist/config/services.js.map +1 -1
- package/dist/config/sites.d.ts +0 -9
- package/dist/config/sites.js +82 -98
- package/dist/config/sites.js.map +1 -1
- package/dist/config/userChannels.d.ts +22 -29
- package/dist/config/userChannels.js +47 -65
- package/dist/config/userChannels.js.map +1 -1
- package/dist/config/userConfig.d.ts +19 -4
- package/dist/config/userConfig.js +123 -25
- package/dist/config/userConfig.js.map +1 -1
- package/dist/config/userProfiles.d.ts +2 -3
- package/dist/config/userProfiles.js +16 -13
- package/dist/config/userProfiles.js.map +1 -1
- package/dist/hdhr/channelMap.d.ts +0 -1
- package/dist/hdhr/deviceId.d.ts +0 -1
- package/dist/hdhr/discover.d.ts +0 -1
- package/dist/hdhr/getHandlers.d.ts +0 -1
- package/dist/hdhr/identity.d.ts +0 -1
- package/dist/hdhr/index.d.ts +0 -1
- package/dist/hdhr/protocol.d.ts +1 -2
- package/dist/hdhr/protocol.js +1 -1
- package/dist/hdhr/tunerState.d.ts +0 -1
- package/dist/hdhr/udp.d.ts +0 -1
- package/dist/hdhr/udp.js +16 -4
- package/dist/hdhr/udp.js.map +1 -1
- package/dist/identity.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/native/codecInference.d.ts +5 -4
- package/dist/native/codecInference.js +12 -7
- package/dist/native/codecInference.js.map +1 -1
- package/dist/native/decrypt.d.ts +10 -3
- package/dist/native/decrypt.js +9 -5
- package/dist/native/decrypt.js.map +1 -1
- package/dist/native/index.d.ts +26 -24
- package/dist/native/index.js +26 -20
- package/dist/native/index.js.map +1 -1
- package/dist/native/probe.d.ts +7 -10
- package/dist/native/probe.js +41 -37
- package/dist/native/probe.js.map +1 -1
- package/dist/native/proxy.d.ts +3 -4
- package/dist/native/proxy.js +91 -69
- package/dist/native/proxy.js.map +1 -1
- package/dist/native/tokenExpiry.d.ts +0 -1
- package/dist/routes/assets.d.ts +0 -1
- package/dist/routes/auth.d.ts +0 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/auth.js.map +1 -1
- package/dist/routes/cdp.d.ts +11 -5
- package/dist/routes/cdp.js +91 -63
- package/dist/routes/cdp.js.map +1 -1
- package/dist/routes/channels.d.ts +0 -1
- package/dist/routes/clientActions.d.ts +0 -1
- package/dist/routes/components.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/browse.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/bulk.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/bulk.js +3 -3
- package/dist/routes/config/channels/endpoints/bulk.js.map +1 -1
- package/dist/routes/config/channels/endpoints/crud.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/crud.js +4 -3
- package/dist/routes/config/channels/endpoints/crud.js.map +1 -1
- package/dist/routes/config/channels/endpoints/importExport.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/importExport.js +7 -3
- package/dist/routes/config/channels/endpoints/importExport.js.map +1 -1
- package/dist/routes/config/channels/endpoints/predefined.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/prefs.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/prefs.js +1 -1
- package/dist/routes/config/channels/endpoints/prefs.js.map +1 -1
- package/dist/routes/config/channels/endpoints/service.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/service.js +8 -5
- package/dist/routes/config/channels/endpoints/service.js.map +1 -1
- package/dist/routes/config/channels/endpoints/tags.d.ts +0 -1
- package/dist/routes/config/channels/endpoints/tags.js +3 -3
- package/dist/routes/config/channels/endpoints/tags.js.map +1 -1
- package/dist/routes/config/channels/healthBridge.d.ts +4 -1
- package/dist/routes/config/channels/healthBridge.js +9 -5
- package/dist/routes/config/channels/healthBridge.js.map +1 -1
- package/dist/routes/config/channels/http/handler.d.ts +0 -1
- package/dist/routes/config/channels/http/playlistHint.d.ts +0 -1
- package/dist/routes/config/channels/http/serviceWarning.d.ts +0 -1
- package/dist/routes/config/channels/http/serviceWarning.js +1 -1
- package/dist/routes/config/channels/http/serviceWarning.js.map +1 -1
- package/dist/routes/config/channels/index.d.ts +0 -1
- package/dist/routes/config/channels/setup.d.ts +0 -1
- package/dist/routes/config/channels/table.d.ts +0 -1
- package/dist/routes/config/channels/table.js +66 -134
- package/dist/routes/config/channels/table.js.map +1 -1
- package/dist/routes/config/http/envelope.d.ts +1 -2
- package/dist/routes/config/index.d.ts +5 -5
- package/dist/routes/config/index.js +7 -5
- package/dist/routes/config/index.js.map +1 -1
- package/dist/routes/config/services.d.ts +0 -1
- package/dist/routes/config/services.js +17 -19
- package/dist/routes/config/services.js.map +1 -1
- package/dist/routes/config/settings.d.ts +6 -15
- package/dist/routes/config/settings.js +16 -35
- package/dist/routes/config/settings.js.map +1 -1
- package/dist/routes/debug.d.ts +0 -1
- package/dist/routes/debug.js +1 -1
- package/dist/routes/debug.js.map +1 -1
- package/dist/routes/health.d.ts +16 -8
- package/dist/routes/health.js +27 -12
- package/dist/routes/health.js.map +1 -1
- package/dist/routes/hls.d.ts +0 -1
- package/dist/routes/icons.d.ts +0 -1
- package/dist/routes/index.d.ts +0 -1
- package/dist/routes/logs.d.ts +3 -2
- package/dist/routes/logs.js +54 -14
- package/dist/routes/logs.js.map +1 -1
- package/dist/routes/mpegts.d.ts +0 -1
- package/dist/routes/play.d.ts +0 -1
- package/dist/routes/playlist.d.ts +0 -1
- package/dist/routes/playlist.js +2 -1
- package/dist/routes/playlist.js.map +1 -1
- package/dist/routes/root/content.d.ts +0 -1
- package/dist/routes/root/content.js +32 -11
- package/dist/routes/root/content.js.map +1 -1
- package/dist/routes/root/index.d.ts +10 -1
- package/dist/routes/root/index.js +17 -7
- package/dist/routes/root/index.js.map +1 -1
- package/dist/routes/root/scripts/channels.d.ts +0 -1
- package/dist/routes/root/scripts/channels.js +10 -20
- package/dist/routes/root/scripts/channels.js.map +1 -1
- package/dist/routes/root/scripts/clientEscape.d.ts +0 -1
- package/dist/routes/root/scripts/clientEscape.js +1 -1
- package/dist/routes/root/scripts/clientUrl.d.ts +0 -1
- package/dist/routes/root/scripts/config.d.ts +0 -1
- package/dist/routes/root/scripts/config.js +8 -29
- package/dist/routes/root/scripts/config.js.map +1 -1
- package/dist/routes/root/scripts/index.d.ts +0 -1
- package/dist/routes/root/scripts/shared.d.ts +0 -1
- package/dist/routes/root/scripts/shared.js +16 -13
- package/dist/routes/root/scripts/shared.js.map +1 -1
- package/dist/routes/root/scripts/status.d.ts +0 -1
- package/dist/routes/root/scripts/status.handlers.d.ts +3 -1
- package/dist/routes/root/scripts/status.handlers.js +52 -26
- package/dist/routes/root/scripts/status.handlers.js.map +1 -1
- package/dist/routes/root/styles.d.ts +0 -1
- package/dist/routes/root/styles.js +10 -18
- package/dist/routes/root/styles.js.map +1 -1
- package/dist/routes/services.d.ts +0 -1
- package/dist/routes/services.js +1 -1
- package/dist/routes/services.js.map +1 -1
- package/dist/routes/sse.d.ts +3 -2
- package/dist/routes/sse.js +7 -3
- package/dist/routes/sse.js.map +1 -1
- package/dist/routes/streams.d.ts +4 -2
- package/dist/routes/streams.js +8 -5
- package/dist/routes/streams.js.map +1 -1
- package/dist/routes/theme.d.ts +0 -1
- package/dist/routes/theme.js +3 -3
- package/dist/routes/theme.js.map +1 -1
- package/dist/routes/ui.d.ts +0 -1
- package/dist/routes/ui.js +5 -5
- package/dist/routes/ui.js.map +1 -1
- package/dist/routes/upgrade.d.ts +0 -1
- package/dist/routes/upgrade.js +2 -1
- package/dist/routes/upgrade.js.map +1 -1
- package/dist/service/commands.context.d.ts +0 -1
- package/dist/service/commands.context.js +7 -1
- package/dist/service/commands.context.js.map +1 -1
- package/dist/service/commands.d.ts +0 -1
- package/dist/service/generators.context.d.ts +0 -1
- package/dist/service/generators.d.ts +0 -1
- package/dist/service/index.d.ts +0 -1
- package/dist/streaming/captureLock.d.ts +1 -2
- package/dist/streaming/captureLock.js +8 -7
- package/dist/streaming/captureLock.js.map +1 -1
- package/dist/streaming/captureSession.d.ts +0 -1
- package/dist/streaming/clients.d.ts +4 -3
- package/dist/streaming/clients.js +5 -4
- package/dist/streaming/clients.js.map +1 -1
- package/dist/streaming/codec.d.ts +0 -1
- package/dist/streaming/fmp4Segmenter.d.ts +11 -6
- package/dist/streaming/fmp4Segmenter.js +39 -17
- package/dist/streaming/fmp4Segmenter.js.map +1 -1
- package/dist/streaming/hls.d.ts +96 -3
- package/dist/streaming/hls.js +282 -171
- package/dist/streaming/hls.js.map +1 -1
- package/dist/streaming/hlsResume.d.ts +8 -5
- package/dist/streaming/hlsResume.js +10 -8
- package/dist/streaming/hlsResume.js.map +1 -1
- package/dist/streaming/hlsSegments.d.ts +11 -8
- package/dist/streaming/hlsSegments.js +38 -18
- package/dist/streaming/hlsSegments.js.map +1 -1
- package/dist/streaming/lifecycle.d.ts +5 -4
- package/dist/streaming/lifecycle.js +43 -13
- package/dist/streaming/lifecycle.js.map +1 -1
- package/dist/streaming/monitor.d.ts +14 -3
- package/dist/streaming/monitor.js +447 -234
- package/dist/streaming/monitor.js.map +1 -1
- package/dist/streaming/mp4Parser.d.ts +0 -1
- package/dist/streaming/mpegts.d.ts +11 -1
- package/dist/streaming/mpegts.js +92 -28
- package/dist/streaming/mpegts.js.map +1 -1
- package/dist/streaming/playlistBuilder.d.ts +0 -1
- package/dist/streaming/preroll.d.ts +34 -15
- package/dist/streaming/preroll.js +32 -30
- package/dist/streaming/preroll.js.map +1 -1
- package/dist/streaming/pretune.d.ts +2 -3
- package/dist/streaming/pretune.js +45 -45
- package/dist/streaming/pretune.js.map +1 -1
- package/dist/streaming/pretuneTimers.d.ts +16 -12
- package/dist/streaming/pretuneTimers.js +27 -37
- package/dist/streaming/pretuneTimers.js.map +1 -1
- package/dist/streaming/recovery.d.ts +97 -9
- package/dist/streaming/recovery.js +96 -18
- package/dist/streaming/recovery.js.map +1 -1
- package/dist/streaming/registry.d.ts +102 -15
- package/dist/streaming/registry.js +90 -5
- package/dist/streaming/registry.js.map +1 -1
- package/dist/streaming/setup.d.ts +90 -32
- package/dist/streaming/setup.js +379 -248
- package/dist/streaming/setup.js.map +1 -1
- package/dist/streaming/showInfo.d.ts +8 -4
- package/dist/streaming/showInfo.js +54 -45
- package/dist/streaming/showInfo.js.map +1 -1
- package/dist/streaming/statusEmitter.d.ts +5 -3
- package/dist/streaming/statusEmitter.js +20 -8
- package/dist/streaming/statusEmitter.js.map +1 -1
- package/dist/types/channels.d.ts +0 -1
- package/dist/types/channels.js +0 -4
- package/dist/types/channels.js.map +1 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +2 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/profiles.d.ts +51 -9
- package/dist/types/profiles.js +35 -1
- package/dist/types/profiles.js.map +1 -1
- package/dist/types/selection.d.ts +10 -1
- package/dist/types/shared.d.ts +0 -1
- package/dist/types/streaming.d.ts +8 -1
- package/dist/types/streaming.js +7 -0
- package/dist/types/streaming.js.map +1 -1
- package/dist/upgrade/commands.context.d.ts +0 -1
- package/dist/upgrade/commands.d.ts +0 -1
- package/dist/upgrade/commands.js +1 -1
- package/dist/upgrade/commands.js.map +1 -1
- package/dist/upgrade/detection.context.d.ts +0 -1
- package/dist/upgrade/detection.d.ts +1 -2
- package/dist/upgrade/index.d.ts +0 -1
- package/dist/upgrade/lifecycle.context.d.ts +2 -1
- package/dist/upgrade/lifecycle.context.js +9 -4
- package/dist/upgrade/lifecycle.context.js.map +1 -1
- package/dist/upgrade/lifecycle.d.ts +0 -1
- package/dist/upgrade/pathHandle.d.ts +0 -1
- package/dist/utils/bootSession.context.d.ts +0 -1
- package/dist/utils/bootSession.context.js +3 -2
- package/dist/utils/bootSession.context.js.map +1 -1
- package/dist/utils/bootSession.d.ts +0 -1
- package/dist/utils/chromeFetch.d.ts +0 -1
- package/dist/utils/cliOutput.d.ts +0 -1
- package/dist/utils/debugFilter.d.ts +0 -1
- package/dist/utils/debugFilter.js +5 -3
- package/dist/utils/debugFilter.js.map +1 -1
- package/dist/utils/delay.d.ts +65 -13
- package/dist/utils/delay.js +96 -23
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/errors.d.ts +0 -11
- package/dist/utils/errors.js +3 -14
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/evaluate.d.ts +11 -3
- package/dist/utils/evaluate.js +4 -3
- package/dist/utils/evaluate.js.map +1 -1
- package/dist/utils/ffmpeg.context.d.ts +0 -1
- package/dist/utils/ffmpeg.d.ts +1 -1
- package/dist/utils/ffmpeg.js +2 -1
- package/dist/utils/ffmpeg.js.map +1 -1
- package/dist/utils/fileLogger.d.ts +26 -7
- package/dist/utils/fileLogger.js +241 -102
- package/dist/utils/fileLogger.js.map +1 -1
- package/dist/utils/format.d.ts +36 -4
- package/dist/utils/format.js +66 -12
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/logEmitter.d.ts +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/m3u.d.ts +0 -1
- package/dist/utils/markup.d.ts +0 -1
- package/dist/utils/memo.d.ts +0 -1
- package/dist/utils/morganStream.d.ts +2 -3
- package/dist/utils/morganStream.js +6 -8
- package/dist/utils/morganStream.js.map +1 -1
- package/dist/utils/network.d.ts +0 -1
- package/dist/utils/never.d.ts +8 -0
- package/dist/utils/never.js +20 -0
- package/dist/utils/never.js.map +1 -0
- package/dist/utils/pid.d.ts +0 -1
- package/dist/utils/platform.d.ts +0 -1
- package/dist/utils/processInspector.context.d.ts +32 -2
- package/dist/utils/processInspector.context.js +117 -1
- package/dist/utils/processInspector.context.js.map +1 -1
- package/dist/utils/processInspector.d.ts +0 -32
- package/dist/utils/processInspector.js +10 -117
- package/dist/utils/processInspector.js.map +1 -1
- package/dist/utils/retry.d.ts +5 -4
- package/dist/utils/retry.js +43 -33
- package/dist/utils/retry.js.map +1 -1
- package/dist/utils/runtimeIdentity.context.d.ts +0 -1
- package/dist/utils/runtimeIdentity.context.js +3 -1
- package/dist/utils/runtimeIdentity.context.js.map +1 -1
- package/dist/utils/runtimeIdentity.d.ts +1 -1
- package/dist/utils/runtimeIdentity.js +1 -1
- package/dist/utils/runtimeIdentity.js.map +1 -1
- package/dist/utils/sanitize.d.ts +8 -1
- package/dist/utils/sanitize.js +19 -0
- package/dist/utils/sanitize.js.map +1 -1
- package/dist/utils/streamContext.d.ts +0 -1
- package/dist/utils/timing.d.ts +3 -4
- package/dist/utils/timing.js +4 -4
- package/dist/utils/timing.js.map +1 -1
- package/dist/utils/version.d.ts +14 -8
- package/dist/utils/version.js +35 -24
- package/dist/utils/version.js.map +1 -1
- package/package.json +7 -7
- package/dist/app.d.ts.map +0 -1
- package/dist/browser/blockedPage.d.ts.map +0 -1
- package/dist/browser/browserSupervisor.d.ts.map +0 -1
- package/dist/browser/cdp.d.ts.map +0 -1
- package/dist/browser/channelSelection.d.ts.map +0 -1
- package/dist/browser/consent.d.ts.map +0 -1
- package/dist/browser/display.d.ts.map +0 -1
- package/dist/browser/hlsPlaylistObserver.d.ts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/launchGovernor.d.ts.map +0 -1
- package/dist/browser/login.d.ts.map +0 -1
- package/dist/browser/manifestInterceptor.d.ts.map +0 -1
- package/dist/browser/pageStaleness.d.ts.map +0 -1
- package/dist/browser/precaching.d.ts.map +0 -1
- package/dist/browser/tabNetworkObserver.d.ts.map +0 -1
- package/dist/browser/tuning/cache.d.ts.map +0 -1
- package/dist/browser/tuning/comcastPolymer.d.ts.map +0 -1
- package/dist/browser/tuning/cox.d.ts.map +0 -1
- package/dist/browser/tuning/directv.d.ts.map +0 -1
- package/dist/browser/tuning/fox.d.ts.map +0 -1
- package/dist/browser/tuning/gridSearch.d.ts.map +0 -1
- package/dist/browser/tuning/hbo.d.ts.map +0 -1
- package/dist/browser/tuning/hulu.d.ts.map +0 -1
- package/dist/browser/tuning/shared.d.ts.map +0 -1
- package/dist/browser/tuning/sling.d.ts.map +0 -1
- package/dist/browser/tuning/spectrum.d.ts.map +0 -1
- package/dist/browser/tuning/thumbnailRow.d.ts.map +0 -1
- package/dist/browser/tuning/tileClick.d.ts.map +0 -1
- package/dist/browser/tuning/xfinity.d.ts.map +0 -1
- package/dist/browser/tuning/youtubeTv.d.ts.map +0 -1
- package/dist/browser/video.d.ts.map +0 -1
- package/dist/channels/index.d.ts.map +0 -1
- package/dist/config/channelForm.d.ts.map +0 -1
- package/dist/config/consistencyProbe.d.ts.map +0 -1
- package/dist/config/health.d.ts.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/paths.d.ts.map +0 -1
- package/dist/config/persistence.context.d.ts.map +0 -1
- package/dist/config/persistence.d.ts.map +0 -1
- package/dist/config/presets.d.ts.map +0 -1
- package/dist/config/profiles.d.ts.map +0 -1
- package/dist/config/providerLineups.d.ts.map +0 -1
- package/dist/config/reactivity.d.ts.map +0 -1
- package/dist/config/servicePacks.d.ts.map +0 -1
- package/dist/config/services.d.ts.map +0 -1
- package/dist/config/sites.d.ts.map +0 -1
- package/dist/config/userChannels.d.ts.map +0 -1
- package/dist/config/userConfig.d.ts.map +0 -1
- package/dist/config/userProfiles.d.ts.map +0 -1
- package/dist/hdhr/channelMap.d.ts.map +0 -1
- package/dist/hdhr/deviceId.d.ts.map +0 -1
- package/dist/hdhr/discover.d.ts.map +0 -1
- package/dist/hdhr/getHandlers.d.ts.map +0 -1
- package/dist/hdhr/identity.d.ts.map +0 -1
- package/dist/hdhr/index.d.ts.map +0 -1
- package/dist/hdhr/protocol.d.ts.map +0 -1
- package/dist/hdhr/tunerState.d.ts.map +0 -1
- package/dist/hdhr/udp.d.ts.map +0 -1
- package/dist/identity.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/native/codecInference.d.ts.map +0 -1
- package/dist/native/decrypt.d.ts.map +0 -1
- package/dist/native/index.d.ts.map +0 -1
- package/dist/native/probe.d.ts.map +0 -1
- package/dist/native/proxy.d.ts.map +0 -1
- package/dist/native/tokenExpiry.d.ts.map +0 -1
- package/dist/routes/assets.d.ts.map +0 -1
- package/dist/routes/auth.d.ts.map +0 -1
- package/dist/routes/cdp.d.ts.map +0 -1
- package/dist/routes/channels.d.ts.map +0 -1
- package/dist/routes/clientActions.d.ts.map +0 -1
- package/dist/routes/components.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/browse.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/bulk.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/crud.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/importExport.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/predefined.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/prefs.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/service.d.ts.map +0 -1
- package/dist/routes/config/channels/endpoints/tags.d.ts.map +0 -1
- package/dist/routes/config/channels/healthBridge.d.ts.map +0 -1
- package/dist/routes/config/channels/http/handler.d.ts.map +0 -1
- package/dist/routes/config/channels/http/playlistHint.d.ts.map +0 -1
- package/dist/routes/config/channels/http/serviceWarning.d.ts.map +0 -1
- package/dist/routes/config/channels/index.d.ts.map +0 -1
- package/dist/routes/config/channels/setup.d.ts.map +0 -1
- package/dist/routes/config/channels/table.d.ts.map +0 -1
- package/dist/routes/config/http/envelope.d.ts.map +0 -1
- package/dist/routes/config/index.d.ts.map +0 -1
- package/dist/routes/config/services.d.ts.map +0 -1
- package/dist/routes/config/settings.d.ts.map +0 -1
- package/dist/routes/debug.d.ts.map +0 -1
- package/dist/routes/health.d.ts.map +0 -1
- package/dist/routes/hls.d.ts.map +0 -1
- package/dist/routes/icons.d.ts.map +0 -1
- package/dist/routes/index.d.ts.map +0 -1
- package/dist/routes/logs.d.ts.map +0 -1
- package/dist/routes/mpegts.d.ts.map +0 -1
- package/dist/routes/play.d.ts.map +0 -1
- package/dist/routes/playlist.d.ts.map +0 -1
- package/dist/routes/root/content.d.ts.map +0 -1
- package/dist/routes/root/index.d.ts.map +0 -1
- package/dist/routes/root/scripts/channels.d.ts.map +0 -1
- package/dist/routes/root/scripts/clientEscape.d.ts.map +0 -1
- package/dist/routes/root/scripts/clientUrl.d.ts.map +0 -1
- package/dist/routes/root/scripts/config.d.ts.map +0 -1
- package/dist/routes/root/scripts/index.d.ts.map +0 -1
- package/dist/routes/root/scripts/shared.d.ts.map +0 -1
- package/dist/routes/root/scripts/status.d.ts.map +0 -1
- package/dist/routes/root/scripts/status.handlers.d.ts.map +0 -1
- package/dist/routes/root/styles.d.ts.map +0 -1
- package/dist/routes/services.d.ts.map +0 -1
- package/dist/routes/sse.d.ts.map +0 -1
- package/dist/routes/streams.d.ts.map +0 -1
- package/dist/routes/theme.d.ts.map +0 -1
- package/dist/routes/ui.d.ts.map +0 -1
- package/dist/routes/upgrade.d.ts.map +0 -1
- package/dist/service/commands.context.d.ts.map +0 -1
- package/dist/service/commands.d.ts.map +0 -1
- package/dist/service/generators.context.d.ts.map +0 -1
- package/dist/service/generators.d.ts.map +0 -1
- package/dist/service/index.d.ts.map +0 -1
- package/dist/streaming/captureLock.d.ts.map +0 -1
- package/dist/streaming/captureSession.d.ts.map +0 -1
- package/dist/streaming/clients.d.ts.map +0 -1
- package/dist/streaming/codec.d.ts.map +0 -1
- package/dist/streaming/fmp4Segmenter.d.ts.map +0 -1
- package/dist/streaming/hls.d.ts.map +0 -1
- package/dist/streaming/hlsResume.d.ts.map +0 -1
- package/dist/streaming/hlsSegments.d.ts.map +0 -1
- package/dist/streaming/lifecycle.d.ts.map +0 -1
- package/dist/streaming/monitor.d.ts.map +0 -1
- package/dist/streaming/mp4Parser.d.ts.map +0 -1
- package/dist/streaming/mpegts.d.ts.map +0 -1
- package/dist/streaming/playlistBuilder.d.ts.map +0 -1
- package/dist/streaming/preroll.d.ts.map +0 -1
- package/dist/streaming/pretune.d.ts.map +0 -1
- package/dist/streaming/pretuneTimers.d.ts.map +0 -1
- package/dist/streaming/recovery.d.ts.map +0 -1
- package/dist/streaming/registry.d.ts.map +0 -1
- package/dist/streaming/setup.d.ts.map +0 -1
- package/dist/streaming/showInfo.d.ts.map +0 -1
- package/dist/streaming/statusEmitter.d.ts.map +0 -1
- package/dist/types/channels.d.ts.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/profiles.d.ts.map +0 -1
- package/dist/types/selection.d.ts.map +0 -1
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/streaming.d.ts.map +0 -1
- package/dist/upgrade/commands.context.d.ts.map +0 -1
- package/dist/upgrade/commands.d.ts.map +0 -1
- package/dist/upgrade/detection.context.d.ts.map +0 -1
- package/dist/upgrade/detection.d.ts.map +0 -1
- package/dist/upgrade/index.d.ts.map +0 -1
- package/dist/upgrade/lifecycle.context.d.ts.map +0 -1
- package/dist/upgrade/lifecycle.d.ts.map +0 -1
- package/dist/upgrade/pathHandle.d.ts.map +0 -1
- package/dist/utils/bootSession.context.d.ts.map +0 -1
- package/dist/utils/bootSession.d.ts.map +0 -1
- package/dist/utils/chromeFetch.d.ts.map +0 -1
- package/dist/utils/cliOutput.d.ts.map +0 -1
- package/dist/utils/clock.d.ts +0 -15
- package/dist/utils/clock.d.ts.map +0 -1
- package/dist/utils/clock.js +0 -31
- package/dist/utils/clock.js.map +0 -1
- package/dist/utils/debugFilter.d.ts.map +0 -1
- package/dist/utils/delay.d.ts.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/evaluate.d.ts.map +0 -1
- package/dist/utils/ffmpeg.context.d.ts.map +0 -1
- package/dist/utils/ffmpeg.d.ts.map +0 -1
- package/dist/utils/fileLogger.d.ts.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logEmitter.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/m3u.d.ts.map +0 -1
- package/dist/utils/markup.d.ts.map +0 -1
- package/dist/utils/memo.d.ts.map +0 -1
- package/dist/utils/morganStream.d.ts.map +0 -1
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/pid.d.ts.map +0 -1
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/processInspector.context.d.ts.map +0 -1
- package/dist/utils/processInspector.d.ts.map +0 -1
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/runtimeIdentity.context.d.ts.map +0 -1
- package/dist/utils/runtimeIdentity.d.ts.map +0 -1
- package/dist/utils/sanitize.d.ts.map +0 -1
- package/dist/utils/streamContext.d.ts.map +0 -1
- package/dist/utils/timing.d.ts.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type { MediaContainer, Nullable, ResolvedSiteProfile
|
|
1
|
+
import type { MediaContainer, Nullable, ResolvedSiteProfile } from "../types/index.ts";
|
|
2
2
|
import type { CaptureCodec } from "./codec.ts";
|
|
3
3
|
import type { CaptureSession } from "./captureSession.ts";
|
|
4
4
|
import { EventEmitter } from "node:events";
|
|
5
|
+
import type { FMP4SegmenterResult } from "./fmp4Segmenter.ts";
|
|
5
6
|
import type { ManifestInterceptionResult } from "../browser/manifestInterceptor.ts";
|
|
6
7
|
import type { MonitorHandle } from "./recovery.ts";
|
|
7
8
|
import type { NativeProxy } from "../native/proxy.ts";
|
|
8
9
|
import type { Page } from "puppeteer-core";
|
|
9
10
|
import type { ProbeCacheIdentity } from "../native/probe.ts";
|
|
11
|
+
import type { RefreshedFeedMetadata } from "../native/index.ts";
|
|
10
12
|
/**
|
|
11
13
|
* Typed event map for segment notifications. MPEG-TS consumers and lifecycle handlers subscribe to these events. Using a typed interface ensures event names and
|
|
12
14
|
* argument types are checked at compile time, preventing misspelled event names or incorrect payloads.
|
|
@@ -30,6 +32,13 @@ export interface SegmentEmitter extends EventEmitter {
|
|
|
30
32
|
* signature names the type rather than restating the literal pair.
|
|
31
33
|
*/
|
|
32
34
|
export type InitSegmentTrack = "audio" | "video";
|
|
35
|
+
/**
|
|
36
|
+
* The HTTP status and user-facing message a failed stream setup answers its clients with.
|
|
37
|
+
*/
|
|
38
|
+
export interface SetupFailureStatus {
|
|
39
|
+
readonly statusCode: number;
|
|
40
|
+
readonly userMessage: string;
|
|
41
|
+
}
|
|
33
42
|
/**
|
|
34
43
|
* HLS segment and playlist storage for a stream. This includes the fMP4 initialization segment (codec configuration), media segments (.m4s files), and the current
|
|
35
44
|
* playlist content. The playlistReady promise allows callers to wait for the first playlist to be generated.
|
|
@@ -59,9 +68,10 @@ export interface HLSState {
|
|
|
59
68
|
prerollBaseUrl: Nullable<string>;
|
|
60
69
|
prerollCodec: Nullable<CaptureCodec>;
|
|
61
70
|
prerollSegmentCount: number;
|
|
62
|
-
prerollStartTime: Nullable<
|
|
63
|
-
prerollTimer: Nullable<
|
|
71
|
+
prerollStartTime: Nullable<number>;
|
|
72
|
+
prerollTimer: Nullable<Disposable>;
|
|
64
73
|
resumeSegmentIndex: number;
|
|
74
|
+
setupFailure: Nullable<SetupFailureStatus>;
|
|
65
75
|
}
|
|
66
76
|
/**
|
|
67
77
|
* Stream-specific information for idle detection.
|
|
@@ -70,32 +80,46 @@ export interface StreamInfo {
|
|
|
70
80
|
lastPlaylistRequest: number;
|
|
71
81
|
storeKey: string;
|
|
72
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* The identity of a capture-mode stream: the screen-capture pipeline and the encoder facts that describe what it is producing.
|
|
85
|
+
*/
|
|
86
|
+
export interface CaptureStreamIdentity {
|
|
87
|
+
readonly captureCodec: Nullable<string>;
|
|
88
|
+
readonly captureSession: Nullable<CaptureSession>;
|
|
89
|
+
readonly hardwareAccelerated: boolean;
|
|
90
|
+
readonly mode: "capture";
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The identity of a native-mode stream: the HLS proxy relaying the service's own segments, and the manifest facts that describe the feed it is bound to.
|
|
94
|
+
*/
|
|
95
|
+
export interface NativeStreamIdentity {
|
|
96
|
+
readonly captureCodec: Nullable<string>;
|
|
97
|
+
readonly mode: "native";
|
|
98
|
+
readonly nativeBandwidth: number;
|
|
99
|
+
readonly nativeContainer: Nullable<MediaContainer>;
|
|
100
|
+
readonly nativeProxy: NativeProxy;
|
|
101
|
+
readonly nativeResolution: Nullable<string>;
|
|
102
|
+
readonly reestablishManifest: (page: Page) => Promise<Nullable<ManifestInterceptionResult>>;
|
|
103
|
+
}
|
|
104
|
+
export type StreamIdentity = CaptureStreamIdentity | NativeStreamIdentity;
|
|
73
105
|
/**
|
|
74
106
|
* Registry entry for an active stream. This is the single source of truth for all stream data, including browser state, HLS segments, and the segmenter reference.
|
|
75
107
|
*/
|
|
76
108
|
export interface StreamRegistryEntry {
|
|
77
|
-
captureCodec: Nullable<string>;
|
|
78
|
-
captureSession: Nullable<CaptureSession>;
|
|
79
109
|
channelName: Nullable<string>;
|
|
80
110
|
clientAddress: Nullable<string>;
|
|
81
|
-
hardwareAccelerated: boolean;
|
|
82
111
|
hls: HLSState;
|
|
83
112
|
id: number;
|
|
113
|
+
identity: StreamIdentity;
|
|
84
114
|
mpegTsClientCount: number;
|
|
85
|
-
nativeBandwidth: number;
|
|
86
|
-
nativeContainer: Nullable<MediaContainer>;
|
|
87
|
-
nativeProxy: Nullable<NativeProxy>;
|
|
88
|
-
nativeResolution: Nullable<string>;
|
|
89
115
|
info: StreamInfo;
|
|
90
116
|
page: Nullable<Page>;
|
|
91
117
|
preTuned: boolean;
|
|
92
118
|
probeIdentity: Nullable<ProbeCacheIdentity>;
|
|
93
119
|
profile: Nullable<ResolvedSiteProfile>;
|
|
94
|
-
|
|
95
|
-
startTime: Date;
|
|
120
|
+
startTime: number;
|
|
96
121
|
monitor: Nullable<MonitorHandle>;
|
|
97
122
|
streamIdStr: string;
|
|
98
|
-
streamingMode: StreamingMode;
|
|
99
123
|
url: string;
|
|
100
124
|
}
|
|
101
125
|
/**
|
|
@@ -129,11 +153,65 @@ export declare function getAllStreams(): StreamRegistryEntry[];
|
|
|
129
153
|
* @returns The number of active streams.
|
|
130
154
|
*/
|
|
131
155
|
export declare function getStreamCount(): number;
|
|
156
|
+
/**
|
|
157
|
+
* Reports whether any registered stream is in capture mode. The browser window's visibility policy reads this, so it is evaluated fresh on every call - the answer
|
|
158
|
+
* flips with every stream start and end, and a cached copy would be stale exactly when it matters.
|
|
159
|
+
*
|
|
160
|
+
* Registry presence is the test rather than a live captureSession reference. A pending entry registers in capture mode before physical capture starts, and an entry
|
|
161
|
+
* leaves the registry only after teardown, so membership brackets the entire window during which Chrome is reading the compositor. The capture session attaches
|
|
162
|
+
* partway through establishment, which would leave the predicate reading false across the whole tune - the moment the window most needs to be visible.
|
|
163
|
+
* @returns True when at least one registered stream is in capture mode.
|
|
164
|
+
*/
|
|
165
|
+
export declare function hasActiveCaptureStreams(): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Reports whether any registered stream has been established on the browser. A stream is established once its entry holds its page, in either mode - a capture
|
|
168
|
+
* reads that page's compositor output and a native relay keeps its page for re-establishment - and from that moment it depends on the browser the page lives in.
|
|
169
|
+
* A pending entry holds no page, so a tune that has released its page to wait on a relaunch does not count itself among the reasons that relaunch cannot run.
|
|
170
|
+
*
|
|
171
|
+
* It is deliberately narrower than hasActiveCaptureStreams beside it, which counts pending entries on purpose: the window has to be on screen for the whole tune,
|
|
172
|
+
* whereas the question here is what a browser teardown would destroy.
|
|
173
|
+
* @returns True when at least one registered stream holds a page.
|
|
174
|
+
*/
|
|
175
|
+
export declare function hasEstablishedStreams(): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Builds the identity a stream is born with: capture mode, with no pipeline and no encoder facts yet. The literal exists here alone so the pending birth and the
|
|
178
|
+
* native fallback's pre-flip declare the same shape rather than hand-copying it.
|
|
179
|
+
* @returns A capture identity in its pending state.
|
|
180
|
+
*/
|
|
181
|
+
export declare function makePendingCaptureIdentity(): CaptureStreamIdentity;
|
|
182
|
+
/**
|
|
183
|
+
* Narrows a stream entry to capture mode. Published alongside the segment-health readers so consumers outside the streaming layer ask the registry what a stream
|
|
184
|
+
* is rather than reaching into its identity themselves.
|
|
185
|
+
* @param entry - The stream registry entry to test.
|
|
186
|
+
* @returns True when the entry carries a capture identity, narrowing it for the caller.
|
|
187
|
+
*/
|
|
188
|
+
export declare function isCaptureIdentity(entry: StreamRegistryEntry): entry is StreamRegistryEntry & {
|
|
189
|
+
identity: CaptureStreamIdentity;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Reports whether a stream is encoding on the local GPU. Hardware acceleration is a capture-mode fact, so native streams answer false: they pass the service's own
|
|
193
|
+
* segments through and encode nothing locally. The status projections read it here rather than each narrowing the identity themselves.
|
|
194
|
+
* @param entry - The stream registry entry to query.
|
|
195
|
+
* @returns True when the stream is capturing with hardware-accelerated encoding.
|
|
196
|
+
*/
|
|
197
|
+
export declare function isHardwareAccelerated(entry: StreamRegistryEntry): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Records the quality a token refresh has bound this stream to. The registry owns the mechanics because two layers relay the same refresh - the native upgrade in
|
|
200
|
+
* hls.ts and the monitor's L2 recovery - and a hand-copied guard-then-spread in each would be two chances to get it wrong.
|
|
201
|
+
*
|
|
202
|
+
* The narrow happens here, freshly, because both callers invoke this from an asynchronous callback that can fire long after any earlier check: a refresh that
|
|
203
|
+
* completes while a capture fallback is mid-flight finds a capture identity and is skipped. Skipping is right in every case - quality metadata for a stream
|
|
204
|
+
* midway through a fallback is moot, and a fallback that fails restores the proxy, whose next refresh writes the quality again.
|
|
205
|
+
* @param entry - The stream registry entry to update.
|
|
206
|
+
* @param refreshed - The quality facts of the freshly bound feed.
|
|
207
|
+
*/
|
|
208
|
+
export declare function applyNativeQualityRefresh(entry: StreamRegistryEntry, refreshed: RefreshedFeedMetadata): void;
|
|
132
209
|
/**
|
|
133
210
|
* Updates the last playlist request timestamp for a stream. This should be called whenever a playlist or segment is requested to keep the idle timeout accurate.
|
|
134
211
|
* @param id - The numeric stream ID.
|
|
212
|
+
* @param now - The instant of the request.
|
|
135
213
|
*/
|
|
136
|
-
export declare function updateLastAccess(id: number): void;
|
|
214
|
+
export declare function updateLastAccess(id: number, now: number): void;
|
|
137
215
|
/**
|
|
138
216
|
* Creates the initial HLS state for a new stream. This sets up empty segment storage and the playlist readiness signaling mechanism.
|
|
139
217
|
* @returns A new HLSState object ready to receive segments.
|
|
@@ -167,6 +245,16 @@ export declare function getStreamMemoryUsage(entry: StreamRegistryEntry): Stream
|
|
|
167
245
|
* @returns Total memory usage in bytes across all streams.
|
|
168
246
|
*/
|
|
169
247
|
export declare function getTotalSegmentMemory(): number;
|
|
248
|
+
/**
|
|
249
|
+
* Returns the fMP4 segmenter producing a stream's segments, or null when there is none: a native stream relays the service's own segments, and a capture stream
|
|
250
|
+
* has no segmenter until createCaptureSegmenter wires one. This is the single place the capture-identity narrow and the pipeline walk are written, so the several
|
|
251
|
+
* consumers that read segment indices, init segments, and session statistics all ask the same question the same way.
|
|
252
|
+
*
|
|
253
|
+
* An absent entry is accepted because callers routinely look the stream up and read its segmenter in one expression; a stream that is gone has no segmenter.
|
|
254
|
+
* @param entry - The stream registry entry to query, or undefined when the lookup found nothing.
|
|
255
|
+
* @returns The attached segmenter, or null.
|
|
256
|
+
*/
|
|
257
|
+
export declare function getStreamSegmenter(entry: StreamRegistryEntry | undefined): Nullable<FMP4SegmenterResult>;
|
|
170
258
|
/**
|
|
171
259
|
* Returns whether the last segment contained video traf boxes. Used by the monitor to distinguish dead capture pipelines (audio-only, no video trafs) from legitimate
|
|
172
260
|
* small segments produced by static content (video trafs present but low-bitrate). Returns null if the segmenter does not exist or the video trackId is unknown.
|
|
@@ -182,4 +270,3 @@ export declare function getLastSegmentHasVideo(entry: StreamRegistryEntry): Null
|
|
|
182
270
|
*/
|
|
183
271
|
export declare function getLastSegmentSize(entry: StreamRegistryEntry): Nullable<number>;
|
|
184
272
|
export {};
|
|
185
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -48,14 +48,83 @@ export function getAllStreams() {
|
|
|
48
48
|
export function getStreamCount() {
|
|
49
49
|
return streamRegistry.size;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Reports whether any registered stream is in capture mode. The browser window's visibility policy reads this, so it is evaluated fresh on every call - the answer
|
|
53
|
+
* flips with every stream start and end, and a cached copy would be stale exactly when it matters.
|
|
54
|
+
*
|
|
55
|
+
* Registry presence is the test rather than a live captureSession reference. A pending entry registers in capture mode before physical capture starts, and an entry
|
|
56
|
+
* leaves the registry only after teardown, so membership brackets the entire window during which Chrome is reading the compositor. The capture session attaches
|
|
57
|
+
* partway through establishment, which would leave the predicate reading false across the whole tune - the moment the window most needs to be visible.
|
|
58
|
+
* @returns True when at least one registered stream is in capture mode.
|
|
59
|
+
*/
|
|
60
|
+
export function hasActiveCaptureStreams() {
|
|
61
|
+
return getAllStreams().some(isCaptureIdentity);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reports whether any registered stream has been established on the browser. A stream is established once its entry holds its page, in either mode - a capture
|
|
65
|
+
* reads that page's compositor output and a native relay keeps its page for re-establishment - and from that moment it depends on the browser the page lives in.
|
|
66
|
+
* A pending entry holds no page, so a tune that has released its page to wait on a relaunch does not count itself among the reasons that relaunch cannot run.
|
|
67
|
+
*
|
|
68
|
+
* It is deliberately narrower than hasActiveCaptureStreams beside it, which counts pending entries on purpose: the window has to be on screen for the whole tune,
|
|
69
|
+
* whereas the question here is what a browser teardown would destroy.
|
|
70
|
+
* @returns True when at least one registered stream holds a page.
|
|
71
|
+
*/
|
|
72
|
+
export function hasEstablishedStreams() {
|
|
73
|
+
return getAllStreams().some((entry) => entry.page !== null);
|
|
74
|
+
}
|
|
75
|
+
// Identity.
|
|
76
|
+
/**
|
|
77
|
+
* Builds the identity a stream is born with: capture mode, with no pipeline and no encoder facts yet. The literal exists here alone so the pending birth and the
|
|
78
|
+
* native fallback's pre-flip declare the same shape rather than hand-copying it.
|
|
79
|
+
* @returns A capture identity in its pending state.
|
|
80
|
+
*/
|
|
81
|
+
export function makePendingCaptureIdentity() {
|
|
82
|
+
return { captureCodec: null, captureSession: null, hardwareAccelerated: false, mode: "capture" };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Narrows a stream entry to capture mode. Published alongside the segment-health readers so consumers outside the streaming layer ask the registry what a stream
|
|
86
|
+
* is rather than reaching into its identity themselves.
|
|
87
|
+
* @param entry - The stream registry entry to test.
|
|
88
|
+
* @returns True when the entry carries a capture identity, narrowing it for the caller.
|
|
89
|
+
*/
|
|
90
|
+
export function isCaptureIdentity(entry) {
|
|
91
|
+
return entry.identity.mode === "capture";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Reports whether a stream is encoding on the local GPU. Hardware acceleration is a capture-mode fact, so native streams answer false: they pass the service's own
|
|
95
|
+
* segments through and encode nothing locally. The status projections read it here rather than each narrowing the identity themselves.
|
|
96
|
+
* @param entry - The stream registry entry to query.
|
|
97
|
+
* @returns True when the stream is capturing with hardware-accelerated encoding.
|
|
98
|
+
*/
|
|
99
|
+
export function isHardwareAccelerated(entry) {
|
|
100
|
+
return (entry.identity.mode === "capture") && entry.identity.hardwareAccelerated;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Records the quality a token refresh has bound this stream to. The registry owns the mechanics because two layers relay the same refresh - the native upgrade in
|
|
104
|
+
* hls.ts and the monitor's L2 recovery - and a hand-copied guard-then-spread in each would be two chances to get it wrong.
|
|
105
|
+
*
|
|
106
|
+
* The narrow happens here, freshly, because both callers invoke this from an asynchronous callback that can fire long after any earlier check: a refresh that
|
|
107
|
+
* completes while a capture fallback is mid-flight finds a capture identity and is skipped. Skipping is right in every case - quality metadata for a stream
|
|
108
|
+
* midway through a fallback is moot, and a fallback that fails restores the proxy, whose next refresh writes the quality again.
|
|
109
|
+
* @param entry - The stream registry entry to update.
|
|
110
|
+
* @param refreshed - The quality facts of the freshly bound feed.
|
|
111
|
+
*/
|
|
112
|
+
export function applyNativeQualityRefresh(entry, refreshed) {
|
|
113
|
+
const identity = entry.identity;
|
|
114
|
+
if (identity.mode !== "native") {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
entry.identity = { ...identity, captureCodec: refreshed.codec, nativeBandwidth: refreshed.bandwidth, nativeResolution: refreshed.resolution };
|
|
118
|
+
}
|
|
51
119
|
/**
|
|
52
120
|
* Updates the last playlist request timestamp for a stream. This should be called whenever a playlist or segment is requested to keep the idle timeout accurate.
|
|
53
121
|
* @param id - The numeric stream ID.
|
|
122
|
+
* @param now - The instant of the request.
|
|
54
123
|
*/
|
|
55
|
-
export function updateLastAccess(id) {
|
|
124
|
+
export function updateLastAccess(id, now) {
|
|
56
125
|
const entry = streamRegistry.get(id);
|
|
57
126
|
if (entry) {
|
|
58
|
-
entry.info.lastPlaylistRequest =
|
|
127
|
+
entry.info.lastPlaylistRequest = now;
|
|
59
128
|
}
|
|
60
129
|
}
|
|
61
130
|
/**
|
|
@@ -92,6 +161,7 @@ export function createHLSState() {
|
|
|
92
161
|
segmentBytes: 0,
|
|
93
162
|
segmentEmitter,
|
|
94
163
|
segments: new Map(),
|
|
164
|
+
setupFailure: null,
|
|
95
165
|
signalInitSegmentReady,
|
|
96
166
|
signalPlaylistReady,
|
|
97
167
|
videoPlaylist: ""
|
|
@@ -106,7 +176,7 @@ export function createHLSState() {
|
|
|
106
176
|
*/
|
|
107
177
|
export function cancelPrerollTimer(hls) {
|
|
108
178
|
if (hls.prerollTimer) {
|
|
109
|
-
|
|
179
|
+
hls.prerollTimer[Symbol.dispose]();
|
|
110
180
|
hls.prerollTimer = null;
|
|
111
181
|
}
|
|
112
182
|
}
|
|
@@ -139,6 +209,21 @@ export function getTotalSegmentMemory() {
|
|
|
139
209
|
return total;
|
|
140
210
|
}
|
|
141
211
|
// Segment Health.
|
|
212
|
+
/**
|
|
213
|
+
* Returns the fMP4 segmenter producing a stream's segments, or null when there is none: a native stream relays the service's own segments, and a capture stream
|
|
214
|
+
* has no segmenter until createCaptureSegmenter wires one. This is the single place the capture-identity narrow and the pipeline walk are written, so the several
|
|
215
|
+
* consumers that read segment indices, init segments, and session statistics all ask the same question the same way.
|
|
216
|
+
*
|
|
217
|
+
* An absent entry is accepted because callers routinely look the stream up and read its segmenter in one expression; a stream that is gone has no segmenter.
|
|
218
|
+
* @param entry - The stream registry entry to query, or undefined when the lookup found nothing.
|
|
219
|
+
* @returns The attached segmenter, or null.
|
|
220
|
+
*/
|
|
221
|
+
export function getStreamSegmenter(entry) {
|
|
222
|
+
if (entry?.identity.mode !== "capture") {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
return entry.identity.captureSession?.segmenter ?? null;
|
|
226
|
+
}
|
|
142
227
|
/**
|
|
143
228
|
* Returns whether the last segment contained video traf boxes. Used by the monitor to distinguish dead capture pipelines (audio-only, no video trafs) from legitimate
|
|
144
229
|
* small segments produced by static content (video trafs present but low-bitrate). Returns null if the segmenter does not exist or the video trackId is unknown.
|
|
@@ -146,7 +231,7 @@ export function getTotalSegmentMemory() {
|
|
|
146
231
|
* @returns True if video trafs were present, false if absent, null if unknown.
|
|
147
232
|
*/
|
|
148
233
|
export function getLastSegmentHasVideo(entry) {
|
|
149
|
-
return entry
|
|
234
|
+
return getStreamSegmenter(entry)?.getLastSegmentHasVideo() ?? null;
|
|
150
235
|
}
|
|
151
236
|
/**
|
|
152
237
|
* Gets the size in bytes of the last segment stored for a stream. Used by the monitor to detect dead capture pipelines that produce empty segments (18 bytes observed)
|
|
@@ -155,6 +240,6 @@ export function getLastSegmentHasVideo(entry) {
|
|
|
155
240
|
* @returns Segment size in bytes, or null if no segmenter exists.
|
|
156
241
|
*/
|
|
157
242
|
export function getLastSegmentSize(entry) {
|
|
158
|
-
return entry
|
|
243
|
+
return getStreamSegmenter(entry)?.getLastSegmentSize() ?? null;
|
|
159
244
|
}
|
|
160
245
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/streaming/registry.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/streaming/registry.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
import type { Browser, Frame, Page } from "puppeteer-core";
|
|
2
|
-
import { getCurrentBrowser,
|
|
2
|
+
import { acquireCaptureStream, emulateCaptureSurface, getBrowserInstance, getCaptureImpairment, getCurrentBrowser, installActivationHeal, noteBrowserCaptureImpaired, syncWindowVisibility } from "../browser/index.ts";
|
|
3
|
+
import type { CaptureStream } from "../browser/index.ts";
|
|
4
|
+
import { spawnFFmpeg } from "../utils/index.ts";
|
|
3
5
|
import type { ManifestInterceptionResult, ManifestInterceptorHandle } from "../browser/manifestInterceptor.ts";
|
|
4
6
|
import type { MonitorHandle, TabReplacementResult } from "./recovery.ts";
|
|
5
7
|
import type { Nullable, ResolvedChannel, ResolvedSiteProfile, TuneResult, UrlValidationResult } from "../types/index.ts";
|
|
6
8
|
import { initializePlayback } from "../browser/video.ts";
|
|
7
9
|
import type { CaptureSession } from "./captureSession.ts";
|
|
10
|
+
import type { Clock } from "homebridge-plugin-utils";
|
|
8
11
|
import type { InitializePlaybackOptions } from "../browser/video.ts";
|
|
9
12
|
import type { ProbeCacheIdentity } from "../native/probe.ts";
|
|
13
|
+
import { openSharedWindowTab } from "../browser/tabSelection.ts";
|
|
14
|
+
import { reaffirmCaptureSurface } from "../browser/cdp.ts";
|
|
10
15
|
import { startOverlayHandling } from "../browser/consent.ts";
|
|
11
16
|
export declare const STREAM_INIT_TIMEOUT_MESSAGE = "Stream initialization timed out.";
|
|
12
17
|
export declare const CAPTURE_PROBE_TIMEOUT_MESSAGE = "Capture probe timed out.";
|
|
18
|
+
/**
|
|
19
|
+
* Retires a raw capture stream: destroys it so the stop request goes out while the browser is still connected, then waits for the extension to confirm the
|
|
20
|
+
* recording stopped before the caller closes the page. This is the destroy-and-confirm core shared by the mid-life probe's success teardown and every path that
|
|
21
|
+
* must retire a capture stream produced after its caller had already abandoned the turn. It is the async sibling of captureSession.ts's disposer, which tears the
|
|
22
|
+
* composed FFmpeg pipeline down synchronously: this helper awaits the confirmation because a page close follows it directly, and unlike the composed disposer it
|
|
23
|
+
* is used on abandoned paths where the page may already be closed, so the stop side is then best-effort.
|
|
24
|
+
*
|
|
25
|
+
* It never throws. A confirmation that does not arrive inside the ceiling is warned about and then stepped past, because holding a page open for a browser that
|
|
26
|
+
* has stopped answering helps nobody.
|
|
27
|
+
* @param stream - The raw capture stream to retire.
|
|
28
|
+
* @param clock - Clock bounding the stop confirmation. Defaults to the system clock; tests inject a virtual clock.
|
|
29
|
+
*/
|
|
30
|
+
export declare function retireRawStream(stream: CaptureStream, clock?: Clock): Promise<void>;
|
|
13
31
|
/**
|
|
14
32
|
* Thrown by createPageWithCapture when an establishment that navigated to a resolved direct watch URL failed on evidence against that URL - the coordinator's own
|
|
15
33
|
* verdict, read from invalidateDirectUrl, never re-derived here. It says one thing to the caller: the hint has already been evicted, and a fresh attempt down the
|
|
@@ -56,7 +74,7 @@ export interface StreamSetupResult {
|
|
|
56
74
|
profile: ResolvedSiteProfile;
|
|
57
75
|
profileName: string;
|
|
58
76
|
serviceName: string;
|
|
59
|
-
startTime:
|
|
77
|
+
startTime: number;
|
|
60
78
|
monitor: MonitorHandle;
|
|
61
79
|
streamId: string;
|
|
62
80
|
url: string;
|
|
@@ -87,7 +105,6 @@ export declare function withSignInGuidance(userMessage: string, channelKey: Null
|
|
|
87
105
|
*/
|
|
88
106
|
export interface CreatePageWithCaptureOptions {
|
|
89
107
|
comment?: string;
|
|
90
|
-
numericStreamId: number;
|
|
91
108
|
onFFmpegError?: (error: Error) => void;
|
|
92
109
|
persistResolution?: (resolvedSelector: string) => Promise<void>;
|
|
93
110
|
profile: ResolvedSiteProfile;
|
|
@@ -97,6 +114,7 @@ export interface CreatePageWithCaptureOptions {
|
|
|
97
114
|
tabReplacement?: boolean;
|
|
98
115
|
url: string;
|
|
99
116
|
_pageClosedRetries?: number;
|
|
117
|
+
_refusalRetried?: boolean;
|
|
100
118
|
}
|
|
101
119
|
/**
|
|
102
120
|
* Result from creating a page with capture. Contains everything needed to create a segmenter and continue with stream setup.
|
|
@@ -124,9 +142,16 @@ export declare function generateStreamId(channelName: string | undefined, url: s
|
|
|
124
142
|
*/
|
|
125
143
|
export declare function validateStreamUrl(url: string | undefined): UrlValidationResult;
|
|
126
144
|
export interface CreatePageWithCaptureDeps {
|
|
145
|
+
readonly acquireCaptureStream: typeof acquireCaptureStream;
|
|
146
|
+
readonly awaitCaptureVerdict: (error: unknown) => Promise<Nullable<CaptureProbeOutcome>>;
|
|
147
|
+
readonly emulateCaptureSurface: typeof emulateCaptureSurface;
|
|
127
148
|
readonly getCurrentBrowser: typeof getCurrentBrowser;
|
|
128
|
-
readonly
|
|
149
|
+
readonly installActivationHeal: typeof installActivationHeal;
|
|
150
|
+
readonly openSharedWindowTab: typeof openSharedWindowTab;
|
|
151
|
+
readonly reaffirmCaptureSurface: typeof reaffirmCaptureSurface;
|
|
152
|
+
readonly spawnFFmpeg: typeof spawnFFmpeg;
|
|
129
153
|
readonly startOverlayHandling: typeof startOverlayHandling;
|
|
154
|
+
readonly syncWindowVisibility: typeof syncWindowVisibility;
|
|
130
155
|
}
|
|
131
156
|
/**
|
|
132
157
|
* Creates a browser page with media capture and navigates to the URL. This is the reusable core function used by both initial stream setup and tab replacement
|
|
@@ -135,6 +160,8 @@ export interface CreatePageWithCaptureDeps {
|
|
|
135
160
|
* - Initializing media capture (native fMP4 or Matroska+FFmpeg)
|
|
136
161
|
* - Navigating to the URL with retry
|
|
137
162
|
* - Setting up video playback via navigateToPage() + initializePlayback()
|
|
163
|
+
* - Re-entering itself once, on a fresh page through a freshly acquired browser, when Chrome refuses the capture start and the mid-life probe's verdict says a
|
|
164
|
+
* second attempt has something to start from
|
|
138
165
|
*
|
|
139
166
|
* The caller is responsible for:
|
|
140
167
|
* - Creating the segmenter and attaching it to the capture session via captureSession.attachSegmenter()
|
|
@@ -144,7 +171,7 @@ export interface CreatePageWithCaptureDeps {
|
|
|
144
171
|
*
|
|
145
172
|
* @param options - Options for page and capture creation.
|
|
146
173
|
* @param deps - The injected browser and overlay-poll collaborators; defaults to defaultCreatePageWithCaptureDeps. Threaded so a test drives this function without a
|
|
147
|
-
* live Chrome by substituting the shared-browser accessor, the capture
|
|
174
|
+
* live Chrome by substituting the shared-browser accessor, the capture acquisition, and the static-capture overlay poll.
|
|
148
175
|
* @returns The page, context, and capture session (which owns the raw capture stream and any FFmpeg child).
|
|
149
176
|
* @throws Error if page creation, capture initialization, or navigation fails.
|
|
150
177
|
*/
|
|
@@ -195,7 +222,7 @@ export interface EstablishChannelPlaybackOptions {
|
|
|
195
222
|
*/
|
|
196
223
|
export declare function establishChannelPlayback(page: Page, profile: ResolvedSiteProfile, handle: Nullable<ManifestInterceptorHandle>, options: EstablishChannelPlaybackOptions, deps?: EstablishChannelPlaybackDeps): Promise<TuneResult>;
|
|
197
224
|
/**
|
|
198
|
-
* Adjudicates what an establishment's interception selected: finalize it against the
|
|
225
|
+
* Adjudicates what an establishment's interception selected: finalize it against the accurate direct-tune kind, then confirm the manifest belongs to the channel
|
|
199
226
|
* the profile names. The tune path and the native refresh capability both run this, so finalize-then-verify is written exactly once.
|
|
200
227
|
*
|
|
201
228
|
* The stage hands on the interception promise rather than a resolved result, which is what keeps verifyManifestSelection's latency rule holding - its provider
|
|
@@ -235,39 +262,70 @@ export interface ReestablishChannelManifestOptions {
|
|
|
235
262
|
}
|
|
236
263
|
export declare function reestablishChannelManifest(options: ReestablishChannelManifestOptions): Promise<Nullable<ManifestInterceptionResult>>;
|
|
237
264
|
/**
|
|
238
|
-
* Verifies that a freshly-launched Chrome instance can actually capture, by running a real
|
|
239
|
-
* the browser launch gate: browser/index.ts injects it via setCaptureProbe and runs it inside launchReadyBrowser, so a browser is published as
|
|
240
|
-
* capture capability is verified - at boot AND at every relaunch, not just startup. It exercises the exact
|
|
241
|
-
* extension is unregistered, so a dead extension is detected immediately rather than causing every subsequent stream request to
|
|
265
|
+
* Verifies that a freshly-launched Chrome instance can actually capture, by running a real capture acquisition against a throwaway page on it. This is the
|
|
266
|
+
* capability tier of the browser launch gate: browser/index.ts injects it via setCaptureProbe and runs it inside launchReadyBrowser, so a browser is published as
|
|
267
|
+
* ready only after its capture capability is verified - at boot AND at every relaunch, not just startup. It exercises the exact acquisition path that fails when
|
|
268
|
+
* the capture extension is unregistered, so a dead extension is detected immediately rather than causing every subsequent stream request to fail.
|
|
242
269
|
*
|
|
243
|
-
* Each attempt creates a temporary page, attempts a short capture, and tears down both cleanly.
|
|
244
|
-
*
|
|
270
|
+
* Each attempt creates a temporary page, attempts a short capture, and tears down both cleanly. The teardown waits for the extension to confirm the recording
|
|
271
|
+
* stopped, bounded by a ceiling, before closing the page, so Chrome's tabCapture state is released rather than lingering into the first real request.
|
|
245
272
|
*
|
|
246
273
|
* After a system reboot or a fresh relaunch, Chrome's display stack or capture extension may not be ready immediately. The probe retries up to PROBE_MAX_ATTEMPTS
|
|
247
274
|
* times with a delay between attempts, giving the system time to settle before giving up. At boot this prevents a rapid restart storm where the service manager
|
|
248
275
|
* relaunches PrismCast repeatedly, each attempt orphaning a Chrome process; at relaunch it provides in-launch settling before the supervisor counts a launch failure.
|
|
249
|
-
*
|
|
250
|
-
* If stale capture state is detected, the process exits immediately - a Chrome restart cannot fix the leaked module-level mutex, only a fresh process can.
|
|
251
276
|
* @param browser - The Chrome instance to verify (the local instance being launched, passed in rather than re-acquired to avoid re-entering the launch in flight).
|
|
252
277
|
*/
|
|
253
278
|
export declare function verifyCaptureSystem(browser: Browser): Promise<void>;
|
|
254
279
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* demonstrably capturing (so this failure is stream-specific - never invalidate) or those streams will trip their own circuit breakers and drain, after which a
|
|
258
|
-
* later failure reaches the zero-other case. An empty registry (setup failed before the stream was registered) satisfies the isolation check vacuously and is the
|
|
259
|
-
* common real-world shape of this failure.
|
|
260
|
-
* @param inputs - The decision inputs.
|
|
261
|
-
* @param inputs.activeStreamIds - The ids of every stream currently in the registry.
|
|
262
|
-
* @param inputs.failingStreamId - The id of the stream whose setup just failed, excluded from the isolation check.
|
|
263
|
-
* @param inputs.hasBrowser - Whether a browser instance is currently published to probe.
|
|
264
|
-
* @param inputs.reverificationInProgress - Whether a re-verification is already deciding the browser's fate.
|
|
265
|
-
* @returns True when the failure should trigger a re-verification probe.
|
|
280
|
+
* What one mid-life capture probe established about the browser. A `captured` outcome is the browser proving it can still start a capture; `failed` is the verdict
|
|
281
|
+
* the mark rests on; `inconclusive` is the probe never having run, which is evidence of neither.
|
|
266
282
|
*/
|
|
267
|
-
export
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
283
|
+
export type CaptureProbeOutcome = {
|
|
284
|
+
readonly kind: "captured";
|
|
285
|
+
} | {
|
|
286
|
+
readonly kind: "failed";
|
|
287
|
+
readonly reason: string;
|
|
288
|
+
} | {
|
|
289
|
+
readonly kind: "inconclusive";
|
|
290
|
+
readonly reason: string;
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Classifies a throw from the probe's run on the capture lock into a verdict or the absence of one. A turn-wait timeout means the probe never got to run: with
|
|
294
|
+
* other streams tuning at the same moment it queued behind their legitimate acquisitions, and a lock that is busy says something about load, not about the browser
|
|
295
|
+
* - a holder that is genuinely hung marks the browser through its own wedge. Every other value, the outer deadline above all, means the probe held its turn and its
|
|
296
|
+
* own acquisition did not settle, which is exactly the failure the mark exists for. Pure and total, so the distinction the detector rests on is pinnable without a
|
|
297
|
+
* browser.
|
|
298
|
+
* @param error - The value the lock run threw.
|
|
299
|
+
* @returns The outcome the detector acts on.
|
|
300
|
+
*/
|
|
301
|
+
export declare function classifyCaptureProbeFailure(error: unknown): CaptureProbeOutcome;
|
|
302
|
+
/**
|
|
303
|
+
* The collaborators the verdict is reached through: the published-browser read, the mark already recorded against it, the mark this verdict may record, and the
|
|
304
|
+
* probe that decides. Injected as a default parameter in the shape CreatePageWithCaptureDeps uses, so a test drives the one shared slot and the awaited mark
|
|
305
|
+
* without a capture lock, a browser, or a Chrome behind them.
|
|
306
|
+
*/
|
|
307
|
+
export interface CaptureVerdictDeps {
|
|
308
|
+
readonly getBrowserInstance: typeof getBrowserInstance;
|
|
309
|
+
readonly getCaptureImpairment: typeof getCaptureImpairment;
|
|
310
|
+
readonly noteBrowserCaptureImpaired: typeof noteBrowserCaptureImpaired;
|
|
311
|
+
readonly probe: (browser: Browser) => Promise<CaptureProbeOutcome>;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Passive mid-life capture-death detection, called from the stream-setup failure path when the failure carries a capture-infrastructure signature. It re-verifies
|
|
315
|
+
* the browser's capture capability with a lock-serialized probe and, on a confirmed failure, marks the browser: its running captures continue, new capture starts
|
|
316
|
+
* are refused at acquire(), and the adapter relaunches it once nothing depends on it. Any refused start is worth a probe - a browser that is demonstrably
|
|
317
|
+
* capturing for someone else can still be unable to start another - while a browser that already carries a mark needs no second verdict, so the reason on record
|
|
318
|
+
* is handed back instead.
|
|
319
|
+
*
|
|
320
|
+
* The returned promise settles only once everything the verdict set in motion has settled, the relaunch a `failed` outcome triggers included. That is the whole
|
|
321
|
+
* reason a caller can act on it: a tune that re-acquired the browser the instant the mark landed would meet the retiring instance's drain, where acquire() rejects
|
|
322
|
+
* rather than joins, while one that waits for this promise meets the fresh browser or a refusal that means what it says. The promise never rejects; the absence of
|
|
323
|
+
* a verdict is a null rather than a throw.
|
|
324
|
+
*
|
|
325
|
+
* It is deliberately not async: every caller in a burst has to hand back the SAME promise object, because what they are waiting on is the browser's one verdict
|
|
326
|
+
* rather than their own call's. An async wrapper would give each caller a distinct promise that merely adopts it, and the shared identity the single-flight slot
|
|
327
|
+
* exists to provide would stop being observable at this boundary.
|
|
328
|
+
* @param deps - The injected collaborators; defaults to the production ones.
|
|
329
|
+
* @returns The verdict, or null when no browser is published to reach one about.
|
|
330
|
+
*/
|
|
331
|
+
export declare function noteCaptureInfrastructureFailure(deps?: CaptureVerdictDeps): Promise<Nullable<CaptureProbeOutcome>>;
|