prismcast 1.12.1 → 1.14.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.
Files changed (655) hide show
  1. package/dist/app.d.ts +88 -7
  2. package/dist/app.js +295 -161
  3. package/dist/app.js.map +1 -1
  4. package/dist/browser/blockedPage.d.ts +0 -1
  5. package/dist/browser/browserSupervisor.d.ts +4 -4
  6. package/dist/browser/browserSupervisor.js.map +1 -1
  7. package/dist/browser/cdp.d.ts +8 -20
  8. package/dist/browser/cdp.js +11 -61
  9. package/dist/browser/cdp.js.map +1 -1
  10. package/dist/browser/channelSelection.d.ts +16 -4
  11. package/dist/browser/channelSelection.js +42 -31
  12. package/dist/browser/channelSelection.js.map +1 -1
  13. package/dist/browser/consent.d.ts +17 -4
  14. package/dist/browser/consent.js +25 -40
  15. package/dist/browser/consent.js.map +1 -1
  16. package/dist/browser/display.d.ts +0 -1
  17. package/dist/browser/hlsPlaylistObserver.d.ts +3 -2
  18. package/dist/browser/hlsPlaylistObserver.js +9 -4
  19. package/dist/browser/hlsPlaylistObserver.js.map +1 -1
  20. package/dist/browser/index.d.ts +179 -46
  21. package/dist/browser/index.js +473 -306
  22. package/dist/browser/index.js.map +1 -1
  23. package/dist/browser/launchGovernor.d.ts +0 -1
  24. package/dist/browser/login.d.ts +8 -7
  25. package/dist/browser/login.js +25 -16
  26. package/dist/browser/login.js.map +1 -1
  27. package/dist/browser/manifestInterceptor.d.ts +14 -5
  28. package/dist/browser/manifestInterceptor.js +25 -12
  29. package/dist/browser/manifestInterceptor.js.map +1 -1
  30. package/dist/browser/navigation.d.ts +28 -0
  31. package/dist/browser/navigation.js +57 -0
  32. package/dist/browser/navigation.js.map +1 -0
  33. package/dist/browser/pageStaleness.d.ts +0 -1
  34. package/dist/browser/precaching.d.ts +27 -11
  35. package/dist/browser/precaching.js +262 -107
  36. package/dist/browser/precaching.js.map +1 -1
  37. package/dist/browser/tabCapture.d.ts +7 -10
  38. package/dist/browser/tabCapture.js +37 -50
  39. package/dist/browser/tabCapture.js.map +1 -1
  40. package/dist/browser/tabNetworkObserver.d.ts +0 -1
  41. package/dist/browser/tabSelection.d.ts +5 -5
  42. package/dist/browser/tabSelection.js +11 -10
  43. package/dist/browser/tabSelection.js.map +1 -1
  44. package/dist/browser/tuning/cache.d.ts +0 -1
  45. package/dist/browser/tuning/comcastPolymer.d.ts +0 -1
  46. package/dist/browser/tuning/comcastPolymer.js +29 -31
  47. package/dist/browser/tuning/comcastPolymer.js.map +1 -1
  48. package/dist/browser/tuning/cox.d.ts +0 -1
  49. package/dist/browser/tuning/directv.d.ts +0 -1
  50. package/dist/browser/tuning/directv.js +11 -12
  51. package/dist/browser/tuning/directv.js.map +1 -1
  52. package/dist/browser/tuning/fox.d.ts +0 -1
  53. package/dist/browser/tuning/fox.js +2 -2
  54. package/dist/browser/tuning/fox.js.map +1 -1
  55. package/dist/browser/tuning/gridSearch.d.ts +0 -1
  56. package/dist/browser/tuning/hbo.d.ts +0 -1
  57. package/dist/browser/tuning/hbo.js +34 -17
  58. package/dist/browser/tuning/hbo.js.map +1 -1
  59. package/dist/browser/tuning/hulu.d.ts +14 -2
  60. package/dist/browser/tuning/hulu.js +144 -21
  61. package/dist/browser/tuning/hulu.js.map +1 -1
  62. package/dist/browser/tuning/shared.d.ts +0 -1
  63. package/dist/browser/tuning/sling.d.ts +0 -1
  64. package/dist/browser/tuning/sling.js +17 -22
  65. package/dist/browser/tuning/sling.js.map +1 -1
  66. package/dist/browser/tuning/spectrum.d.ts +0 -1
  67. package/dist/browser/tuning/thumbnailRow.d.ts +0 -1
  68. package/dist/browser/tuning/tileClick.d.ts +0 -1
  69. package/dist/browser/tuning/xfinity.d.ts +0 -1
  70. package/dist/browser/tuning/youtubeTv.d.ts +0 -1
  71. package/dist/browser/video.d.ts +22 -20
  72. package/dist/browser/video.js +102 -119
  73. package/dist/browser/video.js.map +1 -1
  74. package/dist/browser/windowSync.d.ts +0 -1
  75. package/dist/channels/index.d.ts +0 -1
  76. package/dist/channels/index.js +5 -5
  77. package/dist/channels/index.js.map +1 -1
  78. package/dist/cliHelp.d.ts +11 -0
  79. package/dist/cliHelp.js +148 -0
  80. package/dist/cliHelp.js.map +1 -0
  81. package/dist/config/channelForm.d.ts +0 -1
  82. package/dist/config/channelForm.js +5 -4
  83. package/dist/config/channelForm.js.map +1 -1
  84. package/dist/config/channelIdentity.d.ts +27 -0
  85. package/dist/config/channelIdentity.js +72 -0
  86. package/dist/config/channelIdentity.js.map +1 -0
  87. package/dist/config/channelSort.d.ts +25 -0
  88. package/dist/config/channelSort.js +101 -0
  89. package/dist/config/channelSort.js.map +1 -0
  90. package/dist/config/consistencyProbe.d.ts +2 -5
  91. package/dist/config/consistencyProbe.js +8 -51
  92. package/dist/config/consistencyProbe.js.map +1 -1
  93. package/dist/config/health.d.ts +3 -2
  94. package/dist/config/health.js +41 -28
  95. package/dist/config/health.js.map +1 -1
  96. package/dist/config/index.d.ts +107 -56
  97. package/dist/config/index.js +499 -267
  98. package/dist/config/index.js.map +1 -1
  99. package/dist/config/paths.d.ts +13 -9
  100. package/dist/config/paths.js +21 -25
  101. package/dist/config/paths.js.map +1 -1
  102. package/dist/config/persistence.context.d.ts +0 -1
  103. package/dist/config/persistence.d.ts +57 -12
  104. package/dist/config/persistence.js +127 -44
  105. package/dist/config/persistence.js.map +1 -1
  106. package/dist/config/presets.d.ts +0 -1
  107. package/dist/config/profiles.d.ts +9 -4
  108. package/dist/config/profiles.js +37 -3
  109. package/dist/config/profiles.js.map +1 -1
  110. package/dist/config/providerLineups.d.ts +0 -1
  111. package/dist/config/reactivity.d.ts +60 -37
  112. package/dist/config/reactivity.js +89 -116
  113. package/dist/config/reactivity.js.map +1 -1
  114. package/dist/config/servicePacks.d.ts +0 -1
  115. package/dist/config/services.d.ts +62 -73
  116. package/dist/config/services.js +140 -202
  117. package/dist/config/services.js.map +1 -1
  118. package/dist/config/sites.d.ts +0 -9
  119. package/dist/config/sites.js +5 -40
  120. package/dist/config/sites.js.map +1 -1
  121. package/dist/config/streamSettings.d.ts +24 -0
  122. package/dist/config/streamSettings.js +17 -0
  123. package/dist/config/streamSettings.js.map +1 -0
  124. package/dist/config/userChannels.d.ts +82 -80
  125. package/dist/config/userChannels.js +184 -248
  126. package/dist/config/userChannels.js.map +1 -1
  127. package/dist/config/userConfig.d.ts +225 -59
  128. package/dist/config/userConfig.js +352 -131
  129. package/dist/config/userConfig.js.map +1 -1
  130. package/dist/config/userProfiles.d.ts +2 -3
  131. package/dist/config/userProfiles.js +6 -2
  132. package/dist/config/userProfiles.js.map +1 -1
  133. package/dist/hdhr/channelMap.d.ts +0 -1
  134. package/dist/hdhr/discover.d.ts +7 -2
  135. package/dist/hdhr/discover.js +12 -6
  136. package/dist/hdhr/discover.js.map +1 -1
  137. package/dist/hdhr/getHandlers.d.ts +0 -1
  138. package/dist/hdhr/identity.d.ts +0 -1
  139. package/dist/hdhr/index.d.ts +51 -11
  140. package/dist/hdhr/index.js +108 -112
  141. package/dist/hdhr/index.js.map +1 -1
  142. package/dist/hdhr/protocol.d.ts +0 -1
  143. package/dist/hdhr/tunerState.d.ts +0 -1
  144. package/dist/hdhr/udp.d.ts +11 -5
  145. package/dist/hdhr/udp.js +25 -20
  146. package/dist/hdhr/udp.js.map +1 -1
  147. package/dist/identity.d.ts +0 -1
  148. package/dist/index.d.ts +0 -1
  149. package/dist/index.js +16 -143
  150. package/dist/index.js.map +1 -1
  151. package/dist/native/codecInference.d.ts +5 -4
  152. package/dist/native/codecInference.js +12 -7
  153. package/dist/native/codecInference.js.map +1 -1
  154. package/dist/native/decrypt.d.ts +10 -3
  155. package/dist/native/decrypt.js +9 -5
  156. package/dist/native/decrypt.js.map +1 -1
  157. package/dist/native/index.d.ts +25 -23
  158. package/dist/native/index.js +27 -20
  159. package/dist/native/index.js.map +1 -1
  160. package/dist/native/probe.d.ts +7 -10
  161. package/dist/native/probe.js +40 -36
  162. package/dist/native/probe.js.map +1 -1
  163. package/dist/native/proxy.d.ts +3 -4
  164. package/dist/native/proxy.js +122 -92
  165. package/dist/native/proxy.js.map +1 -1
  166. package/dist/native/tokenExpiry.d.ts +0 -1
  167. package/dist/routes/assets.d.ts +0 -1
  168. package/dist/routes/auth.d.ts +0 -1
  169. package/dist/routes/auth.js +1 -1
  170. package/dist/routes/auth.js.map +1 -1
  171. package/dist/routes/cdp.d.ts +18 -11
  172. package/dist/routes/cdp.js +99 -70
  173. package/dist/routes/cdp.js.map +1 -1
  174. package/dist/routes/channels.d.ts +0 -1
  175. package/dist/routes/clientActions.d.ts +0 -1
  176. package/dist/routes/components.d.ts +23 -6
  177. package/dist/routes/components.js +21 -4
  178. package/dist/routes/components.js.map +1 -1
  179. package/dist/routes/config/channels/endpoints/browse.d.ts +0 -1
  180. package/dist/routes/config/channels/endpoints/browse.js +39 -29
  181. package/dist/routes/config/channels/endpoints/browse.js.map +1 -1
  182. package/dist/routes/config/channels/endpoints/bulk.d.ts +0 -1
  183. package/dist/routes/config/channels/endpoints/bulk.js +3 -7
  184. package/dist/routes/config/channels/endpoints/bulk.js.map +1 -1
  185. package/dist/routes/config/channels/endpoints/crud.d.ts +0 -1
  186. package/dist/routes/config/channels/endpoints/crud.js +3 -2
  187. package/dist/routes/config/channels/endpoints/crud.js.map +1 -1
  188. package/dist/routes/config/channels/endpoints/importExport.d.ts +0 -1
  189. package/dist/routes/config/channels/endpoints/importExport.js +7 -3
  190. package/dist/routes/config/channels/endpoints/importExport.js.map +1 -1
  191. package/dist/routes/config/channels/endpoints/predefined.d.ts +0 -1
  192. package/dist/routes/config/channels/endpoints/predefined.js +5 -15
  193. package/dist/routes/config/channels/endpoints/predefined.js.map +1 -1
  194. package/dist/routes/config/channels/endpoints/prefs.d.ts +0 -1
  195. package/dist/routes/config/channels/endpoints/prefs.js +8 -7
  196. package/dist/routes/config/channels/endpoints/prefs.js.map +1 -1
  197. package/dist/routes/config/channels/endpoints/service.d.ts +0 -1
  198. package/dist/routes/config/channels/endpoints/service.js +13 -9
  199. package/dist/routes/config/channels/endpoints/service.js.map +1 -1
  200. package/dist/routes/config/channels/endpoints/tags.d.ts +0 -1
  201. package/dist/routes/config/channels/endpoints/tags.js +4 -16
  202. package/dist/routes/config/channels/endpoints/tags.js.map +1 -1
  203. package/dist/routes/config/channels/healthBridge.d.ts +0 -1
  204. package/dist/routes/config/channels/http/handler.d.ts +0 -1
  205. package/dist/routes/config/channels/http/playlistHint.d.ts +0 -1
  206. package/dist/routes/config/channels/http/serviceWarning.d.ts +0 -1
  207. package/dist/routes/config/channels/http/serviceWarning.js +1 -1
  208. package/dist/routes/config/channels/http/serviceWarning.js.map +1 -1
  209. package/dist/routes/config/channels/index.d.ts +0 -1
  210. package/dist/routes/config/channels/setup.d.ts +0 -1
  211. package/dist/routes/config/channels/table.d.ts +2 -2
  212. package/dist/routes/config/channels/table.js +13 -14
  213. package/dist/routes/config/channels/table.js.map +1 -1
  214. package/dist/routes/config/http/envelope.d.ts +6 -4
  215. package/dist/routes/config/http/envelope.js +18 -5
  216. package/dist/routes/config/http/envelope.js.map +1 -1
  217. package/dist/routes/config/index.d.ts +21 -14
  218. package/dist/routes/config/index.js +49 -35
  219. package/dist/routes/config/index.js.map +1 -1
  220. package/dist/routes/config/services.d.ts +0 -1
  221. package/dist/routes/config/services.js +4 -3
  222. package/dist/routes/config/services.js.map +1 -1
  223. package/dist/routes/config/settings.d.ts +43 -7
  224. package/dist/routes/config/settings.js +227 -126
  225. package/dist/routes/config/settings.js.map +1 -1
  226. package/dist/routes/config/vocabulary.d.ts +24 -0
  227. package/dist/routes/config/vocabulary.js +33 -0
  228. package/dist/routes/config/vocabulary.js.map +1 -0
  229. package/dist/routes/debug.d.ts +0 -1
  230. package/dist/routes/debug.js +28 -13
  231. package/dist/routes/debug.js.map +1 -1
  232. package/dist/routes/health.d.ts +1 -2
  233. package/dist/routes/health.js +5 -2
  234. package/dist/routes/health.js.map +1 -1
  235. package/dist/routes/hls.d.ts +0 -1
  236. package/dist/routes/icons.d.ts +0 -1
  237. package/dist/routes/index.d.ts +0 -1
  238. package/dist/routes/logs.d.ts +3 -2
  239. package/dist/routes/logs.js +4 -2
  240. package/dist/routes/logs.js.map +1 -1
  241. package/dist/routes/mpegts.d.ts +0 -1
  242. package/dist/routes/play.d.ts +0 -1
  243. package/dist/routes/playlist.d.ts +0 -1
  244. package/dist/routes/playlist.js +2 -1
  245. package/dist/routes/playlist.js.map +1 -1
  246. package/dist/routes/root/content.d.ts +0 -1
  247. package/dist/routes/root/content.js +33 -26
  248. package/dist/routes/root/content.js.map +1 -1
  249. package/dist/routes/root/index.d.ts +0 -1
  250. package/dist/routes/root/scripts/channels.d.ts +0 -1
  251. package/dist/routes/root/scripts/channels.js +25 -13
  252. package/dist/routes/root/scripts/channels.js.map +1 -1
  253. package/dist/routes/root/scripts/clientEscape.d.ts +0 -1
  254. package/dist/routes/root/scripts/clientUrl.d.ts +0 -1
  255. package/dist/routes/root/scripts/config.d.ts +1 -2
  256. package/dist/routes/root/scripts/config.js +132 -105
  257. package/dist/routes/root/scripts/config.js.map +1 -1
  258. package/dist/routes/root/scripts/index.d.ts +0 -1
  259. package/dist/routes/root/scripts/shared.d.ts +0 -1
  260. package/dist/routes/root/scripts/shared.js +34 -23
  261. package/dist/routes/root/scripts/shared.js.map +1 -1
  262. package/dist/routes/root/scripts/status.d.ts +0 -1
  263. package/dist/routes/root/scripts/status.handlers.d.ts +8 -14
  264. package/dist/routes/root/scripts/status.handlers.js +38 -23
  265. package/dist/routes/root/scripts/status.handlers.js.map +1 -1
  266. package/dist/routes/root/styles.d.ts +0 -1
  267. package/dist/routes/root/styles.js +13 -16
  268. package/dist/routes/root/styles.js.map +1 -1
  269. package/dist/routes/services.d.ts +0 -1
  270. package/dist/routes/services.js +13 -17
  271. package/dist/routes/services.js.map +1 -1
  272. package/dist/routes/sse.d.ts +3 -2
  273. package/dist/routes/sse.js +7 -3
  274. package/dist/routes/sse.js.map +1 -1
  275. package/dist/routes/streams.d.ts +4 -2
  276. package/dist/routes/streams.js +8 -5
  277. package/dist/routes/streams.js.map +1 -1
  278. package/dist/routes/theme.d.ts +0 -1
  279. package/dist/routes/theme.js +12 -12
  280. package/dist/routes/theme.js.map +1 -1
  281. package/dist/routes/ui.d.ts +4 -4
  282. package/dist/routes/ui.js +17 -13
  283. package/dist/routes/ui.js.map +1 -1
  284. package/dist/routes/upgrade.d.ts +0 -1
  285. package/dist/routes/upgrade.js +2 -1
  286. package/dist/routes/upgrade.js.map +1 -1
  287. package/dist/service/commands.context.d.ts +0 -1
  288. package/dist/service/commands.context.js +7 -1
  289. package/dist/service/commands.context.js.map +1 -1
  290. package/dist/service/commands.d.ts +0 -1
  291. package/dist/service/generators.context.d.ts +0 -1
  292. package/dist/service/generators.d.ts +0 -1
  293. package/dist/service/generators.js +12 -9
  294. package/dist/service/generators.js.map +1 -1
  295. package/dist/service/index.d.ts +0 -1
  296. package/dist/streaming/captureLock.d.ts +1 -2
  297. package/dist/streaming/captureLock.js +6 -5
  298. package/dist/streaming/captureLock.js.map +1 -1
  299. package/dist/streaming/captureSession.d.ts +4 -5
  300. package/dist/streaming/captureSession.js +6 -7
  301. package/dist/streaming/captureSession.js.map +1 -1
  302. package/dist/streaming/clients.d.ts +4 -3
  303. package/dist/streaming/clients.js +5 -4
  304. package/dist/streaming/clients.js.map +1 -1
  305. package/dist/streaming/codec.d.ts +12 -3
  306. package/dist/streaming/codec.js +40 -28
  307. package/dist/streaming/codec.js.map +1 -1
  308. package/dist/streaming/fmp4Segmenter.d.ts +16 -5
  309. package/dist/streaming/fmp4Segmenter.js +110 -89
  310. package/dist/streaming/fmp4Segmenter.js.map +1 -1
  311. package/dist/streaming/hls.d.ts +55 -15
  312. package/dist/streaming/hls.js +255 -162
  313. package/dist/streaming/hls.js.map +1 -1
  314. package/dist/streaming/hlsResume.d.ts +42 -16
  315. package/dist/streaming/hlsResume.js +75 -42
  316. package/dist/streaming/hlsResume.js.map +1 -1
  317. package/dist/streaming/hlsSegments.d.ts +9 -7
  318. package/dist/streaming/hlsSegments.js +19 -14
  319. package/dist/streaming/hlsSegments.js.map +1 -1
  320. package/dist/streaming/lifecycle.d.ts +5 -4
  321. package/dist/streaming/lifecycle.js +25 -13
  322. package/dist/streaming/lifecycle.js.map +1 -1
  323. package/dist/streaming/monitor.d.ts +8 -5
  324. package/dist/streaming/monitor.js +109 -93
  325. package/dist/streaming/monitor.js.map +1 -1
  326. package/dist/streaming/mp4Parser.d.ts +29 -5
  327. package/dist/streaming/mp4Parser.js +49 -7
  328. package/dist/streaming/mp4Parser.js.map +1 -1
  329. package/dist/streaming/mpegts.d.ts +0 -1
  330. package/dist/streaming/mpegts.js +23 -7
  331. package/dist/streaming/mpegts.js.map +1 -1
  332. package/dist/streaming/playlistBuilder.d.ts +1 -3
  333. package/dist/streaming/playlistBuilder.js +2 -3
  334. package/dist/streaming/playlistBuilder.js.map +1 -1
  335. package/dist/streaming/preroll.d.ts +76 -30
  336. package/dist/streaming/preroll.js +141 -89
  337. package/dist/streaming/preroll.js.map +1 -1
  338. package/dist/streaming/pretune.d.ts +3 -4
  339. package/dist/streaming/pretune.js +50 -46
  340. package/dist/streaming/pretune.js.map +1 -1
  341. package/dist/streaming/pretuneTimers.d.ts +16 -12
  342. package/dist/streaming/pretuneTimers.js +27 -37
  343. package/dist/streaming/pretuneTimers.js.map +1 -1
  344. package/dist/streaming/recovery.d.ts +36 -7
  345. package/dist/streaming/recovery.js +53 -11
  346. package/dist/streaming/recovery.js.map +1 -1
  347. package/dist/streaming/registry.d.ts +35 -14
  348. package/dist/streaming/registry.js +23 -8
  349. package/dist/streaming/registry.js.map +1 -1
  350. package/dist/streaming/setup.d.ts +66 -25
  351. package/dist/streaming/setup.js +305 -229
  352. package/dist/streaming/setup.js.map +1 -1
  353. package/dist/streaming/showInfo.d.ts +29 -13
  354. package/dist/streaming/showInfo.js +156 -140
  355. package/dist/streaming/showInfo.js.map +1 -1
  356. package/dist/streaming/statusEmitter.d.ts +16 -12
  357. package/dist/streaming/statusEmitter.js +25 -21
  358. package/dist/streaming/statusEmitter.js.map +1 -1
  359. package/dist/types/channels.d.ts +0 -1
  360. package/dist/types/config.d.ts +24 -14
  361. package/dist/types/config.js +5 -1
  362. package/dist/types/config.js.map +1 -1
  363. package/dist/types/index.d.ts +4 -4
  364. package/dist/types/index.js +2 -1
  365. package/dist/types/index.js.map +1 -1
  366. package/dist/types/profiles.d.ts +3 -3
  367. package/dist/types/selection.d.ts +19 -8
  368. package/dist/types/shared.d.ts +0 -1
  369. package/dist/types/streaming.d.ts +12 -6
  370. package/dist/types/streaming.js +12 -5
  371. package/dist/types/streaming.js.map +1 -1
  372. package/dist/upgrade/commands.context.d.ts +0 -1
  373. package/dist/upgrade/commands.d.ts +0 -1
  374. package/dist/upgrade/detection.context.d.ts +0 -1
  375. package/dist/upgrade/detection.d.ts +0 -1
  376. package/dist/upgrade/index.d.ts +0 -1
  377. package/dist/upgrade/lifecycle.context.d.ts +2 -1
  378. package/dist/upgrade/lifecycle.context.js +9 -4
  379. package/dist/upgrade/lifecycle.context.js.map +1 -1
  380. package/dist/upgrade/lifecycle.d.ts +0 -1
  381. package/dist/upgrade/pathHandle.d.ts +0 -1
  382. package/dist/utils/bootSession.context.d.ts +0 -1
  383. package/dist/utils/bootSession.context.js +2 -1
  384. package/dist/utils/bootSession.context.js.map +1 -1
  385. package/dist/utils/bootSession.d.ts +0 -1
  386. package/dist/utils/chromeFetch.d.ts +0 -1
  387. package/dist/utils/cliOutput.d.ts +0 -1
  388. package/dist/utils/debugFilter.d.ts +3 -3
  389. package/dist/utils/debugFilter.js +7 -5
  390. package/dist/utils/debugFilter.js.map +1 -1
  391. package/dist/utils/delay.d.ts +47 -25
  392. package/dist/utils/delay.js +74 -37
  393. package/dist/utils/delay.js.map +1 -1
  394. package/dist/{hdhr → utils}/deviceId.d.ts +1 -2
  395. package/dist/{hdhr → utils}/deviceId.js +11 -29
  396. package/dist/utils/deviceId.js.map +1 -0
  397. package/dist/utils/errors.d.ts +7 -1
  398. package/dist/utils/errors.js +12 -3
  399. package/dist/utils/errors.js.map +1 -1
  400. package/dist/utils/evaluate.d.ts +11 -3
  401. package/dist/utils/evaluate.js +4 -3
  402. package/dist/utils/evaluate.js.map +1 -1
  403. package/dist/utils/ffmpeg.context.d.ts +0 -1
  404. package/dist/utils/ffmpeg.d.ts +0 -1
  405. package/dist/utils/fileLogger.d.ts +26 -14
  406. package/dist/utils/fileLogger.js +89 -49
  407. package/dist/utils/fileLogger.js.map +1 -1
  408. package/dist/utils/format.d.ts +12 -3
  409. package/dist/utils/format.js +29 -11
  410. package/dist/utils/format.js.map +1 -1
  411. package/dist/utils/httpErrors.d.ts +13 -0
  412. package/dist/utils/httpErrors.js +22 -0
  413. package/dist/utils/httpErrors.js.map +1 -0
  414. package/dist/utils/index.d.ts +3 -2
  415. package/dist/utils/index.js +3 -1
  416. package/dist/utils/index.js.map +1 -1
  417. package/dist/utils/logEmitter.d.ts +0 -1
  418. package/dist/utils/logger.d.ts +9 -9
  419. package/dist/utils/logger.js +64 -20
  420. package/dist/utils/logger.js.map +1 -1
  421. package/dist/utils/m3u.d.ts +0 -1
  422. package/dist/utils/markup.d.ts +0 -1
  423. package/dist/utils/markup.js +8 -3
  424. package/dist/utils/markup.js.map +1 -1
  425. package/dist/utils/memo.d.ts +0 -1
  426. package/dist/utils/morganStream.d.ts +0 -1
  427. package/dist/utils/network.d.ts +0 -1
  428. package/dist/utils/never.d.ts +0 -1
  429. package/dist/utils/pid.d.ts +0 -1
  430. package/dist/utils/plainObject.d.ts +6 -0
  431. package/dist/utils/plainObject.js +18 -0
  432. package/dist/utils/plainObject.js.map +1 -0
  433. package/dist/utils/platform.d.ts +0 -1
  434. package/dist/utils/processInspector.context.d.ts +32 -2
  435. package/dist/utils/processInspector.context.js +117 -1
  436. package/dist/utils/processInspector.context.js.map +1 -1
  437. package/dist/utils/processInspector.d.ts +0 -32
  438. package/dist/utils/processInspector.js +10 -117
  439. package/dist/utils/processInspector.js.map +1 -1
  440. package/dist/utils/retry.d.ts +5 -4
  441. package/dist/utils/retry.js +43 -33
  442. package/dist/utils/retry.js.map +1 -1
  443. package/dist/utils/runtimeIdentity.context.d.ts +0 -1
  444. package/dist/utils/runtimeIdentity.context.js +4 -30
  445. package/dist/utils/runtimeIdentity.context.js.map +1 -1
  446. package/dist/utils/runtimeIdentity.d.ts +18 -7
  447. package/dist/utils/runtimeIdentity.js +51 -18
  448. package/dist/utils/runtimeIdentity.js.map +1 -1
  449. package/dist/utils/sanitize.d.ts +0 -1
  450. package/dist/utils/streamContext.d.ts +0 -1
  451. package/dist/utils/timing.d.ts +3 -4
  452. package/dist/utils/timing.js +4 -4
  453. package/dist/utils/timing.js.map +1 -1
  454. package/dist/utils/version.d.ts +5 -4
  455. package/dist/utils/version.js +35 -24
  456. package/dist/utils/version.js.map +1 -1
  457. package/package.json +9 -9
  458. package/dist/app.d.ts.map +0 -1
  459. package/dist/browser/blockedPage.d.ts.map +0 -1
  460. package/dist/browser/browserSupervisor.d.ts.map +0 -1
  461. package/dist/browser/cdp.d.ts.map +0 -1
  462. package/dist/browser/channelSelection.d.ts.map +0 -1
  463. package/dist/browser/consent.d.ts.map +0 -1
  464. package/dist/browser/display.d.ts.map +0 -1
  465. package/dist/browser/hlsPlaylistObserver.d.ts.map +0 -1
  466. package/dist/browser/index.d.ts.map +0 -1
  467. package/dist/browser/launchGovernor.d.ts.map +0 -1
  468. package/dist/browser/login.d.ts.map +0 -1
  469. package/dist/browser/manifestInterceptor.d.ts.map +0 -1
  470. package/dist/browser/pageStaleness.d.ts.map +0 -1
  471. package/dist/browser/precaching.d.ts.map +0 -1
  472. package/dist/browser/tabCapture.d.ts.map +0 -1
  473. package/dist/browser/tabNetworkObserver.d.ts.map +0 -1
  474. package/dist/browser/tabSelection.d.ts.map +0 -1
  475. package/dist/browser/tuning/cache.d.ts.map +0 -1
  476. package/dist/browser/tuning/comcastPolymer.d.ts.map +0 -1
  477. package/dist/browser/tuning/cox.d.ts.map +0 -1
  478. package/dist/browser/tuning/directv.d.ts.map +0 -1
  479. package/dist/browser/tuning/fox.d.ts.map +0 -1
  480. package/dist/browser/tuning/gridSearch.d.ts.map +0 -1
  481. package/dist/browser/tuning/hbo.d.ts.map +0 -1
  482. package/dist/browser/tuning/hulu.d.ts.map +0 -1
  483. package/dist/browser/tuning/shared.d.ts.map +0 -1
  484. package/dist/browser/tuning/sling.d.ts.map +0 -1
  485. package/dist/browser/tuning/spectrum.d.ts.map +0 -1
  486. package/dist/browser/tuning/thumbnailRow.d.ts.map +0 -1
  487. package/dist/browser/tuning/tileClick.d.ts.map +0 -1
  488. package/dist/browser/tuning/xfinity.d.ts.map +0 -1
  489. package/dist/browser/tuning/youtubeTv.d.ts.map +0 -1
  490. package/dist/browser/video.d.ts.map +0 -1
  491. package/dist/browser/windowSync.d.ts.map +0 -1
  492. package/dist/channels/index.d.ts.map +0 -1
  493. package/dist/config/channelForm.d.ts.map +0 -1
  494. package/dist/config/consistencyProbe.d.ts.map +0 -1
  495. package/dist/config/health.d.ts.map +0 -1
  496. package/dist/config/index.d.ts.map +0 -1
  497. package/dist/config/paths.d.ts.map +0 -1
  498. package/dist/config/persistence.context.d.ts.map +0 -1
  499. package/dist/config/persistence.d.ts.map +0 -1
  500. package/dist/config/presets.d.ts.map +0 -1
  501. package/dist/config/profiles.d.ts.map +0 -1
  502. package/dist/config/providerLineups.d.ts.map +0 -1
  503. package/dist/config/reactivity.d.ts.map +0 -1
  504. package/dist/config/servicePacks.d.ts.map +0 -1
  505. package/dist/config/services.d.ts.map +0 -1
  506. package/dist/config/sites.d.ts.map +0 -1
  507. package/dist/config/userChannels.d.ts.map +0 -1
  508. package/dist/config/userConfig.d.ts.map +0 -1
  509. package/dist/config/userProfiles.d.ts.map +0 -1
  510. package/dist/hdhr/channelMap.d.ts.map +0 -1
  511. package/dist/hdhr/deviceId.d.ts.map +0 -1
  512. package/dist/hdhr/deviceId.js.map +0 -1
  513. package/dist/hdhr/discover.d.ts.map +0 -1
  514. package/dist/hdhr/getHandlers.d.ts.map +0 -1
  515. package/dist/hdhr/identity.d.ts.map +0 -1
  516. package/dist/hdhr/index.d.ts.map +0 -1
  517. package/dist/hdhr/protocol.d.ts.map +0 -1
  518. package/dist/hdhr/tunerState.d.ts.map +0 -1
  519. package/dist/hdhr/udp.d.ts.map +0 -1
  520. package/dist/identity.d.ts.map +0 -1
  521. package/dist/index.d.ts.map +0 -1
  522. package/dist/native/codecInference.d.ts.map +0 -1
  523. package/dist/native/decrypt.d.ts.map +0 -1
  524. package/dist/native/index.d.ts.map +0 -1
  525. package/dist/native/probe.d.ts.map +0 -1
  526. package/dist/native/proxy.d.ts.map +0 -1
  527. package/dist/native/tokenExpiry.d.ts.map +0 -1
  528. package/dist/routes/assets.d.ts.map +0 -1
  529. package/dist/routes/auth.d.ts.map +0 -1
  530. package/dist/routes/cdp.d.ts.map +0 -1
  531. package/dist/routes/channels.d.ts.map +0 -1
  532. package/dist/routes/clientActions.d.ts.map +0 -1
  533. package/dist/routes/components.d.ts.map +0 -1
  534. package/dist/routes/config/channels/endpoints/browse.d.ts.map +0 -1
  535. package/dist/routes/config/channels/endpoints/bulk.d.ts.map +0 -1
  536. package/dist/routes/config/channels/endpoints/crud.d.ts.map +0 -1
  537. package/dist/routes/config/channels/endpoints/importExport.d.ts.map +0 -1
  538. package/dist/routes/config/channels/endpoints/predefined.d.ts.map +0 -1
  539. package/dist/routes/config/channels/endpoints/prefs.d.ts.map +0 -1
  540. package/dist/routes/config/channels/endpoints/service.d.ts.map +0 -1
  541. package/dist/routes/config/channels/endpoints/tags.d.ts.map +0 -1
  542. package/dist/routes/config/channels/healthBridge.d.ts.map +0 -1
  543. package/dist/routes/config/channels/http/handler.d.ts.map +0 -1
  544. package/dist/routes/config/channels/http/playlistHint.d.ts.map +0 -1
  545. package/dist/routes/config/channels/http/serviceWarning.d.ts.map +0 -1
  546. package/dist/routes/config/channels/index.d.ts.map +0 -1
  547. package/dist/routes/config/channels/setup.d.ts.map +0 -1
  548. package/dist/routes/config/channels/table.d.ts.map +0 -1
  549. package/dist/routes/config/http/envelope.d.ts.map +0 -1
  550. package/dist/routes/config/index.d.ts.map +0 -1
  551. package/dist/routes/config/services.d.ts.map +0 -1
  552. package/dist/routes/config/settings.d.ts.map +0 -1
  553. package/dist/routes/debug.d.ts.map +0 -1
  554. package/dist/routes/health.d.ts.map +0 -1
  555. package/dist/routes/hls.d.ts.map +0 -1
  556. package/dist/routes/icons.d.ts.map +0 -1
  557. package/dist/routes/index.d.ts.map +0 -1
  558. package/dist/routes/logs.d.ts.map +0 -1
  559. package/dist/routes/mpegts.d.ts.map +0 -1
  560. package/dist/routes/play.d.ts.map +0 -1
  561. package/dist/routes/playlist.d.ts.map +0 -1
  562. package/dist/routes/root/content.d.ts.map +0 -1
  563. package/dist/routes/root/index.d.ts.map +0 -1
  564. package/dist/routes/root/scripts/channels.d.ts.map +0 -1
  565. package/dist/routes/root/scripts/clientEscape.d.ts.map +0 -1
  566. package/dist/routes/root/scripts/clientUrl.d.ts.map +0 -1
  567. package/dist/routes/root/scripts/config.d.ts.map +0 -1
  568. package/dist/routes/root/scripts/index.d.ts.map +0 -1
  569. package/dist/routes/root/scripts/shared.d.ts.map +0 -1
  570. package/dist/routes/root/scripts/status.d.ts.map +0 -1
  571. package/dist/routes/root/scripts/status.handlers.d.ts.map +0 -1
  572. package/dist/routes/root/styles.d.ts.map +0 -1
  573. package/dist/routes/services.d.ts.map +0 -1
  574. package/dist/routes/sse.d.ts.map +0 -1
  575. package/dist/routes/streams.d.ts.map +0 -1
  576. package/dist/routes/theme.d.ts.map +0 -1
  577. package/dist/routes/ui.d.ts.map +0 -1
  578. package/dist/routes/upgrade.d.ts.map +0 -1
  579. package/dist/service/commands.context.d.ts.map +0 -1
  580. package/dist/service/commands.d.ts.map +0 -1
  581. package/dist/service/generators.context.d.ts.map +0 -1
  582. package/dist/service/generators.d.ts.map +0 -1
  583. package/dist/service/index.d.ts.map +0 -1
  584. package/dist/streaming/captureLock.d.ts.map +0 -1
  585. package/dist/streaming/captureSession.d.ts.map +0 -1
  586. package/dist/streaming/clients.d.ts.map +0 -1
  587. package/dist/streaming/codec.d.ts.map +0 -1
  588. package/dist/streaming/fmp4Segmenter.d.ts.map +0 -1
  589. package/dist/streaming/hls.d.ts.map +0 -1
  590. package/dist/streaming/hlsResume.d.ts.map +0 -1
  591. package/dist/streaming/hlsSegments.d.ts.map +0 -1
  592. package/dist/streaming/lifecycle.d.ts.map +0 -1
  593. package/dist/streaming/monitor.d.ts.map +0 -1
  594. package/dist/streaming/mp4Parser.d.ts.map +0 -1
  595. package/dist/streaming/mpegts.d.ts.map +0 -1
  596. package/dist/streaming/playlistBuilder.d.ts.map +0 -1
  597. package/dist/streaming/preroll.d.ts.map +0 -1
  598. package/dist/streaming/pretune.d.ts.map +0 -1
  599. package/dist/streaming/pretuneTimers.d.ts.map +0 -1
  600. package/dist/streaming/recovery.d.ts.map +0 -1
  601. package/dist/streaming/registry.d.ts.map +0 -1
  602. package/dist/streaming/setup.d.ts.map +0 -1
  603. package/dist/streaming/showInfo.d.ts.map +0 -1
  604. package/dist/streaming/statusEmitter.d.ts.map +0 -1
  605. package/dist/types/channels.d.ts.map +0 -1
  606. package/dist/types/config.d.ts.map +0 -1
  607. package/dist/types/index.d.ts.map +0 -1
  608. package/dist/types/profiles.d.ts.map +0 -1
  609. package/dist/types/selection.d.ts.map +0 -1
  610. package/dist/types/shared.d.ts.map +0 -1
  611. package/dist/types/streaming.d.ts.map +0 -1
  612. package/dist/upgrade/commands.context.d.ts.map +0 -1
  613. package/dist/upgrade/commands.d.ts.map +0 -1
  614. package/dist/upgrade/detection.context.d.ts.map +0 -1
  615. package/dist/upgrade/detection.d.ts.map +0 -1
  616. package/dist/upgrade/index.d.ts.map +0 -1
  617. package/dist/upgrade/lifecycle.context.d.ts.map +0 -1
  618. package/dist/upgrade/lifecycle.d.ts.map +0 -1
  619. package/dist/upgrade/pathHandle.d.ts.map +0 -1
  620. package/dist/utils/bootSession.context.d.ts.map +0 -1
  621. package/dist/utils/bootSession.d.ts.map +0 -1
  622. package/dist/utils/chromeFetch.d.ts.map +0 -1
  623. package/dist/utils/cliOutput.d.ts.map +0 -1
  624. package/dist/utils/clock.d.ts +0 -15
  625. package/dist/utils/clock.d.ts.map +0 -1
  626. package/dist/utils/clock.js +0 -31
  627. package/dist/utils/clock.js.map +0 -1
  628. package/dist/utils/debugFilter.d.ts.map +0 -1
  629. package/dist/utils/delay.d.ts.map +0 -1
  630. package/dist/utils/errors.d.ts.map +0 -1
  631. package/dist/utils/evaluate.d.ts.map +0 -1
  632. package/dist/utils/ffmpeg.context.d.ts.map +0 -1
  633. package/dist/utils/ffmpeg.d.ts.map +0 -1
  634. package/dist/utils/fileLogger.d.ts.map +0 -1
  635. package/dist/utils/format.d.ts.map +0 -1
  636. package/dist/utils/index.d.ts.map +0 -1
  637. package/dist/utils/logEmitter.d.ts.map +0 -1
  638. package/dist/utils/logger.d.ts.map +0 -1
  639. package/dist/utils/m3u.d.ts.map +0 -1
  640. package/dist/utils/markup.d.ts.map +0 -1
  641. package/dist/utils/memo.d.ts.map +0 -1
  642. package/dist/utils/morganStream.d.ts.map +0 -1
  643. package/dist/utils/network.d.ts.map +0 -1
  644. package/dist/utils/never.d.ts.map +0 -1
  645. package/dist/utils/pid.d.ts.map +0 -1
  646. package/dist/utils/platform.d.ts.map +0 -1
  647. package/dist/utils/processInspector.context.d.ts.map +0 -1
  648. package/dist/utils/processInspector.d.ts.map +0 -1
  649. package/dist/utils/retry.d.ts.map +0 -1
  650. package/dist/utils/runtimeIdentity.context.d.ts.map +0 -1
  651. package/dist/utils/runtimeIdentity.d.ts.map +0 -1
  652. package/dist/utils/sanitize.d.ts.map +0 -1
  653. package/dist/utils/streamContext.d.ts.map +0 -1
  654. package/dist/utils/timing.d.ts.map +0 -1
  655. package/dist/utils/version.d.ts.map +0 -1
