prismcast 1.10.2 → 1.11.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 (693) hide show
  1. package/dist/app.d.ts +6 -3
  2. package/dist/app.d.ts.map +1 -0
  3. package/dist/app.js +140 -86
  4. package/dist/app.js.map +1 -1
  5. package/dist/browser/blockedPage.d.ts +80 -0
  6. package/dist/browser/blockedPage.d.ts.map +1 -0
  7. package/dist/browser/blockedPage.js +209 -0
  8. package/dist/browser/blockedPage.js.map +1 -0
  9. package/dist/browser/browserSupervisor.d.ts +80 -0
  10. package/dist/browser/browserSupervisor.d.ts.map +1 -0
  11. package/dist/browser/browserSupervisor.js +186 -0
  12. package/dist/browser/browserSupervisor.js.map +1 -0
  13. package/dist/browser/cdp.d.ts +1 -0
  14. package/dist/browser/cdp.d.ts.map +1 -0
  15. package/dist/browser/cdp.js +6 -5
  16. package/dist/browser/cdp.js.map +1 -1
  17. package/dist/browser/channelSelection.d.ts +45 -14
  18. package/dist/browser/channelSelection.d.ts.map +1 -0
  19. package/dist/browser/channelSelection.js +81 -18
  20. package/dist/browser/channelSelection.js.map +1 -1
  21. package/dist/browser/consent.d.ts +152 -0
  22. package/dist/browser/consent.d.ts.map +1 -0
  23. package/dist/browser/consent.js +418 -0
  24. package/dist/browser/consent.js.map +1 -0
  25. package/dist/browser/display.d.ts +1 -0
  26. package/dist/browser/display.d.ts.map +1 -0
  27. package/dist/browser/hlsPlaylistObserver.d.ts +55 -0
  28. package/dist/browser/hlsPlaylistObserver.d.ts.map +1 -0
  29. package/dist/browser/hlsPlaylistObserver.js +132 -0
  30. package/dist/browser/hlsPlaylistObserver.js.map +1 -0
  31. package/dist/browser/index.d.ts +67 -40
  32. package/dist/browser/index.d.ts.map +1 -0
  33. package/dist/browser/index.js +508 -300
  34. package/dist/browser/index.js.map +1 -1
  35. package/dist/browser/launchGovernor.d.ts +89 -0
  36. package/dist/browser/launchGovernor.d.ts.map +1 -0
  37. package/dist/browser/launchGovernor.js +96 -0
  38. package/dist/browser/launchGovernor.js.map +1 -0
  39. package/dist/browser/login.d.ts +10 -2
  40. package/dist/browser/login.d.ts.map +1 -0
  41. package/dist/browser/login.js +36 -5
  42. package/dist/browser/login.js.map +1 -1
  43. package/dist/browser/manifestInterceptor.d.ts +102 -49
  44. package/dist/browser/manifestInterceptor.d.ts.map +1 -0
  45. package/dist/browser/manifestInterceptor.js +219 -237
  46. package/dist/browser/manifestInterceptor.js.map +1 -1
  47. package/dist/browser/pageStaleness.d.ts +30 -0
  48. package/dist/browser/pageStaleness.d.ts.map +1 -0
  49. package/dist/browser/pageStaleness.js +76 -0
  50. package/dist/browser/pageStaleness.js.map +1 -0
  51. package/dist/browser/precaching.d.ts +95 -3
  52. package/dist/browser/precaching.d.ts.map +1 -0
  53. package/dist/browser/precaching.js +499 -65
  54. package/dist/browser/precaching.js.map +1 -1
  55. package/dist/browser/tabNetworkObserver.d.ts +49 -0
  56. package/dist/browser/tabNetworkObserver.d.ts.map +1 -0
  57. package/dist/browser/tabNetworkObserver.js +144 -0
  58. package/dist/browser/tabNetworkObserver.js.map +1 -0
  59. package/dist/browser/tuning/cache.d.ts +61 -0
  60. package/dist/browser/tuning/cache.d.ts.map +1 -0
  61. package/dist/browser/tuning/cache.js +62 -0
  62. package/dist/browser/tuning/cache.js.map +1 -0
  63. package/dist/browser/tuning/comcastPolymer.d.ts +3 -2
  64. package/dist/browser/tuning/comcastPolymer.d.ts.map +1 -0
  65. package/dist/browser/tuning/comcastPolymer.js +79 -102
  66. package/dist/browser/tuning/comcastPolymer.js.map +1 -1
  67. package/dist/browser/tuning/cox.d.ts +1 -0
  68. package/dist/browser/tuning/cox.d.ts.map +1 -0
  69. package/dist/browser/tuning/directv.d.ts +1 -0
  70. package/dist/browser/tuning/directv.d.ts.map +1 -0
  71. package/dist/browser/tuning/directv.js +52 -46
  72. package/dist/browser/tuning/directv.js.map +1 -1
  73. package/dist/browser/tuning/fox.d.ts +1 -0
  74. package/dist/browser/tuning/fox.d.ts.map +1 -0
  75. package/dist/browser/tuning/fox.js +13 -12
  76. package/dist/browser/tuning/fox.js.map +1 -1
  77. package/dist/browser/tuning/gridSearch.d.ts +68 -0
  78. package/dist/browser/tuning/gridSearch.d.ts.map +1 -0
  79. package/dist/browser/tuning/gridSearch.js +85 -0
  80. package/dist/browser/tuning/gridSearch.js.map +1 -0
  81. package/dist/browser/tuning/hbo.d.ts +1 -0
  82. package/dist/browser/tuning/hbo.d.ts.map +1 -0
  83. package/dist/browser/tuning/hbo.js +73 -45
  84. package/dist/browser/tuning/hbo.js.map +1 -1
  85. package/dist/browser/tuning/hulu.d.ts +1 -0
  86. package/dist/browser/tuning/hulu.d.ts.map +1 -0
  87. package/dist/browser/tuning/hulu.js +128 -173
  88. package/dist/browser/tuning/hulu.js.map +1 -1
  89. package/dist/browser/tuning/shared.d.ts +75 -5
  90. package/dist/browser/tuning/shared.d.ts.map +1 -0
  91. package/dist/browser/tuning/shared.js +216 -6
  92. package/dist/browser/tuning/shared.js.map +1 -1
  93. package/dist/browser/tuning/sling.d.ts +1 -0
  94. package/dist/browser/tuning/sling.d.ts.map +1 -0
  95. package/dist/browser/tuning/sling.js +105 -126
  96. package/dist/browser/tuning/sling.js.map +1 -1
  97. package/dist/browser/tuning/spectrum.d.ts +1 -0
  98. package/dist/browser/tuning/spectrum.d.ts.map +1 -0
  99. package/dist/browser/tuning/spectrum.js +80 -125
  100. package/dist/browser/tuning/spectrum.js.map +1 -1
  101. package/dist/browser/tuning/thumbnailRow.d.ts +1 -0
  102. package/dist/browser/tuning/thumbnailRow.d.ts.map +1 -0
  103. package/dist/browser/tuning/thumbnailRow.js +8 -2
  104. package/dist/browser/tuning/thumbnailRow.js.map +1 -1
  105. package/dist/browser/tuning/tileClick.d.ts +1 -0
  106. package/dist/browser/tuning/tileClick.d.ts.map +1 -0
  107. package/dist/browser/tuning/tileClick.js +3 -2
  108. package/dist/browser/tuning/tileClick.js.map +1 -1
  109. package/dist/browser/tuning/xfinity.d.ts +1 -0
  110. package/dist/browser/tuning/xfinity.d.ts.map +1 -0
  111. package/dist/browser/tuning/youtubeTv.d.ts +1 -0
  112. package/dist/browser/tuning/youtubeTv.d.ts.map +1 -0
  113. package/dist/browser/tuning/youtubeTv.js +74 -127
  114. package/dist/browser/tuning/youtubeTv.js.map +1 -1
  115. package/dist/browser/video.d.ts +54 -14
  116. package/dist/browser/video.d.ts.map +1 -0
  117. package/dist/browser/video.js +296 -138
  118. package/dist/browser/video.js.map +1 -1
  119. package/dist/channels/index.d.ts +1 -0
  120. package/dist/channels/index.d.ts.map +1 -0
  121. package/dist/channels/index.js +12 -9
  122. package/dist/channels/index.js.map +1 -1
  123. package/dist/config/channelForm.d.ts +15 -1
  124. package/dist/config/channelForm.d.ts.map +1 -0
  125. package/dist/config/channelForm.js +28 -12
  126. package/dist/config/channelForm.js.map +1 -1
  127. package/dist/config/consistencyProbe.d.ts +1 -0
  128. package/dist/config/consistencyProbe.d.ts.map +1 -0
  129. package/dist/config/consistencyProbe.js +27 -21
  130. package/dist/config/consistencyProbe.js.map +1 -1
  131. package/dist/config/health.d.ts +41 -8
  132. package/dist/config/health.d.ts.map +1 -0
  133. package/dist/config/health.js +189 -38
  134. package/dist/config/health.js.map +1 -1
  135. package/dist/config/index.d.ts +55 -3
  136. package/dist/config/index.d.ts.map +1 -0
  137. package/dist/config/index.js +320 -69
  138. package/dist/config/index.js.map +1 -1
  139. package/dist/config/paths.d.ts +10 -9
  140. package/dist/config/paths.d.ts.map +1 -0
  141. package/dist/config/paths.js +11 -11
  142. package/dist/config/paths.js.map +1 -1
  143. package/dist/config/persistence.context.d.ts +1 -0
  144. package/dist/config/persistence.context.d.ts.map +1 -0
  145. package/dist/config/persistence.d.ts +13 -10
  146. package/dist/config/persistence.d.ts.map +1 -0
  147. package/dist/config/persistence.js +40 -21
  148. package/dist/config/persistence.js.map +1 -1
  149. package/dist/config/presets.d.ts +1 -0
  150. package/dist/config/presets.d.ts.map +1 -0
  151. package/dist/config/profiles.d.ts +22 -15
  152. package/dist/config/profiles.d.ts.map +1 -0
  153. package/dist/config/profiles.js +81 -47
  154. package/dist/config/profiles.js.map +1 -1
  155. package/dist/config/providerLineups.d.ts +47 -0
  156. package/dist/config/providerLineups.d.ts.map +1 -0
  157. package/dist/config/providerLineups.js +137 -0
  158. package/dist/config/providerLineups.js.map +1 -0
  159. package/dist/config/reactivity.d.ts +84 -0
  160. package/dist/config/reactivity.d.ts.map +1 -0
  161. package/dist/config/reactivity.js +226 -0
  162. package/dist/config/reactivity.js.map +1 -0
  163. package/dist/config/servicePacks.d.ts +18 -2
  164. package/dist/config/servicePacks.d.ts.map +1 -0
  165. package/dist/config/servicePacks.js +53 -11
  166. package/dist/config/servicePacks.js.map +1 -1
  167. package/dist/config/services.d.ts +21 -15
  168. package/dist/config/services.d.ts.map +1 -0
  169. package/dist/config/services.js +35 -24
  170. package/dist/config/services.js.map +1 -1
  171. package/dist/config/sites.d.ts +6 -4
  172. package/dist/config/sites.d.ts.map +1 -0
  173. package/dist/config/sites.js +15 -11
  174. package/dist/config/sites.js.map +1 -1
  175. package/dist/config/userChannels.d.ts +129 -30
  176. package/dist/config/userChannels.d.ts.map +1 -0
  177. package/dist/config/userChannels.js +333 -68
  178. package/dist/config/userChannels.js.map +1 -1
  179. package/dist/config/userConfig.d.ts +14 -9
  180. package/dist/config/userConfig.d.ts.map +1 -0
  181. package/dist/config/userConfig.js +87 -25
  182. package/dist/config/userConfig.js.map +1 -1
  183. package/dist/config/userProfiles.d.ts +10 -6
  184. package/dist/config/userProfiles.d.ts.map +1 -0
  185. package/dist/config/userProfiles.js +64 -39
  186. package/dist/config/userProfiles.js.map +1 -1
  187. package/dist/hdhr/channelMap.d.ts +1 -0
  188. package/dist/hdhr/channelMap.d.ts.map +1 -0
  189. package/dist/hdhr/deviceId.d.ts +1 -0
  190. package/dist/hdhr/deviceId.d.ts.map +1 -0
  191. package/dist/hdhr/discover.d.ts +1 -0
  192. package/dist/hdhr/discover.d.ts.map +1 -0
  193. package/dist/hdhr/discover.js +48 -47
  194. package/dist/hdhr/discover.js.map +1 -1
  195. package/dist/hdhr/getHandlers.d.ts +29 -0
  196. package/dist/hdhr/getHandlers.d.ts.map +1 -0
  197. package/dist/hdhr/getHandlers.js +196 -0
  198. package/dist/hdhr/getHandlers.js.map +1 -0
  199. package/dist/hdhr/identity.d.ts +36 -0
  200. package/dist/hdhr/identity.d.ts.map +1 -0
  201. package/dist/hdhr/identity.js +51 -0
  202. package/dist/hdhr/identity.js.map +1 -0
  203. package/dist/hdhr/index.d.ts +22 -4
  204. package/dist/hdhr/index.d.ts.map +1 -0
  205. package/dist/hdhr/index.js +229 -54
  206. package/dist/hdhr/index.js.map +1 -1
  207. package/dist/hdhr/protocol.d.ts +75 -0
  208. package/dist/hdhr/protocol.d.ts.map +1 -0
  209. package/dist/hdhr/protocol.js +264 -0
  210. package/dist/hdhr/protocol.js.map +1 -0
  211. package/dist/hdhr/tunerState.d.ts +24 -0
  212. package/dist/hdhr/tunerState.d.ts.map +1 -0
  213. package/dist/hdhr/tunerState.js +67 -0
  214. package/dist/hdhr/tunerState.js.map +1 -0
  215. package/dist/hdhr/udp.d.ts +43 -0
  216. package/dist/hdhr/udp.d.ts.map +1 -0
  217. package/dist/hdhr/udp.js +277 -0
  218. package/dist/hdhr/udp.js.map +1 -0
  219. package/dist/identity.d.ts +1 -0
  220. package/dist/identity.d.ts.map +1 -0
  221. package/dist/identity.js +13 -11
  222. package/dist/identity.js.map +1 -1
  223. package/dist/index.d.ts +1 -0
  224. package/dist/index.d.ts.map +1 -0
  225. package/dist/index.js +11 -12
  226. package/dist/index.js.map +1 -1
  227. package/dist/native/codecInference.d.ts +1 -0
  228. package/dist/native/codecInference.d.ts.map +1 -0
  229. package/dist/native/codecInference.js +50 -5
  230. package/dist/native/codecInference.js.map +1 -1
  231. package/dist/native/decrypt.d.ts +6 -2
  232. package/dist/native/decrypt.d.ts.map +1 -0
  233. package/dist/native/decrypt.js +15 -8
  234. package/dist/native/decrypt.js.map +1 -1
  235. package/dist/native/index.d.ts +40 -17
  236. package/dist/native/index.d.ts.map +1 -0
  237. package/dist/native/index.js +281 -120
  238. package/dist/native/index.js.map +1 -1
  239. package/dist/native/probe.d.ts +114 -18
  240. package/dist/native/probe.d.ts.map +1 -0
  241. package/dist/native/probe.js +452 -115
  242. package/dist/native/probe.js.map +1 -1
  243. package/dist/native/proxy.d.ts +57 -5
  244. package/dist/native/proxy.d.ts.map +1 -0
  245. package/dist/native/proxy.js +604 -170
  246. package/dist/native/proxy.js.map +1 -1
  247. package/dist/native/tokenExpiry.d.ts +1 -0
  248. package/dist/native/tokenExpiry.d.ts.map +1 -0
  249. package/dist/native/tokenExpiry.js +1 -1
  250. package/dist/routes/assets.d.ts +1 -0
  251. package/dist/routes/assets.d.ts.map +1 -0
  252. package/dist/routes/assets.js +4 -2
  253. package/dist/routes/assets.js.map +1 -1
  254. package/dist/routes/auth.d.ts +1 -0
  255. package/dist/routes/auth.d.ts.map +1 -0
  256. package/dist/routes/auth.js +0 -1
  257. package/dist/routes/auth.js.map +1 -1
  258. package/dist/routes/cdp.d.ts +5 -5
  259. package/dist/routes/cdp.d.ts.map +1 -0
  260. package/dist/routes/cdp.js +59 -20
  261. package/dist/routes/cdp.js.map +1 -1
  262. package/dist/routes/channels.d.ts +1 -0
  263. package/dist/routes/channels.d.ts.map +1 -0
  264. package/dist/routes/channels.js +2 -1
  265. package/dist/routes/channels.js.map +1 -1
  266. package/dist/routes/clientActions.d.ts +98 -0
  267. package/dist/routes/clientActions.d.ts.map +1 -0
  268. package/dist/routes/clientActions.js +113 -0
  269. package/dist/routes/clientActions.js.map +1 -0
  270. package/dist/routes/components.d.ts +5 -3
  271. package/dist/routes/components.d.ts.map +1 -0
  272. package/dist/routes/components.js +36 -39
  273. package/dist/routes/components.js.map +1 -1
  274. package/dist/routes/config/channels/endpoints/browse.d.ts +1 -0
  275. package/dist/routes/config/channels/endpoints/browse.d.ts.map +1 -0
  276. package/dist/routes/config/channels/endpoints/browse.js +23 -10
  277. package/dist/routes/config/channels/endpoints/browse.js.map +1 -1
  278. package/dist/routes/config/channels/endpoints/bulk.d.ts +1 -0
  279. package/dist/routes/config/channels/endpoints/bulk.d.ts.map +1 -0
  280. package/dist/routes/config/channels/endpoints/bulk.js +5 -3
  281. package/dist/routes/config/channels/endpoints/bulk.js.map +1 -1
  282. package/dist/routes/config/channels/endpoints/crud.d.ts +1 -0
  283. package/dist/routes/config/channels/endpoints/crud.d.ts.map +1 -0
  284. package/dist/routes/config/channels/endpoints/crud.js +85 -93
  285. package/dist/routes/config/channels/endpoints/crud.js.map +1 -1
  286. package/dist/routes/config/channels/endpoints/importExport.d.ts +1 -0
  287. package/dist/routes/config/channels/endpoints/importExport.d.ts.map +1 -0
  288. package/dist/routes/config/channels/endpoints/importExport.js +6 -3
  289. package/dist/routes/config/channels/endpoints/importExport.js.map +1 -1
  290. package/dist/routes/config/channels/endpoints/predefined.d.ts +1 -0
  291. package/dist/routes/config/channels/endpoints/predefined.d.ts.map +1 -0
  292. package/dist/routes/config/channels/endpoints/prefs.d.ts +1 -0
  293. package/dist/routes/config/channels/endpoints/prefs.d.ts.map +1 -0
  294. package/dist/routes/config/channels/endpoints/prefs.js +2 -1
  295. package/dist/routes/config/channels/endpoints/prefs.js.map +1 -1
  296. package/dist/routes/config/channels/endpoints/service.d.ts +2 -1
  297. package/dist/routes/config/channels/endpoints/service.d.ts.map +1 -0
  298. package/dist/routes/config/channels/endpoints/service.js +3 -1
  299. package/dist/routes/config/channels/endpoints/service.js.map +1 -1
  300. package/dist/routes/config/channels/endpoints/tags.d.ts +1 -0
  301. package/dist/routes/config/channels/endpoints/tags.d.ts.map +1 -0
  302. package/dist/routes/config/channels/endpoints/tags.js +13 -7
  303. package/dist/routes/config/channels/endpoints/tags.js.map +1 -1
  304. package/dist/routes/config/channels/healthBridge.d.ts +24 -0
  305. package/dist/routes/config/channels/healthBridge.d.ts.map +1 -0
  306. package/dist/routes/config/channels/healthBridge.js +71 -0
  307. package/dist/routes/config/channels/healthBridge.js.map +1 -0
  308. package/dist/routes/config/channels/http/handler.d.ts +1 -0
  309. package/dist/routes/config/channels/http/handler.d.ts.map +1 -0
  310. package/dist/routes/config/channels/http/playlistHint.d.ts +2 -1
  311. package/dist/routes/config/channels/http/playlistHint.d.ts.map +1 -0
  312. package/dist/routes/config/channels/http/playlistHint.js +16 -2
  313. package/dist/routes/config/channels/http/playlistHint.js.map +1 -1
  314. package/dist/routes/config/channels/http/serviceWarning.d.ts +4 -2
  315. package/dist/routes/config/channels/http/serviceWarning.d.ts.map +1 -0
  316. package/dist/routes/config/channels/http/serviceWarning.js +3 -2
  317. package/dist/routes/config/channels/http/serviceWarning.js.map +1 -1
  318. package/dist/routes/config/channels/index.d.ts +1 -0
  319. package/dist/routes/config/channels/index.d.ts.map +1 -0
  320. package/dist/routes/config/channels/setup.d.ts +1 -0
  321. package/dist/routes/config/channels/setup.d.ts.map +1 -0
  322. package/dist/routes/config/channels/table.d.ts +3 -3
  323. package/dist/routes/config/channels/table.d.ts.map +1 -0
  324. package/dist/routes/config/channels/table.js +148 -107
  325. package/dist/routes/config/channels/table.js.map +1 -1
  326. package/dist/routes/config/http/envelope.d.ts +1 -0
  327. package/dist/routes/config/http/envelope.d.ts.map +1 -0
  328. package/dist/routes/config/index.d.ts +35 -3
  329. package/dist/routes/config/index.d.ts.map +1 -0
  330. package/dist/routes/config/index.js +51 -2
  331. package/dist/routes/config/index.js.map +1 -1
  332. package/dist/routes/config/services.d.ts +5 -4
  333. package/dist/routes/config/services.d.ts.map +1 -0
  334. package/dist/routes/config/services.js +57 -43
  335. package/dist/routes/config/services.js.map +1 -1
  336. package/dist/routes/config/settings.d.ts +1 -0
  337. package/dist/routes/config/settings.d.ts.map +1 -0
  338. package/dist/routes/config/settings.js +98 -49
  339. package/dist/routes/config/settings.js.map +1 -1
  340. package/dist/routes/debug.d.ts +1 -0
  341. package/dist/routes/debug.d.ts.map +1 -0
  342. package/dist/routes/debug.js +277 -139
  343. package/dist/routes/debug.js.map +1 -1
  344. package/dist/routes/health.d.ts +39 -1
  345. package/dist/routes/health.d.ts.map +1 -0
  346. package/dist/routes/health.js +33 -27
  347. package/dist/routes/health.js.map +1 -1
  348. package/dist/routes/hls.d.ts +1 -0
  349. package/dist/routes/hls.d.ts.map +1 -0
  350. package/dist/routes/icons.d.ts +1 -0
  351. package/dist/routes/icons.d.ts.map +1 -0
  352. package/dist/routes/icons.js +1 -1
  353. package/dist/routes/index.d.ts +1 -0
  354. package/dist/routes/index.d.ts.map +1 -0
  355. package/dist/routes/logs.d.ts +1 -0
  356. package/dist/routes/logs.d.ts.map +1 -0
  357. package/dist/routes/logs.js +14 -4
  358. package/dist/routes/logs.js.map +1 -1
  359. package/dist/routes/mpegts.d.ts +1 -0
  360. package/dist/routes/mpegts.d.ts.map +1 -0
  361. package/dist/routes/play.d.ts +1 -0
  362. package/dist/routes/play.d.ts.map +1 -0
  363. package/dist/routes/playlist.d.ts +1 -0
  364. package/dist/routes/playlist.d.ts.map +1 -0
  365. package/dist/routes/playlist.js +7 -2
  366. package/dist/routes/playlist.js.map +1 -1
  367. package/dist/routes/root/content.d.ts +8 -5
  368. package/dist/routes/root/content.d.ts.map +1 -0
  369. package/dist/routes/root/content.js +29 -26
  370. package/dist/routes/root/content.js.map +1 -1
  371. package/dist/routes/root/index.d.ts +2 -1
  372. package/dist/routes/root/index.d.ts.map +1 -0
  373. package/dist/routes/root/index.js +26 -21
  374. package/dist/routes/root/index.js.map +1 -1
  375. package/dist/routes/root/scripts/channels.d.ts +6 -0
  376. package/dist/routes/root/scripts/channels.d.ts.map +1 -0
  377. package/dist/routes/root/scripts/channels.js +197 -118
  378. package/dist/routes/root/scripts/channels.js.map +1 -1
  379. package/dist/routes/root/scripts/clientEscape.d.ts +22 -0
  380. package/dist/routes/root/scripts/clientEscape.d.ts.map +1 -0
  381. package/dist/routes/root/scripts/clientEscape.js +41 -0
  382. package/dist/routes/root/scripts/clientEscape.js.map +1 -0
  383. package/dist/routes/root/scripts/clientUrl.d.ts +23 -0
  384. package/dist/routes/root/scripts/clientUrl.d.ts.map +1 -0
  385. package/dist/routes/root/scripts/clientUrl.js +44 -0
  386. package/dist/routes/root/scripts/clientUrl.js.map +1 -0
  387. package/dist/routes/root/scripts/config.d.ts +6 -0
  388. package/dist/routes/root/scripts/config.d.ts.map +1 -0
  389. package/dist/routes/root/scripts/config.js +110 -24
  390. package/dist/routes/root/scripts/config.js.map +1 -1
  391. package/dist/routes/root/scripts/index.d.ts +1 -0
  392. package/dist/routes/root/scripts/index.d.ts.map +1 -0
  393. package/dist/routes/root/scripts/shared.d.ts +1 -0
  394. package/dist/routes/root/scripts/shared.d.ts.map +1 -0
  395. package/dist/routes/root/scripts/shared.js +112 -26
  396. package/dist/routes/root/scripts/shared.js.map +1 -1
  397. package/dist/routes/root/scripts/status.d.ts +1 -0
  398. package/dist/routes/root/scripts/status.d.ts.map +1 -0
  399. package/dist/routes/root/scripts/status.handlers.d.ts +23 -33
  400. package/dist/routes/root/scripts/status.handlers.d.ts.map +1 -0
  401. package/dist/routes/root/scripts/status.handlers.js +46 -92
  402. package/dist/routes/root/scripts/status.handlers.js.map +1 -1
  403. package/dist/routes/root/scripts/status.js +21 -8
  404. package/dist/routes/root/scripts/status.js.map +1 -1
  405. package/dist/routes/root/styles.d.ts +1 -0
  406. package/dist/routes/root/styles.d.ts.map +1 -0
  407. package/dist/routes/root/styles.js +7 -4
  408. package/dist/routes/root/styles.js.map +1 -1
  409. package/dist/routes/services.d.ts +13 -1
  410. package/dist/routes/services.d.ts.map +1 -0
  411. package/dist/routes/services.js +81 -68
  412. package/dist/routes/services.js.map +1 -1
  413. package/dist/routes/sse.d.ts +1 -0
  414. package/dist/routes/sse.d.ts.map +1 -0
  415. package/dist/routes/sse.js +1 -1
  416. package/dist/routes/sse.js.map +1 -1
  417. package/dist/routes/streams.d.ts +2 -1
  418. package/dist/routes/streams.d.ts.map +1 -0
  419. package/dist/routes/streams.js +6 -4
  420. package/dist/routes/streams.js.map +1 -1
  421. package/dist/routes/theme.d.ts +3 -2
  422. package/dist/routes/theme.d.ts.map +1 -0
  423. package/dist/routes/theme.js +6 -5
  424. package/dist/routes/theme.js.map +1 -1
  425. package/dist/routes/ui.d.ts +3 -1
  426. package/dist/routes/ui.d.ts.map +1 -0
  427. package/dist/routes/ui.js +16 -4
  428. package/dist/routes/ui.js.map +1 -1
  429. package/dist/routes/upgrade.d.ts +1 -0
  430. package/dist/routes/upgrade.d.ts.map +1 -0
  431. package/dist/routes/upgrade.js +6 -2
  432. package/dist/routes/upgrade.js.map +1 -1
  433. package/dist/service/commands.context.d.ts +1 -0
  434. package/dist/service/commands.context.d.ts.map +1 -0
  435. package/dist/service/commands.context.js +4 -3
  436. package/dist/service/commands.context.js.map +1 -1
  437. package/dist/service/commands.d.ts +1 -0
  438. package/dist/service/commands.d.ts.map +1 -0
  439. package/dist/service/commands.js +10 -13
  440. package/dist/service/commands.js.map +1 -1
  441. package/dist/service/generators.context.d.ts +1 -0
  442. package/dist/service/generators.context.d.ts.map +1 -0
  443. package/dist/service/generators.context.js +1 -1
  444. package/dist/service/generators.context.js.map +1 -1
  445. package/dist/service/generators.d.ts +4 -3
  446. package/dist/service/generators.d.ts.map +1 -0
  447. package/dist/service/generators.js +111 -31
  448. package/dist/service/generators.js.map +1 -1
  449. package/dist/service/index.d.ts +1 -0
  450. package/dist/service/index.d.ts.map +1 -0
  451. package/dist/streaming/captureLock.d.ts +44 -0
  452. package/dist/streaming/captureLock.d.ts.map +1 -0
  453. package/dist/streaming/captureLock.js +95 -0
  454. package/dist/streaming/captureLock.js.map +1 -0
  455. package/dist/streaming/captureSession.d.ts +31 -0
  456. package/dist/streaming/captureSession.d.ts.map +1 -0
  457. package/dist/streaming/captureSession.js +54 -0
  458. package/dist/streaming/captureSession.js.map +1 -0
  459. package/dist/streaming/clients.d.ts +1 -0
  460. package/dist/streaming/clients.d.ts.map +1 -0
  461. package/dist/streaming/codec.d.ts +1 -0
  462. package/dist/streaming/codec.d.ts.map +1 -0
  463. package/dist/streaming/fmp4Segmenter.d.ts +29 -2
  464. package/dist/streaming/fmp4Segmenter.d.ts.map +1 -0
  465. package/dist/streaming/fmp4Segmenter.js +79 -26
  466. package/dist/streaming/fmp4Segmenter.js.map +1 -1
  467. package/dist/streaming/hls.d.ts +18 -7
  468. package/dist/streaming/hls.d.ts.map +1 -0
  469. package/dist/streaming/hls.js +220 -120
  470. package/dist/streaming/hls.js.map +1 -1
  471. package/dist/streaming/hlsResume.d.ts +1 -0
  472. package/dist/streaming/hlsResume.d.ts.map +1 -0
  473. package/dist/streaming/hlsResume.js +1 -1
  474. package/dist/streaming/hlsResume.js.map +1 -1
  475. package/dist/streaming/hlsSegments.d.ts +59 -2
  476. package/dist/streaming/hlsSegments.d.ts.map +1 -0
  477. package/dist/streaming/hlsSegments.js +147 -17
  478. package/dist/streaming/hlsSegments.js.map +1 -1
  479. package/dist/streaming/lifecycle.d.ts +4 -1
  480. package/dist/streaming/lifecycle.d.ts.map +1 -0
  481. package/dist/streaming/lifecycle.js +65 -85
  482. package/dist/streaming/lifecycle.js.map +1 -1
  483. package/dist/streaming/monitor.d.ts +6 -4
  484. package/dist/streaming/monitor.d.ts.map +1 -0
  485. package/dist/streaming/monitor.js +343 -145
  486. package/dist/streaming/monitor.js.map +1 -1
  487. package/dist/streaming/mp4Parser.d.ts +5 -4
  488. package/dist/streaming/mp4Parser.d.ts.map +1 -0
  489. package/dist/streaming/mp4Parser.js +36 -13
  490. package/dist/streaming/mp4Parser.js.map +1 -1
  491. package/dist/streaming/mpegts.d.ts +16 -0
  492. package/dist/streaming/mpegts.d.ts.map +1 -0
  493. package/dist/streaming/mpegts.js +61 -17
  494. package/dist/streaming/mpegts.js.map +1 -1
  495. package/dist/streaming/playlistBuilder.d.ts +1 -0
  496. package/dist/streaming/playlistBuilder.d.ts.map +1 -0
  497. package/dist/streaming/preroll.d.ts +32 -5
  498. package/dist/streaming/preroll.d.ts.map +1 -0
  499. package/dist/streaming/preroll.js +70 -32
  500. package/dist/streaming/preroll.js.map +1 -1
  501. package/dist/streaming/pretune.d.ts +26 -1
  502. package/dist/streaming/pretune.d.ts.map +1 -0
  503. package/dist/streaming/pretune.js +22 -24
  504. package/dist/streaming/pretune.js.map +1 -1
  505. package/dist/streaming/pretuneTimers.d.ts +24 -0
  506. package/dist/streaming/pretuneTimers.d.ts.map +1 -0
  507. package/dist/streaming/pretuneTimers.js +56 -0
  508. package/dist/streaming/pretuneTimers.js.map +1 -0
  509. package/dist/streaming/recovery.d.ts +139 -5
  510. package/dist/streaming/recovery.d.ts.map +1 -0
  511. package/dist/streaming/recovery.js +160 -16
  512. package/dist/streaming/recovery.js.map +1 -1
  513. package/dist/streaming/registry.d.ts +27 -9
  514. package/dist/streaming/registry.d.ts.map +1 -0
  515. package/dist/streaming/registry.js +21 -3
  516. package/dist/streaming/registry.js.map +1 -1
  517. package/dist/streaming/setup.d.ts +157 -29
  518. package/dist/streaming/setup.d.ts.map +1 -0
  519. package/dist/streaming/setup.js +1034 -458
  520. package/dist/streaming/setup.js.map +1 -1
  521. package/dist/streaming/showInfo.d.ts +21 -1
  522. package/dist/streaming/showInfo.d.ts.map +1 -0
  523. package/dist/streaming/showInfo.js +31 -16
  524. package/dist/streaming/showInfo.js.map +1 -1
  525. package/dist/streaming/statusEmitter.d.ts +10 -10
  526. package/dist/streaming/statusEmitter.d.ts.map +1 -0
  527. package/dist/streaming/statusEmitter.js +5 -8
  528. package/dist/streaming/statusEmitter.js.map +1 -1
  529. package/dist/types/channels.d.ts +16 -4
  530. package/dist/types/channels.d.ts.map +1 -0
  531. package/dist/types/channels.js +4 -2
  532. package/dist/types/channels.js.map +1 -1
  533. package/dist/types/config.d.ts +16 -5
  534. package/dist/types/config.d.ts.map +1 -0
  535. package/dist/types/index.d.ts +3 -2
  536. package/dist/types/index.d.ts.map +1 -0
  537. package/dist/types/profiles.d.ts +6 -4
  538. package/dist/types/profiles.d.ts.map +1 -0
  539. package/dist/types/selection.d.ts +31 -3
  540. package/dist/types/selection.d.ts.map +1 -0
  541. package/dist/types/selection.js +4 -2
  542. package/dist/types/selection.js.map +1 -1
  543. package/dist/types/shared.d.ts +1 -0
  544. package/dist/types/shared.d.ts.map +1 -0
  545. package/dist/types/streaming.d.ts +8 -0
  546. package/dist/types/streaming.d.ts.map +1 -0
  547. package/dist/upgrade/commands.context.d.ts +1 -0
  548. package/dist/upgrade/commands.context.d.ts.map +1 -0
  549. package/dist/upgrade/commands.context.js +14 -10
  550. package/dist/upgrade/commands.context.js.map +1 -1
  551. package/dist/upgrade/commands.d.ts +8 -15
  552. package/dist/upgrade/commands.d.ts.map +1 -0
  553. package/dist/upgrade/commands.js +27 -28
  554. package/dist/upgrade/commands.js.map +1 -1
  555. package/dist/upgrade/detection.context.d.ts +1 -0
  556. package/dist/upgrade/detection.context.d.ts.map +1 -0
  557. package/dist/upgrade/detection.context.js +4 -1
  558. package/dist/upgrade/detection.context.js.map +1 -1
  559. package/dist/upgrade/detection.d.ts +9 -7
  560. package/dist/upgrade/detection.d.ts.map +1 -0
  561. package/dist/upgrade/detection.js +23 -54
  562. package/dist/upgrade/detection.js.map +1 -1
  563. package/dist/upgrade/index.d.ts +2 -0
  564. package/dist/upgrade/index.d.ts.map +1 -0
  565. package/dist/upgrade/index.js +1 -0
  566. package/dist/upgrade/index.js.map +1 -1
  567. package/dist/upgrade/lifecycle.context.d.ts +20 -0
  568. package/dist/upgrade/lifecycle.context.d.ts.map +1 -0
  569. package/dist/upgrade/lifecycle.context.js +47 -0
  570. package/dist/upgrade/lifecycle.context.js.map +1 -0
  571. package/dist/upgrade/lifecycle.d.ts +72 -0
  572. package/dist/upgrade/lifecycle.d.ts.map +1 -0
  573. package/dist/upgrade/lifecycle.js +175 -0
  574. package/dist/upgrade/lifecycle.js.map +1 -0
  575. package/dist/upgrade/pathHandle.d.ts +30 -0
  576. package/dist/upgrade/pathHandle.d.ts.map +1 -0
  577. package/dist/upgrade/pathHandle.js +102 -0
  578. package/dist/upgrade/pathHandle.js.map +1 -0
  579. package/dist/utils/bootSession.context.d.ts +16 -0
  580. package/dist/utils/bootSession.context.d.ts.map +1 -0
  581. package/dist/utils/bootSession.context.js +60 -0
  582. package/dist/utils/bootSession.context.js.map +1 -0
  583. package/dist/utils/bootSession.d.ts +17 -0
  584. package/dist/utils/bootSession.d.ts.map +1 -0
  585. package/dist/utils/bootSession.js +20 -0
  586. package/dist/utils/bootSession.js.map +1 -0
  587. package/dist/utils/chromeFetch.d.ts +1 -0
  588. package/dist/utils/chromeFetch.d.ts.map +1 -0
  589. package/dist/utils/cliOutput.d.ts +1 -0
  590. package/dist/utils/cliOutput.d.ts.map +1 -0
  591. package/dist/utils/clock.d.ts +5 -4
  592. package/dist/utils/clock.d.ts.map +1 -0
  593. package/dist/utils/clock.js +19 -16
  594. package/dist/utils/clock.js.map +1 -1
  595. package/dist/utils/debugFilter.d.ts +9 -1
  596. package/dist/utils/debugFilter.d.ts.map +1 -0
  597. package/dist/utils/debugFilter.js +60 -33
  598. package/dist/utils/debugFilter.js.map +1 -1
  599. package/dist/utils/delay.d.ts +48 -15
  600. package/dist/utils/delay.d.ts.map +1 -0
  601. package/dist/utils/delay.js +73 -20
  602. package/dist/utils/delay.js.map +1 -1
  603. package/dist/utils/errors.d.ts +32 -0
  604. package/dist/utils/errors.d.ts.map +1 -0
  605. package/dist/utils/errors.js +45 -4
  606. package/dist/utils/errors.js.map +1 -1
  607. package/dist/utils/evaluate.d.ts +1 -0
  608. package/dist/utils/evaluate.d.ts.map +1 -0
  609. package/dist/utils/evaluate.js +29 -23
  610. package/dist/utils/evaluate.js.map +1 -1
  611. package/dist/utils/ffmpeg.context.d.ts +1 -0
  612. package/dist/utils/ffmpeg.context.d.ts.map +1 -0
  613. package/dist/utils/ffmpeg.context.js.map +1 -1
  614. package/dist/utils/ffmpeg.d.ts +29 -7
  615. package/dist/utils/ffmpeg.d.ts.map +1 -0
  616. package/dist/utils/ffmpeg.js +32 -14
  617. package/dist/utils/ffmpeg.js.map +1 -1
  618. package/dist/utils/fileLogger.d.ts +3 -1
  619. package/dist/utils/fileLogger.d.ts.map +1 -0
  620. package/dist/utils/fileLogger.js +64 -29
  621. package/dist/utils/fileLogger.js.map +1 -1
  622. package/dist/utils/format.d.ts +14 -1
  623. package/dist/utils/format.d.ts.map +1 -0
  624. package/dist/utils/format.js +19 -5
  625. package/dist/utils/format.js.map +1 -1
  626. package/dist/utils/index.d.ts +4 -0
  627. package/dist/utils/index.d.ts.map +1 -0
  628. package/dist/utils/index.js +3 -0
  629. package/dist/utils/index.js.map +1 -1
  630. package/dist/utils/logEmitter.d.ts +1 -0
  631. package/dist/utils/logEmitter.d.ts.map +1 -0
  632. package/dist/utils/logger.d.ts +1 -0
  633. package/dist/utils/logger.d.ts.map +1 -0
  634. package/dist/utils/logger.js +10 -6
  635. package/dist/utils/logger.js.map +1 -1
  636. package/dist/utils/m3u.d.ts +3 -2
  637. package/dist/utils/m3u.d.ts.map +1 -0
  638. package/dist/utils/m3u.js +4 -3
  639. package/dist/utils/m3u.js.map +1 -1
  640. package/dist/utils/markup.d.ts +13 -1
  641. package/dist/utils/markup.d.ts.map +1 -0
  642. package/dist/utils/markup.js +28 -4
  643. package/dist/utils/markup.js.map +1 -1
  644. package/dist/utils/memo.d.ts +3 -2
  645. package/dist/utils/memo.d.ts.map +1 -0
  646. package/dist/utils/memo.js +3 -3
  647. package/dist/utils/morganStream.d.ts +1 -0
  648. package/dist/utils/morganStream.d.ts.map +1 -0
  649. package/dist/utils/network.d.ts +1 -0
  650. package/dist/utils/network.d.ts.map +1 -0
  651. package/dist/utils/network.js +2 -2
  652. package/dist/utils/pid.d.ts +3 -25
  653. package/dist/utils/pid.d.ts.map +1 -0
  654. package/dist/utils/pid.js +10 -49
  655. package/dist/utils/pid.js.map +1 -1
  656. package/dist/utils/platform.d.ts +3 -1
  657. package/dist/utils/platform.d.ts.map +1 -0
  658. package/dist/utils/platform.js +2 -1
  659. package/dist/utils/platform.js.map +1 -1
  660. package/dist/utils/processInspector.context.d.ts +8 -0
  661. package/dist/utils/processInspector.context.d.ts.map +1 -0
  662. package/dist/utils/processInspector.context.js +106 -0
  663. package/dist/utils/processInspector.context.js.map +1 -0
  664. package/dist/utils/processInspector.d.ts +55 -0
  665. package/dist/utils/processInspector.d.ts.map +1 -0
  666. package/dist/utils/processInspector.js +127 -0
  667. package/dist/utils/processInspector.js.map +1 -0
  668. package/dist/utils/retry.d.ts +25 -2
  669. package/dist/utils/retry.d.ts.map +1 -0
  670. package/dist/utils/retry.js +33 -6
  671. package/dist/utils/retry.js.map +1 -1
  672. package/dist/utils/runtimeIdentity.context.d.ts +7 -0
  673. package/dist/utils/runtimeIdentity.context.d.ts.map +1 -0
  674. package/dist/utils/runtimeIdentity.context.js +43 -0
  675. package/dist/utils/runtimeIdentity.context.js.map +1 -0
  676. package/dist/utils/runtimeIdentity.d.ts +98 -0
  677. package/dist/utils/runtimeIdentity.d.ts.map +1 -0
  678. package/dist/utils/runtimeIdentity.js +181 -0
  679. package/dist/utils/runtimeIdentity.js.map +1 -0
  680. package/dist/utils/sanitize.d.ts +1 -0
  681. package/dist/utils/sanitize.d.ts.map +1 -0
  682. package/dist/utils/streamContext.d.ts +2 -1
  683. package/dist/utils/streamContext.d.ts.map +1 -0
  684. package/dist/utils/streamContext.js +1 -1
  685. package/dist/utils/timing.d.ts +2 -1
  686. package/dist/utils/timing.d.ts.map +1 -0
  687. package/dist/utils/timing.js +0 -5
  688. package/dist/utils/timing.js.map +1 -1
  689. package/dist/utils/version.d.ts +1 -0
  690. package/dist/utils/version.d.ts.map +1 -0
  691. package/dist/utils/version.js +47 -13
  692. package/dist/utils/version.js.map +1 -1
  693. package/package.json +26 -20
