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
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
*
|
|
3
3
|
* hlsPlaylistObserver.ts: HLS-aware observer layered on top of the tab-wide network observer.
|
|
4
4
|
*/
|
|
5
|
-
import { LOG, chromeFetch } from "../utils/index.js";
|
|
5
|
+
import { LOG, chromeFetch, timeoutSignal } from "../utils/index.js";
|
|
6
6
|
import { classifyHlsPlaylist, extractChildPlaylistUrls, isLiveMediaPlaylist } from "../native/probe.js";
|
|
7
7
|
import { observeTabResponses } from "./tabNetworkObserver.js";
|
|
8
|
+
import { systemClock } from "homebridge-plugin-utils";
|
|
8
9
|
/* This module is the HLS-aware layer on top of tabNetworkObserver. Its job is to deliver every recognized HLS playlist (URL + kind) observed anywhere in the tab
|
|
9
10
|
* to a single callback. It encapsulates:
|
|
10
11
|
*
|
|
@@ -37,15 +38,15 @@ const MANIFEST_BODY_FETCH_TIMEOUT = 5000;
|
|
|
37
38
|
* Returns null when the underlying tab network observer could not be installed (page closed, root CDP session creation failed).
|
|
38
39
|
*
|
|
39
40
|
* @param page - The puppeteer page to observe.
|
|
40
|
-
* @param options - Observer options
|
|
41
|
+
* @param options - Observer options: the playlist callback, the debug log category, and the clock the body fetch's bound arms on.
|
|
41
42
|
* @returns The observer handle, or null if installation failed.
|
|
42
43
|
*/
|
|
43
44
|
export async function observeHlsPlaylists(page, options) {
|
|
44
|
-
const { logCategory, onPlaylist } = options;
|
|
45
|
+
const { clock = systemClock, logCategory, onPlaylist } = options;
|
|
45
46
|
let disposed = false;
|
|
46
47
|
// Wire-arrival sequence counter. Each eligible unique URL is assigned the next ordinal synchronously at the dedup gate - before its body fetch begins - so the
|
|
47
48
|
// ordinal reflects the order responses arrived on the wire rather than the order their independent, racing body fetches happen to resolve. Sequences start at 1,
|
|
48
|
-
// so a currentSequence() of 0 means nothing has been observed yet and an epoch fenced at 0 reads every later observation as post-epoch. The
|
|
49
|
+
// so a currentSequence() of 0 means nothing has been observed yet and an epoch fenced at 0 reads every later observation as post-epoch. The bound: the
|
|
49
50
|
// ordinal reflects CDP-event arrival order at the client, and Chrome does not guarantee cross-session event ordering for OOPIF targets, so the fence approximates
|
|
50
51
|
// wire order within event-delivery latency - a residual window of milliseconds, in place of the seconds-wide body-fetch race a delivery-time ordering would carry.
|
|
51
52
|
let sequenceCounter = 0;
|
|
@@ -72,11 +73,12 @@ export async function observeHlsPlaylists(page, options) {
|
|
|
72
73
|
}
|
|
73
74
|
seenUrls.add(url);
|
|
74
75
|
// Assign the wire-arrival ordinal synchronously, immediately past the dedup gate and before the first await, so it reflects the order this response arrived
|
|
75
|
-
// rather than the order its body fetch resolves against every other in-flight fetch. The local
|
|
76
|
+
// rather than the order its body fetch resolves against every other in-flight fetch. The local is carried across the fetch and is delivered on the observation.
|
|
76
77
|
const sequence = ++sequenceCounter;
|
|
77
78
|
LOG.debug(logCategory, "Observed .m3u8 response (seq %s): %s.", sequence, url.slice(0, 120));
|
|
79
|
+
const bound = timeoutSignal(MANIFEST_BODY_FETCH_TIMEOUT, { clock });
|
|
78
80
|
try {
|
|
79
|
-
const response = await chromeFetch(url, { signal:
|
|
81
|
+
const response = await chromeFetch(url, { signal: bound.signal });
|
|
80
82
|
if (!response.ok) {
|
|
81
83
|
LOG.debug(logCategory, "Manifest fetch returned HTTP %s for %s.", response.status, url.slice(0, 120));
|
|
82
84
|
return;
|
|
@@ -108,6 +110,9 @@ export async function observeHlsPlaylists(page, options) {
|
|
|
108
110
|
catch (error) {
|
|
109
111
|
LOG.debug(logCategory, "Could not fetch .m3u8 body: %s.", String(error));
|
|
110
112
|
}
|
|
113
|
+
finally {
|
|
114
|
+
bound.cancel();
|
|
115
|
+
}
|
|
111
116
|
};
|
|
112
117
|
const tabObserver = await observeTabResponses(page, {
|
|
113
118
|
onResponse: (response) => { void handleResponse(response.url); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hlsPlaylistObserver.js","sourceRoot":"","sources":["../../src/browser/hlsPlaylistObserver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"hlsPlaylistObserver.js","sourceRoot":"","sources":["../../src/browser/hlsPlaylistObserver.ts"],"names":[],"mappings":"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"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import type { Browser, LaunchOptions, Page } from "puppeteer-core";
|
|
2
|
+
import type { BrowserPurpose, CaptureImpairment } from "./browserSupervisor.ts";
|
|
2
3
|
import { clearLoginState, isLoginModeActive } from "./login.ts";
|
|
3
|
-
import {
|
|
4
|
+
import { getAllStreams } from "../streaming/registry.ts";
|
|
5
|
+
import { getCachedTabId } from "./tabSelection.ts";
|
|
6
|
+
import type { Clock } from "homebridge-plugin-utils";
|
|
4
7
|
import type { Nullable } from "../types/index.ts";
|
|
5
8
|
import type { ProcessInfo } from "../utils/index.ts";
|
|
9
|
+
import type { WindowPlacement } from "./cdp.ts";
|
|
6
10
|
type CaptureProbe = (browser: Browser) => Promise<void>;
|
|
7
11
|
/**
|
|
8
12
|
* Injects the capture-readiness probe used as the capability tier of the launch gate. Called once from streaming/setup.ts at module load (which always precedes any
|
|
9
13
|
* launch, since the streaming layer is imported during server startup). Separating the wiring from the call keeps browser/index.ts free of a streaming-layer import.
|
|
10
|
-
* @param probe - The probe to run against a freshly-launched browser; it resolves when the browser can capture and rejects
|
|
11
|
-
* unrecoverable stale-mutex case).
|
|
14
|
+
* @param probe - The probe to run against a freshly-launched browser; it resolves when the browser can capture and rejects when it cannot.
|
|
12
15
|
*/
|
|
13
16
|
export declare function setCaptureProbe(probe: CaptureProbe): void;
|
|
17
|
+
type StreamTerminator = (streamId: number, channelName: string, reason: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Injects the authoritative stream terminator used when browser readiness is lost. Called once from streaming/lifecycle.ts at module load. Separating the wiring
|
|
20
|
+
* from the call keeps browser/index.ts free of a streaming-layer import.
|
|
21
|
+
* @param terminator - The function that tears down one stream and all of the resources it owns.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setStreamTerminator(terminator: StreamTerminator): void;
|
|
24
|
+
export type BrowserRestartCause = "impairment" | "maintenance";
|
|
14
25
|
/**
|
|
15
26
|
* Returns true if graceful shutdown is in progress.
|
|
16
27
|
*/
|
|
@@ -19,10 +30,63 @@ export declare function isGracefulShutdown(): boolean;
|
|
|
19
30
|
* Sets the graceful shutdown flag. Call this at the start of shutdown, before terminating streams, so that page close errors are suppressed.
|
|
20
31
|
*/
|
|
21
32
|
export declare function setGracefulShutdown(value: boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Reports whether a page may carry a CDP command aimed at the shared window: it exists, it is still open, and it does not live in a window of its own. The
|
|
35
|
+
* parameter accepts the absent case so every caller narrows through this one test rather than guarding beside it.
|
|
36
|
+
* @param page - The candidate page, which may be absent.
|
|
37
|
+
* @returns True when the page can carry a shared-window command.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isCarrierPage(page: Nullable<Page>): page is Page;
|
|
40
|
+
/**
|
|
41
|
+
* Picks the page a shared-window command should travel on from the pages a browser has open, taking the first that qualifies.
|
|
42
|
+
* @param pages - The candidate pages, in the order the browser reports them.
|
|
43
|
+
* @returns The page to carry the command, or null when none of them qualifies.
|
|
44
|
+
*/
|
|
45
|
+
export declare function pickCarrierPage(pages: readonly Page[]): Nullable<Page>;
|
|
46
|
+
/**
|
|
47
|
+
* Records which window the shared one is, reading it from a page that sits in it.
|
|
48
|
+
*
|
|
49
|
+
* This is the one way an identity is written. The launch path calls it once the launch-era pages exist, so every browser this process publishes carries the
|
|
50
|
+
* answer before anything asks for a capture tab, and a probe running against a browser of its own calls the same function rather than reaching for the map.
|
|
51
|
+
* @param browser - The browser whose shared window is being recorded.
|
|
52
|
+
* @param page - A page that sits in that window.
|
|
53
|
+
*/
|
|
54
|
+
export declare function noteSharedWindow(browser: Browser, page: Page): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Picks the page an opener-anchored tab should be opened from: one the browser has open, living in the shared window rather than a window of its own, and
|
|
57
|
+
* confirmed to sit in the window this process recorded.
|
|
58
|
+
*
|
|
59
|
+
* A plain-origin page is preferred over the capture extension's own options page, which is the carrier of last resort. The options page is recognized by the URL
|
|
60
|
+
* prefix its own pages carry rather than through the library's resolver, whose wait for a missing extension would spend thirty seconds inside a caller's turn.
|
|
61
|
+
* When no identity was ever recorded the confirmation has nothing to test against, and the first qualifying page is the answer: an anchor to some window of the
|
|
62
|
+
* browser's is still better than letting Chrome choose one.
|
|
63
|
+
* @param browser - The browser to resolve a carrier in.
|
|
64
|
+
* @returns The page to evaluate the open on, or null when none of the browser's pages qualifies.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveSharedWindowCarrier(browser: Browser): Promise<Nullable<Page>>;
|
|
67
|
+
/**
|
|
68
|
+
* Reports whether a page ended up in the shared window.
|
|
69
|
+
*
|
|
70
|
+
* Advisory when no identity was ever recorded: there is nothing to contradict the placement with, so the answer is true and the caller proceeds. A window that
|
|
71
|
+
* cannot be READ is the opposite answer, though, and deliberately so - the shared lookup reports undefined for a closed page, an empty response, and a CDP
|
|
72
|
+
* failure alike, and reading any of those as a confirmation would confirm a wrong-window tab in exactly the case this check exists for.
|
|
73
|
+
* @param page - The page to test.
|
|
74
|
+
* @returns True when the page sits in the recorded window, or when no window was ever recorded.
|
|
75
|
+
*/
|
|
76
|
+
export declare function confirmSharedWindowPlacement(page: Page): Promise<boolean>;
|
|
22
77
|
export { clearLoginState, isLoginModeActive };
|
|
23
78
|
export type { LoginStatus } from "./login.ts";
|
|
24
79
|
export { endLoginMode, getLoginPage, getLoginStatus, setLoginModeEndObserver, startLoginMode } from "./login.ts";
|
|
25
|
-
export { BrowserSupersededError, BrowserUnavailableError } from "./browserSupervisor.ts";
|
|
80
|
+
export { BrowserCaptureImpairedError, BrowserSupersededError, BrowserUnavailableError } from "./browserSupervisor.ts";
|
|
81
|
+
export type { BrowserPurpose, CaptureImpairment } from "./browserSupervisor.ts";
|
|
82
|
+
/**
|
|
83
|
+
* Brings the shared browser window into agreement with the visibility policy. This is the one entry point every layer uses - streaming, recovery, login,
|
|
84
|
+
* precaching, and startup all call it and none of them decide window state themselves.
|
|
85
|
+
* @param page - The page whose CDP session should carry the command, when the caller has one in hand. The executor falls back to any open page, or a temporary
|
|
86
|
+
* one, when it is omitted or the page has closed.
|
|
87
|
+
* @returns A promise that resolves once a pass that began at or after this call has completed.
|
|
88
|
+
*/
|
|
89
|
+
export declare function syncWindowVisibility(page?: Page): Promise<void>;
|
|
26
90
|
/**
|
|
27
91
|
* Computes the current system status and emits it to SSE subscribers. Called when browser state changes significantly or when streams are added/removed.
|
|
28
92
|
*/
|
|
@@ -34,11 +98,12 @@ export declare function emitCurrentSystemStatus(): Promise<void>;
|
|
|
34
98
|
* Each registered page receives a unique ID that persists for the page's lifetime. This ID is used for comparison and staleness tracking, avoiding potential
|
|
35
99
|
* issues with Page object reference identity.
|
|
36
100
|
* @param page - The Puppeteer Page to register.
|
|
37
|
-
* @param options - Registration options. Set
|
|
38
|
-
*
|
|
101
|
+
* @param options - Registration options. Set inFlight when an operation owns the page for its duration but nothing the stale page cleanup reads records that
|
|
102
|
+
* ownership - a stream setup that has not yet written its page into the registry, or a discovery walk whose page belongs to no stream at all - so the cleanup
|
|
103
|
+
* never closes a page out from under the operation driving it.
|
|
39
104
|
*/
|
|
40
105
|
export declare function registerManagedPage(page: Page, options?: {
|
|
41
|
-
|
|
106
|
+
inFlight?: boolean;
|
|
42
107
|
}): void;
|
|
43
108
|
/**
|
|
44
109
|
* Unregisters a page from PrismCast's management. This should be called when a page is being closed intentionally (during stream cleanup). Unregistering prevents the
|
|
@@ -118,51 +183,160 @@ export declare function getExecutablePath(): string;
|
|
|
118
183
|
* - Pipe mode provides a faster, more reliable connection than WebSocket
|
|
119
184
|
* @returns Puppeteer launch options.
|
|
120
185
|
*/
|
|
121
|
-
export declare function buildLaunchOptions(): LaunchOptions
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* the
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
windowState?: string;
|
|
135
|
-
} | undefined, captureSurface: {
|
|
186
|
+
export declare function buildLaunchOptions(): LaunchOptions & {
|
|
187
|
+
defaultViewport: null;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Emulates the capture surface on a page that is about to be captured: the configured quality preset's dimensions, declared at the pixel density the display
|
|
191
|
+
* actually has. Chrome composes an active tab's capture from the window presentation unless the page's device-metrics override declares a density explicitly
|
|
192
|
+
* and that density matches the display's real one, so the density is read from the page itself - a page carrying no declared density reports the display's own -
|
|
193
|
+
* and declared back before capture acquires the page. The declared dimensions are returned so the caller holds its capture constraints to the surface that was
|
|
194
|
+
* emulated rather than reading the preset a second time.
|
|
195
|
+
* @param page - The page to emulate the capture surface on.
|
|
196
|
+
* @returns The dimensions declared on the page.
|
|
197
|
+
*/
|
|
198
|
+
export declare function emulateCaptureSurface(page: Page): Promise<{
|
|
136
199
|
height: number;
|
|
137
200
|
width: number;
|
|
138
|
-
}
|
|
201
|
+
}>;
|
|
202
|
+
/**
|
|
203
|
+
* Emulates the layout surface on a page that is laid out but never captured: the configured quality preset's dimensions at the display's own density. The guide
|
|
204
|
+
* walks were written against that layout and the launch-gate capture probe acquires against it, so declaring it is what keeps both on the surface they were
|
|
205
|
+
* validated on. The density stays the display's, because nothing reads this page's pixels.
|
|
206
|
+
* @param page - The page to emulate the layout surface on.
|
|
207
|
+
* @returns The dimensions declared on the page.
|
|
208
|
+
*/
|
|
209
|
+
export declare function emulateLayoutSurface(page: Page): Promise<{
|
|
139
210
|
height: number;
|
|
140
211
|
width: number;
|
|
141
212
|
}>;
|
|
142
213
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
214
|
+
* Derives the creation bounds for a window that should open exactly where an existing window rests. The four numbers always travel, so the new window lands on
|
|
215
|
+
* the same frame. The state travels only when it is "maximized", because that is the one state Chrome saves alongside the frame and a maximized window mirrored
|
|
216
|
+
* as a normal one would drop it. Every other state is left off deliberately: a fullscreen window's frame is its whole screen and a normal window at that frame
|
|
217
|
+
* is the right stand-in for it, and a minimized window reports the frame it will return to, which is a placement worth inheriting without the minimization.
|
|
218
|
+
* @param placement - The placement of the window to mirror.
|
|
219
|
+
* @returns The bounds to create the new window with.
|
|
220
|
+
*/
|
|
221
|
+
export declare function mirrorPlacement(placement: WindowPlacement): {
|
|
222
|
+
height: number;
|
|
223
|
+
left: number;
|
|
224
|
+
top: number;
|
|
225
|
+
width: number;
|
|
226
|
+
windowState?: "maximized";
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Opens a page for a channel guide discovery walk in a browser window of its own, and marks it as belonging to that window.
|
|
230
|
+
*
|
|
231
|
+
* A document renders only while Chrome presents it: the active tab of a window the desktop is showing, or a page Chrome counts as captured. The shared window
|
|
232
|
+
* rests minimized whenever nothing is capturing and no sign-in holds it on screen, with its selected tab belonging to the user. A guide walk needs its page to
|
|
233
|
+
* render - an observer-driven channel rail fills its tiles from rendering updates, a virtualized grid re-renders as the walk scrolls it, and every wait the walk
|
|
234
|
+
* makes polls on the page's animation frames - yet it is never captured, so it has no claim on the shared window's presentation and no business moving the
|
|
235
|
+
* user's selection. A window of its own resolves the tab half: the page is that window's active tab from the moment it exists. The window is created in the
|
|
236
|
+
* background, so Chrome shows it inactive and moves no focus (measured 2026-08-31), and such a window's document is one Chrome does not present on its own: it
|
|
237
|
+
* reports itself hidden and unfocused and delivers no animation frame beyond a document load's first ones (measured 2026-09-13). Focus emulation resolves the
|
|
238
|
+
* presentation half, for the page's whole life - Puppeteer's own emulateFocusedPage carries the mechanism, on the page's own session.
|
|
239
|
+
*
|
|
240
|
+
* The window opens at the shared window's own placement, so the window placement Chrome persists for the profile never changes - readWindowPlacement carries
|
|
241
|
+
* the reasoning. The caller declares the layout surface on the page and owns its registration, and closing the page closes the window with it.
|
|
242
|
+
* @param browser - The browser to open the window in.
|
|
243
|
+
* @returns The page, as the active tab of its own window.
|
|
244
|
+
*/
|
|
245
|
+
export declare function createDiscoveryPage(browser: Browser): Promise<Page>;
|
|
246
|
+
/**
|
|
247
|
+
* Builds the callback the page's focus binding invokes: an immediate re-issue, then a ladder of follow-ups at ACTIVATION_REAFFIRM_LADDER_MS's offsets from this
|
|
248
|
+
* invocation. The ladder is what makes the heal land, because the compositor's switch outlasts the focus event announcing it - the immediate shot alone cannot
|
|
249
|
+
* reach the far side of the switch, so later shots have to.
|
|
148
250
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
251
|
+
* Invocations supersede rather than accumulate. A generation counter makes the newest invocation the owner of the rung schedule: the duplicate focus events a
|
|
252
|
+
* single activation fires collapse into one schedule a few milliseconds newer than the first, while an activation that genuinely arrives later - a second
|
|
253
|
+
* stream's tab give-back landing on this page, another click - gets a full bracket timed from its own moment instead of inheriting the tail of an in-flight one.
|
|
254
|
+
* The counter lives in this closure, so a callback supersedes only the ladders it started itself and two streams' pages cannot reach each other's schedules.
|
|
255
|
+
*
|
|
256
|
+
* Nothing cancels a superseded ladder, because nothing has to: it returns at its next generation check, a shot against a page mid-teardown rejects into the
|
|
257
|
+
* swallow below, and a shot that never settles leaves its ladder awaiting a promise nobody holds. The counter needs no reset for the same reason - a newer
|
|
258
|
+
* invocation is itself the invalidation - and the schedule holds no timers, only awaited sleeps.
|
|
259
|
+
*
|
|
260
|
+
* A rejection is swallowed into a debug line because a focus event races page teardown by nature - the tab a user just selected can be the one a terminating
|
|
261
|
+
* stream is closing - and the periodic re-affirmation corrects anything a lost re-issue leaves behind.
|
|
262
|
+
* @param page - The capture page this callback re-affirms.
|
|
263
|
+
* @param reaffirm - The re-issue to invoke. A parameter rather than a direct call so the callback's behavior can be driven on its own: what it does with the page
|
|
264
|
+
* it was built for, what schedule it keeps, and what it does with a rejection, is the whole of its contract.
|
|
265
|
+
* @param clock - The time source the ladder's waits run on. Defaults to the system clock.
|
|
266
|
+
* @returns The callback, which never rejects. Its promise settles once the ladder is spent, which the page-side listener does not wait on.
|
|
267
|
+
*/
|
|
268
|
+
export declare function makeFocusReaffirmCallback(page: Page, reaffirm: (page: Page) => Promise<void>, clock?: Clock): () => Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* The collaborators a page's heal is built from: the time source its ladder's waits run on, and the re-issue each of its shots performs. Injected as a default
|
|
271
|
+
* parameter in the shape CreatePageWithCaptureDeps, TabCaptureDeps, FullscreenDeps, and PrecachingDeps already use, so a test drives the enrolled callback through
|
|
272
|
+
* the install point itself rather than around it. The port holds no state, and production call sites pass nothing.
|
|
273
|
+
*/
|
|
274
|
+
export interface ActivationHealDeps {
|
|
275
|
+
readonly clock: Clock;
|
|
276
|
+
readonly reaffirm: (page: Page) => Promise<void>;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Installs the tab-activation heal on a capture page. Chrome composes the capture of a selected tab from the window's fitted presentation, so the instant a
|
|
280
|
+
* capture tab becomes the selected one that capture starts recording a clipped view of itself; the re-issue ladder this installs moves the composition back to
|
|
281
|
+
* the emulated surface about a second later.
|
|
282
|
+
*
|
|
283
|
+
* The heal has two triggers and one ladder between them. The exposed binding is fired by a focus listener inside the page, which covers the activation that
|
|
284
|
+
* arrives with a user's click focusing the browser window. The enrollment in activationHeals is fired by the selection primitive's activation report, which
|
|
285
|
+
* covers every activation PrismCast performs for itself - the give-back returning a user to a capture tab, the selection step, a re-assert - and a captured page
|
|
286
|
+
* hears none of those: capture holds it visible and the extension's update moves no operating-system focus, so no page event fires at all (measured 2026-08-30).
|
|
287
|
+
* Both triggers hold the same callback instance, which is what lets them share its generation counter instead of running two schedules against one page.
|
|
288
|
+
*
|
|
289
|
+
* The listener is registered through evaluateOnNewDocument so it survives the page's navigations, exactly as the shared video-selector helper does, and the
|
|
290
|
+
* binding survives them on Puppeteer's own terms.
|
|
291
|
+
* @param page - The capture page to install the heal on.
|
|
292
|
+
* @param deps - The clock and the re-issue the ladder runs on. Defaults to the production pair.
|
|
293
|
+
*/
|
|
294
|
+
export declare function installActivationHeal(page: Page, deps?: ActivationHealDeps): Promise<void>;
|
|
295
|
+
/**
|
|
296
|
+
* Heals the capture page showing in a tab the selection primitive has just activated.
|
|
297
|
+
*
|
|
298
|
+
* The report names a tab and what needs healing is a page, so the match walks the registry for a capture-mode stream whose page was identified as that tab. A
|
|
299
|
+
* report matching nothing is the ordinary case rather than a failure - a give-back returning the selection to the user's own tab, a native stream that composes
|
|
300
|
+
* no capture at all, a page registered before its setup reached the install point - and every one of them is a quiet no-op.
|
|
301
|
+
* @param tabId - The tab the selection primitive activated.
|
|
302
|
+
* @param deps - The registry read and the page-to-tab lookup the match runs through. Defaults to the production pair.
|
|
303
|
+
*/
|
|
304
|
+
export declare function healActivatedCaptureTab(tabId: number, deps?: {
|
|
305
|
+
readonly getAllStreams: typeof getAllStreams;
|
|
306
|
+
readonly getCachedTabId: typeof getCachedTabId;
|
|
307
|
+
}): void;
|
|
308
|
+
/**
|
|
309
|
+
* Records that a still-connected browser can no longer start captures - a mid-life capture death that no "disconnected" event would surface - and runs the
|
|
310
|
+
* relaunch that cures it. This is the single recovery action for a browser that is alive and still serving: the mark lives on the supervisor's ready state, so its
|
|
311
|
+
* running captures continue untouched, new stream requests are refused at acquire() with a 503 back-off, the recovery ladder stops offering tab replacement, and
|
|
312
|
+
* the relaunch waits until nothing depends on the browser. Exported for the streaming layer to call once its probe or its wedge has produced the verdict.
|
|
313
|
+
*
|
|
314
|
+
* The returned promise settles once the relaunch this mark triggered has settled, which is what a caller that means to use the fresh browser awaits: the teardown
|
|
315
|
+
* holds the supervisor in its draining state, where acquire() rejects rather than joins, so acquiring any earlier draws that rejection instead of the new
|
|
316
|
+
* instance. A caller with nothing waiting on the outcome voids it and the relaunch proceeds on its own.
|
|
317
|
+
*
|
|
318
|
+
* The restart trigger uses this function's return value rather than the supervisor's transition observer, deliberately. The observer runs inside transition(), so a
|
|
319
|
+
* restart begun there would call noteReadinessLost re-entrantly while the marking transition's notification is still on the stack. The observer stays a reporter -
|
|
320
|
+
* the alarm and the status emit - and the caller that holds the verdict acts on it once the transition has completed.
|
|
321
|
+
* @param browser - The specific browser instance the caller verified as unable to start captures.
|
|
322
|
+
* @param reason - A short description of the evidence behind the verdict, carried in the alarm log and the impairment record.
|
|
323
|
+
* @returns A promise settling once the relaunch this mark triggered has settled, or at once when the verdict landed on nothing.
|
|
154
324
|
*/
|
|
155
|
-
export declare function
|
|
325
|
+
export declare function noteBrowserCaptureImpaired(browser: Browser, reason: string): Promise<void>;
|
|
156
326
|
/**
|
|
157
327
|
* Provides access to the capture-ready browser, launching one if needed. This is the single gated entry point for all browser access: it delegates to the
|
|
158
328
|
* supervisor's acquire(), which returns the ready browser, joins an in-flight launch (single-flight, so concurrent callers never contend on Chrome's profile lock),
|
|
159
329
|
* lazily launches when absent, or - while the relaunch governor is cooling after repeated failures - rejects fast with a BrowserUnavailableError WITHOUT spawning
|
|
160
330
|
* Chrome (the loop bound). The launch it drives runs the readiness gate, so a returned browser is verified capture-ready, not merely connected.
|
|
331
|
+
*
|
|
332
|
+
* The purpose is what the caller intends to do with the browser, and it is the gate on a marked one: a "capture" caller is refused, because that is precisely the
|
|
333
|
+
* operation the browser can no longer perform, while a "page" caller - precaching, the startup warm-up, the relaunch itself - is served as usual.
|
|
334
|
+
* @param purpose - Whether the caller goes on to start a capture or only needs a page to open.
|
|
161
335
|
* @returns The capture-ready browser instance.
|
|
162
|
-
* @throws BrowserUnavailableError while the governor is cooling,
|
|
163
|
-
* launch error when a launch attempt fails.
|
|
336
|
+
* @throws BrowserUnavailableError while the governor is cooling, BrowserCaptureImpairedError when a capture purpose meets a browser that can no longer start
|
|
337
|
+
* captures, BrowserSupersededError if an in-flight launch was abandoned by a readiness-loss, or the underlying launch error when a launch attempt fails.
|
|
164
338
|
*/
|
|
165
|
-
export declare function getCurrentBrowser(): Promise<Browser>;
|
|
339
|
+
export declare function getCurrentBrowser(purpose: BrowserPurpose): Promise<Browser>;
|
|
166
340
|
/**
|
|
167
341
|
* Returns the Chrome version string captured when the browser launched, or null if the browser is not connected.
|
|
168
342
|
* @returns The Chrome version string (e.g., "Chrome/144.0.7559.110") or null.
|
|
@@ -174,19 +348,18 @@ export declare function getChromeVersion(): Nullable<string>;
|
|
|
174
348
|
* @returns The browser instance, or null if not running.
|
|
175
349
|
*/
|
|
176
350
|
export declare function getBrowserInstance(): Nullable<Browser>;
|
|
351
|
+
/**
|
|
352
|
+
* Returns the impairment recorded on the published browser, or null when nothing is published or the published browser can still start captures. Like
|
|
353
|
+
* getBrowserInstance this does not launch, so callers that only need to know whether captures can be started - the recovery ladder, the status composition, the
|
|
354
|
+
* health endpoint - read it without touching the lifecycle.
|
|
355
|
+
* @returns The impairment record, or null.
|
|
356
|
+
*/
|
|
357
|
+
export declare function getCaptureImpairment(): Nullable<CaptureImpairment>;
|
|
177
358
|
/**
|
|
178
359
|
* Checks if the browser is currently connected and usable. This is a synchronous check that can be used before attempting browser operations.
|
|
179
360
|
* @returns True if the browser is connected and ready for use, false otherwise.
|
|
180
361
|
*/
|
|
181
362
|
export declare function isBrowserConnected(): boolean;
|
|
182
|
-
/**
|
|
183
|
-
* Minimizes the browser window. The window's presentation state is all this touches - the surface pages render at is emulated from the configured preset and is
|
|
184
|
-
* unaffected by whether the window is on screen.
|
|
185
|
-
*
|
|
186
|
-
* To avoid issues with creating temporary pages (which can cause the window to restore on macOS), we prefer using an existing page if one is available. Only if
|
|
187
|
-
* no pages exist do we create a temporary page.
|
|
188
|
-
*/
|
|
189
|
-
export declare function minimizeBrowserWindow(): Promise<void>;
|
|
190
363
|
/**
|
|
191
364
|
* Gets all open browser pages (tabs). This is used by the health check endpoint to report page count.
|
|
192
365
|
* @returns Array of pages, or empty array if the browser is not connected.
|
|
@@ -204,29 +377,70 @@ export declare function closeBrowser(): Promise<void>;
|
|
|
204
377
|
*
|
|
205
378
|
* The cleanup uses a multi-stage filtering process:
|
|
206
379
|
* 1. Only consider pages we created (in managedPageIds)
|
|
207
|
-
* 2. Exclude pages associated with active streams, and pages
|
|
380
|
+
* 2. Exclude pages associated with active streams, and pages an operation still holds in flight
|
|
208
381
|
* 3. Apply a grace period before closing (to handle race conditions)
|
|
209
382
|
* 4. Preserve at least one page to keep the browser alive
|
|
383
|
+
* @param now - The instant the sweep judges staleness against, read from the interval's own clock so the staleness clocks this sweep starts and the ones it
|
|
384
|
+
* later reads are stamped on one time source.
|
|
210
385
|
*/
|
|
211
|
-
export declare function cleanupStalePages(): Promise<void>;
|
|
386
|
+
export declare function cleanupStalePages(now: number): Promise<void>;
|
|
212
387
|
/**
|
|
213
|
-
* Starts the periodic stale page cleanup
|
|
214
|
-
*
|
|
388
|
+
* Starts the periodic stale page cleanup. This should be called once during server startup, after the browser is initialized. The sweep runs indefinitely until
|
|
389
|
+
* stopStalePageCleanup() is called (typically during graceful shutdown). A second start while one is running changes nothing.
|
|
390
|
+
* @param clock - The clock the sweep's interval arms on and whose reading each sweep judges staleness against, so the cadence and the judgment share one time
|
|
391
|
+
* source. Defaults to the system clock.
|
|
215
392
|
*/
|
|
216
|
-
export declare function startStalePageCleanup(): void;
|
|
393
|
+
export declare function startStalePageCleanup(clock?: Clock): void;
|
|
217
394
|
/**
|
|
218
|
-
* Stops the stale page cleanup
|
|
219
|
-
*
|
|
395
|
+
* Stops the periodic stale page cleanup. This should be called during graceful shutdown to prevent the sweep from running after we've started shutting down the
|
|
396
|
+
* browser and streams. Disposing the registry drains the interval, and a stop with nothing running is a no-op.
|
|
220
397
|
*/
|
|
221
398
|
export declare function stopStalePageCleanup(): void;
|
|
222
399
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
400
|
+
* The registry facts a restart's idleness decision is made from. One shape, read by readRestartFacts and judged by isBrowserIdleForRestart, so the decision stays
|
|
401
|
+
* a pure function of stated facts rather than of whatever each guard happened to read.
|
|
402
|
+
*/
|
|
403
|
+
interface RestartFacts {
|
|
404
|
+
readonly establishedStreams: boolean;
|
|
405
|
+
readonly inFlightPages: number;
|
|
406
|
+
readonly streamCount: number;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Decides whether the browser may be torn down for the given cause, from facts read at the call. Each cause asks a different question of the same registry, so
|
|
410
|
+
* the decision is stated once here rather than spelled out at each guard.
|
|
411
|
+
*
|
|
412
|
+
* Maintenance is opportunistic housekeeping, so it waits for an empty registry outright: a pending entry is a tune in progress, and replacing the browser under
|
|
413
|
+
* one would fail it for nothing better than a fresher instance. Impairment is a repair the tunes themselves are waiting on, so it asks the narrower question of
|
|
414
|
+
* what a teardown would actually destroy - a stream established on this browser, whose entry holds its page, or a page an operation still holds in flight. A tune
|
|
415
|
+
* refused a capture start holds neither while it waits for the relaunch, so the very pending entry that maintenance would defer to is not a reason to leave an
|
|
416
|
+
* unusable browser in place. A tune that has acquired the browser but not yet opened its page falls outside every dependency source for the same reason and
|
|
417
|
+
* deliberately so: it holds nothing a relaunch would destroy, neither a page nor a capture, and its own capture start would meet the impaired browser in any
|
|
418
|
+
* case, so the relaunch may run under it.
|
|
419
|
+
* @param cause - Why the restart wants to run.
|
|
420
|
+
* @param facts - The registry facts read at the call.
|
|
421
|
+
* @returns True when the browser may be torn down for this cause.
|
|
422
|
+
*/
|
|
423
|
+
export declare function isBrowserIdleForRestart(cause: BrowserRestartCause, facts: RestartFacts): boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Relaunches a browser that can no longer start captures, as soon as nothing depends on it. Every trigger routes here - the mark itself, each stream termination,
|
|
426
|
+
* and the periodic restart check as the backstop for a moment when the other two could not act (login mode above all) - so the decision lives in one place rather
|
|
427
|
+
* than being re-derived by each. Idleness rather than age is the condition, because the mark makes the browser useless for new tunes immediately while its running
|
|
428
|
+
* captures are still worth finishing, so the earliest safe moment is exactly the moment the last thing depending on this browser lets go of it.
|
|
429
|
+
*
|
|
430
|
+
* The returned promise settles once the relaunch has settled, for the caller that goes on to acquire the fresh browser; a trigger with nothing waiting on the
|
|
431
|
+
* outcome voids it. An early return resolves at once, because there is nothing for such a caller to wait for.
|
|
432
|
+
* @returns A promise settling once the relaunch has settled, or at once when no relaunch runs.
|
|
433
|
+
*/
|
|
434
|
+
export declare function restartBrowserIfImpairedAndIdle(): Promise<void>;
|
|
435
|
+
/**
|
|
436
|
+
* Starts the periodic browser restart eligibility check. This should be called once during server startup, after the browser is initialized. The check runs
|
|
437
|
+
* indefinitely until stopBrowserRestartChecking() is called (typically during graceful shutdown). A second start while one is running changes nothing.
|
|
438
|
+
* @param clock - The clock the check's interval and the quiet period it arms both run on. Defaults to the system clock.
|
|
225
439
|
*/
|
|
226
|
-
export declare function startBrowserRestartChecking(): void;
|
|
440
|
+
export declare function startBrowserRestartChecking(clock?: Clock): void;
|
|
227
441
|
/**
|
|
228
|
-
* Stops the browser restart
|
|
229
|
-
*
|
|
442
|
+
* Stops the periodic browser restart eligibility check. This should be called during graceful shutdown to prevent a restart from racing with server shutdown.
|
|
443
|
+
* Disposing the registry drains the check and any pending quiet period together, and a stop with nothing running is a no-op.
|
|
230
444
|
*/
|
|
231
445
|
export declare function stopBrowserRestartChecking(): void;
|
|
232
446
|
/**
|
|
@@ -237,5 +451,5 @@ export declare function stopBrowserRestartChecking(): void;
|
|
|
237
451
|
* @throws If extension extraction fails.
|
|
238
452
|
*/
|
|
239
453
|
export declare function prepareExtension(): Promise<void>;
|
|
240
|
-
export {
|
|
241
|
-
|
|
454
|
+
export { acquireCaptureStream } from "./tabCapture.ts";
|
|
455
|
+
export type { CaptureStream, CaptureStreamOptions } from "./tabCapture.ts";
|