@@ -1,18 +1,30 @@
1
1
  import type { Browser, LaunchOptions, Page } from "puppeteer-core";
2
2
  import type { BrowserPurpose, CaptureImpairment } from "./browserSupervisor.ts";
3
- import type { Clock, ProcessInfo } from "../utils/index.ts";
3
+ import type { ChangeRejection, ConfigChange } from "../config/reactivity.ts";
4
+ import type { Config, Nullable } from "../types/index.ts";
4
5
  import { clearLoginState, isLoginModeActive } from "./login.ts";
5
6
  import { getAllStreams } from "../streaming/registry.ts";
6
7
  import { getCachedTabId } from "./tabSelection.ts";
7
- import type { Nullable } from "../types/index.ts";
8
+ import type { Clock } from "homebridge-plugin-utils";
9
+ import type { ProcessInfo } from "../utils/index.ts";
10
+ import type { SystemStatus } from "../streaming/statusEmitter.ts";
8
11
  import type { WindowPlacement } from "./cdp.ts";
9
12
  type CaptureProbe = (browser: Browser) => Promise<void>;
10
13
  /**
11
14
  * 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
12
- * 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.
15
+ * launch, since the streaming layer is imported during server startup). Separating the wiring from the call keeps browser/index.ts from importing
16
+ * streaming/setup.ts, which already imports this module, so the dependency stays one-directional.
13
17
  * @param probe - The probe to run against a freshly-launched browser; it resolves when the browser can capture and rejects when it cannot.
14
18
  */