@@ -1,7 +1,7 @@
1
1
  import type { ChannelSortField, Nullable, SortDirection } from "./shared.ts";
2
2
  /**
3
- * Browser-related configuration controlling Chrome launch behavior. Viewport dimensions are derived from the quality preset via getViewport() and are not stored in
4
- * this configuration object.
3
+ * Browser-related configuration controlling Chrome launch behavior. Viewport dimensions are derived from the quality preset via getPresetViewport() and are not
4
+ * stored in this configuration object.
5
5
  */
6
6
  export interface BrowserConfig {
7
7
  executablePath: Nullable<string>;
@@ -42,6 +42,9 @@ export interface RecoveryConfig {
42
42
  circuitBreakerThreshold: number;
43
43
  circuitBreakerWindow: number;
44
44
  maxBackoffDelay: number;
45
+ relaunchFailureThreshold: number;
46
+ relaunchFailureWindow: number;
47
+ relaunchHealthHold: number;
45
48
  stalePageCleanupInterval: number;
46
49
  stalePageGracePeriod: number;
47
50
  }
@@ -70,7 +73,7 @@ export interface ChannelsConfig {
70
73
  * and pretune scheduling.
71
74
  *
72
75
  * Host is auto-discovered at runtime from client request IPs by `showInfo.ts`. It is intentionally NOT in `CONFIG_METADATA` and is not exposed as a settings
73
- * UI field - users do not configure it directly. The host invariant: host-only, never `host:port`. Port lives at `channelsDvr.port` exclusively.
76
+ * UI field - users do not configure it directly. The host rule: host-only, never `host:port`. Port lives at `channelsDvr.port` exclusively.
74
77
  *
75
78
  * Port is user-configurable via `CONFIG_METADATA` because Channels DVR's port is user-configurable per their docs and a non-default port would otherwise be
76
79
  * unreachable from PrismCast.
@@ -84,11 +87,15 @@ export interface ChannelsDvrConfig {
84
87
  port: number;
85
88
  }
86
89
  /**
87
- * HDHomeRun emulation configuration. When enabled, PrismCast runs a separate HTTP server that emulates the HDHomeRun API, allowing Plex to discover and use
88
- * PrismCast as a virtual tuner for live TV and DVR recording. The emulated device appears in Plex's tuner setup and serves PrismCast's HLS streams directly.
90
+ * HDHomeRun emulation configuration. When enabled, PrismCast runs a separate HTTP server that emulates the HDHomeRun API and (when discoveryEnabled is also
91
+ * true) a UDP discovery responder on port 65001 that lets Plex find PrismCast on the LAN automatically. The emulated device appears in Plex's tuner setup and
92
+ * serves PrismCast's MPEG-TS streams directly. Channels DVR also auto-discovers but its discovery assumes the standard HDHomeRun port 80, which most
93
+ * installations cannot bind; Channels DVR users typically add PrismCast manually as a Custom Channels source. Other HDHR-aware clients work to the extent that
94
+ * they honor the BaseURL advertised in the protocol; their compatibility is incidental rather than supported.
89
95
  */
90
96
  export interface HdhrConfig {
91
97
  deviceId: string;
98
+ discoveryEnabled: boolean;
92
99
  enabled: boolean;
93
100
  friendlyName: string;
94
101
  port: number;
@@ -112,6 +119,9 @@ export interface ServerConfig {
112
119
  * Capture mode for media recording. Determines how video/audio is captured from the browser and processed for HLS output.
113
120
  * - "ffmpeg": Captures Matroska (H264+Opus) and uses FFmpeg to transcode audio to AAC. More stable for long recordings.
114
121
  * - "native": Captures fMP4 (H264+AAC) directly from Chrome. No dependencies but may be unstable with long recordings.
122
+ *
123
+ * Chrome's native fMP4 MediaRecorder produces corrupt output after 20-30 minutes of recording, so `config/index.ts` currently forces this value to "ffmpeg"
124
+ * at startup and rejects a live configuration save that requests "native" rather than silently coercing it.
115
125
  */
116
126
  export type CaptureMode = "ffmpeg" | "native";
117
127
  /**
@@ -145,3 +155,4 @@ export interface Config {
145
155
  server: ServerConfig;
146
156
  streaming: StreamingConfig;
147
157
  }
158
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQ7E;;;GAGG;AACH,MAAM,WAAW,aAAa;IAI5B,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAMjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAI1B,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAIhC,iBAAiB,EAAE,MAAM,CAAC;IAI1B,gBAAgB,EAAE,MAAM,CAAC;IAIzB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW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E,cAAc,CAAC;IAGzB,QAAQ,EAAE,cAAc,CAAC;IAGzB,MAAM,EAAE,YAAY,CAAC;IAGrB,SAAS,EAAE,eAAe,CAAC;CAC5B"}
@@ -2,8 +2,9 @@ export type { BrowserConfig, CaptureMode, ChannelsConfig, Config, HdhrConfig, HL
2
2
  export type { CanonicalChannel, Channel, ChannelDefinition, ChannelDelta, ChannelIdentity, ChannelListingEntry, ChannelMap, ChannelServiceBinding, CustomizableField, ResolvedChannel, ResolvedChannelMap, ServiceGroup, ServiceVariant, StoredChannel, StoredChannelMap, VariantChannel } from "./channels.ts";
3
3
  export { CHANNEL_BINDING_KEYS, CHANNEL_IDENTITY_KEYS, DELTA_ELIGIBLE_BINDING_KEYS, DELTA_ELIGIBLE_IDENTITY_KEYS } from "./channels.ts";
4
4
  export type { ChannelSelectionConfig, ChannelSelectionStrategy, DomainConfig, ProfileCategory, ProfileResolutionResult, ProfilesValidationResult, ResolvedSiteProfile, ServicePack, SiteProfile, UserProfilesFile, UserProfilesLoadResult } from "./profiles.ts";
5
- export type { CategoryResolution, CategoryResolutionConfig, CategoryResolutionFailure, CategoryResolutionSuccess, ChannelSelectionProfile, ChannelSelectorResult, ChannelStrategyEntry, ChannelStrategyHandler, ClickTarget, DiscoveredChannel, ProviderModule, TuneResult, UiSize } from "./selection.ts";
5
+ export type { AuthWallIndicators, CategoryResolution, CategoryResolutionConfig, CategoryResolutionFailure, CategoryResolutionSuccess, ChannelSelectionProfile, ChannelSelectorResult, ChannelStrategyEntry, ChannelStrategyHandler, ClickTarget, DiscoveredChannel, ProviderModule, TuneResult, UiSize } from "./selection.ts";
6
6
  export type { ChannelSortField, Nullable, SortDirection } from "./shared.ts";
7
- export type { CaptureCodec, HealthStatus, StreamListItem, StreamListResponse, StreamingMode, UrlValidationResult, VideoSelectorType, VideoState } from "./streaming.ts";
7
+ export type { CaptureCodec, HealthStatus, MediaContainer, StreamListItem, StreamListResponse, StreamingMode, UrlValidationResult, VideoSelectorType, VideoState } from "./streaming.ts";
8
8
  export { RECOGNIZED_CODECS } from "./streaming.ts";
9
9
  export { isChannelSelectionProfile } from "./selection.ts";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EACjJ,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,qBAAqB,EAC/I,iBAAiB,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/J,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AACvI,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,wBAAwB,EAC9I,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACjH,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,uBAAuB,EAC3J,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAClK,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,EACjJ,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -6,8 +6,8 @@ import type { Nullable } from "./shared.ts";
6
6
  * - "directvGrid": Tune via webpack injection - captures __webpack_require__, extracts the Redux store from the React fiber tree, matches by channel name, and
7
7
  * dispatches playConsumable. Falls back to logo aria-label click when the interceptor fails. Used by DirecTV Stream.
8
8
  * - "foxGrid": Find channel by station code in a non-virtualized guide grid, click the channel logo button via DOM .click(). Used by Fox.com.
9
- * - "guideGrid": Find channel by exact-matching image alt text, click nearest clickable ancestor. Optionally clicks a tab to reveal the list first. Used by Hulu
10
- * Live TV.
9
+ * - "guideGrid": Find channel by data-testid in a virtualized guide grid via binary search, click the on-now program cell, then click the play button tile.
10
+ * Optionally clicks a tab to reveal the list first. Used by Hulu Live TV.
11
11
  * - "hboGrid": Discover the HBO tab page URL from the homepage menu bar, read the live channel tile rail for a matching channel name, and navigate to the watch
12
12
  * URL. Caches the tab URL across tunes with stale-cache fallback. Used by HBO Max.
13
13
  * - "none": No channel selection needed (single-channel sites). This is the default.
@@ -100,12 +100,13 @@ export interface ResolvedSiteProfile {
100
100
  * profile came from a channel hint, domain-based autodetection, or the default fallback.
101
101
  */
102
102
  export interface ProfileResolutionResult {
103
+ readonly overriddenProfile?: string;
103
104
  profile: ResolvedSiteProfile;
104
105
  profileName: string;
105
106
  }
106
107
  /**
107
108
  * Domain-level configuration associating domain patterns with site profiles and service display names. Each entry can specify a site profile for behavior
108
- * configuration and/or a service display name for friendly UI labels. Used by both built-in domain mappings in sites.ts and user-defined mappings in profiles.json.
109
+ * configuration and/or a service display name for friendly UI labels. Used by both builtin domain mappings in sites.ts and user-defined mappings in profiles.json.
109
110
  */
110
111
  export interface DomainConfig {
111
112
  dismissSelector?: string;
@@ -118,7 +119,7 @@ export interface DomainConfig {
118
119
  videoTimeout?: number;
119
120
  }
120
121
  /**
121
- * Storage format for profiles.json. Contains user-defined site profiles and domain mappings that extend or override the built-in configurations.
122
+ * Storage format for profiles.json. Contains user-defined site profiles and domain mappings that extend or override the builtin configurations.
122
123
  */
123
124
  export interface UserProfilesFile {
124
125
  domains?: Record<string, DomainConfig>;
@@ -154,3 +155,4 @@ export interface ProfilesValidationResult {
154
155
  profiles: Record<string, SiteProfile>;
155
156
  valid: boolean;
156
157
  }
158
+ //# sourceMappingURL=profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/types/profiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAO5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,wBAAwB,GAClC,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,cAAc,GAAG,cAAc,GAAG,WAAW,GACxI,eAAe,GAAG,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAIrC,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,aAAa,CAAC,EAAE,MAAM,CAAC;IAIvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,cAAc,CAAC,EAAE,MAAM,CAAC;IAKxB,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,QAAQ,EAAE,wBAAwB,CAAC;CACpC;AAWD;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,cAAc,GAA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AAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAItC,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAG1B,QAAQ,CAAC,EAAE,UAAU,CAAC;IAGtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAGvC,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAGtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IAGvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAGtC,MAAM,EAAE,MAAM,EAAE,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAGtC,KAAK,EAAE,OAAO,CAAC;CAChB"}
@@ -1,15 +1,25 @@
1
1
  import type { ChannelSelectionStrategy, ResolvedSiteProfile, SiteProfile } from "./profiles.ts";
2
2
  import type { Frame, Page } from "puppeteer-core";
3
3
  import type { Nullable } from "./shared.ts";
4
+ import type { PersistedLineupChannel } from "../config/providerLineups.ts";
5
+ /**
6
+ * Narrowed profile type for strategy functions. When selectChannel() validates that channelSelector is non-null, it narrows the profile to this type so
7
+ * strategy functions receive a guaranteed non-null channelSelector without needing non-null assertions.
8
+ */
4
9
  export interface ChannelSelectionProfile extends ResolvedSiteProfile {
5
10
  channelSelector: string;
6
11
  }
12
+ /**
13
+ * Type guard that proves channelSelector is a non-empty string, rejecting both null and empty string. Used by the coordinator before dispatching to strategy
14
+ * functions.
15
+ */
7
16
  export declare function isChannelSelectionProfile(profile: ResolvedSiteProfile): profile is ChannelSelectionProfile;
8
17
  /**
9
18
  * Result of attempting to select a channel from a multi-channel player UI.
10
19
  */
11
20
  export interface ChannelSelectorResult {
12
21
  directTune?: boolean;
22
+ guideUnavailable?: boolean;
13
23
  reason?: string;
14
24
  success: boolean;
15
25
  }
@@ -54,17 +64,34 @@ export interface DiscoveredChannel {
54
64
  stationId?: string;
55
65
  tier?: string;
56
66
  }
67
+ /**
68
+ * Provider-declared identifiers for the provider's authentication wall, consumed by the blocked-page classifier when a discovery walk returns zero channels.
69
+ * Host patterns match the landed URL's hostname (exact, or any subdomain of the pattern); selectors match against the page DOM. Either match classifies the page
70
+ * as an auth wall ahead of the generic sign-in shape probe. Declared per provider only when the generic probe cannot recognize that provider's wall.
71
+ */
72
+ export interface AuthWallIndicators {
73
+ hosts?: string[];
74
+ selectors?: string[];
75
+ }
57
76
  /**
58
77
  * Unified provider contract that bundles identity metadata, tuning strategy, and channel discovery into a single registry entry. Each provider tuning file
59
78
  * exports one ProviderModule. The coordinator builds its strategy dispatch lookup from provider modules at evaluation time. Generic strategies (thumbnailRow,
60
79
  * tileClick) remain bare ChannelStrategyEntry objects - they are not providers.
61
80
  */
62
81
  export interface ProviderModule {
82
+ authWallIndicators?: AuthWallIndicators;
63
83
  /**
64
84
  * Discovers all available channels from the provider's guide. The route handler navigates to guideUrl before calling this function unless handlesOwnNavigation
65
85
  * is set. Returns a standardized DiscoveredChannel array.
66
86
  */
67
87
  discoverChannels: (page: Page) => Promise<DiscoveredChannel[]>;
88
+ /**
89
+ * Returns the provider's own statement of which lineup facts outlive the browser session that discovered them, for the persisted lineup store. A provider whose
90
+ * direct-tune address is a stable per-channel URL (or a stable identifier the URL is built from) exports it here alongside the channel identity; a provider that
91
+ * tunes by interacting with its guide has no such address and omits the hook entirely, so the store never holds a watch URL that cannot be navigated to.
92
+ * Returns null when the provider's cache is cold and there is nothing to state.
93
+ */
94
+ exportDurableLineup?: () => Nullable<PersistedLineupChannel[]>;
68
95
  /**
69
96
  * Returns cached discovered channels if the provider has already fully enumerated its lineup from a previous tune or discovery call, or null if no enumeration
70
97
  * has occurred. When non-null, the route handler can skip browser page creation entirely and return the cached result immediately.
@@ -106,9 +133,9 @@ export interface CategoryResolutionFailure {
106
133
  * these two shapes - there is no null. This forces every resolver to articulate its outcome explicitly, which guarantees diagnostic detail on every failure and
107
134
  * removes ambiguity between "could not resolve" and "did not attempt to resolve."
108
135
  *
109
- * The union is structurally discriminated by the `callSign` and `reason` field names so consumers can use TypeScript's `"callSign" in result` narrowing without
110
- * needing a tagged enum. A future evolution that needs additional outcomes (e.g., resolution to a list of candidates for user disambiguation) can add a new
111
- * variant here as a new named interface without touching the existing two.
136
+ * Consumers tell the two variants apart by the `callSign` and `reason` field names, using TypeScript's `"callSign" in result` narrowing without needing a tagged
137
+ * enum. A future evolution that needs additional outcomes (e.g., resolution to a list of candidates for user disambiguation) can add a new variant here as a new
138
+ * named interface without touching the existing two.
112
139
  */
113
140
  export type CategoryResolution = CategoryResolutionSuccess | CategoryResolutionFailure;
114
141
  /**
@@ -148,3 +175,4 @@ export interface UiSize {
148
175
  height: number;
149
176
  width: number;
150
177
  }
178
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/types/selection.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAElE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,IAAI,uBAAuB,CAG1G;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAGpC,UAAU,CAAC,EAAE,OAAO,CAAC;IASrB,gBAAgB,CA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AAE,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAG1B,CAAC,EAAE,MAAM,CAAC;IAGV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAGzB,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IAGtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD;;;GAGG;AACH,MAAM,WAAW,MAAM;IAGrB,MAAM,EAAE,MAAM,CAAC;IAGf,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,5 +1,7 @@
1
- // Type guard that proves channelSelector is a non-empty string. Matches the original !channelSelector truthiness check, which rejects both null and empty string.
2
- // Used by the coordinator before dispatching to strategy functions.
1
+ /**
2
+ * Type guard that proves channelSelector is a non-empty string, rejecting both null and empty string. Used by the coordinator before dispatching to strategy
3
+ * functions.
4
+ */
3
5
  export function isChannelSelectionProfile(profile) {
4
6
  return (profile.channelSelector !== null) && (profile.channelSelector.length > 0);
5
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/types/selection.ts"],"names":[],"mappings":"AAeA,kKAAkK;AAClK,oEAAoE;AACpE,MAAM,UAAU,yBAAyB,CAAC,OAA4B;IAEpE,OAAO,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACpF,CAAC"}
1
+ {"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/types/selection.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAA4B;IAEpE,OAAO,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACpF,CAAC"}
@@ -5,3 +5,4 @@
5
5
  export type Nullable<T> = T | null;
6
6
  export type ChannelSortField = "channelNumber" | "channelSelector" | "hdhrEnabled" | "key" | "name" | "profile" | "service" | "stationId" | "tags";
7
7
  export type SortDirection = "asc" | "desc";
8
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/types/shared.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAGnC,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,iBAAiB,GAAG,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AAGnJ,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC"}
@@ -41,6 +41,13 @@ export interface UrlValidationResult {
41
41
  * directly in Node, bypassing screen capture entirely.
42
42
  */
43
43
  export type StreamingMode = "capture" | "native";
44
+ /**
45
+ * Media container format of an upstream HLS source. "fmp4" sources (CMAF) carry their codec configuration in a separate initialization segment referenced by
46
+ * #EXT-X-MAP, so the relay must fetch, store, and re-reference that init for the fragments to be playable. "ts" sources are self-describing - every MPEG-TS
47
+ * segment carries its own PAT/PMT - so they need no init at all. Consumers select the fMP4 behavior on an exact "fmp4" match; every other value takes the
48
+ * self-describing path.
49
+ */
50
+ export type MediaContainer = "fmp4" | "ts";
44
51
  /**
45
52
  * Health check response structure returned by the /health endpoint.
46
53
  */
@@ -93,3 +100,4 @@ export interface StreamListResponse {
93
100
  limit: number;
94
101
  streams: StreamListItem[];
95
102
  }
103
+ //# sourceMappingURL=streaming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../src/types/streaming.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,2BAA8B,CAAC;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CAAC;QAGlB,QAAQ,EAAE,MAAM,CAAC;QAGjB,GAAG,EAAE,MAAM,CAAC;QAGZ,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IAGF,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;IAG7C,OAAO,EAAE;QAGP,MAAM,EAAE,MAAM,CAAC;QAGf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAGF,SAAS,EAAE,MAAM,CAAC;IAGlB,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAG7B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAG1B,QAAQ,EAAE,MAAM,CAAC;IAGjB,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAGjC,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IAGd,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B"}
@@ -4,3 +4,4 @@ import type { UpgradeContext } from "./commands.ts";
4
4
  * @returns An UpgradeContext populated from the live process.
5
5
  */
6
6
  export declare function createDefaultUpgradeContext(): UpgradeContext;
7
+ //# sourceMappingURL=commands.context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.context.d.ts","sourceRoot":"","sources":["../../src/upgrade/commands.context.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQpD;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,cAAc,CAY5D"}
@@ -1,8 +1,20 @@
1
+ /* Copyright(C) 2024-2026, HJD (https://github.com/hjdhjd). All rights reserved.
2
+ *
3
+ * commands.context.ts: The default adapter that produces an UpgradeContext from real runtime I/O. The handler in commands.ts is a pure orchestrator over an
4
+ * UpgradeContext; this file is the only place in the upgrade-commands module that fetches the npm registry, invokes process.exit, or wires the platform-aware
5
+ * lifecycle through to performUpgrade. Tests bypass this file entirely by constructing UpgradeContext literals inline.
6
+ *
7
+ * The lifecycle context is built when performUpgrade is invoked, not at UpgradeContext construction time. Eager construction would call
8
+ * getDataDir() before the upgrade-execution branch is reached, which is wrong for the --help and --check paths (they never invoke performUpgrade) and brittle
9
+ * for tests that exercise those paths against the default context without initializing the data directory. Lazy construction keeps the cost paid exactly when
10
+ * the work happens.
11
+ */
1
12
  import { print, printError } from "../utils/cliOutput.js";
13
+ import { createDefaultLifecycleContext } from "./lifecycle.context.js";
2
14
  import { detectInstallMethod } from "./detection.js";
3
- import { execSync } from "node:child_process";
4
15
  import { fetchLatestVersion } from "../utils/version.js";
5
16
  import { isRunningAsService } from "../utils/platform.js";
17
+ import { performUpgrade } from "./lifecycle.js";
6
18
  /**
7
19
  * Builds the default UpgradeContext from real runtime I/O.
8
20
  * @returns An UpgradeContext populated from the live process.
@@ -13,15 +25,7 @@ export function createDefaultUpgradeContext() {
13
25
  exit: (code) => process.exit(code),
14
26
  fetchLatestVersion,
15
27
  isService: isRunningAsService(),
16
- runUpgradeCommand: (cmd, options) => {
17
- try {
18
- execSync(cmd, { cwd: options.cwd, encoding: "utf-8", stdio: "inherit" });
19
- return { success: true };
20
- }
21
- catch {
22
- return { success: false };
23
- }
24
- },
28
+ performUpgrade: (info) => performUpgrade(createDefaultLifecycleContext(), info),
25
29
  stderr: printError,
26
30
  stdout: print
27
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"commands.context.js","sourceRoot":"","sources":["../../src/upgrade/commands.context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAA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AAU,2BAA2B;IAEzC,OAAO;QAEL,MAAM,EAAE,mBAAmB;QAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAClC,kBAAkB;QAClB,SAAS,EAAE,kBAAkB,EAAE;QAC/B,cAAc,EAAE,CAAC,IAAiB,EAAe,EAAE,CAAC,cAAc,CAAC,6BAA6B,EAAE,EAAE,IAAI,CAAC;QACzG,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC"}
@@ -1,14 +1,8 @@
1
1
  import type { InstallInfo } from "./detection.ts";
2
+ import type { UpgradeStep } from "./lifecycle.ts";
2
3
  /**
3
- * Result of running an upgrade command. The success flag distinguishes ran-without-error from threw-or-exited-non-zero; the runner does not surface the actual
4
- * error because execSync's stderr is inherited to the user's terminal directly.
5
- */
6
- export interface UpgradeResult {
7
- readonly success: boolean;
8
- }
9
- /**
10
- * The runtime context handleUpgradeCommand consumes. Each field models one capability the command needs - detection, version lookup, subprocess execution,
11
- * stdout/stderr output, process termination, and a service-mode probe. Decision logic is a pure function of this shape; production wires it through
4
+ * The runtime context handleUpgradeCommand consumes. Each field models one capability the command needs - detection, version lookup, platform-aware upgrade
5
+ * execution, stdout/stderr output, process termination, and a service-mode probe. Decision logic is a pure function of this shape; production wires it through
12
6
  * createDefaultUpgradeContext (in commands.context.ts), tests pass a context literal.
13
7
  */
14
8
  export interface UpgradeContext {
@@ -16,18 +10,17 @@ export interface UpgradeContext {
16
10
  readonly exit: (code: number) => never;
17
11
  readonly fetchLatestVersion: () => Promise<string | null>;
18
12
  readonly isService: boolean;
19
- readonly runUpgradeCommand: (cmd: string, options: {
20
- cwd?: string;
21
- }) => UpgradeResult;
13
+ readonly performUpgrade: (info: InstallInfo) => UpgradeStep;
22
14
  readonly stderr: (line: string) => void;
23
15
  readonly stdout: (line: string) => void;
24
16
  }
25
17
  /**
26
- * Main handler for the `upgrade` subcommand. Parses arguments and orchestrates the appropriate upgrade flow through the UpgradeContext. Pure function of
27
- * UpgradeContext modulo the help/usage paths that just write to stdout - no detection, registry, subprocess, or process state is touched outside the context's
28
- * methods.
18
+ * Main handler for the `upgrade` subcommand. Parses arguments and orchestrates the appropriate upgrade flow through the UpgradeContext. Pure orchestrator over
19
+ * UpgradeContext - decision logic depends only on context methods plus the synchronous getPackageVersion() lookup, never on direct subprocess, registry, or
20
+ * process-state I/O.
29
21
  * @param args - Arguments after 'upgrade' (e.g., ['--check', '--force']).
30
22
  * @param ctx - The upgrade context. Defaults to createDefaultUpgradeContext() which wires real runtime I/O.
31
23
  * @returns Exit code (0 for success, 1 for error).
32
24
  */
33
25
  export declare function handleUpgradeCommand(args: readonly string[], ctx?: UpgradeContext): Promise<number>;
26
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/upgrade/commands.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,gBAAgB,CAAC;AAG7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAG7B,QAAQ,CAAC,MAAM,EAAE,MAAM,WAAW,CAAC;IAGnC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC;IAGvC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAK1D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAK5B,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,WAAW,CAAC;IAI5D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAIxC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AA0FD;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,GAAE,cAA8C,GAAG,OAAO,CAAC,MAAM,CAAC,CAoGxI"}
@@ -3,10 +3,6 @@ import { createDefaultUpgradeContext } from "./commands.context.js";
3
3
  /* The upgrade subcommand handles `prismcast upgrade [--check] [--force] [-h|--help]`. Detection picks the install method, the registry lookup checks for a
4
4
  * newer version, and the runner executes the per-method upgrade command (or prints manual instructions for non-upgradeable methods).
5
5
  */
6
- /**
7
- * Prints usage information for the upgrade subcommand.
8
- * @param ctx - The upgrade context (used for stdout output).
9
- */
10
6
  function printUpgradeUsage(ctx) {
11
7
  ctx.stdout("Usage: prismcast upgrade [options]");
12
8
  ctx.stdout("");
@@ -17,13 +13,7 @@ function printUpgradeUsage(ctx) {
17
13
  ctx.stdout(" --force Upgrade even if already up to date");
18
14
  ctx.stdout(" -h, --help Show this help message");
19
15
  }
20
- /**
21
- * Prints the upgrade summary table (shared between --check mode and the pre-upgrade display).
22
- * @param ctx - The upgrade context (used for stdout output).
23
- * @param info - The detected installation info.
24
- * @param currentVersion - The currently running version.
25
- * @param latestVersion - The latest available version, or null if unknown.
26
- */
16
+ // Shared between --check mode and the non-upgradeable summary so both surfaces print identical version/install-method/upgrade-command rows.
27
17
  function printUpgradeInfo(ctx, info, currentVersion, latestVersion) {
28
18
  ctx.stdout("PrismCast Upgrade Check");
29
19
  ctx.stdout("─".repeat(40));
@@ -57,14 +47,6 @@ function printNonUpgradeableSummary(ctx, info, currentVersion, latestVersion) {
57
47
  }
58
48
  ctx.stdout(" " + info.upgradeCommand);
59
49
  }
60
- /**
61
- * Handles the --check flag: prints upgrade information and exits with 0.
62
- * @param ctx - The upgrade context.
63
- * @param info - The detected installation info.
64
- * @param currentVersion - The currently running version.
65
- * @param latestVersion - The latest available version, or null if unknown.
66
- * @returns Exit code (0).
67
- */
68
50
  function handleCheck(ctx, info, currentVersion, latestVersion) {
69
51
  if (!info.upgradeable) {
70
52
  printNonUpgradeableSummary(ctx, info, currentVersion, latestVersion);
@@ -84,9 +66,9 @@ function handleCheck(ctx, info, currentVersion, latestVersion) {
84
66
  return 0;
85
67
  }
86
68
  /**
87
- * Main handler for the `upgrade` subcommand. Parses arguments and orchestrates the appropriate upgrade flow through the UpgradeContext. Pure function of
88
- * UpgradeContext modulo the help/usage paths that just write to stdout - no detection, registry, subprocess, or process state is touched outside the context's
89
- * methods.
69
+ * Main handler for the `upgrade` subcommand. Parses arguments and orchestrates the appropriate upgrade flow through the UpgradeContext. Pure orchestrator over
70
+ * UpgradeContext - decision logic depends only on context methods plus the synchronous getPackageVersion() lookup, never on direct subprocess, registry, or
71
+ * process-state I/O.
90
72
  * @param args - Arguments after 'upgrade' (e.g., ['--check', '--force']).
91
73
  * @param ctx - The upgrade context. Defaults to createDefaultUpgradeContext() which wires real runtime I/O.
92
74
  * @returns Exit code (0 for success, 1 for error).
@@ -112,7 +94,7 @@ export async function handleUpgradeCommand(args, ctx = createDefaultUpgradeConte
112
94
  return 0;
113
95
  }
114
96
  // Already-current short-circuit: skip when --force is set or when we could not check the registry. Without --force, an indeterminate version check is fatal
115
- // because we should not blindly run npm install when we can not see whether it would do anything.
97
+ // because we should not blindly run npm install when we cannot see whether it would do anything.
116
98
  if (!force && latestVersion && !isVersionLessThan(currentVersion, latestVersion)) {
117
99
  ctx.stdout("PrismCast v" + currentVersion + " is already the latest version.");
118
100
  ctx.stdout("Use --force to upgrade anyway.");
@@ -127,17 +109,34 @@ export async function handleUpgradeCommand(args, ctx = createDefaultUpgradeConte
127
109
  ctx.stdout("Install method: " + info.displayName);
128
110
  ctx.stdout("Running: " + info.upgradeCommand);
129
111
  ctx.stdout("");
130
- // Execute the upgrade. packageDir is set only by the npm-local strategy (it is the lone field in ResolvableFields and only npm-local declares a resolver),
131
- // so reading it directly is sufficient - the runner uses it as cwd when present and falls back to process.cwd() when absent.
132
- const result = ctx.runUpgradeCommand(info.upgradeCommand, { cwd: info.packageDir });
133
- if (!result.success) {
112
+ // Dispatch to the platform-aware lifecycle. The returned UpgradeStep tells us whether the upgrade ran in-process synchronously (POSIX path) or was handed
113
+ // off to a detached helper (Windows path); we narrow on `kind` and handle each variant's messaging and exit behavior. packageDir flows through to the
114
+ // lifecycle as part of InstallInfo (only npm-local declares a resolver that sets it).
115
+ const step = ctx.performUpgrade(info);
116
+ if (step.kind === "handed-off") {
117
+ // The Windows handoff strategy has spawned a detached helper that is waiting for the current process to exit so file locks on the prismcast directory
118
+ // release before npm install runs. We must exit immediately; the helper handles the upgrade and (conditionally) the service-task restart on its own. The
119
+ // log path is surfaced so the user has somewhere to look while the upgrade runs.
120
+ //
121
+ // The restart message is deliberately phrased as a conditional rather than an unconditional promise. The helper only restarts the scheduled task when one
122
+ // is registered; a user who invokes `prismcast upgrade` against a non-service install will need to restart PrismCast manually after the helper finishes.
123
+ // We cannot know which branch will apply without probing Task Scheduler from our process, and that would add a synchronous PowerShell call to every
124
+ // upgrade. The honest two-clause message keeps both audiences correctly informed without that cost.
125
+ ctx.stdout("Upgrade is running in the background.");
126
+ ctx.stdout("If PrismCast is registered as a Windows service, the helper will restart it when the upgrade completes; otherwise, restart PrismCast manually.");
127
+ ctx.stdout("Helper log: " + step.logPath);
128
+ ctx.exit(0);
129
+ }
130
+ // In-process path: the upgrade ran synchronously and the result is the runner's outcome.
131
+ if (!step.success) {
134
132
  ctx.stderr("");
135
133
  ctx.stderr("Upgrade failed. Check the output above for details.");
136
134
  return 1;
137
135
  }
138
136
  ctx.stdout("");
139
137
  ctx.stdout("Upgrade complete.");
140
- // Service-managed processes restart automatically when we exit; manual installs need a user-driven restart.
138
+ // Service-managed processes restart automatically when we exit; manual installs need a user-driven restart. The handoff branch above does not reach this
139
+ // code because its helper owns the restart; only the in-process branch falls through here.
141
140
  if (ctx.isService) {
142
141
  ctx.stdout("Restarting PrismCast via service manager...");
143
142
  ctx.exit(0);
@@ -1 +1 @@
1
- {"version":3,"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IAEhC,yJAAyJ;IACzJ,2FAA2F;IAC3F,IAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAEjB,GAAG,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;QAE1D,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IAED,GAAG,CAAC,MAAM,CAAC,2DAA2D,CAAC,CAAC;IAExE,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -4,3 +4,4 @@ import type { DetectionContext } from "./detection.ts";
4
4
  * @returns A DetectionContext populated from the live process.
5
5
  */
6
6
  export declare function createDefaultDetectionContext(): DetectionContext;
7
+ //# sourceMappingURL=detection.context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detection.context.d.ts","sourceRoot":"","sources":["../../src/upgrade/detection.context.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOvD;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,gBAAgB,CAoBhE"}
@@ -1,3 +1,4 @@
1
+ import { createPathHandle } from "./pathHandle.js";
1
2
  import { execSync } from "node:child_process";
2
3
  import { existsSync } from "node:fs";
3
4
  import { isRunningInContainer } from "../utils/platform.js";
@@ -8,11 +9,13 @@ import url from "node:url";
8
9
  */
9
10
  export function createDefaultDetectionContext() {
10
11
  return {
11
- currentFile: url.fileURLToPath(import.meta.url),
12
+ currentFile: createPathHandle(url.fileURLToPath(import.meta.url)),
12
13
  fileExists: existsSync,
13
14
  isContainer: isRunningInContainer(),
14
15
  runCommand: (cmd) => {
15
16
  try {
17
+ // We cap each detection probe at five seconds so that a hung command (for example, a stalled "npm prefix -g") cannot stall install-method detection. A
18
+ // probe that exceeds the ceiling throws, which we treat the same as any other failure by returning null below.
16
19
  return execSync(cmd, { encoding: "utf-8", timeout: 5000 }).trim();
17
20
  }
18
21
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"detection.context.js","sourceRoot":"","sources":["../../src/upgrade/detection.context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B;;;GAGG;AACH,MAAM,UAAU,6BAA6B;IAE3C,OAAO;QAEL,WAAW,EAAE,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/C,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,oBAAoB,EAAE;QACnC,UAAU,EAAE,CAAC,GAAW,EAAiB,EAAE;YAEzC,IAAI,CAAC;gBAEH,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACpE,CAAC;YAAC,MAAM,CAAC;gBAEP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"detection.context.js","sourceRoot":"","sources":["../../src/upgrade/detection.context.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B;;;GAGG;AACH,MAAM,UAAU,6BAA6B;IAE3C,OAAO;QAEL,WAAW,EAAE,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjE,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,oBAAoB,EAAE;QACnC,UAAU,EAAE,CAAC,GAAW,EAAiB,EAAE;YAEzC,IAAI,CAAC;gBAEH,uJAAuJ;gBACvJ,+GAA+G;gBAC/G,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACpE,CAAC;YAAC,MAAM,CAAC;gBAEP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,10 +1,11 @@
1
+ import type { PathHandle } from "./pathHandle.ts";
1
2
  /**
2
3
  * The runtime context detection consumes. Each field is one narrow capability the decision logic depends on - the path of the running module, whether we are
3
4
  * inside a Docker container, the ability to run a shell command and read its trimmed stdout, the ability to check that a path exists. Decision logic is a pure
4
5
  * function of this shape; the default adapter wires it from real I/O, tests pass a context literal.
5
6
  */
6
7
  export interface DetectionContext {
7
- readonly currentFile: string;
8
+ readonly currentFile: PathHandle;
8
9
  readonly fileExists: (path: string) => boolean;
9
10
  readonly isContainer: boolean;
10
11
  readonly runCommand: (cmd: string) => string | null;
@@ -46,8 +47,8 @@ export interface NonUpgradeableInstallStrategy<M extends string = string> extend
46
47
  readonly upgradeable: false;
47
48
  }
48
49
  /**
49
- * Discriminated union of install-method strategies. Discriminator is `upgradeable`. Consumers narrow on it to access manualUpgradeMessage with type safety;
50
- * structurally impossible to declare an upgradeable strategy that carries manual instructions or a non-upgradeable strategy that omits them.
50
+ * Discriminated union of install-method strategies. The field that marks the kind is `upgradeable`. Consumers narrow on it to access manualUpgradeMessage with
51
+ * type safety; structurally impossible to declare an upgradeable strategy that carries manual instructions or a non-upgradeable strategy that omits them.
51
52
  */
52
53
  export type InstallStrategy<M extends string = string> = UpgradeableInstallStrategy<M> | NonUpgradeableInstallStrategy<M>;
53
54
  declare const STRATEGY_TUPLE: readonly [{
@@ -91,7 +92,7 @@ export type RegisteredMethod = typeof STRATEGY_TUPLE[number]["id"];
91
92
  export declare const INSTALL_STRATEGIES: readonly InstallStrategy<RegisteredMethod>[];
92
93
  /**
93
94
  * The full install-method discriminator. Adds the unknown sentinel that the dispatcher returns when no strategy in the registry matches; everything else is
94
- * registered. Consumers (e.g., commands.ts's switch on info.method) that need exhaustive coverage get it via this type.
95
+ * registered. Consumers that need exhaustive coverage over the full method set get it via this type.
95
96
  */
96
97
  export type InstallMethod = RegisteredMethod | "unknown";
97
98
  /**
@@ -131,9 +132,9 @@ export type InstallInfo = UpgradeableInstallInfo | NonUpgradeableInstallInfo;
131
132
  export declare const UNKNOWN_INSTALL: NonUpgradeableInstallInfo;
132
133
  /**
133
134
  * Detects the installation method. Walks INSTALL_STRATEGIES in priority order; on the first match, builds an InstallInfo by composing the strategy's optional
134
- * resolver output with the strategy's constant fields. The resolver's return type is restricted to ResolvableFields, so it cannot override id, displayName,
135
- * upgradeCommand, or upgradeable; the spread order also places constants after the resolved fields as belt-and-suspenders. The strategy's `upgradeable`
136
- * discriminator selects which InstallInfo variant the dispatcher emits, carrying manualUpgradeMessage through for the non-upgradeable case.
135
+ * resolver output with the strategy's constant fields. The resolver's return type is restricted to ResolvableFields, so it cannot override method, displayName,
136
+ * or upgradeCommand; the spread order also places constants after the resolved fields as belt-and-suspenders. The strategy's `upgradeable`
137
+ * field selects which InstallInfo variant the dispatcher emits, carrying manualUpgradeMessage through for the non-upgradeable case.
137
138
  *
138
139
  * Pure function of DetectionContext - all I/O happens inside the context's runCommand and fileExists callbacks, which the default adapter wires to real system
139
140
  * calls and tests stub inline. Falls back to UNKNOWN_INSTALL when no strategy matches.
@@ -143,3 +144,4 @@ export declare const UNKNOWN_INSTALL: NonUpgradeableInstallInfo;
143
144
  */
144
145
  export declare function detectInstallMethod(ctx?: DetectionContext): InstallInfo;
145
146
  export {};
147
+ //# sourceMappingURL=detection.d.ts.map