15
19
  export declare function setCaptureProbe(probe: CaptureProbe): void;
20
+ type StreamTerminator = (streamId: number, channelName: string, reason: string) => void;
21
+ /**
22
+ * Injects the authoritative stream terminator used when browser readiness is lost. Called once from streaming/lifecycle.ts at module load. Separating the wiring
23
+ * from the call keeps browser/index.ts from importing streaming/lifecycle.ts, which already imports this module, so the dependency stays one-directional.
24
+ * @param terminator - The function that tears down one stream and all of the resources it owns.
25
+ */
26
+ export declare function setStreamTerminator(terminator: StreamTerminator): void;
27
+ export type BrowserRestartCause = "impairment" | "maintenance";
16
28
  /**
17
29
  * Returns true if graceful shutdown is in progress.
18
30
  */
@@ -38,7 +50,7 @@ export declare function pickCarrierPage(pages: readonly Page[]): Nullable<Page>;
38
50
  * Records which window the shared one is, reading it from a page that sits in it.
39
51
  *
40
52
  * 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
41
- * 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.
53
+ * answer before anything asks for a capture tab.
42
54
  * @param browser - The browser whose shared window is being recorded.
43
55
  * @param page - A page that sits in that window.
44
56
  */
@@ -70,6 +82,13 @@ export type { LoginStatus } from "./login.ts";
70
82
  export { endLoginMode, getLoginPage, getLoginStatus, setLoginModeEndObserver, startLoginMode } from "./login.ts";
71
83
  export { BrowserCaptureImpairedError, BrowserSupersededError, BrowserUnavailableError } from "./browserSupervisor.ts";
72
84
  export type { BrowserPurpose, CaptureImpairment } from "./browserSupervisor.ts";
85
+ /**
86
+ * Thrown when the browser launched but its capture system failed a launch gate: the capture extension never became ready, or the capture probe found no
87
+ * working capture across its attempts. setupStream answers it as a capture-infrastructure failure by its type, so its message is free to state what happened.
88
+ */
89
+ export declare class CaptureLaunchError extends Error {
90
+ constructor(message: string, options?: ErrorOptions);
91
+ }
73
92
  /**
74
93
  * Brings the shared browser window into agreement with the visibility policy. This is the one entry point every layer uses - streaming, recovery, login,
75
94
  * precaching, and startup all call it and none of them decide window state themselves.
@@ -78,6 +97,25 @@ export type { BrowserPurpose, CaptureImpairment } from "./browserSupervisor.ts";
78
97
  * @returns A promise that resolves once a pass that began at or after this call has completed.
79
98
  */
80
99
  export declare function syncWindowVisibility(page?: Page): Promise<void>;
100
+ /**
101
+ * The facts a system status is composed from: the browser and capture state, and the process and registry readings taken beside them. One shape, read by
102
+ * emitCurrentSystemStatus and composed by composeSystemStatus, so the payload is a pure function of stated facts.
103
+ */
104
+ interface SystemStatusFacts {
105
+ readonly browser: Nullable<Pick<Browser, "connected">>;
106
+ readonly captureImpaired: boolean;
107
+ readonly memory: Pick<NodeJS.MemoryUsage, "heapUsed" | "rss">;
108
+ readonly pageCount: number;
109
+ readonly streams: SystemStatus["streams"];
110
+ readonly uptime: number;
111
+ }
112
+ /**
113
+ * Composes the system status the SSE bus carries. A browser reads as connected only when one is published and its connection is live, and the memory readings
114
+ * carry only the figures the status reports.
115
+ * @param facts - The browser and capture state and the process and registry readings, read at the moment the status is composed.
116
+ * @returns The system status.
117
+ */
118
+ export declare function composeSystemStatus(facts: SystemStatusFacts): SystemStatus;
81
119
  /**
82
120
  * Computes the current system status and emits it to SSE subscribers. Called when browser state changes significantly or when streams are added/removed.
83
121
  */
@@ -86,8 +124,8 @@ export declare function emitCurrentSystemStatus(): Promise<void>;
86
124
  * Registers a page as managed by PrismCast. This should be called immediately after creating a page via browser.newPage(). Registered pages are tracked for stale
87
125
  * page cleanup, while unregistered pages (manually opened, site popups, etc.) are left alone.
88
126
  *
89
- * 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
90
- * issues with Page object reference identity.
127
+ * Each registered page receives a unique ID that persists for the page's lifetime, read back through the Page reference by getManagedPageId. The staleness map,
128
+ * the in-flight set and the stale page cleanup's decision core all work on this stable string key rather than on Page objects.
91
129
  * @param page - The Puppeteer Page to register.
92
130
  * @param options - Registration options. Set inFlight when an operation owns the page for its duration but nothing the stale page cleanup reads records that
93
131
  * 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
@@ -104,11 +142,7 @@ export declare function registerManagedPage(page: Page, options?: {
104
142
  export declare function unregisterManagedPage(page: Page): void;
105
143
  /**
106
144
  * Ensures the data directory exists, creating it if necessary. This should be called during application startup before any operations that depend on the data
107
- * directory (like browser launch or extension preparation).
108
- *
109
- * The data directory stores:
110
- * - Chrome profile data (cookies, local storage, session state)
111
- * - Extension files (when running as a packaged executable)
145
+ * directory, browser launch above all, because the directory holds the Chrome profile data (cookies, local storage, session state).
112
146
  */
113
147
  export declare function ensureDataDirectory(): Promise<void>;
114
148
  /**
@@ -126,6 +160,20 @@ export declare function ensureDataDirectory(): Promise<void>;
126
160
  * @returns The PIDs to terminate, in process-table order.
127
161
  */
128
162
  export declare function findChromeProcessesUsingProfile(processes: readonly ProcessInfo[], profileDir: string, ownPid: number, isProcessAlive: (pid: number) => boolean): number[];
163
+ /**
164
+ * Finds a live Chrome outside this process that holds our profile directory. A Chrome holds the profile when it roots a tree of processes on the profile and the
165
+ * kill filter's ownership stage spares it, its parent alive and not this process. The test reads the root because Chrome's helpers carry the profile flag with
166
+ * the Chrome main as their parent, so a helper's parent, the main, is a live process that is not this one, and every helper of this process's own Chrome would
167
+ * otherwise read as a holder. It reads the ownership stage rather than a liveness test of its own so it stays in step with the kill filter: the sweep never keeps
168
+ * the files of a Chrome it ends nor removes those of one it spares. A helper whose parent lacks the profile flag reads as a root, so that error keeps the lock files
169
+ * rather than removing them, and the next sweep with no Chrome alive removes them.
170
+ * @param processes - The current process table snapshot: the sweep's scan from before its kill loop, or the teardown's scan once its Chrome has exited.
171
+ * @param profileDir - The Chrome user-data-dir to match against.
172
+ * @param ownPid - The current process's PID (a Chrome whose parent is us is ours, never a holder).
173
+ * @param isProcessAlive - Predicate that returns true when the given PID is currently a live process. Injected so tests do not depend on real PIDs.
174
+ * @returns The PID of the first holder in process-table order, or null when no live Chrome outside this process holds the profile.
175
+ */
176
+ export declare function findProfileHolder(processes: readonly ProcessInfo[], profileDir: string, ownPid: number, isProcessAlive: (pid: number) => boolean): Nullable<number>;
129
177
  /**
130
178
  * Ensures a clean slate for browser launch by terminating any stale Chrome processes and removing orphaned profile lock files. Chrome locks its profile
131
179
  * directory while running; if a previous instance crashed without releasing the lock, we cannot launch a new browser with the same profile. Discovery is done
@@ -137,13 +185,23 @@ export declare function findChromeProcessesUsingProfile(processes: readonly Proc
137
185
  * process exit handler: Chrome may be running normally (e.g., after a capture probe timeout) and an immediate SIGKILL would corrupt its profile databases,
138
186
  * poisoning the Docker volume for subsequent container restarts.
139
187
  *
140
- * The ownership filter makes this function safe to call from any context, including a rejected-duplicate startup's exit handler: a duplicate that never
141
- * spawned Chrome will find nothing matching its ownership criteria and signal nothing.
188
+ * The ownership filter and the holder test together make this function safe to call from any context, including a rejected-duplicate startup's exit handler: a
189
+ * duplicate that never spawned Chrome finds nothing matching its ownership criteria, signals nothing, and leaves the profile's lock files to the live Chrome
190
+ * that holds them.
142
191
  *
143
192
  * Called at startup before launching the browser and from the process exit handler as a crash recovery fallback. Safe to call when no stale processes or files
144
193
  * exist - the discovery and lock-file cleanup are both no-ops in the empty case.
145
194
  */
146
195
  export declare function killStaleChrome(): void;
196
+ /**
197
+ * Removes the profile's lock files and the DevTools port file unless a live Chrome outside this process holds the profile. Chrome writes these while running and
198
+ * removes them on clean shutdown, but an unclean exit (container kill, SIGKILL, crash) leaves them behind. Stale lock files prevent Chrome from acquiring the
199
+ * profile, and a stale DevToolsActivePort can confuse the Puppeteer connection. This is the one removal of those files, so each caller, the stale-Chrome sweep and
200
+ * the teardown primitive, reaches them through the holder test, and none removes them from under a live holder.
201
+ * @param processes - The process table the holder test reads: the sweep's scan from before its kill loop, or the teardown's scan once its Chrome has exited.
202
+ * @param profileDir - The Chrome user data directory path.
203
+ */
204
+ export declare function cleanStaleProfileFiles(processes: readonly ProcessInfo[], profileDir: string): void;
147
205
  /**
148
206
  * Seeds the extension developer-mode preference into the Chrome profile so the capture extension loads. Chrome loads an unpacked extension only when the profile
149
207
  * has extension developer mode enabled, and PrismCast's capture extension is loaded unpacked...without the flag the extension never registers and the capture
@@ -201,6 +259,18 @@ export declare function emulateLayoutSurface(page: Page): Promise<{
201
259
  height: number;
202
260
  width: number;
203
261
  }>;
262
+ /**
263
+ * Re-issues a capture page's own standing device-metrics override. Chrome composes the capture of a selected tab from the window's fitted presentation rather than
264
+ * from the emulated surface, and re-sending the page's standing override is what moves the composition back to the emulated surface, while a capture already
265
+ * composing that surface is left exactly as it was. Callable at any time, from anywhere, at any frequency, because the values sent are the ones Puppeteer has
266
+ * already declared on this page - nothing about the page's emulation changes.
267
+ *
268
+ * The re-issue goes through the page's own emulation session, the one Puppeteer keeps on the page's primary target, because the override is only as durable as
269
+ * the session that holds it and Chrome restores the window's view size when a session that declared one detaches.
270
+ * @param page - The page to re-affirm. A page carrying no explicitly declared density is left alone.
271
+ * @throws Whatever the viewport setter rejects with. Each trigger site decides whether that matters to it.
272
+ */
273
+ export declare function reaffirmCaptureSurface(page: Page): Promise<void>;
204
274
  /**
205
275
  * 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
206
276
  * 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
@@ -219,14 +289,17 @@ export declare function mirrorPlacement(placement: WindowPlacement): {
219
289
  /**
220
290
  * Opens a page for a channel guide discovery walk in a browser window of its own, and marks it as belonging to that window.
221
291
  *
222
- * A document renders only while it is the active tab of a window that is not minimized, and the shared window rests minimized whenever nothing is capturing and
223
- * no sign-in holds it on screen, with its selected tab belonging to the user. A guide walk needs its page to render - an observer-driven channel rail fills its
224
- * tiles from rendering updates, and a virtualized grid re-renders as the walk scrolls it - yet it is never captured, so it has no claim on the shared window's
225
- * presentation and no business moving the user's selection. Its own window resolves both: the page is the active tab there from the moment it exists.
292
+ * 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
293
+ * 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
294
+ * 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
295
+ * 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
296
+ * 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
297
+ * 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
298
+ * 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
299
+ * presentation half, for the page's whole life - Puppeteer's own emulateFocusedPage carries the mechanism, on the page's own session.
226
300
  *
227
- * The window is created in the background, so Chrome shows it inactive and moves no focus (measured 2026-08-31), and at the shared window's own placement, so
228
- * the window placement Chrome persists for the profile never changes - readWindowPlacement carries the reasoning. The caller declares the layout surface on
229
- * the page and owns its registration, and closing the page closes the window with it.
301
+ * The window opens at the shared window's own placement, so the window placement Chrome persists for the profile never changes - readWindowPlacement carries
302
+ * the reasoning. The caller declares the layout surface on the page and owns its registration, and closing the page closes the window with it.
230
303
  * @param browser - The browser to open the window in.
231
304
  * @returns The page, as the active tab of its own window.
232
305
  */
@@ -250,7 +323,7 @@ export declare function createDiscoveryPage(browser: Browser): Promise<Page>;
250
323
  * @param page - The capture page this callback re-affirms.
251
324
  * @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
252
325
  * it was built for, what schedule it keeps, and what it does with a rejection, is the whole of its contract.
253
- * @param clock - The time source the ladder's waits run on. Defaults to realClock.
326
+ * @param clock - The time source the ladder's waits run on. Defaults to the system clock.
254
327
  * @returns The callback, which never rejects. Its promise settles once the ladder is spent, which the page-side listener does not wait on.
255
328
  */
256
329
  export declare function makeFocusReaffirmCallback(page: Page, reaffirm: (page: Page) => Promise<void>, clock?: Clock): () => Promise<void>;
@@ -294,18 +367,23 @@ export declare function healActivatedCaptureTab(tabId: number, deps?: {
294
367
  readonly getCachedTabId: typeof getCachedTabId;
295
368
  }): void;
296
369
  /**
297
- * Records that a still-connected browser can no longer start captures - a mid-life capture death that no "disconnected" event would surface - and schedules the
370
+ * 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
298
371
  * 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
299
372
  * running captures continue untouched, new stream requests are refused at acquire() with a 503 back-off, the recovery ladder stops offering tab replacement, and
300
- * the relaunch waits for the registry to empty. Exported for the streaming layer to call once its probe or its wedge has produced the verdict.
373
+ * 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.
374
+ *
375
+ * 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
376
+ * holds the supervisor in its draining state, where acquire() rejects rather than joins, so acquiring any earlier draws that rejection instead of the new
377
+ * instance. A caller with nothing waiting on the outcome voids it and the relaunch proceeds on its own.
301
378
  *
302
379
  * The restart trigger uses this function's return value rather than the supervisor's transition observer, deliberately. The observer runs inside transition(), so a
303
380
  * restart begun there would call noteReadinessLost re-entrantly while the marking transition's notification is still on the stack. The observer stays a reporter -
304
381
  * the alarm and the status emit - and the caller that holds the verdict acts on it once the transition has completed.
305
382
  * @param browser - The specific browser instance the caller verified as unable to start captures.
306
383
  * @param reason - A short description of the evidence behind the verdict, carried in the alarm log and the impairment record.
384
+ * @returns A promise settling once the relaunch this mark triggered has settled, or at once when the verdict landed on nothing.
307
385
  */
308
- export declare function noteBrowserCaptureImpaired(browser: Browser, reason: string): void;
386
+ export declare function noteBrowserCaptureImpaired(browser: Browser, reason: string): Promise<void>;
309
387
  /**
310
388
  * 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
311
389
  * 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),
@@ -363,43 +441,98 @@ export declare function closeBrowser(): Promise<void>;
363
441
  * 2. Exclude pages associated with active streams, and pages an operation still holds in flight
364
442
  * 3. Apply a grace period before closing (to handle race conditions)
365
443
  * 4. Preserve at least one page to keep the browser alive
444
+ * @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
445
+ * later reads are stamped on one time source.
366
446
  */
367
- export declare function cleanupStalePages(): Promise<void>;
447
+ export declare function cleanupStalePages(now: number): Promise<void>;
368
448
  /**
369
- * Starts the periodic stale page cleanup interval. This should be called once during server startup, after the browser is initialized. The interval runs
370
- * indefinitely until stopStalePageCleanup() is called (typically during graceful shutdown).
449
+ * Starts the periodic stale page cleanup. This should be called once during server startup, after the browser is initialized. The sweep runs indefinitely until
450
+ * stopStalePageCleanup() is called (typically during graceful shutdown), and a saved interval re-arms it through applyStalePageCleanupChanges(). A second start
451
+ * while one is running changes nothing.
452
+ * @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
453
+ * source. Defaults to the system clock.
371
454
  */
372
- export declare function startStalePageCleanup(): void;
455
+ export declare function startStalePageCleanup(clock?: Clock): void;
373
456
  /**
374
- * Stops the stale page cleanup interval. This should be called during graceful shutdown to prevent the cleanup from running after we've started shutting down
375
- * the browser and streams.
457
+ * 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
458
+ * browser and streams. Disposing the registry drains the interval, and a stop with nothing running is a no-op.
376
459
  */
377
460
  export declare function stopStalePageCleanup(): void;
461
+ /**
462
+ * Re-arms the running stale-page sweep at a saved cleanup interval. The re-arm restarts the cadence from the save, so the next sweep runs one full interval after
463
+ * it, and the grace period needs nothing here, because each sweep already reads it when it runs. The handler reads the running sweep and never creates one, so a
464
+ * save before the boot's start or after the stop arms nothing, and a save can never resurrect a stopped sweep. The interval comes from the candidate, because
465
+ * the reconcile commits CONFIG only after its handlers run. Re-arming cannot fail, so the handler refuses nothing.
466
+ * @param _changes - The change to the cleanup interval; the candidate carries the interval, so the handler reads that instead.
467
+ * @param next - The candidate running configuration.
468
+ * @returns No rejections.
469
+ */
470
+ export declare function applyStalePageCleanupChanges(_changes: readonly ConfigChange[], next: Readonly<Config>): Promise<readonly ChangeRejection[]>;
471
+ /**
472
+ * The registry facts a restart's idleness decision is made from. One shape, read by readRestartFacts and judged by isBrowserIdleForRestart, so the decision stays
473
+ * a pure function of stated facts rather than of whatever each guard happened to read.
474
+ */
475
+ interface RestartFacts {
476
+ readonly establishedStreams: boolean;
477
+ readonly inFlightPages: number;
478
+ readonly streamCount: number;
479
+ }
480
+ /**
481
+ * 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
482
+ * the decision is stated once here rather than spelled out at each guard.
483
+ *
484
+ * 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
485
+ * 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
486
+ * 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
487
+ * 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
488
+ * 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
489
+ * 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
490
+ * case, so the relaunch may run under it.
491
+ * @param cause - Why the restart wants to run.
492
+ * @param facts - The registry facts read at the call.
493
+ * @returns True when the browser may be torn down for this cause.
494
+ */
495
+ export declare function isBrowserIdleForRestart(cause: BrowserRestartCause, facts: RestartFacts): boolean;
496
+ /**
497
+ * The facts the maintenance quiet period is decided from. One shape, read by the restart check's tick and judged by decideRestartQuietPeriod, so the decision is
498
+ * a pure function of stated facts in the way the idleness decision is.
499
+ */
500
+ interface QuietPeriodFacts {
501
+ readonly age: number;
502
+ readonly quietPending: boolean;
503
+ readonly streamCount: number;
504
+ }
505
+ export type QuietPeriodAction = "arm" | "cancel" | "skip";
506
+ /**
507
+ * Decides what a restart check's tick does about the maintenance quiet period. A browser younger than BROWSER_MAX_AGE needs no maintenance, so the tick leaves
508
+ * the countdown as it stands. An old browser with streams registered waits for them: a countdown already running is cancelled, so a stream that starts during
509
+ * the quiet period resets it, and with no countdown running there is nothing to do. An old browser with an empty registry starts the countdown, unless one is
510
+ * already running.
511
+ * @param facts - The browser's age, the registry's size and the countdown's state, read at the tick.
512
+ * @returns The action the tick takes.
513
+ */
514
+ export declare function decideRestartQuietPeriod(facts: QuietPeriodFacts): QuietPeriodAction;
378
515
  /**
379
516
  * 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,
380
517
  * 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
381
518
  * 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
382
- * captures are still worth finishing, so the earliest safe moment is exactly the moment the last of them ends.
519
+ * 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.
520
+ *
521
+ * 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
522
+ * outcome voids it. An early return resolves at once, because there is nothing for such a caller to wait for.
523
+ * @returns A promise settling once the relaunch has settled, or at once when no relaunch runs.
383
524
  */
384
- export declare function restartBrowserIfImpairedAndIdle(): void;
525
+ export declare function restartBrowserIfImpairedAndIdle(): Promise<void>;
385
526
  /**
386
- * Starts the periodic browser restart eligibility check. This should be called once during server startup, after the browser is initialized. The interval runs
387
- * indefinitely until stopBrowserRestartChecking() is called (typically during graceful shutdown).
527
+ * Starts the periodic browser restart eligibility check. This should be called once during server startup, after the browser is initialized. The check runs
528
+ * indefinitely until stopBrowserRestartChecking() is called (typically during graceful shutdown). A second start while one is running changes nothing.
529
+ * @param clock - The clock the check's interval and the quiet period it arms both run on, and the browser's age is measured on. Defaults to the system clock.
388
530
  */
389
- export declare function startBrowserRestartChecking(): void;
531
+ export declare function startBrowserRestartChecking(clock?: Clock): void;
390
532
  /**
391
- * Stops the browser restart checking interval and cancels any pending quiet timer. This should be called during graceful shutdown to prevent a restart from
392
- * racing with server shutdown.
533
+ * Stops the periodic browser restart eligibility check. This should be called during graceful shutdown to prevent a restart from racing with server shutdown.
534
+ * Disposing the registry drains the check and any pending quiet period together, and a stop with nothing running is a no-op.
393
535
  */
394
536
  export declare function stopBrowserRestartChecking(): void;
395
- /**
396
- * Extracts the Puppeteer Stream extension files when running as a packaged executable. This copies the extension files from within the packaged binary to the
397
- * filesystem where Chrome can load them.
398
- *
399
- * When running from source (not packaged), this function does nothing - puppeteer-stream can load the extension directly from node_modules.
400
- * @throws If extension extraction fails.
401
- */
402
- export declare function prepareExtension(): Promise<void>;
403
537
  export { acquireCaptureStream } from "./tabCapture.ts";
404
538
  export type { CaptureStream, CaptureStreamOptions } from "./tabCapture.ts";
405
- //# sourceMappingURL=index.d.ts.map