@moq/net 0.4.8 → 0.22.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 (662) hide show
  1. package/README.md +7 -1
  2. package/announce.d.ts +1 -1
  3. package/announce.d.ts.map +1 -1
  4. package/announce.js +1 -1
  5. package/announce.js.map +1 -1
  6. package/announced.d.ts +51 -47
  7. package/announced.d.ts.map +1 -1
  8. package/announced.js +183 -31
  9. package/announced.js.map +1 -1
  10. package/announced.test-util.d.ts +2 -0
  11. package/announced.test-util.d.ts.map +1 -0
  12. package/announced.test-util.js +27 -0
  13. package/announced.test-util.js.map +1 -0
  14. package/auth.d.ts +64 -0
  15. package/auth.d.ts.map +1 -0
  16. package/auth.js +20 -0
  17. package/auth.js.map +1 -0
  18. package/auth_gate.d.ts +2 -0
  19. package/auth_gate.d.ts.map +1 -0
  20. package/auth_gate.js +24 -0
  21. package/auth_gate.js.map +1 -0
  22. package/auth_session.d.ts +49 -0
  23. package/auth_session.d.ts.map +1 -0
  24. package/auth_session.js +1097 -0
  25. package/auth_session.js.map +1 -0
  26. package/bandwidth.d.ts +129 -25
  27. package/bandwidth.d.ts.map +1 -1
  28. package/bandwidth.js +410 -138
  29. package/bandwidth.js.map +1 -1
  30. package/bandwidth_api.d.ts +1 -1
  31. package/bandwidth_api.d.ts.map +1 -1
  32. package/bandwidth_api.js +1 -1
  33. package/bandwidth_api.js.map +1 -1
  34. package/broadcast.d.ts +62 -36
  35. package/broadcast.d.ts.map +1 -1
  36. package/broadcast.js +556 -172
  37. package/broadcast.js.map +1 -1
  38. package/cache.d.ts +103 -0
  39. package/cache.d.ts.map +1 -0
  40. package/cache.js +254 -0
  41. package/cache.js.map +1 -0
  42. package/claim.test-util.d.ts +5 -0
  43. package/claim.test-util.d.ts.map +1 -0
  44. package/claim.test-util.js +13 -0
  45. package/claim.test-util.js.map +1 -0
  46. package/connection/accept.d.ts +20 -12
  47. package/connection/accept.d.ts.map +1 -1
  48. package/connection/accept.js +97 -129
  49. package/connection/accept.js.map +1 -1
  50. package/connection/browser.d.ts.map +1 -1
  51. package/connection/browser.js +28 -19
  52. package/connection/browser.js.map +1 -1
  53. package/connection/connect.d.ts +119 -23
  54. package/connection/connect.d.ts.map +1 -1
  55. package/connection/connect.js +535 -216
  56. package/connection/connect.js.map +1 -1
  57. package/connection/dials.d.ts +45 -0
  58. package/connection/dials.d.ts.map +1 -0
  59. package/connection/dials.js +109 -0
  60. package/connection/dials.js.map +1 -0
  61. package/connection/endpoint.d.ts +60 -0
  62. package/connection/endpoint.d.ts.map +1 -0
  63. package/connection/endpoint.js +114 -0
  64. package/connection/endpoint.js.map +1 -0
  65. package/connection/forward.d.ts +7 -1
  66. package/connection/forward.d.ts.map +1 -1
  67. package/connection/forward.js +265 -80
  68. package/connection/forward.js.map +1 -1
  69. package/connection/goaway.d.ts +16 -9
  70. package/connection/goaway.d.ts.map +1 -1
  71. package/connection/goaway.js +22 -108
  72. package/connection/goaway.js.map +1 -1
  73. package/connection/handshake.d.ts +32 -6
  74. package/connection/handshake.d.ts.map +1 -1
  75. package/connection/handshake.js +97 -20
  76. package/connection/handshake.js.map +1 -1
  77. package/connection/index.d.ts +3 -6
  78. package/connection/index.d.ts.map +1 -1
  79. package/connection/index.js +1 -2
  80. package/connection/index.js.map +1 -1
  81. package/connection/liveness.d.ts +14 -0
  82. package/connection/liveness.d.ts.map +1 -0
  83. package/connection/liveness.js +30 -0
  84. package/connection/liveness.js.map +1 -0
  85. package/connection/pool.d.ts +137 -58
  86. package/connection/pool.d.ts.map +1 -1
  87. package/connection/pool.js +281 -117
  88. package/connection/pool.js.map +1 -1
  89. package/connection/reload.d.ts +60 -12
  90. package/connection/reload.d.ts.map +1 -1
  91. package/connection/reload.js +859 -233
  92. package/connection/reload.js.map +1 -1
  93. package/connection/session.d.ts +91 -0
  94. package/connection/session.d.ts.map +1 -0
  95. package/connection/session.js +2 -0
  96. package/connection/session.js.map +1 -0
  97. package/connection/stats.d.ts +20 -11
  98. package/connection/stats.d.ts.map +1 -1
  99. package/connection/stats.js +64 -8
  100. package/connection/stats.js.map +1 -1
  101. package/connection/ticker.d.ts +4 -0
  102. package/connection/ticker.d.ts.map +1 -0
  103. package/connection/ticker.js +66 -0
  104. package/connection/ticker.js.map +1 -0
  105. package/connection/tokens.d.ts +2 -0
  106. package/connection/tokens.d.ts.map +1 -0
  107. package/connection/tokens.js +404 -0
  108. package/connection/tokens.js.map +1 -0
  109. package/connection/transport.d.ts.map +1 -1
  110. package/connection/transport.js +4 -4
  111. package/connection/transport.js.map +1 -1
  112. package/connection/withdrawal.d.ts +2 -0
  113. package/connection/withdrawal.d.ts.map +1 -0
  114. package/connection/withdrawal.js +23 -0
  115. package/connection/withdrawal.js.map +1 -0
  116. package/consume.js +213 -46
  117. package/consume.js.map +1 -1
  118. package/cover.d.ts +59 -0
  119. package/cover.d.ts.map +1 -0
  120. package/cover.js +375 -0
  121. package/cover.js.map +1 -0
  122. package/datagram.d.ts +70 -11
  123. package/datagram.d.ts.map +1 -1
  124. package/datagram.js +317 -1
  125. package/datagram.js.map +1 -1
  126. package/datagram_stream.d.ts +18 -0
  127. package/datagram_stream.d.ts.map +1 -0
  128. package/datagram_stream.js +67 -0
  129. package/datagram_stream.js.map +1 -0
  130. package/defined.test-util.d.ts +2 -0
  131. package/defined.test-util.d.ts.map +1 -0
  132. package/defined.test-util.js +7 -0
  133. package/defined.test-util.js.map +1 -0
  134. package/delivered.d.ts +75 -0
  135. package/delivered.d.ts.map +1 -0
  136. package/delivered.js +228 -0
  137. package/delivered.js.map +1 -0
  138. package/demand.d.ts +173 -0
  139. package/demand.d.ts.map +1 -0
  140. package/demand.js +582 -0
  141. package/demand.js.map +1 -0
  142. package/drops.d.ts +93 -0
  143. package/drops.d.ts.map +1 -0
  144. package/drops.js +283 -0
  145. package/drops.js.map +1 -0
  146. package/error.d.ts +120 -21
  147. package/error.d.ts.map +1 -1
  148. package/error.js +230 -37
  149. package/error.js.map +1 -1
  150. package/errors.d.ts +2 -2
  151. package/errors.d.ts.map +1 -1
  152. package/errors.js +2 -2
  153. package/errors.js.map +1 -1
  154. package/fill.d.ts +174 -0
  155. package/fill.d.ts.map +1 -0
  156. package/fill.js +760 -0
  157. package/fill.js.map +1 -0
  158. package/flate/decoder.d.ts +2 -0
  159. package/flate/decoder.d.ts.map +1 -0
  160. package/flate/decoder.js +63 -0
  161. package/flate/decoder.js.map +1 -0
  162. package/flate/encoder.d.ts +2 -0
  163. package/flate/encoder.d.ts.map +1 -0
  164. package/flate/encoder.js +64 -0
  165. package/flate/encoder.js.map +1 -0
  166. package/flate/group.d.ts +34 -0
  167. package/flate/group.d.ts.map +1 -0
  168. package/flate/group.js +140 -0
  169. package/flate/group.js.map +1 -0
  170. package/frame.d.ts +80 -0
  171. package/frame.d.ts.map +1 -0
  172. package/frame.js +296 -0
  173. package/frame.js.map +1 -0
  174. package/frame.test-util.d.ts +5 -0
  175. package/frame.test-util.d.ts.map +1 -0
  176. package/frame.test-util.js +9 -0
  177. package/frame.test-util.js.map +1 -0
  178. package/group.d.ts +108 -45
  179. package/group.d.ts.map +1 -1
  180. package/group.js +1616 -307
  181. package/group.js.map +1 -1
  182. package/group_api.d.ts +7 -0
  183. package/group_api.d.ts.map +1 -0
  184. package/group_api.js +7 -0
  185. package/group_api.js.map +1 -0
  186. package/hop.d.ts +62 -76
  187. package/hop.d.ts.map +1 -1
  188. package/hop.js +92 -64
  189. package/hop.js.map +1 -1
  190. package/identity.d.ts +39 -0
  191. package/identity.d.ts.map +1 -0
  192. package/identity.js +47 -0
  193. package/identity.js.map +1 -0
  194. package/ietf/active_count.d.ts +2 -0
  195. package/ietf/active_count.d.ts.map +1 -0
  196. package/ietf/active_count.js +30 -0
  197. package/ietf/active_count.js.map +1 -0
  198. package/ietf/aliases.js +69 -35
  199. package/ietf/aliases.js.map +1 -1
  200. package/ietf/cluster.d.ts +3 -3
  201. package/ietf/cluster.js +14 -62
  202. package/ietf/cluster.js.map +1 -1
  203. package/ietf/connection.d.ts +1 -31
  204. package/ietf/connection.d.ts.map +1 -1
  205. package/ietf/connection.js +305 -143
  206. package/ietf/connection.js.map +1 -1
  207. package/ietf/datagram.d.ts +60 -0
  208. package/ietf/datagram.d.ts.map +1 -0
  209. package/ietf/datagram.js +152 -0
  210. package/ietf/datagram.js.map +1 -0
  211. package/ietf/error.d.ts +3 -3
  212. package/ietf/error.js +82 -100
  213. package/ietf/error.js.map +1 -1
  214. package/ietf/fetch.d.ts +91 -35
  215. package/ietf/fetch.d.ts.map +1 -1
  216. package/ietf/fetch.js +172 -93
  217. package/ietf/fetch.js.map +1 -1
  218. package/ietf/filter.d.ts +20 -30
  219. package/ietf/filter.d.ts.map +1 -1
  220. package/ietf/filter.js +140 -171
  221. package/ietf/filter.js.map +1 -1
  222. package/ietf/goaway.d.ts +11 -9
  223. package/ietf/goaway.d.ts.map +1 -1
  224. package/ietf/goaway.js +22 -35
  225. package/ietf/goaway.js.map +1 -1
  226. package/ietf/hidden.js +1 -1
  227. package/ietf/hidden.js.map +1 -1
  228. package/ietf/index.d.ts +2 -14
  229. package/ietf/index.d.ts.map +1 -1
  230. package/ietf/index.js +4 -14
  231. package/ietf/index.js.map +1 -1
  232. package/ietf/join.d.ts +7 -0
  233. package/ietf/join.d.ts.map +1 -0
  234. package/ietf/join.js +234 -0
  235. package/ietf/join.js.map +1 -0
  236. package/ietf/message.d.ts +18 -2
  237. package/ietf/message.d.ts.map +1 -1
  238. package/ietf/message.js +60 -40
  239. package/ietf/message.js.map +1 -1
  240. package/ietf/message.test-util.d.ts +6 -0
  241. package/ietf/message.test-util.d.ts.map +1 -0
  242. package/ietf/message.test-util.js +13 -0
  243. package/ietf/message.test-util.js.map +1 -0
  244. package/ietf/namespace.d.ts +17 -3
  245. package/ietf/namespace.d.ts.map +1 -1
  246. package/ietf/namespace.js +78 -26
  247. package/ietf/namespace.js.map +1 -1
  248. package/ietf/object.d.ts +194 -32
  249. package/ietf/object.d.ts.map +1 -1
  250. package/ietf/object.js +405 -178
  251. package/ietf/object.js.map +1 -1
  252. package/ietf/parameters.d.ts +22 -42
  253. package/ietf/parameters.d.ts.map +1 -1
  254. package/ietf/parameters.js +260 -472
  255. package/ietf/parameters.js.map +1 -1
  256. package/ietf/priority.d.ts +17 -2
  257. package/ietf/priority.d.ts.map +1 -1
  258. package/ietf/priority.js +19 -4
  259. package/ietf/priority.js.map +1 -1
  260. package/ietf/properties.d.ts +5 -4
  261. package/ietf/properties.d.ts.map +1 -1
  262. package/ietf/properties.js +78 -48
  263. package/ietf/properties.js.map +1 -1
  264. package/ietf/publish.d.ts +22 -30
  265. package/ietf/publish.d.ts.map +1 -1
  266. package/ietf/publish.js +45 -139
  267. package/ietf/publish.js.map +1 -1
  268. package/ietf/publish_namespace.d.ts +46 -69
  269. package/ietf/publish_namespace.d.ts.map +1 -1
  270. package/ietf/publish_namespace.js +66 -184
  271. package/ietf/publish_namespace.js.map +1 -1
  272. package/ietf/publisher.js +1800 -600
  273. package/ietf/publisher.js.map +1 -1
  274. package/ietf/range.d.ts +2 -0
  275. package/ietf/range.d.ts.map +1 -0
  276. package/ietf/range.js +222 -0
  277. package/ietf/range.js.map +1 -0
  278. package/ietf/request.d.ts +3 -27
  279. package/ietf/request.d.ts.map +1 -1
  280. package/ietf/request.js +41 -78
  281. package/ietf/request.js.map +1 -1
  282. package/ietf/request_stream.d.ts +1 -6
  283. package/ietf/request_stream.d.ts.map +1 -1
  284. package/ietf/request_stream.js +306 -16
  285. package/ietf/request_stream.js.map +1 -1
  286. package/ietf/session.d.ts +41 -0
  287. package/ietf/session.d.ts.map +1 -0
  288. package/ietf/session.js +65 -0
  289. package/ietf/session.js.map +1 -0
  290. package/ietf/setup.d.ts +4 -29
  291. package/ietf/setup.d.ts.map +1 -1
  292. package/ietf/setup.js +6 -117
  293. package/ietf/setup.js.map +1 -1
  294. package/ietf/setup_options.d.ts +31 -0
  295. package/ietf/setup_options.d.ts.map +1 -0
  296. package/ietf/setup_options.js +138 -0
  297. package/ietf/setup_options.js.map +1 -0
  298. package/ietf/solicit.js +4 -14
  299. package/ietf/solicit.js.map +1 -1
  300. package/ietf/subscribe.d.ts +48 -41
  301. package/ietf/subscribe.d.ts.map +1 -1
  302. package/ietf/subscribe.js +118 -239
  303. package/ietf/subscribe.js.map +1 -1
  304. package/ietf/subscribe_namespace.d.ts +13 -76
  305. package/ietf/subscribe_namespace.d.ts.map +1 -1
  306. package/ietf/subscribe_namespace.js +30 -201
  307. package/ietf/subscribe_namespace.js.map +1 -1
  308. package/ietf/subscriber.js +1839 -536
  309. package/ietf/subscriber.js.map +1 -1
  310. package/ietf/token.js +105 -27
  311. package/ietf/token.js.map +1 -1
  312. package/ietf/track.d.ts +25 -22
  313. package/ietf/track.d.ts.map +1 -1
  314. package/ietf/track.js +48 -61
  315. package/ietf/track.js.map +1 -1
  316. package/ietf/version.d.ts +13 -42
  317. package/ietf/version.d.ts.map +1 -1
  318. package/ietf/version.js +22 -48
  319. package/ietf/version.js.map +1 -1
  320. package/implementation.d.ts +2 -0
  321. package/implementation.d.ts.map +1 -0
  322. package/implementation.js +5 -0
  323. package/implementation.js.map +1 -0
  324. package/index.d.ts +25 -10
  325. package/index.d.ts.map +1 -1
  326. package/index.js +19 -6
  327. package/index.js.map +1 -1
  328. package/internal.d.ts +1512 -64
  329. package/internal.d.ts.map +1 -1
  330. package/internal.js +557 -79
  331. package/internal.js.map +1 -1
  332. package/ledger.d.ts +23 -0
  333. package/ledger.d.ts.map +1 -0
  334. package/ledger.js +247 -0
  335. package/ledger.js.map +1 -0
  336. package/listing.d.ts +132 -0
  337. package/listing.d.ts.map +1 -0
  338. package/listing.js +486 -0
  339. package/listing.js.map +1 -0
  340. package/lite/announce.d.ts +124 -63
  341. package/lite/announce.d.ts.map +1 -1
  342. package/lite/announce.js +384 -158
  343. package/lite/announce.js.map +1 -1
  344. package/lite/announce_stream.d.ts +2 -0
  345. package/lite/announce_stream.d.ts.map +1 -0
  346. package/lite/announce_stream.js +92 -0
  347. package/lite/announce_stream.js.map +1 -0
  348. package/lite/answer.d.ts +22 -0
  349. package/lite/answer.d.ts.map +1 -0
  350. package/lite/answer.js +301 -0
  351. package/lite/answer.js.map +1 -0
  352. package/lite/auth.d.ts +45 -0
  353. package/lite/auth.d.ts.map +1 -0
  354. package/lite/auth.js +204 -0
  355. package/lite/auth.js.map +1 -0
  356. package/lite/compat.d.ts +31 -0
  357. package/lite/compat.d.ts.map +1 -0
  358. package/lite/compat.js +86 -0
  359. package/lite/compat.js.map +1 -0
  360. package/lite/connection.d.ts +1 -45
  361. package/lite/connection.d.ts.map +1 -1
  362. package/lite/connection.js +360 -77
  363. package/lite/connection.js.map +1 -1
  364. package/lite/datagram-end.d.ts +26 -0
  365. package/lite/datagram-end.d.ts.map +1 -0
  366. package/lite/datagram-end.js +30 -0
  367. package/lite/datagram-end.js.map +1 -0
  368. package/lite/datagram.d.ts +73 -8
  369. package/lite/datagram.d.ts.map +1 -1
  370. package/lite/datagram.js +144 -9
  371. package/lite/datagram.js.map +1 -1
  372. package/lite/duration.d.ts +6 -0
  373. package/lite/duration.d.ts.map +1 -0
  374. package/lite/duration.js +14 -0
  375. package/lite/duration.js.map +1 -0
  376. package/lite/error.d.ts +9 -0
  377. package/lite/error.d.ts.map +1 -0
  378. package/lite/error.js +24 -0
  379. package/lite/error.js.map +1 -0
  380. package/lite/fills.d.ts +162 -0
  381. package/lite/fills.d.ts.map +1 -0
  382. package/lite/fills.js +486 -0
  383. package/lite/fills.js.map +1 -0
  384. package/lite/fit.d.ts +49 -0
  385. package/lite/fit.d.ts.map +1 -0
  386. package/lite/fit.js +305 -0
  387. package/lite/fit.js.map +1 -0
  388. package/lite/goaway.d.ts +1 -1
  389. package/lite/goaway.d.ts.map +1 -1
  390. package/lite/goaway.js +5 -13
  391. package/lite/goaway.js.map +1 -1
  392. package/lite/group.d.ts +64 -13
  393. package/lite/group.d.ts.map +1 -1
  394. package/lite/group.js +108 -30
  395. package/lite/group.js.map +1 -1
  396. package/lite/identity.d.ts +25 -0
  397. package/lite/identity.d.ts.map +1 -0
  398. package/lite/identity.js +79 -0
  399. package/lite/identity.js.map +1 -0
  400. package/lite/index.d.ts +2 -1
  401. package/lite/index.d.ts.map +1 -1
  402. package/lite/index.js +2 -1
  403. package/lite/index.js.map +1 -1
  404. package/lite/message.d.ts +9 -1
  405. package/lite/message.d.ts.map +1 -1
  406. package/lite/message.js +28 -44
  407. package/lite/message.js.map +1 -1
  408. package/lite/priority.d.ts +9 -2
  409. package/lite/priority.d.ts.map +1 -1
  410. package/lite/priority.js +11 -105
  411. package/lite/priority.js.map +1 -1
  412. package/lite/probe.d.ts.map +1 -1
  413. package/lite/probe.js +9 -0
  414. package/lite/probe.js.map +1 -1
  415. package/lite/publisher.d.ts +10 -1
  416. package/lite/publisher.d.ts.map +1 -1
  417. package/lite/publisher.js +2548 -437
  418. package/lite/publisher.js.map +1 -1
  419. package/lite/routed.d.ts +59 -0
  420. package/lite/routed.d.ts.map +1 -0
  421. package/lite/routed.js +564 -0
  422. package/lite/routed.js.map +1 -0
  423. package/lite/session.d.ts +1 -27
  424. package/lite/session.d.ts.map +1 -1
  425. package/lite/session.js +0 -99
  426. package/lite/session.js.map +1 -1
  427. package/lite/setup.d.ts +29 -2
  428. package/lite/setup.d.ts.map +1 -1
  429. package/lite/setup.js +95 -21
  430. package/lite/setup.js.map +1 -1
  431. package/lite/stream.d.ts +5 -11
  432. package/lite/stream.d.ts.map +1 -1
  433. package/lite/stream.js +5 -1
  434. package/lite/stream.js.map +1 -1
  435. package/lite/subscribe.d.ts +475 -75
  436. package/lite/subscribe.d.ts.map +1 -1
  437. package/lite/subscribe.js +1373 -142
  438. package/lite/subscribe.js.map +1 -1
  439. package/lite/subscriber.d.ts +7 -44
  440. package/lite/subscriber.d.ts.map +1 -1
  441. package/lite/subscriber.js +3290 -515
  442. package/lite/subscriber.js.map +1 -1
  443. package/lite/track.d.ts +24 -9
  444. package/lite/track.d.ts.map +1 -1
  445. package/lite/track.js +116 -37
  446. package/lite/track.js.map +1 -1
  447. package/lite/tracks.d.ts +55 -0
  448. package/lite/tracks.d.ts.map +1 -0
  449. package/lite/tracks.js +114 -0
  450. package/lite/tracks.js.map +1 -0
  451. package/lite/version.d.ts +132 -24
  452. package/lite/version.d.ts.map +1 -1
  453. package/lite/version.js +378 -33
  454. package/lite/version.js.map +1 -1
  455. package/meta.d.ts +77 -0
  456. package/meta.d.ts.map +1 -0
  457. package/meta.js +130 -0
  458. package/meta.js.map +1 -0
  459. package/meta_api.d.ts +7 -0
  460. package/meta_api.d.ts.map +1 -0
  461. package/meta_api.js +7 -0
  462. package/meta_api.js.map +1 -0
  463. package/mint.d.ts +28 -0
  464. package/mint.d.ts.map +1 -0
  465. package/mint.js +66 -0
  466. package/mint.js.map +1 -0
  467. package/open.d.ts +63 -0
  468. package/open.d.ts.map +1 -0
  469. package/open.js +250 -0
  470. package/open.js.map +1 -0
  471. package/origin.d.ts +392 -140
  472. package/origin.d.ts.map +1 -1
  473. package/origin.js +2533 -686
  474. package/origin.js.map +1 -1
  475. package/package.json +8 -13
  476. package/path.d.ts +51 -51
  477. package/path.d.ts.map +1 -1
  478. package/path.js +210 -57
  479. package/path.js.map +1 -1
  480. package/payload.d.ts +33 -0
  481. package/payload.d.ts.map +1 -0
  482. package/payload.js +65 -0
  483. package/payload.js.map +1 -0
  484. package/prefix.d.ts +152 -0
  485. package/prefix.d.ts.map +1 -0
  486. package/prefix.js +349 -0
  487. package/prefix.js.map +1 -0
  488. package/priority.d.ts +8 -0
  489. package/priority.d.ts.map +1 -0
  490. package/priority.js +185 -0
  491. package/priority.js.map +1 -0
  492. package/queue.d.ts +2 -0
  493. package/queue.d.ts.map +1 -0
  494. package/queue.js +46 -0
  495. package/queue.js.map +1 -0
  496. package/ranges.d.ts +36 -0
  497. package/ranges.d.ts.map +1 -0
  498. package/ranges.js +312 -0
  499. package/ranges.js.map +1 -0
  500. package/rescale.d.ts +24 -0
  501. package/rescale.d.ts.map +1 -0
  502. package/rescale.js +39 -0
  503. package/rescale.js.map +1 -0
  504. package/resume.d.ts +55 -0
  505. package/resume.d.ts.map +1 -0
  506. package/resume.js +4173 -0
  507. package/resume.js.map +1 -0
  508. package/resume.test-util.d.ts +2 -0
  509. package/resume.test-util.d.ts.map +1 -0
  510. package/resume.test-util.js +25 -0
  511. package/resume.test-util.js.map +1 -0
  512. package/skips.d.ts +48 -0
  513. package/skips.d.ts.map +1 -0
  514. package/skips.js +182 -0
  515. package/skips.js.map +1 -0
  516. package/stream.d.ts +75 -37
  517. package/stream.d.ts.map +1 -1
  518. package/stream.js +236 -92
  519. package/stream.js.map +1 -1
  520. package/subscription.test-util.d.ts +2 -0
  521. package/subscription.test-util.d.ts.map +1 -0
  522. package/subscription.test-util.js +49 -0
  523. package/subscription.test-util.js.map +1 -0
  524. package/tail.d.ts +23 -14
  525. package/tail.d.ts.map +1 -1
  526. package/tail.js +224 -97
  527. package/tail.js.map +1 -1
  528. package/time.d.ts +41 -102
  529. package/time.d.ts.map +1 -1
  530. package/time.js +129 -91
  531. package/time.js.map +1 -1
  532. package/timed.d.ts +21 -0
  533. package/timed.d.ts.map +1 -0
  534. package/timed.js +2 -0
  535. package/timed.js.map +1 -0
  536. package/track.d.ts +577 -245
  537. package/track.d.ts.map +1 -1
  538. package/track.js +7306 -771
  539. package/track.js.map +1 -1
  540. package/track_api.d.ts +7 -0
  541. package/track_api.d.ts.map +1 -0
  542. package/track_api.js +7 -0
  543. package/track_api.js.map +1 -0
  544. package/util/abort.d.ts +1 -0
  545. package/util/abort.d.ts.map +1 -1
  546. package/util/abort.js +23 -1
  547. package/util/abort.js.map +1 -1
  548. package/util/announce.d.ts +4 -0
  549. package/util/announce.d.ts.map +1 -0
  550. package/util/announce.js +11 -0
  551. package/util/announce.js.map +1 -0
  552. package/util/bigint.d.ts +3 -0
  553. package/util/bigint.d.ts.map +1 -0
  554. package/util/bigint.js +8 -0
  555. package/util/bigint.js.map +1 -0
  556. package/util/change.d.ts +12 -0
  557. package/util/change.d.ts.map +1 -0
  558. package/util/change.js +18 -0
  559. package/util/change.js.map +1 -0
  560. package/util/deadline.d.ts +2 -0
  561. package/util/deadline.d.ts.map +1 -0
  562. package/util/deadline.js +108 -0
  563. package/util/deadline.js.map +1 -0
  564. package/util/decode_error.d.ts +3 -0
  565. package/util/decode_error.d.ts.map +1 -0
  566. package/util/decode_error.js +11 -0
  567. package/util/decode_error.js.map +1 -0
  568. package/util/demand.d.ts +8 -0
  569. package/util/demand.d.ts.map +1 -0
  570. package/util/demand.js +24 -0
  571. package/util/demand.js.map +1 -0
  572. package/util/given_up.d.ts +2 -0
  573. package/util/given_up.d.ts.map +1 -0
  574. package/util/given_up.js +101 -0
  575. package/util/given_up.js.map +1 -0
  576. package/util/hex.d.ts +6 -0
  577. package/util/hex.d.ts.map +1 -1
  578. package/util/hex.js +19 -4
  579. package/util/hex.js.map +1 -1
  580. package/util/key.d.ts +15 -0
  581. package/util/key.d.ts.map +1 -0
  582. package/util/key.js +38 -0
  583. package/util/key.js.map +1 -0
  584. package/util/limits.d.ts +2 -0
  585. package/util/limits.d.ts.map +1 -0
  586. package/util/limits.js +76 -0
  587. package/util/limits.js.map +1 -0
  588. package/util/observed.d.ts +23 -0
  589. package/util/observed.d.ts.map +1 -0
  590. package/util/observed.js +122 -0
  591. package/util/observed.js.map +1 -0
  592. package/util/sorted.d.ts +2 -0
  593. package/util/sorted.d.ts.map +1 -0
  594. package/util/sorted.js +149 -0
  595. package/util/sorted.js.map +1 -0
  596. package/util/timeout.d.ts +2 -1
  597. package/util/timeout.d.ts.map +1 -1
  598. package/util/timeout.js +13 -9
  599. package/util/timeout.js.map +1 -1
  600. package/util/timer.d.ts +2 -0
  601. package/util/timer.d.ts.map +1 -0
  602. package/util/timer.js +19 -0
  603. package/util/timer.js.map +1 -0
  604. package/util/utf8.d.ts +2 -0
  605. package/util/utf8.d.ts.map +1 -1
  606. package/util/utf8.js +7 -1
  607. package/util/utf8.js.map +1 -1
  608. package/util/varint.d.ts.map +1 -1
  609. package/util/varint.js +8 -1
  610. package/util/varint.js.map +1 -1
  611. package/util/watch.d.ts +8 -0
  612. package/util/watch.d.ts.map +1 -0
  613. package/util/watch.js +38 -0
  614. package/util/watch.js.map +1 -0
  615. package/util/yield.d.ts +2 -0
  616. package/util/yield.d.ts.map +1 -0
  617. package/util/yield.js +31 -0
  618. package/util/yield.js.map +1 -0
  619. package/varint.d.ts +0 -29
  620. package/varint.d.ts.map +1 -1
  621. package/varint.js +7 -28
  622. package/varint.js.map +1 -1
  623. package/varint_api.d.ts +7 -0
  624. package/varint_api.d.ts.map +1 -0
  625. package/varint_api.js +7 -0
  626. package/varint_api.js.map +1 -0
  627. package/version.d.ts +2 -0
  628. package/version.d.ts.map +1 -0
  629. package/version.js +4 -0
  630. package/version.js.map +1 -0
  631. package/window.d.ts +570 -0
  632. package/window.d.ts.map +1 -0
  633. package/window.js +1677 -0
  634. package/window.js.map +1 -0
  635. package/wire.d.ts +145 -30
  636. package/wire.d.ts.map +1 -1
  637. package/wire.js +27 -0
  638. package/wire.js.map +1 -1
  639. package/connection/established.d.ts +0 -53
  640. package/connection/established.d.ts.map +0 -1
  641. package/connection/established.js +0 -2
  642. package/connection/established.js.map +0 -1
  643. package/ietf/adapter.d.ts +0 -75
  644. package/ietf/adapter.d.ts.map +0 -1
  645. package/ietf/adapter.js +0 -699
  646. package/ietf/adapter.js.map +0 -1
  647. package/lite/datagram_stream.d.ts +0 -8
  648. package/lite/datagram_stream.d.ts.map +0 -1
  649. package/lite/datagram_stream.js +0 -43
  650. package/lite/datagram_stream.js.map +0 -1
  651. package/lite/fetch.d.ts +0 -28
  652. package/lite/fetch.d.ts.map +0 -1
  653. package/lite/fetch.js +0 -78
  654. package/lite/fetch.js.map +0 -1
  655. package/util/log.d.ts +0 -5
  656. package/util/log.d.ts.map +0 -1
  657. package/util/log.js +0 -16
  658. package/util/log.js.map +0 -1
  659. package/zod.d.ts +0 -13
  660. package/zod.d.ts.map +0 -1
  661. package/zod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,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;oBACjD,QAAQ,GAAG,MAAM,CAAC;oBAClB,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;gBAClC,CAAC;YACF,CAAC;QACF,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;YACxC,MAAM,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;IAED,KAAK;QACJ,iFAAiF;QACjF,4EAA4E;QAE5E,qEAAqE;QACrE,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;IAClC,CAAC;CACD","sourcesContent":["import { type Dispose, type Getter, race, Signal } from \"@moq/signals\";\nimport type * as broadcast from \"../broadcast.ts\";\nimport { error, NotFound, reason, StreamCode, StreamError } from \"../error.ts\";\nimport type * as group from \"../group.ts\";\nimport { Cost, type Hop, type Route, routesEqual } from \"../hop.ts\";\nimport { hiddenBelow, hooks, presented } from \"../internal.ts\";\nimport type { Consumer as OriginConsumer } from \"../origin.ts\";\nimport type * as Path from \"../path.ts\";\nimport { type Reader, type Stream, Writer } from \"../stream.ts\";\nimport { Milli, Timescale } from \"../time.ts\";\nimport type * as track from \"../track.ts\";\nimport { type Advertised, type Advertisements, wireOf } from \"../wire.ts\";\nimport { AnnounceInit, AnnounceOk, type AnnounceRequest, encodeAnnounceBroadcast } from \"./announce.ts\";\nimport { Datagram as DatagramMessage } from \"./datagram.ts\";\nimport * as DatagramStream from \"./datagram_stream.ts\";\nimport type { Fetch } from \"./fetch.ts\";\nimport { Group as GroupMessage } from \"./group.ts\";\nimport { Priority, sendOrder } from \"./priority.ts\";\nimport { Probe } from \"./probe.ts\";\nimport {\n\tencodeSubscribeResponse,\n\texclusiveGroupEnd,\n\ttype Subscribe,\n\tSubscribeEnd,\n\tSubscribeOk,\n\tSubscribeStart,\n\tSubscribeUpdate,\n} from \"./subscribe.ts\";\nimport { TrackInfo as TrackInfoMessage, type Track as TrackMessage } from \"./track.ts\";\nimport {\n\thasAnnounceId,\n\thasAnnounceOk,\n\thasDatagrams,\n\thasProbeRtt,\n\thasRouteCost,\n\thasStreamCount,\n\tresolvesStart,\n\tVersion,\n} from \"./version.ts\";\n\nconst PROBE_INTERVAL = 100; // ms\nconst PROBE_MAX_AGE = 10_000; // ms\nconst PROBE_MAX_DELTA = 0.25;\nconst PROBE_RTT_DELTA = 0.25;\n\n/** Map a signed delta to an unsigned zigzag varint value (mirrors Rust `VarInt::from_zigzag`). */\nfunction zigzag(delta: bigint): bigint {\n\treturn delta >= 0n ? delta << 1n : (-delta << 1n) - 1n;\n}\n\n/** What {@link Publisher.openGroup} and {@link Publisher.serveGroup} need to serve one group. */\ninterface RunGroup {\n\t/** The subscription ID. */\n\tsub: bigint;\n\n\t/** The group to serve. */\n\tgroup: group.Consumer;\n\n\t/** The track's advertised timescale, applied to every frame timestamp. */\n\ttimescale: Timescale;\n\n\t/** The subscription's ranking, which this stream joins for as long as it runs. */\n\tpriority: Priority;\n\n\t/** Settles when the subscriber leaves, dropping a group still queued for a stream slot. */\n\tunsubscribed: Promise<void>;\n\n\t/** First frame to send; anything below it was excluded by the subscription. */\n\tstart: number;\n\n\t/** Last frame to send (inclusive), or undefined for the rest of the group. */\n\tend?: number;\n}\n\n// The TRACK stream, implicit SUBSCRIBE acceptance, and SUBSCRIBE_START/END are\n// all lite-05+.\nfunction supportsTrackStream(version: Version): boolean {\n\tswitch (version) {\n\t\tcase Version.DRAFT_01:\n\t\tcase Version.DRAFT_02:\n\t\tcase Version.DRAFT_03:\n\t\tcase Version.DRAFT_04:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/**\n * The frame bounds a subscription placed on its start and end group, as they stand\n * after any SUBSCRIBE_UPDATE.\n *\n * Only the two named groups are qualified; the group range itself lives on the\n * subscriber's read cursor (see {@link frameRange}).\n */\ntype FrameBounds = {\n\t/** The group {@link startFrame} qualifies, if the subscription named one. */\n\tstartGroup?: number;\n\t/** First frame to send within {@link startGroup}; every other group starts at 0. */\n\tstartFrame: number;\n\t/** The group {@link endFrame} qualifies, if the subscription named one. */\n\tendGroup?: number;\n\t/** Last frame (inclusive) to send within {@link endGroup}; every other group runs to its end. */\n\tendFrame?: number;\n};\n\n/**\n * The frames of `sequence` a subscription asked for, as a start index and an inclusive end.\n *\n * The frame bounds qualify the start and end group only; every other group is served whole.\n * Which groups are served at all is the subscriber's read cursor (`replaceGroups`),\n * applied when a group is popped rather than re-checked here.\n *\n * The serving loop calls this synchronously after the pop, before any SUBSCRIBE_UPDATE can\n * change `bounds`. Nothing downstream trims the frame range: it is a wire request,\n * deliberately decoupled from the receiver's local read cursor.\n */\nfunction frameRange(bounds: FrameBounds, sequence: number): { start: number; end?: number } {\n\treturn {\n\t\tstart: bounds.startGroup === sequence ? bounds.startFrame : 0,\n\t\tend: bounds.endGroup === sequence ? bounds.endFrame : undefined,\n\t};\n}\n\n/** What serving one group needs beyond the group itself. */\ntype ServeGroup = {\n\t/** The Subscribe ID the GROUP message references. */\n\tsub: bigint;\n\t/** The track's advertised timescale, which every frame timestamp is converted to. */\n\ttimescale: Timescale;\n\t/** First frame to send; anything below it was excluded by the subscription. */\n\tstart: number;\n\t/** Last frame to send (inclusive), or undefined for the rest of the group. */\n\tend?: number;\n};\n\n/** What serving fetched frames needs beyond the group and destination stream. */\ntype ServeFetch = Omit<ServeGroup, \"sub\">;\n\n/** What the serving loop takes from the subscribe stream instead of serving a group. */\ntype Control =\n\t/** The peer re-stated the subscription: priority, ordering, latency, and both ranges. */\n\t| { kind: \"update\"; update: SubscribeUpdate }\n\t/** The peer FIN'd, or our own half went away. Either way there is nobody left to serve. */\n\t| { kind: \"done\" }\n\t/** The stream failed; the subscription goes down with it. */\n\t| { kind: \"error\"; error: Error };\n\ntype SubscriptionControlOptions = {\n\treader: Reader;\n\twriter: Writer;\n\tversion: Version;\n\tapply: (update: SubscribeUpdate) => void;\n};\n\n/**\n * The subscribe stream's control half, decoded ahead of the serving loop.\n *\n * Decoding runs on its own and publishes each full subscription update immediately, so a\n * blocked response write cannot delay re-ranking streams already in flight. It separately\n * stores only the latest range state for the serving loop, which owns the local track cursor\n * and frame bounds. That keeps a group pop and its frame-range snapshot one indivisible step.\n *\n * Reading ahead makes control-first ordering hold for a burst. Coalescing bounds memory while\n * preserving the newest state decoded before the next group pop. The Rust publisher gets the\n * same ordering from `poll_decode_maybe`, which decodes straight out of the reader's buffer;\n * nothing here can decode synchronously, so it reads ahead instead.\n */\nclass SubscriptionControls {\n\t#writer: Writer;\n\t#update?: SubscribeUpdate;\n\t// Sticky, first one wins: null once the stream is over, an Error once it failed.\n\t#end?: Error | null;\n\t#ended: Promise<Error | null>;\n\t#resolveEnd!: (end: Error | null) => void;\n\t#changed = new Signal(0);\n\n\t/** Settles once decoding stops, so teardown can wait for it rather than leaving it running. */\n\treadonly decoding: Promise<void>;\n\n\tconstructor({ reader, writer, version, apply }: SubscriptionControlOptions) {\n\t\tthis.#writer = writer;\n\t\tthis.#ended = new Promise((resolve) => {\n\t\t\tthis.#resolveEnd = resolve;\n\t\t});\n\t\tthis.decoding = this.#decode(reader, version, apply);\n\t\t// Our own half going away ends the loop too, and has to reach it the same way: the\n\t\t// loop looks at nothing else.\n\t\tvoid writer.closed.then(\n\t\t\t() => this.#finish(null),\n\t\t\t(err: unknown) => this.#finish(error(err)),\n\t\t);\n\t}\n\n\t/** The next control to apply, or undefined while the peer is quiet. */\n\ttake(): Control | undefined {\n\t\tconst update = this.#update;\n\t\tthis.#update = undefined;\n\t\t// An update decoded before the stream ended still applies before the sticky end.\n\t\tif (update) return { kind: \"update\", update };\n\t\tif (this.#end === undefined) return undefined;\n\t\treturn this.#end === null ? { kind: \"done\" } : { kind: \"error\", error: this.#end };\n\t}\n\n\t/** Calls `fn` once {@link take} may answer differently. */\n\tchanged(fn: () => void): Dispose {\n\t\treturn this.#changed.changed(fn);\n\t}\n\n\t/** Returns false when peer departure supersedes a blocked response write. */\n\tasync response(pending: Promise<void>): Promise<boolean> {\n\t\t// `#ended` lives as long as the stream, so it is raced as-is rather than mapped per call.\n\t\tconst result = await race([\n\t\t\tpending.then(\n\t\t\t\t() => ({ kind: \"sent\" }) as const,\n\t\t\t\t(err: unknown) => ({ kind: \"error\", error: error(err) }) as const,\n\t\t\t),\n\t\t\tthis.#ended,\n\t\t]);\n\n\t\tif (result !== null && !(result instanceof Error)) {\n\t\t\tif (result.kind === \"sent\") return true;\n\t\t\tthrow result.error;\n\t\t}\n\n\t\t// The race leaves the blocked encode running, so reset the writable half too.\n\t\tthis.#writer.reset(result ?? new StreamError(StreamCode.Cancel, { message: \"cancel\" }));\n\t\tif (result) throw result;\n\t\treturn false;\n\t}\n\n\t/** Settles once the stream is over: `null` when it ended cleanly, or the failure. */\n\tget ended(): Promise<Error | null> {\n\t\treturn this.#ended;\n\t}\n\n\t#finish(end: Error | null) {\n\t\tif (this.#end !== undefined) return;\n\t\tthis.#end = end;\n\t\tthis.#resolveEnd(end);\n\t\tthis.#changed.update((value) => value + 1);\n\t}\n\n\tasync #decode(reader: Reader, version: Version, apply: (update: SubscribeUpdate) => void) {\n\t\ttry {\n\t\t\twhile (this.#end === undefined) {\n\t\t\t\tconst update = await SubscribeUpdate.decodeMaybe(reader, version);\n\t\t\t\tif (!update) break;\n\t\t\t\tapply(update);\n\t\t\t\tthis.#update = update;\n\t\t\t\tthis.#changed.update((value) => value + 1);\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tthis.#finish(error(err));\n\t\t\treturn;\n\t\t}\n\t\tthis.#finish(null);\n\t}\n}\n\n// A microtask is too short: decoding one framed update crosses several awaits, each of which\n// can requeue behind the serving continuation. A task boundary lets the decoder finish whatever\n// the transport already delivered before the next group pop. Updates are rare, so groups do not\n// pay this scheduling cost on the normal path.\nconst yieldToControls = () => new Promise<void>((resolve) => setTimeout(resolve, 0));\n\n// Register both readiness sources in the same turn after the caller observed neither ready.\n// The winner disposes both registrations, so an idle subscription accumulates nothing no\n// matter how many times it wakes.\nfunction waitForSubscription(controls: SubscriptionControls, subscriber: track.Subscriber): Promise<void> {\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst dispose: Dispose[] = [];\n\t\tconst wake = () => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tfor (const close of dispose) close();\n\t\t\tresolve();\n\t\t};\n\t\tdispose.push(controls.changed(wake), hooks.groupChanged(subscriber, wake));\n\t});\n}\n\n/**\n * The budget to serve a peer with, given what its wire could tell us.\n *\n * A version without the field decodes as `0`, which is indistinguishable from a peer\n * genuinely asking for the live edge. Serving that as real time would discard backlog\n * a legacy subscriber never declined, so fall back to a window wide enough not to drop\n * and leave enforcement to the receiver, as the IETF path does for the same reason.\n */\nfunction servingMaxAge(version: Version, requested: number | undefined): number {\n\treturn carriesMaxAge(version) ? (requested ?? 0) : Number.MAX_SAFE_INTEGER;\n}\n\n/** Whether this version's SUBSCRIBE carries Subscriber Max Age at all. */\nfunction carriesMaxAge(version: Version): boolean {\n\treturn version !== Version.DRAFT_01 && version !== Version.DRAFT_02;\n}\n\n/**\n * Position a subscription's read cursor for the wire serving it.\n *\n * On lite-06 there is nothing to do: the cursor is floored at the group the subscription\n * named (or 0), and its Max Age decides what above the floor is worth delivering.\n *\n * Pre-06 wires are the exception: their drafts define an absent `Group Start` as the\n * latest group, so say so explicitly rather than letting the budget reach back. Lite-03/04/05\n * carry a Max Age, but there it is a staleness tolerance only; lite-01/02 additionally get\n * an unbounded budget so nothing is dropped under them (see {@link servingMaxAge}), which\n * must not read as a request to replay the whole cache on join.\n */\nfunction positionCursor(track: track.Subscriber, version: Version, startGroup: number | undefined) {\n\tif (resolvesStart(version) || startGroup !== undefined) return;\n\n\tconst latest = track.latest();\n\tif (latest !== undefined) hooks.replaceGroups(track, { start: { included: latest } });\n}\n\n/**\n * Handles publishing broadcasts and managing their lifecycle.\n *\n * @internal\n */\nexport class Publisher {\n\t// The version of the connection.\n\treadonly version: Version;\n\n\t// Per-connection origin appended to outbound Announce hops, so the peer\n\t// can detect loops and prefer shorter paths. Created by Connection and\n\t// shared with Subscriber, which can optionally use it to filter out its\n\t// own announcements.\n\treadonly hop: Hop;\n\n\t#quic: WebTransport;\n\n\t// The one writer for the outbound datagram stream (getWriter locks it), acquired once at\n\t// construction when this version + transport carry datagrams, released in close(). Its\n\t// presence is the gate: undefined means datagrams aren't served on this connection. All\n\t// subscriptions share it, since a second getWriter on the same stream would throw.\n\t#datagramWriter?: WritableStreamDefaultWriter<Uint8Array>;\n\n\t// Originated advertisements this session forwards.\n\t#advertised: Getter<Advertisements | undefined>;\n\n\t#publish?: OriginConsumer;\n\n\t// TRACK_INFO is immutable per track, so resolve it from the application once\n\t// (via a throwaway subscribe whose info() resolves when the app calls accept)\n\t// and reuse it for every later TRACK request of the same track. Keyed by the\n\t// routing front rather than the path: immutability holds for one broadcast, and a\n\t// republish puts a different one on the path, so its entries must not be reused.\n\t// A rejected lookup is evicted so a retry can re-probe.\n\t#trackInfo = new WeakMap<broadcast.Consumer, Map<string, Promise<TrackInfoMessage>>>();\n\n\t/**\n\t * Creates a new Publisher instance.\n\t * @param quic - The WebTransport session to use\n\t * @param version - Negotiated protocol version\n\t * @param origin - Hop id shared with the Subscriber\n\t * @param publish - The origin whose broadcasts this session serves; omit to publish nothing\n\t *\n\t * @internal\n\t */\n\tconstructor(quic: WebTransport, version: Version, hop: Hop, publish?: OriginConsumer) {\n\t\tthis.#quic = quic;\n\t\tthis.version = version;\n\t\tthis.hop = hop;\n\t\tconst origin = publish && wireOf(publish);\n\t\tthis.#advertised = origin?.advertised ?? new Signal(new Map());\n\t\tthis.#publish = publish;\n\n\t\t// Grab the datagram writer up front when the transport carries datagrams (no group\n\t\t// fallback, so it stays undefined otherwise). One writer for all subscriptions.\n\t\tif (hasDatagrams(version)) {\n\t\t\tthis.#datagramWriter = DatagramStream.datagramWriter(quic);\n\t\t}\n\t}\n\n\t/**\n\t * Handles an announce interest message.\n\t * @param msg - The announce interest message\n\t * @param stream - The stream to write announcements to\n\t *\n\t * @internal\n\t */\n\tasync runAnnounce(msg: AnnounceRequest, stream: Stream) {\n\t\tconsole.debug(`announce: prefix=${msg.prefix}`);\n\n\t\t// Keyed by suffix, valued by identity plus route, so a republish diffs as\n\t\t// ended-then-active and a re-price as a restart.\n\t\tlet active = new Map<Path.Valid, Advertised>();\n\n\t\t// Lite06+: announce ids. Every active we send implicitly assigns the next\n\t\t// per-stream ordinal; ended/restart reference the id instead of repeating the path.\n\t\tlet nextAnnounceId = 0n;\n\t\tconst announceIds = new Map<Path.Valid, bigint>();\n\n\t\tconst wireHops = (route: Route): Hop[] => {\n\t\t\tif (hasAnnounceOk(this.version)) return route.hops;\n\t\t\treturn [...route.hops, this.hop];\n\t\t};\n\n\t\t// What the peer decodes for a route: pre-lite-06 wires carry no cost, so a re-price\n\t\t// there must not restart.\n\t\tconst onWire = (route: Route): Route => (hasRouteCost(this.version) ? route : { ...route, cost: Cost.zero });\n\n\t\tconst announce = async (suffix: Path.Valid, route: Route) => {\n\t\t\tconsole.debug(`announce: broadcast=${suffix} active=true`);\n\t\t\tif (hasAnnounceId(this.version)) announceIds.set(suffix, nextAnnounceId++);\n\t\t\tawait encodeAnnounceBroadcast(\n\t\t\t\tstream.writer,\n\t\t\t\t{ status: \"active\", suffix, hops: wireHops(route), cost: route.cost },\n\t\t\t\tthis.version,\n\t\t\t);\n\t\t};\n\n\t\tconst restart = async (suffix: Path.Valid, route: Route) => {\n\t\t\tif (!hasAnnounceId(this.version)) {\n\t\t\t\tawait retract(suffix);\n\t\t\t\tawait announce(suffix, route);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst id = announceIds.get(suffix);\n\t\t\tif (id === undefined) {\n\t\t\t\tawait announce(suffix, route);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconsole.debug(`announce: broadcast=${suffix} restart=true`);\n\t\t\tawait encodeAnnounceBroadcast(\n\t\t\t\tstream.writer,\n\t\t\t\t{ status: \"restart\", id, hops: wireHops(route), cost: route.cost },\n\t\t\t\tthis.version,\n\t\t\t);\n\t\t};\n\n\t\t// Lite06+ retracts by announce id; older versions repeat the path (ended announces\n\t\t// don't need hops).\n\t\tconst retract = async (suffix: Path.Valid) => {\n\t\t\tconsole.debug(`announce: broadcast=${suffix} active=false`);\n\t\t\tif (!hasAnnounceId(this.version)) {\n\t\t\t\tawait encodeAnnounceBroadcast(stream.writer, { status: \"ended\", suffix }, this.version);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst id = announceIds.get(suffix);\n\t\t\tannounceIds.delete(suffix);\n\t\t\tif (id === undefined) return; // never announced\n\t\t\tawait encodeAnnounceBroadcast(stream.writer, { status: \"endedId\", id }, this.version);\n\t\t};\n\n\t\t// Subscribe BEFORE writing anything: every encode below awaits the wire, and a publish\n\t\t// landing in that window only notifies the listeners already registered. One created\n\t\t// afterwards would sleep through it, leaving the change unannounced until something\n\t\t// unrelated moved.\n\t\t// TODO Make a better helper within Signals.\n\t\tlet dispose!: Dispose;\n\t\tlet changed = new Promise<Advertisements | undefined>((resolve) => {\n\t\t\tdispose = this.#advertised.changed(resolve);\n\t\t});\n\n\t\t// A hidden route stays off the wire unless the request opted in.\n\t\tconst carries = (covered: Path.Valid) => msg.hidden || !hiddenBelow(msg.prefix, covered);\n\n\t\ttry {\n\t\t\tconst initial = this.#advertised.peek();\n\t\t\tif (!initial) return; // closed\n\n\t\t\tfor (const [name, snap] of presented(msg.prefix, initial, carries)) {\n\t\t\t\tactive.set(name, snap);\n\t\t\t}\n\n\t\t\tswitch (this.version) {\n\t\t\t\tcase Version.DRAFT_01:\n\t\t\t\tcase Version.DRAFT_02: {\n\t\t\t\t\tfor (const suffix of active.keys()) {\n\t\t\t\t\t\tconsole.debug(`announce: broadcast=${suffix} active=true`);\n\t\t\t\t\t}\n\t\t\t\t\tconst init = new AnnounceInit([...active.keys()]);\n\t\t\t\t\tawait init.encode(stream.writer, this.version);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tif (!hasAnnounceOk(this.version)) {\n\t\t\t\t\t\tfor (const [suffix, snap] of active) {\n\t\t\t\t\t\t\tawait announce(suffix, snap.route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst ok = new AnnounceOk(this.hop, active.size);\n\t\t\t\t\tawait ok.encode(stream.writer, this.version);\n\t\t\t\t\tfor (const [suffix, snap] of active) {\n\t\t\t\t\t\tawait announce(suffix, snap.route);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (;;) {\n\t\t\t\tconst advertised = await race([changed, stream.reader.closed]);\n\t\t\t\tdispose();\n\t\t\t\tif (!advertised) break;\n\n\t\t\t\t// Re-arm before reading, so an advertise that lands while we write is not lost.\n\t\t\t\tchanged = new Promise<Advertisements | undefined>((resolve) => {\n\t\t\t\t\tdispose = this.#advertised.changed(resolve);\n\t\t\t\t});\n\n\t\t\t\tconst latest = this.#advertised.peek();\n\t\t\t\tif (!latest) break;\n\n\t\t\t\tconst updated = new Map<Path.Valid, Advertised>();\n\t\t\t\tfor (const [name, snap] of presented(msg.prefix, latest, carries)) {\n\t\t\t\t\tupdated.set(name, snap);\n\t\t\t\t}\n\n\t\t\t\tfor (const [suffix, snap] of active) {\n\t\t\t\t\tconst cur = updated.get(suffix);\n\t\t\t\t\tif (!cur || cur.identity !== snap.identity) await retract(suffix);\n\t\t\t\t}\n\t\t\t\tfor (const [suffix, snap] of updated) {\n\t\t\t\t\tconst prev = active.get(suffix);\n\t\t\t\t\tif (!prev || prev.identity !== snap.identity) {\n\t\t\t\t\t\tawait announce(suffix, snap.route);\n\t\t\t\t\t} else if (!routesEqual(onWire(prev.route), onWire(snap.route))) {\n\t\t\t\t\t\tawait restart(suffix, snap.route);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tactive = updated;\n\t\t\t}\n\t\t} finally {\n\t\t\tdispose();\n\t\t}\n\t}\n\n\t/**\n\t * Handles a subscribe message.\n\t * @param msg - The subscribe message\n\t * @param stream - The stream to write track data to\n\t *\n\t * @internal\n\t */\n\tasync runSubscribe(msg: Subscribe, stream: Stream) {\n\t\tlet front: broadcast.Consumer | undefined;\n\t\ttry {\n\t\t\tfront =\n\t\t\t\tthis.#publish &&\n\t\t\t\t(wireOf(this.#publish).local(msg.broadcast) ?? (await wireOf(this.#publish).demand(msg.broadcast)));\n\t\t} catch (err: unknown) {\n\t\t\tstream.writer.reset(error(err));\n\t\t\treturn;\n\t\t}\n\t\tif (!front) {\n\t\t\tconsole.debug(`publish unknown: broadcast=${msg.broadcast}`);\n\t\t\tstream.writer.reset(new NotFound(`broadcast ${msg.broadcast}`));\n\t\t\treturn;\n\t\t}\n\n\t\tconst endGroup = exclusiveGroupEnd(msg.endGroup);\n\t\tconst track = wireOf(front).subscribe(msg.track, {\n\t\t\tpriority: msg.priority,\n\t\t\tmaxAge: Milli(servingMaxAge(this.version, msg.maxAge)),\n\t\t\tgroups: {\n\t\t\t\tstart: msg.startGroup === undefined ? undefined : { included: msg.startGroup },\n\t\t\t\tend: endGroup === undefined ? undefined : { excluded: endGroup },\n\t\t\t},\n\t\t});\n\t\tpositionCursor(track, this.version, msg.startGroup);\n\t\thooks.replaceGroups(track, { end: endGroup === undefined ? undefined : { excluded: endGroup } });\n\n\t\t// The best-effort datagram loop, started once serving begins. It parks when the\n\t\t// track finishes (recvDatagram returns undefined), so #runTrack alone ends the\n\t\t// subscription; awaited during teardown so it doesn't outlive the subscription.\n\t\tlet datagrams = Promise.resolve();\n\t\tlet controls: SubscriptionControls | undefined;\n\n\t\ttry {\n\t\t\tlet timescale: Timescale = Timescale.MILLI;\n\n\t\t\tif (supportsTrackStream(this.version)) {\n\t\t\t\t// Lite-05+ accepts implicitly: no SUBSCRIBE_OK (the immutable\n\t\t\t\t// properties live in TRACK_INFO), and the resolved range arrives as\n\t\t\t\t// SUBSCRIBE_START / SUBSCRIBE_END emitted from #runTrack.\n\t\t\t\t//\n\t\t\t\t// The timescale is an immutable property, so serving MUST use exactly\n\t\t\t\t// what TRACK_INFO advertised. It comes from the producer's accept(), so\n\t\t\t\t// they always agree. Awaiting info() also surfaces a rejected track\n\t\t\t\t// (accept never called, track closed) as an error here, which resets the\n\t\t\t\t// stream.\n\t\t\t\tconst info = await track.info();\n\t\t\t\ttimescale = info.timescale;\n\t\t\t} else {\n\t\t\t\t// Older drafts acknowledge with SUBSCRIBE_OK and stream frames verbatim.\n\t\t\t\tconst ok = new SubscribeOk({\n\t\t\t\t\tpriority: msg.priority,\n\t\t\t\t\tmaxAge: msg.maxAge,\n\t\t\t\t\tstartGroup: msg.startGroup,\n\t\t\t\t\tendGroup: msg.endGroup,\n\t\t\t\t});\n\t\t\t\tawait encodeSubscribeResponse(stream.writer, { ok }, this.version);\n\t\t\t}\n\n\t\t\tconsole.debug(`publish ok: broadcast=${msg.broadcast} track=${track.name}`);\n\n\t\t\t// Serve datagrams concurrently with groups whenever the transport carries them\n\t\t\t// (the writer exists iff so). No group fallback: otherwise they simply aren't sent.\n\t\t\tif (this.#datagramWriter) {\n\t\t\t\tdatagrams = this.#runDatagrams(msg.id, track, timescale);\n\t\t\t}\n\n\t\t\tcontrols = new SubscriptionControls({\n\t\t\t\treader: stream.reader,\n\t\t\t\twriter: stream.writer,\n\t\t\t\tversion: this.version,\n\t\t\t\tapply: (update) => {\n\t\t\t\t\tconst end = exclusiveGroupEnd(update.endGroup);\n\t\t\t\t\ttrack.update({\n\t\t\t\t\t\tpriority: update.priority,\n\t\t\t\t\t\tmaxAge: Milli(servingMaxAge(this.version, update.maxAge)),\n\t\t\t\t\t\tgroups: {\n\t\t\t\t\t\t\tstart: update.startGroup === undefined ? undefined : { included: update.startGroup },\n\t\t\t\t\t\t\tend: end === undefined ? undefined : { excluded: end },\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t\tawait this.#runTrack(track, stream.writer, controls, {\n\t\t\t\tsub: msg.id,\n\t\t\t\tbroadcast: msg.broadcast,\n\t\t\t\ttimescale,\n\t\t\t\tbounds: {\n\t\t\t\t\tstartGroup: msg.startGroup,\n\t\t\t\t\tstartFrame: msg.startFrame,\n\t\t\t\t\tendGroup: msg.endGroup,\n\t\t\t\t\tendFrame: msg.endFrame,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tconsole.debug(`publish done: broadcast=${msg.broadcast} track=${track.name}`);\n\t\t\tstream.close();\n\t\t\ttrack.close();\n\t\t\t// Closing the stream ends the decoder and track.close ends the datagram loop.\n\t\t\tawait Promise.all([datagrams, controls.decoding]);\n\t\t} catch (err: unknown) {\n\t\t\tconst e = error(err);\n\t\t\tconsole.warn(`publish error: broadcast=${msg.broadcast} track=${track.name} error=${reason(e)}`);\n\t\t\ttrack.close(e);\n\t\t\tstream.abort(e);\n\t\t\tawait Promise.all([datagrams, controls?.decoding]);\n\t\t}\n\t}\n\n\t/**\n\t * Handles a FETCH stream by serving one group as bare frame records (lite-05+).\n\t *\n\t * @internal\n\t */\n\tasync runFetch(msg: Fetch, stream: Stream) {\n\t\tif (!supportsTrackStream(this.version)) {\n\t\t\tstream.writer.reset(new Error(\"fetch requires moq-lite-05 or newer\"));\n\t\t\treturn;\n\t\t}\n\n\t\tlet front: broadcast.Consumer | undefined;\n\t\ttry {\n\t\t\tfront =\n\t\t\t\tthis.#publish &&\n\t\t\t\t(wireOf(this.#publish).local(msg.broadcast) ?? (await wireOf(this.#publish).demand(msg.broadcast)));\n\t\t} catch (err: unknown) {\n\t\t\tstream.writer.reset(error(err));\n\t\t\treturn;\n\t\t}\n\t\tif (!front) {\n\t\t\tconsole.debug(`fetch unknown: broadcast=${msg.broadcast}`);\n\t\t\tstream.writer.reset(new NotFound(`broadcast ${msg.broadcast}`));\n\t\t\treturn;\n\t\t}\n\n\t\t// The subscriber opened this stream, so its send order only ranked the request. Rank the\n\t\t// response here, on the same scale as the group streams it competes with.\n\t\tstream.writer.setPriority(sendOrder({ priority: msg.priority }));\n\n\t\tlet group: group.Consumer | undefined;\n\t\ttry {\n\t\t\t// The timescale is immutable, so serve exactly what TRACK_INFO advertised. Both\n\t\t\t// come off the same front, so the metadata and the frames are one generation.\n\t\t\tconst info = await this.#resolveTrackInfo(front, msg.track);\n\t\t\tgroup = await wireOf(front).fetchGroup(msg.track, msg.group, { priority: msg.priority });\n\t\t\tawait this.#runFetchGroup(group, stream.writer, {\n\t\t\t\ttimescale: Timescale(info.timescale),\n\t\t\t\tstart: msg.startFrame,\n\t\t\t\tend: msg.endFrame,\n\t\t\t});\n\t\t\tconsole.debug(`fetch done: broadcast=${msg.broadcast} track=${msg.track} group=${msg.group}`);\n\t\t\tstream.close();\n\t\t\tgroup.close();\n\t\t} catch (err: unknown) {\n\t\t\tconst e = error(err);\n\t\t\tconsole.warn(\n\t\t\t\t`fetch error: broadcast=${msg.broadcast} track=${msg.track} group=${msg.group} error=${reason(e)}`,\n\t\t\t);\n\t\t\tgroup?.close(e);\n\t\t\tstream.abort(e);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a track and sends its data to the stream.\n\t * @param sub - The subscription ID\n\t * @param broadcast - The broadcast name\n\t * @param track - The track to run\n\t * @param stream - The stream to write to\n\t *\n\t * @internal\n\t */\n\tasync #runTrack(\n\t\ttrack: track.Subscriber,\n\t\tstream: Writer,\n\t\tcontrols: SubscriptionControls,\n\t\tserving: { sub: bigint; broadcast: Path.Valid; timescale: Timescale; bounds: FrameBounds },\n\t) {\n\t\tconst { sub, broadcast, timescale, bounds } = serving;\n\t\t// Lite-05+ resolves the range on the subscribe stream: SUBSCRIBE_START once the\n\t\t// first group is known, SUBSCRIBE_END when the track finishes.\n\t\tconst emitRange = supportsTrackStream(this.version);\n\t\tlet startSent = false;\n\t\tlet endSent = false;\n\n\t\t// Lite-07+ counts the group streams in SUBSCRIBE_END, so it goes out only once every\n\t\t// served group has opened its stream or given up, and a cap holding groups back\n\t\t// delays it until they are released.\n\t\tconst countStreams = hasStreamCount(this.version);\n\t\tlet streams = 0;\n\t\tconst opening = new Set<Promise<unknown>>();\n\n\t\t// The track's exclusive final boundary. A Rust subscriber feeds SUBSCRIBE_END\n\t\t// straight into finish_at, so it must name the track's boundary (which counts\n\t\t// datagram sequences too), not the delivered range: a subscription cap can hold\n\t\t// produced groups back. The latest() fallback covers a subscription torn down\n\t\t// before the producer declared it.\n\t\tconst boundary = () => track.final() ?? (track.latest() ?? -1) + 1;\n\n\t\t// Before lite-07, SUBSCRIBE_END names that boundary, which a cap can hold groups back\n\t\t// from, so it goes out as soon as the producer finishes and the subscription keeps\n\t\t// serving whatever a later cap raise releases (see the Rust publisher's Recv::Boundary).\n\t\tconst sendEnd = async (): Promise<boolean> => {\n\t\t\tendSent = true;\n\t\t\tif (!emitRange) return true;\n\t\t\treturn controls.response(\n\t\t\t\t(async () => {\n\t\t\t\t\t// A group that gives up before its stream opens is never counted.\n\t\t\t\t\tif (countStreams) while (opening.size > 0) await Promise.all(opening);\n\t\t\t\t\tconst end = new SubscribeEnd(boundary(), streams);\n\t\t\t\t\tawait encodeSubscribeResponse(stream, { end }, this.version);\n\t\t\t\t})(),\n\t\t\t);\n\t\t};\n\n\t\t// One ranking for the whole subscription, shared by every group it serves.\n\t\tconst priority = new Priority(track);\n\n\t\t// Every group this subscription started serving, until its stream finishes or resets.\n\t\tconst groups = new Set<Promise<void>>();\n\n\t\t// Cancels groups still queued for a stream slot. Only the subscriber leaving counts:\n\t\t// a track that ran out of groups still has to flush the ones already queued, and the\n\t\t// caller FINs the subscribe stream to say so.\n\t\tlet finished = false;\n\t\tlet unsubscribe!: () => void;\n\t\tconst unsubscribed = new Promise<void>((resolve) => {\n\t\t\tunsubscribe = resolve;\n\t\t});\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\t// Control before data, matching the Rust publisher: every control decoded while\n\t\t\t\t// the loop was parked applies to the next pop, never to one already made. This\n\t\t\t\t// drain is synchronous, so nothing the decoder holds can land between the pop\n\t\t\t\t// below and its frame range.\n\t\t\t\tconst control = controls.take();\n\t\t\t\tif (control) {\n\t\t\t\t\tswitch (control.kind) {\n\t\t\t\t\t\tcase \"done\":\n\t\t\t\t\t\t\t// The subscriber left. Its queued groups are pointless now, which\n\t\t\t\t\t\t\t// the finally below acts on since `finished` stays false.\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\t\tthrow control.error;\n\t\t\t\t\t\tcase \"update\": {\n\t\t\t\t\t\t\tconst update = control.update;\n\t\t\t\t\t\t\tconsole.debug(`subscribe update: broadcast=${broadcast} track=${track.name}`);\n\t\t\t\t\t\t\t// `positionCursor` pins an unfloored pre-06 SUBSCRIBE to the latest\n\t\t\t\t\t\t\t// group, so an update that drops a named floor re-pins there too. On\n\t\t\t\t\t\t\t// an empty track the next group is the latest, whatever its sequence.\n\t\t\t\t\t\t\tconst start =\n\t\t\t\t\t\t\t\tupdate.startGroup === undefined &&\n\t\t\t\t\t\t\t\tbounds.startGroup !== undefined &&\n\t\t\t\t\t\t\t\t!resolvesStart(this.version)\n\t\t\t\t\t\t\t\t\t? (track.latest() ?? 0)\n\t\t\t\t\t\t\t\t\t: update.startGroup;\n\t\t\t\t\t\t\thooks.replaceGroups(track, {\n\t\t\t\t\t\t\t\tstart: start === undefined ? undefined : { included: start },\n\t\t\t\t\t\t\t\tend: update.endGroup === undefined ? undefined : { included: update.endGroup },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbounds.startGroup = update.startGroup;\n\t\t\t\t\t\t\tbounds.startFrame = update.startFrame;\n\t\t\t\t\t\t\tbounds.endGroup = update.endGroup;\n\t\t\t\t\t\t\tbounds.endFrame = update.endFrame;\n\t\t\t\t\t\t\tawait yieldToControls();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Exactly-once arrival-order serving. This synchronous package-internal pop\n\t\t\t\t// and frameRange call are the operation's linearization point.\n\t\t\t\tconst recv = hooks.tryRecvGroup(track);\n\t\t\t\tswitch (recv.kind) {\n\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\tthrow recv.error;\n\t\t\t\t\tcase \"idle\":\n\t\t\t\t\t\t// Before lite-07, an end declared ahead of the live edge goes out as\n\t\t\t\t\t\t// soon as it is known, while the remaining groups are still being\n\t\t\t\t\t\t// produced. The lite-07 count is not final until those groups open.\n\t\t\t\t\t\tif (!endSent && !countStreams && track.final() !== undefined) {\n\t\t\t\t\t\t\tif (!(await sendEnd())) return;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait waitForSubscription(controls, track);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"boundary\":\n\t\t\t\t\t\t// The producer finished but is still holding groups above the cap.\n\t\t\t\t\t\t// Declare the boundary, then wait for an update to release them.\n\t\t\t\t\t\tif (!endSent && !countStreams) {\n\t\t\t\t\t\t\tif (!(await sendEnd())) return;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait waitForSubscription(controls, track);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"done\": {\n\t\t\t\t\t\tif (!endSent) {\n\t\t\t\t\t\t\tif (!(await sendEnd())) return;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// The FIN tells the subscriber every group is accounted for, so it waits\n\t\t\t\t\t\t// until each group stream finished or reset. The subscriber leaving\n\t\t\t\t\t\t// instead cancels whatever is still queued.\n\t\t\t\t\t\tconst drained = Symbol(\"drained\");\n\t\t\t\t\t\tconst end = await Promise.race([Promise.all(groups).then(() => drained), controls.ended]);\n\t\t\t\t\t\tif (end instanceof Error) throw end;\n\t\t\t\t\t\tif (end !== drained) return;\n\t\t\t\t\t\tfinished = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst group = recv.group;\n\t\t\t\tconst range = frameRange(bounds, group.sequence);\n\n\t\t\t\tif (emitRange && !startSent) {\n\t\t\t\t\tstartSent = true;\n\t\t\t\t\t// SUBSCRIBE_START names the first group served now. A later group at or\n\t\t\t\t\t// above an explicit floor is still delivered, so the cursor stays put.\n\t\t\t\t\t// A pre-06 subscribe that named no group is the exception: an absent\n\t\t\t\t\t// Group Start is the latest group, and this sequence becomes the floor.\n\t\t\t\t\t// Lite-06 encodes a floor of group 0 as 0, so an omitted start is not pinned.\n\t\t\t\t\tif (bounds.startGroup === undefined && !resolvesStart(this.version)) {\n\t\t\t\t\t\thooks.replaceGroups(track, {\n\t\t\t\t\t\t\tstart: { included: group.sequence },\n\t\t\t\t\t\t\tend: bounds.endGroup === undefined ? undefined : { included: bounds.endGroup },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(await controls.response(\n\t\t\t\t\t\t\tencodeSubscribeResponse(\n\t\t\t\t\t\t\t\tstream,\n\t\t\t\t\t\t\t\t{ start: new SubscribeStart(group.sequence) },\n\t\t\t\t\t\t\t\tthis.version,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t))\n\t\t\t\t\t)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst options: RunGroup = {\n\t\t\t\t\tsub,\n\t\t\t\t\tgroup,\n\t\t\t\t\ttimescale,\n\t\t\t\t\tpriority,\n\t\t\t\t\tunsubscribed,\n\t\t\t\t\tstart: range.start,\n\t\t\t\t\tend: range.end,\n\t\t\t\t};\n\t\t\t\t// `opening` settles when the stream opens so the lite-07 count can be sent.\n\t\t\t\t// `groups` covers the serve too, so the FIN still waits for every stream to\n\t\t\t\t// finish or reset, including one that has not opened yet.\n\t\t\t\tconst opened = this.#openGroup(options);\n\t\t\t\tconst task = opened.then(async (writer) => {\n\t\t\t\t\tif (!writer) return;\n\t\t\t\t\tstreams += 1;\n\t\t\t\t\tawait this.#serveGroup(writer, options);\n\t\t\t\t});\n\t\t\t\tgroups.add(task);\n\t\t\t\tvoid task.finally(() => groups.delete(task));\n\t\t\t\topening.add(opened);\n\t\t\t\tvoid opened.finally(() => opening.delete(opened));\n\t\t\t}\n\t\t} finally {\n\t\t\tif (!finished) unsubscribe();\n\t\t\tpriority.close();\n\t\t}\n\t}\n\n\t/**\n\t * Answers a TRACK stream (0x6) with a single TRACK_INFO, then FINs.\n\t *\n\t * @internal\n\t */\n\tasync runTrackInfo(msg: TrackMessage, stream: Stream) {\n\t\ttry {\n\t\t\tconst front =\n\t\t\t\tthis.#publish &&\n\t\t\t\t(wireOf(this.#publish).local(msg.broadcast) ?? (await wireOf(this.#publish).demand(msg.broadcast)));\n\t\t\tif (!front) throw new NotFound(`broadcast ${msg.broadcast}`);\n\n\t\t\tconst info = await this.#resolveTrackInfo(front, msg.track);\n\t\t\tawait info.encode(stream.writer, this.version);\n\t\t\tconsole.debug(`track info: broadcast=${msg.broadcast} track=${msg.track}`);\n\t\t\tstream.close();\n\t\t} catch (err) {\n\t\t\tconsole.debug(`track unknown: broadcast=${msg.broadcast} track=${msg.track}`);\n\t\t\tstream.writer.reset(error(err));\n\t\t}\n\t}\n\n\t// Resolve (and cache) a track's immutable TRACK_INFO by asking the application.\n\t// `resolveTrackInfo` triggers a TrackRequest the app answers with accept(TrackInfo);\n\t// only the immutable properties are needed (not the groups). Cached because they're\n\t// fixed for the track's lifetime. Rejects if the track is unavailable.\n\t#resolveTrackInfo(front: broadcast.Consumer, track: string): Promise<TrackInfoMessage> {\n\t\tlet tracks = this.#trackInfo.get(front);\n\t\tif (!tracks) {\n\t\t\ttracks = new Map();\n\t\t\tthis.#trackInfo.set(front, tracks);\n\t\t}\n\n\t\tconst cached = tracks.get(track);\n\t\tif (cached !== undefined) return cached;\n\n\t\tconst pending = (async () => {\n\t\t\tconst info = await wireOf(front).resolveTrackInfo(track);\n\t\t\treturn new TrackInfoMessage({\n\t\t\t\tpriority: info.priority,\n\t\t\t\t// Publisher Max Age: the publisher's retention bound, advertised so\n\t\t\t\t// relays re-serve with the same window.\n\t\t\t\tmaxAge: info.maxAge,\n\t\t\t\t// Lite05 mandates per-frame timestamps. Advertise the track's timescale;\n\t\t\t\t// `#serveGroup` emits each frame converted to it.\n\t\t\t\ttimescale: info.timescale,\n\t\t\t});\n\t\t})();\n\n\t\t// Don't poison the cache on failure: a later request may succeed.\n\t\tpending.catch(() => tracks.delete(track));\n\t\ttracks.set(track, pending);\n\t\treturn pending;\n\t}\n\n\t/**\n\t * Forwards a track's datagrams best-effort over QUIC datagrams (lite-05 §6.4), parallel to\n\t * its groups. Each datagram is dropped (there is no group fallback) if the encoded body\n\t * doesn't fit the transport's datagram limit or the send fails. Returns once the track\n\t * finishes; a failure never tears down the subscription.\n\t *\n\t * @internal\n\t */\n\tasync #runDatagrams(sub: bigint, track: track.Subscriber, timescale: Timescale) {\n\t\tconst writer = this.#datagramWriter;\n\t\tif (!writer) return; // Only reached with a writer (see the #datagramWriter gate).\n\t\tconst maxSize = DatagramStream.maxDatagramSize(this.#quic);\n\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tconst datagram = await track.recvDatagram();\n\t\t\t\tif (!datagram) return; // Track finished; #runTrack tears the subscription down.\n\n\t\t\t\t// Convert the timestamp to the track's advertised timescale, matching #serveGroup.\n\t\t\t\tconst ts = Math.round(datagram.timestamp.as(timescale));\n\t\t\t\tconst body = new DatagramMessage(sub, datagram.sequence, ts, datagram.payload).encode(this.version);\n\n\t\t\t\t// No group fallback: drop anything that doesn't fit a single datagram.\n\t\t\t\tif (body.byteLength > maxSize) {\n\t\t\t\t\tconsole.debug(`dropping oversize datagram: sub=${sub} size=${body.byteLength} max=${maxSize}`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tawait writer.ready;\n\t\t\t\tawait writer.write(body);\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\t// Best-effort: a datagram send failure stops sending but never fails the subscription.\n\t\t\tconsole.debug(`datagram send stopped: sub=${sub} error=${reason(err)}`);\n\t\t}\n\t}\n\n\t// Serialize a fetched group's frames onto the FETCH stream as bare records: each a\n\t// zigzag-delta timestamp (at the track's advertised timescale) followed by size + bytes.\n\tasync #runFetchGroup(\n\t\tgroup: group.Consumer,\n\t\tstream: Writer,\n\t\t{ timescale, start: startFrame, end: endFrame }: ServeFetch,\n\t) {\n\t\t// The response carries no header, so the receiver numbers the first frame it gets\n\t\t// as `startFrame`. Skipping the head here is the only thing keeping those numbers\n\t\t// honest; a group that ends before we reach it can't be served at all.\n\t\tfor (let i = 0; i < startFrame; i++) {\n\t\t\tif (!(await race([group.readFrame(), stream.closed]))) {\n\t\t\t\tthrow new Error(`fetch group ended at frame ${i}, before the requested start ${startFrame}`);\n\t\t\t}\n\t\t}\n\n\t\tlet prevTs = 0n;\n\t\tfor (let index = startFrame; endFrame === undefined || index <= endFrame; index++) {\n\t\t\tconst frame = await race([group.readFrame(), stream.closed]);\n\t\t\tif (!frame) break;\n\n\t\t\tconst ts = BigInt(Math.round(frame.timestamp.as(timescale)));\n\t\t\tawait stream.u62(zigzag(ts - prevTs));\n\t\t\tprevTs = ts;\n\n\t\t\tawait stream.u53(frame.payload.byteLength);\n\t\t\tawait stream.write(frame.payload);\n\t\t}\n\t}\n\n\t/**\n\t * Opens the unidirectional stream for one group, or closes the group and resolves\n\t * `undefined` when it cannot get one.\n\t *\n\t * @internal\n\t */\n\tasync #openGroup(options: RunGroup): Promise<Writer | undefined> {\n\t\tconst { group, priority, unsubscribed } = options;\n\t\ttry {\n\t\t\t// The transport drains streams by send order, so this is what makes a high-priority\n\t\t\t// track (and a newer group within it) win the link when there isn't room for both.\n\t\t\t//\n\t\t\t// One stream per group is faster than a peer at its limit can retire them, so this\n\t\t\t// is the one path that doesn't wait for a slot: the transport would serve the opens\n\t\t\t// in the order we asked, which is oldest-first, exactly backwards for live media.\n\t\t\t// Failing here drops the group and lets the next one compete for the next slot.\n\t\t\tconst stream = await Writer.tryOpen(this.#quic, {\n\t\t\t\tversion: this.version,\n\t\t\t\tsendOrder: priority.rank(group.sequence),\n\t\t\t\tcancel: unsubscribed,\n\t\t\t\twaitUntilAvailable: false,\n\t\t\t});\n\t\t\tif (!stream) group.close(new Error(\"no stream slot\"));\n\t\t\treturn stream;\n\t\t} catch (err: unknown) {\n\t\t\tgroup.close(error(err));\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Serves one group on the stream {@link #openGroup} opened for it.\n\t *\n\t * @internal\n\t */\n\tasync #serveGroup(stream: Writer, options: RunGroup) {\n\t\tconst { sub, group, timescale, priority, start: startFrame, end: endFrame } = options;\n\t\t// This model holds whole groups, so frame `startFrame` is always reachable unless\n\t\t// the group ends first. Declaring it up front keeps the stream self-describing.\n\t\tconst msg = new GroupMessage({ subscribe: sub, sequence: group.sequence, frameStart: startFrame });\n\t\t// Everything past this point runs inside the cleanup scope, so a failure never leaves\n\t\t// a finished group's stream being ranked.\n\t\ttry {\n\t\t\t// A SUBSCRIBE_UPDATE re-ranks the subscription, so a group already on the wire\n\t\t\t// follows it too rather than keeping a stale rank until it finishes.\n\t\t\tpriority.add(stream, group.sequence);\n\n\t\t\tawait hooks.guardGroup(group, async () => {\n\t\t\t\tawait stream.u53(0); // stream type\n\t\t\t\tawait msg.encode(stream, this.version);\n\t\t\t});\n\n\t\t\t// Lite05+ prefixes every frame with a zigzag-delta timestamp at the track's\n\t\t\t// advertised timescale; older drafts omit it.\n\t\t\tconst timestamps = supportsTrackStream(this.version);\n\t\t\tlet prevTs = 0n;\n\t\t\t// Whether the cursor ever reached the requested start, which decides how the\n\t\t\t// end of the group is read below.\n\t\t\tlet reached = startFrame === 0;\n\n\t\t\tfor (;;) {\n\t\t\t\tconst read = await race([hooks.readGroupFrame(group), stream.closed]);\n\t\t\t\tif (!read) {\n\t\t\t\t\t// The group ended before the frame the subscriber asked to start\n\t\t\t\t\t// at, so this publisher can't serve the range at all. FINning here\n\t\t\t\t\t// would claim an empty group under that index; reset so it reads\n\t\t\t\t\t// as the gap it is.\n\t\t\t\t\tif (!reached) throw new Error(`group ended before frame ${startFrame}`);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\t// A group that ends exactly at the start is a valid, empty range.\n\t\t\t\t\tif (read.sequence + 1 >= startFrame) reached = true;\n\t\t\t\t\t// Frames below the requested start were excluded, and the receiver\n\t\t\t\t\t// numbers what it gets from `startFrame`.\n\t\t\t\t\tif (read.sequence < startFrame) continue;\n\t\t\t\t\tif (endFrame !== undefined && read.sequence > endFrame) break;\n\n\t\t\t\t\tif (timestamps) {\n\t\t\t\t\t\t// Convert each frame to the track's advertised timescale.\n\t\t\t\t\t\tconst ts = BigInt(Math.round(read.frame.timestamp.as(timescale)));\n\t\t\t\t\t\tawait hooks.guardGroup(group, () => stream.u62(zigzag(ts - prevTs)));\n\t\t\t\t\t\tprevTs = ts;\n\t\t\t\t\t}\n\n\t\t\t\t\tawait hooks.guardGroup(group, () => stream.u53(read.frame.payload.byteLength));\n\t\t\t\t\tawait hooks.guardGroup(group, () => stream.write(read.frame.payload));\n\t\t\t\t} finally {\n\t\t\t\t\tread.complete();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstream.close();\n\t\t\tgroup.close();\n\t\t} catch (err: unknown) {\n\t\t\tconst e = error(err);\n\t\t\tstream.reset(e);\n\t\t\tgroup.close(e);\n\t\t} finally {\n\t\t\tpriority.remove(stream);\n\t\t}\n\t}\n\n\t/**\n\t * Handles a probe stream by periodically reporting estimated bitrate.\n\t * @param stream - The probe bidi stream\n\t *\n\t * @internal\n\t */\n\tasync runProbe(stream: Stream) {\n\t\t// getStats is not yet in the TypeScript WebTransport type definitions.\n\t\tconst quic = this.#quic as unknown as {\n\t\t\tgetStats?: () => Promise<{ estimatedSendRate: number | null; smoothedRtt?: number | null }>;\n\t\t};\n\t\tif (!quic.getStats) {\n\t\t\t// Best-effort: we can't supply bandwidth estimates, so close the\n\t\t\t// whole bidi (FIN + STOP_SENDING) to let the peer release its end.\n\t\t\tstream.close();\n\t\t\treturn;\n\t\t}\n\n\t\tlet lastSent: Probe | undefined;\n\t\tlet lastSentTime: number | undefined;\n\n\t\t// Whether a metric moved enough to be worth another report. Gaining or\n\t\t// losing a value always counts; both unknown never does.\n\t\tconst moved = (prev?: number, next?: number, threshold = 0): boolean => {\n\t\t\tif (prev === undefined && next === undefined) return false;\n\t\t\tif (prev === undefined || next === undefined) return true;\n\t\t\tif (prev === 0) return next !== 0;\n\t\t\treturn Math.abs(next - prev) / prev >= threshold;\n\t\t};\n\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tconst timeout = new Promise<\"timeout\">((resolve) =>\n\t\t\t\t\tsetTimeout(() => resolve(\"timeout\"), PROBE_INTERVAL),\n\t\t\t\t);\n\t\t\t\tconst result = await race([timeout, stream.reader.closed]);\n\t\t\t\tif (result !== \"timeout\") break;\n\n\t\t\t\t// The two fields are independent on the wire, each using 0 for\n\t\t\t\t// unknown, so a transport exposing only one still has something to\n\t\t\t\t// report. Anything this version can't carry is dropped here rather\n\t\t\t\t// than by the encoder, so it reads as unknown to every check below.\n\t\t\t\tconst stats = await quic.getStats();\n\t\t\t\t// `smoothedRtt` is a DOMHighResTimeStamp, i.e. a double, but the wire\n\t\t\t\t// carries whole milliseconds and the varint encoder throws on a\n\t\t\t\t// fractional value. Round before it ever reaches `Probe`.\n\t\t\t\tconst rtt = stats.smoothedRtt != null ? Math.round(stats.smoothedRtt) : undefined;\n\t\t\t\tconst report = new Probe({\n\t\t\t\t\tbitrate: stats.estimatedSendRate ?? undefined,\n\t\t\t\t\trtt: hasProbeRtt(this.version) ? rtt : undefined,\n\t\t\t\t});\n\n\t\t\t\t// Nothing left to report. Say so once if it retracts a value the peer\n\t\t\t\t// is still holding, then stay quiet rather than repeating \"unknown\"\n\t\t\t\t// every time the max age comes around.\n\t\t\t\tif (report.bitrate === undefined && report.rtt === undefined) {\n\t\t\t\t\tconst retracts =\n\t\t\t\t\t\tlastSent !== undefined && (lastSent.bitrate !== undefined || lastSent.rtt !== undefined);\n\t\t\t\t\tif (!retracts) continue;\n\t\t\t\t}\n\n\t\t\t\tlet shouldSend: boolean;\n\t\t\t\tif (lastSent === undefined || lastSentTime === undefined) {\n\t\t\t\t\tshouldSend = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst elapsed = performance.now() - lastSentTime;\n\t\t\t\t\t// The bitrate threshold decays to zero as the last report ages: a\n\t\t\t\t\t// stale estimate is worth refreshing for a smaller move.\n\t\t\t\t\tconst t = Math.max(PROBE_INTERVAL, Math.min(PROBE_MAX_AGE, elapsed));\n\t\t\t\t\tconst range = PROBE_MAX_AGE - PROBE_INTERVAL;\n\t\t\t\t\tconst threshold = (PROBE_MAX_DELTA * (PROBE_MAX_AGE - t)) / range;\n\t\t\t\t\tshouldSend =\n\t\t\t\t\t\telapsed >= PROBE_MAX_AGE ||\n\t\t\t\t\t\tmoved(lastSent.bitrate, report.bitrate, threshold) ||\n\t\t\t\t\t\tmoved(lastSent.rtt, report.rtt, PROBE_RTT_DELTA);\n\t\t\t\t}\n\n\t\t\t\tif (shouldSend) {\n\t\t\t\t\tawait report.encode(stream.writer, this.version);\n\t\t\t\t\tlastSent = report;\n\t\t\t\t\tlastSentTime = performance.now();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tconsole.warn(\"probe stream error\", err);\n\t\t\tstream.close();\n\t\t}\n\t}\n\n\tclose() {\n\t\t// The broadcasts belong to the origin, which outlives this session; closing here\n\t\t// only drops the borrow. The peer sees the unannounce when the streams die.\n\n\t\t// Release the datagram writer's lock so the stream can be torn down.\n\t\tthis.#datagramWriter?.releaseLock();\n\t\tthis.#datagramWriter = undefined;\n\t}\n}\n"]}
1
+ {"version":3,"file":"publisher.js","sourceRoot":"","sources":["../../src/lite/publisher.ts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,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;YACzF,CAAC,CAAC;SACF,CAAC,CAAC;QACH,qFAAqF;QACrF,mFAAmF;QACnF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;YAAE,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,SAAS,CAAC,MAAM,KAAK,UAAU;YAAE,MAAM,SAAS,CAAC,MAAM,CAAC;IAC7D,CAAC;IAED,KAAK;QACJ,iFAAiF;QACjF,4EAA4E;QAC5E,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;QAEtB,qEAAqE;QACrE,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;IAClC,CAAC;CACD","sourcesContent":["import { Duration, type Instant, now, sleep, yieldNow } from \"@moq/clock\";\nimport { type Dispose, type Getter, Once, race, Signal } from \"@moq/signals\";\nimport type { Grant } from \"../auth.ts\";\nimport { Gate } from \"../auth_gate.ts\";\nimport type { AuthSession } from \"../auth_session.ts\";\nimport { enforceGrant } from \"../auth_session.ts\";\nimport type * as broadcast from \"../broadcast.ts\";\nimport { statsOf } from \"../connection/stats.ts\";\nimport { Withdrawal } from \"../connection/withdrawal.ts\";\nimport { Counts } from \"../cover.ts\";\nimport type * as datagram from \"../datagram.ts\";\nimport * as DatagramStream from \"../datagram_stream.ts\";\nimport { Runs } from \"../drops.ts\";\nimport {\n\terror,\n\tNotFound,\n\tProtocolViolation,\n\treason,\n\tStreamCode,\n\tStreamError,\n\tTimestampMismatch,\n\ttoStreamCode,\n\tunauthorized,\n} from \"../error.ts\";\nimport type * as group from \"../group.ts\";\nimport { Cost, type Hop, routesEqual, type WireRoute } from \"../hop.ts\";\nimport type * as Identity from \"../identity.ts\";\nimport {\n\ttype DropRun,\n\tdatagramTrackInfo,\n\tdropHole,\n\tfinalKey,\n\ttype Hole,\n\thiddenBelow,\n\tholeOf,\n\thooks,\n\tinsertRun,\n\tNO_MAX_DELAY,\n\tpresented,\n\ttype Run,\n\trunGaps,\n\tsameHole,\n\tskipHole,\n\tstaleHole,\n} from \"../internal.ts\";\nimport type { Consumer as OriginConsumer } from \"../origin.ts\";\nimport * as Path from \"../path.ts\";\nimport { readSize, sendPayload } from \"../payload.ts\";\nimport { Priority, type Ranking, sendOrder } from \"../priority.ts\";\nimport { concat, encodeVarint, type Reader, type Stream, type StreamVersion, Writer } from \"../stream.ts\";\nimport { floorAt, type Timescale, type Timestamp } from \"../time.ts\";\nimport type * as track from \"../track.ts\";\nimport { untilAborted } from \"../util/abort.ts\";\nimport { nextChange } from \"../util/change.ts\";\nimport { GivenUp } from \"../util/given_up.ts\";\nimport { max, min } from \"../util/key.ts\";\nimport { Budget } from \"../util/yield.ts\";\nimport { isEmpty, type Resolved, rangeKey } from \"../window.ts\";\nimport { type Advertised, type Advertisements, sameIdentity, trackMetaOf, wireOf } from \"../wire.ts\";\nimport { type Add, AnnounceInit, AnnounceOk, type AnnounceRequest, encodeAnnounceBroadcast } from \"./announce.ts\";\nimport { AnnounceStream } from \"./announce_stream.ts\";\nimport { Answer } from \"./answer.ts\";\nimport { Datagram as DatagramMessage, type Datagrams, DatagramsInfo, DatagramsUpdate } from \"./datagram.ts\";\nimport { DatagramEnd } from \"./datagram-end.ts\";\nimport { closeViolation, servedError } from \"./error.ts\";\nimport { Group as GroupMessage } from \"./group.ts\";\nimport { Probe, probeBitrate } from \"./probe.ts\";\nimport {\n\ttype Applied,\n\ttype Edge,\n\tExactRanges,\n\tencodeSubscribeResponse,\n\tgivenUp,\n\tgroupPolicy,\n\tLiveRanges,\n\tlegacyStart,\n\tpolicyOf,\n\tpositionFrames,\n\tpositionStops,\n\trangeBounds,\n\trangesOf,\n\trequestedPlaced,\n\trequestedRange,\n\trequestedRanges,\n\ttype Subscribe,\n\tSubscribeDrop,\n\tSubscribeEnd,\n\tSubscribeOk,\n\ttype SubscribeResponse,\n\tSubscribeStart,\n\tSubscribeUpdate,\n\tspanBetween,\n\tsubscriptionPolicy,\n\ttype WireRange,\n} from \"./subscribe.ts\";\nimport { TrackInfo as TrackInfoMessage, type Track as TrackMessage } from \"./track.ts\";\nimport { encodeTracksEvent, type Tracks as TracksMessage, type TracksEvent as TracksMessageEvent } from \"./tracks.ts\";\nimport {\n\thasAnnounceId,\n\thasAnnounceOk,\n\thasCompression,\n\thasDatagrams,\n\thasDatagramTracks,\n\thasGroupEnd,\n\thasLargest,\n\thasLengthFirst,\n\thasProbeRtt,\n\thasRanges,\n\thasReliableReset,\n\thasRouteCost,\n\thasRoutes,\n\thasTrackStream,\n\tkeepsSubscribeOpen,\n\tresolvesStart,\n\tVersion,\n\twaitsForSubscriberFin,\n\twireTimescale,\n} from \"./version.ts\";\n\nconst PROBE_INTERVAL = 100; // ms\nconst PROBE_MAX_AGE = 10_000; // ms\nconst PROBE_MAX_DELTA = 0.25;\nconst PROBE_RTT_DELTA = 0.25;\nconst datagramBudget = new Budget();\n// Shared by every subscription's walk of what a lowered start owes before lite-07.\nconst replayBudget = new Budget();\n\n/** Map a signed delta to an unsigned zigzag varint value (mirrors Rust `varint::zigzag`). */\nfunction zigzag(delta: bigint): bigint {\n\treturn delta >= 0n ? delta << 1n : (-delta << 1n) - 1n;\n}\n\n// The track a SUBSCRIBE reads: a metadata subscription reads the copy kept apart for it where the\n// broadcast keeps one, so no payload crosses a hop for it.\nfunction subscribed(front: broadcast.Consumer, msg: Subscribe): track.Consumer {\n\treturn msg.meta ? trackMetaOf(msg.track, front) : front.track(msg.track);\n}\n\n/**\n * A frame's fields ahead of its payload, built in memory for one write: a stream write is far\n * costlier than a varint, and a backlog pays it for every frame. The timestamp `delta` is present\n * when the track is stamped, and `inflated` when the frame was decompressed. Lite-07 leads with the\n * size plus one, leaving 0 for GROUP_END, and carries each delta unsigned, since a group's\n * timestamps never decrease, omitting frame 0's (`implicit`): a group starts at its first frame.\n * Before lite-07 every delta is zigzagged and the header ends with the size.\n */\nexport function frameHeader(\n\tversion: StreamVersion,\n\tdelta: bigint | undefined,\n\tinflated: number | undefined,\n\tsize: number,\n\tlengthFirst: boolean,\n\timplicit: boolean,\n) {\n\tconst parts: Uint8Array[] = [];\n\tif (lengthFirst) parts.push(encodeVarint(size + 1, version));\n\tif (delta !== undefined) {\n\t\t// Lite-07 carries unsigned deltas and places frame 0 at the group's start.\n\t\tif (lengthFirst && (delta < 0n || (implicit && delta !== 0n))) throw new TimestampMismatch();\n\t\tif (!(lengthFirst && implicit)) parts.push(encodeVarint(lengthFirst ? delta : zigzag(delta), version));\n\t}\n\tif (inflated !== undefined) parts.push(encodeVarint(inflated, version));\n\tif (!lengthFirst) parts.push(encodeVarint(size, version));\n\treturn concat(parts);\n}\n\n/**\n * Lite-07 GROUP_END, after a finished group's last frame: a zero `Payload Length`, where a frame\n * would start, then the group's exclusive `end` as a delta from `base`: the last timestamp the\n * stream carried, or the group's start when it carried none. A finished group's end is at or\n * above both, so an `end` below `base` throws {@link TimestampMismatch}.\n */\nfunction groupEnd(version: StreamVersion, end: bigint, base: bigint): Uint8Array {\n\tif (end < base) throw new TimestampMismatch();\n\treturn concat([encodeVarint(0, version), encodeVarint(end - base, version)]);\n}\n\n/** How a lite hop stamps a track's frames and datagrams. */\ninterface Stamp {\n\t/**\n\t * The wire timescale TRACK_INFO declared (see `wireTimescale`), or undefined for a datagram on a\n\t * scale-less lite-07 track, whose timestamp goes out as a bare number.\n\t */\n\ttimescale?: Timescale;\n}\n\n/**\n * How `version` stamps a track with `info`, or undefined when its frames carry no timestamps:\n * before lite-05, and on a scale-less lite-07 track, whose frame's time is its group's start (its\n * datagrams go out bare). Lite-05/06 declare milliseconds for a scale-less track, whose frames\n * carry 0.\n */\nfunction stamping(version: Version, info: { timescale?: Timescale | null }): Stamp | undefined {\n\tconst wire = wireTimescale(version, info.timescale);\n\tif (wire === undefined) return undefined;\n\treturn { timescale: wire };\n}\n\n/**\n * A frame or datagram's `timestamp` as its raw wire value. A scale-less track's carries no time: on\n * lite-05/06, which declare it milliseconds, it goes out as 0, since a wide key would overflow a\n * zigzag delta and receivers drop it; a lite-07 datagram's goes out bare. Mirrors the Rust\n * `Stamp::wire`.\n */\nfunction wireTime(timestamp: Timestamp, stamp: Stamp): bigint {\n\tif (timestamp.scale === undefined) return stamp.timescale === undefined ? BigInt(timestamp.value) : 0n;\n\t// A timed timestamp on a track declared scale-less: the model never writes one.\n\tif (stamp.timescale === undefined) throw new TimestampMismatch();\n\treturn BigInt(floorAt(timestamp, stamp.timescale));\n}\n\n/**\n * Settles once the peer acknowledged everything written before the FIN, or the stream failed.\n * Closing the session sooner would discard bytes still in flight.\n */\nfunction acknowledged(writer: Writer): Promise<void> {\n\treturn writer.closed.catch(() => {});\n}\n\n/**\n * Lite-07: whether a Group Stream this side just reset still accounts for its group, `held` once\n * a reset delivers its whole header. A reset of this side's delivers the held header, which does.\n * A STOP_SENDING owes a drop only when it evicted the stream before the peer acknowledged the\n * header, since the subscriber may never have read which group it carried; any other the\n * subscriber sent knowing the group, or wanting none of it. Mirrors the Rust `accounts`.\n */\nasync function accounts(stream: Writer, held: boolean): Promise<boolean> {\n\tconst stop = stream.stopped;\n\tif (stop === undefined) return held;\n\treturn stop !== StreamCode.Evicted || (await stream.heldAcknowledged());\n}\n\n// The TRACK_INFO a TRACK stream, or a listing's TRACKS_ADD, answers for a track.\n/** A listing event as TRACKS carries it: an added track's info as its kind's request would answer. */\nfunction tracksEvent(event: broadcast.TracksEvent, version: Version): TracksMessageEvent {\n\tif (event.kind !== \"added\") return event;\n\tif (event.type === \"datagrams\")\n\t\treturn { kind: \"added\", name: event.name, type: \"datagrams\", info: new DatagramsInfo(event.info) };\n\treturn { kind: \"added\", name: event.name, type: \"track\", info: trackInfoMessage(event.info, version) };\n}\n\nfunction trackInfoMessage(info: track.Info, version: Version): TrackInfoMessage {\n\treturn new TrackInfoMessage({\n\t\tpriority: info.priority,\n\t\trefresh: info.refresh.ratio ?? undefined,\n\t\trefreshInterval: info.refresh.interval?.asMillis(),\n\t\t// Publisher Max Age: the publisher's staleness bound, advertised so relays re-serve\n\t\t// with the same bound.\n\t\tmaxAge: info.maxAge?.asMillis(),\n\t\t// `#serveGroup` emits each frame converted to it.\n\t\ttimescale: info.timescale ?? undefined,\n\t\t// An older peer is served the frames inflated.\n\t\tcompress: hasCompression(version) && info.compression === \"deflate\",\n\t});\n}\n\n/** A track's cached TRACK_INFO, and the request behind it while requesters hold it. */\ninterface TrackInfoEntry {\n\tinfo: Promise<TrackInfoMessage>;\n\t/** The requesters holding the request: open TRACK streams. */\n\tholders: number;\n\t/** Lets the request go once its last holder leaves, abandoning it if still unanswered. */\n\trelease: AbortController;\n}\n\n/** What {@link Publisher.openGroup} and {@link Publisher.serveGroup} need to serve one group. */\ninterface RunGroup {\n\t/** The subscription ID. */\n\tsub: bigint;\n\n\t/** The group to serve. */\n\tgroup: group.Consumer;\n\t/** Why to stop writing {@link group}, watched while it is served. */\n\tgivenUp: GivenUp;\n\n\t/** How every frame is stamped, or undefined to send no timestamps. */\n\tstamp: Stamp | undefined;\n\t/** Whether to serve stored slices with their declared plain sizes. */\n\tcompress: boolean;\n\t/**\n\t * Whether the subscriber asked for each frame's header alone (lite-07 `Meta`): its FRAME names\n\t * the plain size, and no payload follows it, so a compressed frame is never inflated to send it.\n\t */\n\tmeta: boolean;\n\n\t/** The subscription's ranking, which this stream joins for as long as it runs. */\n\tpriority: Pick<Priority, \"reserve\" | \"add\" | \"remove\">;\n\t/** Lite-07: the group's own ranking within {@link priority}, by the ranges still wanting it. */\n\tranking?: Ranking;\n\n\t/** Settles when the subscriber leaves, dropping a group still queued for a stream slot. */\n\tunsubscribed: Promise<void>;\n\n\t/** First frame to send; anything below it was excluded by the subscription. */\n\tstart: number;\n\n\t/** Last frame to send (inclusive), or undefined for the rest of the group. */\n\tend?: number;\n\n\t/**\n\t * Lite-07: where each group a range ends partway through stops, by group (see\n\t * {@link FrameBounds.stops}). The stream parks there with the stream open, and sends the rest\n\t * on it once an update moves the end. `ended` settles once the subscription's run ends, which\n\t * resets a parked stream: no update will move its stop any more.\n\t */\n\tstops?: { at: Getter<ReadonlyMap<bigint, number>>; ended: Promise<void> };\n\n\t/**\n\t * Lite-07: called as the stream buffers GROUP_END with the group's end, so the starts inside\n\t * the group's span are accounted for.\n\t */\n\tended?: (end: bigint) => void;\n\n\t/**\n\t * Lite-07: called when a reset after GROUP_END was buffered accounts for the group, with the\n\t * starts inside its span: the reset may cut the GROUP_END, so they are named again.\n\t */\n\tcut?: (start: bigint, end: bigint) => void;\n\n\t/**\n\t * Lite-07: called as the stream resets, before waiting on whether the reset accounts for the\n\t * group, so a failure names the budget it had then rather than one an update widened meanwhile.\n\t */\n\tresetting?: () => void;\n}\n\n/**\n * The frame bounds a subscription placed on its start and end group, as they stand\n * after any SUBSCRIBE_UPDATE.\n *\n * Only the two named groups are qualified; the group range itself lives on the\n * subscriber's read cursor (see {@link frameRange}).\n */\ntype FrameBounds = {\n\t/** The group {@link startFrame} qualifies, if the subscription named one. */\n\tstartGroup?: bigint;\n\t/** First frame to send within {@link startGroup}; every other group starts at 0. */\n\tstartFrame: number;\n\t/** The group {@link endFrame} qualifies, if the subscription named one. */\n\tendGroup?: bigint;\n\t/** Last frame (inclusive) to send within {@link endGroup}; every other group runs to its end. */\n\tendFrame?: number;\n\t/** Lite-07: the first frame of each group a range starts partway through (see {@link positionFrames}). */\n\tstarts: ReadonlyMap<bigint, number>;\n\t/** Lite-07: {@link starts} as each decoded update leaves them, until the run applies that update. */\n\tstartsAfter: WeakMap<SubscribeUpdate, ReadonlyMap<bigint, number>>;\n\t/**\n\t * Lite-07: the frame each group a range ends partway through stops before (see\n\t * {@link positionStops}), which a group already streaming follows as an update moves it.\n\t */\n\tstops: Signal<ReadonlyMap<bigint, number>>;\n\t/** Lite-07: {@link stops} as each decoded update leaves them, until the run applies that update. */\n\tstopsAfter: WeakMap<SubscribeUpdate, ReadonlyMap<bigint, number>>;\n};\n\n/** Whether two frame-end tables hold the same stops. */\nfunction sameStops(a: ReadonlyMap<bigint, number>, b: ReadonlyMap<bigint, number>): boolean {\n\tif (a.size !== b.size) return false;\n\tfor (const [group, frame] of a) if (b.get(group) !== frame) return false;\n\treturn true;\n}\n\n/**\n * The frames of `key` a subscription asked for, as a start index and an inclusive end.\n *\n * The frame bounds qualify the start and end group only; every other group is served whole.\n * Which groups are served at all is the serving subscriber's ranges and floor,\n * applied when a group is popped rather than re-checked here.\n *\n * The serving loop calls this synchronously after the pop, before any SUBSCRIBE_UPDATE can\n * change `bounds`. Nothing downstream trims the frame range: it is a wire request,\n * deliberately decoupled from the receiver's local read cursor.\n */\nfunction frameRange(bounds: FrameBounds, key: bigint): { start: number; end?: number } {\n\treturn {\n\t\tstart: bounds.starts.get(key) ?? (bounds.startGroup === key ? bounds.startFrame : 0),\n\t\tend: bounds.endGroup === key ? bounds.endFrame : undefined,\n\t};\n}\n\n/** What the serving loop takes from the subscribe stream instead of serving a group. */\ntype Control =\n\t/**\n\t * The peer re-stated the subscription: priority, ordering, latency, and its ranges, with the\n\t * Range IDs it retired and added on lite-07.\n\t */\n\t| { kind: \"update\"; update: SubscribeUpdate; applied: Applied }\n\t/**\n\t * Lite-07: the peer cleanly FIN'd its send half (no further updates; deliver every requested\n\t * range and close cleanly once accounted for).\n\t */\n\t| { kind: \"fin\" }\n\t/** The peer FIN'd (pre-lite-07), or our own half went away. Either way there is nobody left to serve. */\n\t| { kind: \"done\" }\n\t/** The stream failed; the subscription goes down with it. */\n\t| { kind: \"error\"; error: Error };\n\ntype SubscriptionControlOptions = {\n\tquic: WebTransport;\n\treader: Reader;\n\twriter: Writer;\n\tversion: Version;\n\t/** The SUBSCRIBE's ranges, which each lite-07 update edits. */\n\tlive: LiveRanges;\n\t/** Apply an update, with the ranges it retired and added by Range ID on lite-07. */\n\tapply: (update: SubscribeUpdate, applied: Applied) => void;\n};\n\n/**\n * The subscribe stream's control half, decoded ahead of the serving loop.\n *\n * Decoding runs on its own and publishes each full subscription update immediately, so a\n * blocked response write cannot delay re-ranking streams already in flight. It separately\n * stores only the latest range state for the serving loop, which owns the local track cursor\n * and frame bounds. That keeps a group pop and its frame-range snapshot one indivisible step.\n *\n * Reading ahead makes control-first ordering hold for a burst. Coalescing bounds memory while\n * preserving the newest state decoded before the next group pop. The Rust publisher gets the\n * same ordering from `poll_decode_maybe`, which decodes straight out of the reader's buffer;\n * nothing here can decode synchronously, so it reads ahead instead.\n */\nclass SubscriptionControls {\n\t#writer: Writer;\n\t#live: LiveRanges;\n\t// The latest update the loop has yet to take, with every edit since the last one it took: a\n\t// range added then retired before then was never live, so it is in neither.\n\t#update?: {\n\t\tupdate: SubscribeUpdate;\n\t\tretired: bigint[];\n\t\tadded: Map<bigint, WireRange>;\n\t\tretuned: Map<bigint, WireRange>;\n\t};\n\t// Sticky, first one wins: null once the stream is over, an Error once it failed.\n\t#end?: Error | null;\n\t// Lite-07: the subscriber cleanly FIN'd its send half (no further updates).\n\t#peerFin = false;\n\t#finTaken = false;\n\t#ended: Promise<Error | null>;\n\t#resolveEnd!: (end: Error | null) => void;\n\t#changed = new Signal(0);\n\n\t/** Settles once decoding stops, so teardown can wait for it rather than leaving it running. */\n\treadonly decoding: Promise<void>;\n\n\tconstructor(options: SubscriptionControlOptions) {\n\t\tconst { writer, live } = options;\n\t\tthis.#writer = writer;\n\t\tthis.#live = live;\n\t\tthis.#ended = new Promise((resolve) => {\n\t\t\tthis.#resolveEnd = resolve;\n\t\t});\n\t\tthis.decoding = this.#decode(options);\n\t\t// Our own half going away ends the loop too, and has to reach it the same way: the\n\t\t// loop looks at nothing else.\n\t\tvoid writer.closed.then(\n\t\t\t() => this.#finish(null),\n\t\t\t(err: unknown) => this.#finish(error(err)),\n\t\t);\n\t}\n\n\t/** The next control to apply, or undefined while the peer is quiet. */\n\ttake(): Control | undefined {\n\t\tconst update = this.#update;\n\t\tthis.#update = undefined;\n\t\t// An update decoded before the stream ended still applies before the sticky end.\n\t\tif (update)\n\t\t\treturn {\n\t\t\t\tkind: \"update\",\n\t\t\t\tupdate: update.update,\n\t\t\t\tapplied: { retired: update.retired, added: [...update.added], retuned: [...update.retuned] },\n\t\t\t};\n\t\tif (this.#peerFin && !this.#finTaken) {\n\t\t\tthis.#finTaken = true;\n\t\t\treturn { kind: \"fin\" };\n\t\t}\n\t\tif (this.#end === undefined) return undefined;\n\t\treturn this.#end === null ? { kind: \"done\" } : { kind: \"error\", error: this.#end };\n\t}\n\n\t/**\n\t * Where each live Range ID sits among the track model's ranges, which hold them in Range ID\n\t * order. The decoder applies each update to the model as it decodes it, ahead of {@link take},\n\t * so this rather than the last control taken is what indexes the model. Costs every range.\n\t */\n\tpositions(): Map<bigint, number> {\n\t\treturn new Map(this.#live.ids().map((id, index) => [id, index]));\n\t}\n\n\t/** Whether the track model holds Range ID `id`, as {@link positions} would index it. */\n\tholds(id: bigint): boolean {\n\t\treturn this.#live.get(id) !== undefined;\n\t}\n\n\t/** The live range with Range ID `id`, as the subscriber asked it. */\n\trange(id: bigint): WireRange | undefined {\n\t\treturn this.#live.get(id);\n\t}\n\n\t/** Whether {@link take} has a control to answer with now. */\n\tpending(): boolean {\n\t\treturn this.#update !== undefined || (this.#peerFin && !this.#finTaken) || this.#end !== undefined;\n\t}\n\n\t/** Whether the subscriber cleanly FIN'd its send half (lite-07). */\n\tget peerFin(): boolean {\n\t\treturn this.#peerFin;\n\t}\n\n\t/** Calls `fn` once {@link take} may answer differently. */\n\tchanged(fn: () => void): Dispose {\n\t\treturn this.#changed.changed(fn);\n\t}\n\n\t/** Returns false when peer departure supersedes a blocked response write. */\n\tasync response(pending: Promise<void>): Promise<boolean> {\n\t\t// `#ended` lives as long as the stream, so it is raced as-is rather than mapped per call.\n\t\tconst result = await race([\n\t\t\tpending.then(\n\t\t\t\t() => ({ kind: \"sent\" }) as const,\n\t\t\t\t(err: unknown) => ({ kind: \"error\", error: error(err) }) as const,\n\t\t\t),\n\t\t\tthis.#ended,\n\t\t]);\n\n\t\tif (result !== null && !(result instanceof Error)) {\n\t\t\tif (result.kind === \"sent\") return true;\n\t\t\tthrow result.error;\n\t\t}\n\n\t\t// The race leaves the blocked encode running, so reset the writable half too.\n\t\tthis.#writer.reset(result ?? new StreamError(StreamCode.Cancel, { message: \"cancel\" }));\n\t\tif (result) throw result;\n\t\treturn false;\n\t}\n\n\t/** Settles once the stream is over: `null` when it ended cleanly, or the failure. */\n\tget ended(): Promise<Error | null> {\n\t\treturn this.#ended;\n\t}\n\n\t#finish(end: Error | null) {\n\t\tif (this.#end !== undefined) return;\n\t\tthis.#end = end;\n\t\tthis.#resolveEnd(end);\n\t\tthis.#changed.update((value) => value + 1);\n\t}\n\n\tasync #decode({ reader, version, live, apply, quic }: SubscriptionControlOptions) {\n\t\ttry {\n\t\t\t// Runs until the peer's half ends, even past our own FIN: a lite-05+ publisher waits\n\t\t\t// for that end, and every other teardown stops the reader.\n\t\t\tfor (;;) {\n\t\t\t\tconst update = await SubscribeUpdate.decodeMaybe(reader, version);\n\t\t\t\tif (!update) break;\n\t\t\t\t// Each lite-07 update edits the live ranges, which only the stream's history names.\n\t\t\t\tconst edit = live.apply(update);\n\t\t\t\t// Lite-07 carries a priority and order per range, which rank each group by the ranges\n\t\t\t\t// wanting it (see `groupPolicy`). The subscription's as a whole still ranks a group no range\n\t\t\t\t// wants, and is what a copy asks upstream.\n\t\t\t\tif (hasRanges(version)) Object.assign(update, subscriptionPolicy(live.ranges()));\n\t\t\t\tapply(update, edit);\n\t\t\t\t// The latest one replaces any the loop has yet to take, its edit folded in.\n\t\t\t\tconst pending = this.#update ?? {\n\t\t\t\t\tupdate,\n\t\t\t\t\tretired: [] as bigint[],\n\t\t\t\t\tadded: new Map<bigint, WireRange>(),\n\t\t\t\t\tretuned: new Map<bigint, WireRange>(),\n\t\t\t\t};\n\t\t\t\tpending.update = update;\n\t\t\t\tfor (const id of edit.retired) {\n\t\t\t\t\tpending.retuned.delete(id);\n\t\t\t\t\tif (!pending.added.delete(id)) pending.retired.push(id);\n\t\t\t\t}\n\t\t\t\t// A later retune of a range this added is that range added as it now reads, and one\n\t\t\t\t// of a range this retuned replaces that retune. Mirrors the Rust `Applied::then`.\n\t\t\t\tfor (const [id, range] of edit.retuned) {\n\t\t\t\t\tif (pending.added.has(id)) pending.added.set(id, range);\n\t\t\t\t\telse pending.retuned.set(id, range);\n\t\t\t\t}\n\t\t\t\tfor (const [id, range] of edit.added) pending.added.set(id, range);\n\t\t\t\tthis.#update = pending;\n\t\t\t\tthis.#changed.update((value) => value + 1);\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tcloseViolation(quic, err);\n\t\t\tthis.#finish(error(err));\n\t\t\treturn;\n\t\t}\n\t\tif (keepsSubscribeOpen(version)) {\n\t\t\tthis.#peerFin = true;\n\t\t\tthis.#changed.update((value) => value + 1);\n\t\t\treturn;\n\t\t}\n\t\tthis.#finish(null);\n\t}\n}\n\n/**\n * A subscription's requested ranges by Range ID, as the model holds them, with the bounds the read\n * cursor takes from them counted, so an edit moves them in what it costs. Mirrors the Rust\n * `Requested`.\n */\nclass Requested {\n\t#ranges = new Map<bigint, WireRange>();\n\t// The groups the ranges start at, and how many count back from the latest group instead.\n\t#starts = new Counts<bigint>();\n\t#unnamed = 0;\n\t// The exclusive groups the ranges end before, and how many have no such end.\n\t#ends = new Counts<bigint>();\n\t#unbounded = 0;\n\n\t/** The ranges a SUBSCRIBE carried, by position. */\n\tconstructor(ranges: readonly WireRange[]) {\n\t\tfor (const [id, range] of ranges.entries()) this.insert(BigInt(id), range);\n\t}\n\n\tget(id: bigint): WireRange | undefined {\n\t\treturn this.#ranges.get(id);\n\t}\n\n\t/** Every live range. */\n\tvalues(): IterableIterator<WireRange> {\n\t\treturn this.#ranges.values();\n\t}\n\n\t/**\n\t * The narrowest max age in milliseconds a live join among the ranges asks, undefined when none\n\t * limits it. Mirrors the Rust `Subscription::narrowest`.\n\t */\n\tnarrowest(): number | undefined {\n\t\tlet narrowest: number | undefined;\n\t\tfor (const range of this.#ranges.values()) {\n\t\t\tconst max = range.start?.live?.max ?? range.start?.joined?.max;\n\t\t\tif (typeof max === \"number\" && max < NO_MAX_DELAY) narrowest = Math.min(narrowest ?? max, max);\n\t\t}\n\t\treturn narrowest;\n\t}\n\n\t/** Hold `range` as Range ID `id`, replacing any it held. */\n\tinsert(id: bigint, range: WireRange): void {\n\t\tthis.remove(id);\n\t\tthis.#count(range, true);\n\t\tthis.#ranges.set(id, range);\n\t}\n\n\tremove(id: bigint): void {\n\t\tconst range = this.#ranges.get(id);\n\t\tif (range === undefined) return;\n\t\tthis.#count(range, false);\n\t\tthis.#ranges.delete(id);\n\t}\n\n\t#count(range: WireRange, add: boolean): void {\n\t\tconst [from, to] = rangeBounds(range);\n\t\tif (from === undefined) this.#unnamed += add ? 1 : -1;\n\t\telse if (add) this.#starts.add(from);\n\t\telse this.#starts.remove(from);\n\t\tif (to === undefined) this.#unbounded += add ? 1 : -1;\n\t\telse if (add) this.#ends.add(to);\n\t\telse this.#ends.remove(to);\n\t}\n\n\t/** The lowest group the ranges start at, undefined unless each names its start; see {@link spanOf}. */\n\tstart(): bigint | undefined {\n\t\treturn this.#unnamed > 0 ? undefined : this.#starts.first();\n\t}\n\n\t/** The exclusive end past every range, undefined when one has no such end; see {@link spanOf}. */\n\tend(): bigint | undefined {\n\t\treturn this.#unbounded > 0 ? undefined : this.#ends.last();\n\t}\n}\n\n/**\n * Lite-07 ranges whose time starts, live joins, or time ends may still resolve, by Range ID, each\n * due once the latest group reaches the lowest start that could resolve it. Mirrors the Rust\n * `Unpinned`.\n */\nclass Unpinned {\n\t#due = new Map<bigint, bigint>();\n\t#byDue = new Map<bigint, Set<bigint>>();\n\t#dues = new Counts<bigint>();\n\n\t/** Hold range `id` until `due`, or let it go for undefined. */\n\tinsert(id: bigint, due: bigint | undefined): void {\n\t\tthis.remove(id);\n\t\tif (due === undefined) return;\n\t\tthis.#due.set(id, due);\n\t\tlet ids = this.#byDue.get(due);\n\t\tif (!ids) {\n\t\t\tids = new Set();\n\t\t\tthis.#byDue.set(due, ids);\n\t\t\tthis.#dues.add(due);\n\t\t}\n\t\tids.add(id);\n\t}\n\n\tremove(id: bigint): void {\n\t\tconst due = this.#due.get(id);\n\t\tif (due === undefined) return;\n\t\tthis.#due.delete(id);\n\t\tconst ids = this.#byDue.get(due);\n\t\tids?.delete(id);\n\t\tif (ids?.size === 0) {\n\t\t\tthis.#byDue.delete(due);\n\t\t\tthis.#dues.remove(due);\n\t\t}\n\t}\n\n\t/** The ranges due once the latest group starts at `latest`. */\n\tdue(latest: bigint): bigint[] {\n\t\treturn this.#dues.through(latest).flatMap((due) => [...(this.#byDue.get(due) ?? [])]);\n\t}\n}\n\n/**\n * The lowest latest group start that could resolve `range`'s time start, unless `started`, then\n * its time end. Undefined once neither can move. A live join is never pinned: as a time start its\n * groups would turn from live ones that expire past its max into history, and the model already\n * keeps it placed by its Range ID. Mirrors the Rust `due`.\n */\nfunction due(range: WireRange, started: boolean): bigint | undefined {\n\tif (range.start?.live !== undefined || range.start?.joined !== undefined || isEmpty(requestedRange(range)))\n\t\treturn undefined;\n\tif (!started && range.start !== undefined && range.start.absolute === undefined) return 0n;\n\tif (range.end?.time !== undefined) return range.end.time + 1n;\n\treturn undefined;\n}\n\n// Whether `range` starts partway through its group: a Position start, or a placed join's.\nfunction framed(range: WireRange): boolean {\n\tconst start = range.start?.joined ?? range.start;\n\treturn start?.absolute !== undefined && !!start.frame;\n}\n\n// `entry`, a range this subscription already held, resolved as it was: a range resolves once, so\n// an update that leaves it live never looks a time start up again in newer holdings. A live join\n// stays as asked (see `due`). A start reaching back to the oldest group held stays as it was, since\n// an absolute start would turn it into a floor the subscriber never named.\nfunction pin(asked: WireRange, resolved: Resolved | undefined): WireRange {\n\tif (!resolved) return asked;\n\tconst range = { ...asked };\n\tif (resolved.floored && range.start?.absolute === undefined) range.start = { absolute: resolved.start };\n\t// An end resolves once it settles; until then it is reported open.\n\tif (range.end?.time !== undefined && resolved.end !== undefined) range.end = { absolute: resolved.end };\n\treturn range;\n}\n\n// `current`, a held range, at the policy a retune `asked` for, and a live join at its new max.\nfunction retunedRange(current: WireRange, asked: WireRange): WireRange {\n\tconst range: WireRange = { ...current, priority: asked.priority, order: asked.order };\n\t// `null` is no limit, so pick the anchor before reading its max.\n\tconst join = asked.start?.live ?? asked.start?.joined;\n\tif (join === undefined) return range;\n\tif (range.start?.live) range.start = { live: { ...range.start.live, max: join.max } };\n\telse if (range.start?.joined) range.start = { joined: { ...range.start.joined, max: join.max } };\n\treturn range;\n}\n\n/** A lite-07 range still waiting for its SUBSCRIBE_START, as it was asked. Mirrors the Rust `Unstarted`. */\ninterface Asked {\n\t/**\n\t * It starts with a live join not yet placed, which starts at the history this hop vouches for\n\t * from where it is placed, whatever its max: delivery names the groups the max expired as old.\n\t */\n\tjoins: boolean;\n\t/** It follows the live edge, starting with a live join or ending at none, so its answer waits until this hop knows the largest position. */\n\tlive: boolean;\n\t/** It starts at the oldest group, which places it at group 0 on a track with none yet. */\n\toldest: boolean;\n\t/** The time from which a time range names its misses. */\n\ttime: bigint | undefined;\n}\n\nfunction asked(range: WireRange): Asked {\n\tconst live = range.start?.live !== undefined || range.end === undefined;\n\treturn { joins: range.start?.live !== undefined, live, oldest: range.start === undefined, time: range.start?.time };\n}\n\n/**\n * What the subscribe stream has said of where delivery starts. Mirrors the Rust `Answer`, with\n * lite-07's per-range answers kept beside it as the ranges still `unstarted`.\n *\n * - `legacy`: lite-03/04 send no SUBSCRIBE_START, and so no drops either.\n * - `waiting`: lite-05/06, whose one START is the first message and names where delivery starts for\n * good, so the `first` servable group and the edge seen before it was popped wait for the source to\n * say where its feed starts. The groups given up meanwhile are named once the start is.\n * - `started`: lite-05/06, delivery starts at `from`.\n * - `unresolved`: lite-07, where delivery starts is not known yet. Groups are served meanwhile, the\n * lowest at `served`, which delivery starts at or below, so a range waiting on its start holds back\n * no other's. The groups given up meanwhile are named once delivery resolves.\n * - `withheld`: lite-07, delivery starts at `from`, but no range is answered yet, as one following an\n * edge this hop does not know leaves it: the drops given up since go out after the first START.\n * - `answered`: lite-07, a range is answered, so drops go out as they are given up.\n */\n/** The narrower of two max ages in milliseconds, undefined being no limit. */\nfunction narrower(a: number | undefined, b: number | undefined): number | undefined {\n\tif (a === undefined) return b;\n\tif (b === undefined) return a;\n\treturn Math.min(a, b);\n}\n\n// A stream reset before the first START borrows the budget of the held drops.\ntype QueuedHole = Hole | { reason: \"held-old\" };\ntype QueuedDrop = Run & QueuedHole;\n\ntype StartAnswer =\n\t| { kind: \"legacy\" }\n\t| {\n\t\t\tkind: \"waiting\";\n\t\t\tfirst?: { group: group.Consumer; largest: track.Position | undefined };\n\t\t\tskipped: Runs<QueuedDrop>;\n\t }\n\t| { kind: \"started\"; from: bigint }\n\t| { kind: \"unresolved\"; served?: bigint; skipped: Runs<QueuedDrop> }\n\t| { kind: \"withheld\"; from: bigint; held: [bigint, bigint, QueuedHole][] }\n\t| { kind: \"answered\"; from: bigint };\n\n/** What `version` has said of where delivery starts before anything resolved it. */\nfunction startAnswer(version: Version): StartAnswer {\n\tif (!hasTrackStream(version)) return { kind: \"legacy\" };\n\tconst skipped = new Runs<QueuedDrop>((a, b) =>\n\t\ta.reason === \"held-old\" || b.reason === \"held-old\" ? a.reason === b.reason : sameHole(a, b),\n\t);\n\treturn hasRanges(version) ? { kind: \"unresolved\", skipped } : { kind: \"waiting\", skipped };\n}\n\n/** Where delivery starts once `answer` resolved it. */\nfunction answerFrom(answer: StartAnswer): bigint | undefined {\n\treturn answer.kind === \"started\" || answer.kind === \"withheld\" || answer.kind === \"answered\"\n\t\t? answer.from\n\t\t: undefined;\n}\n\n// The later of two locations, either of which may be unknown.\nfunction newer(a: track.Position | undefined, b: track.Position | undefined): track.Position | undefined {\n\tif (!a || !b) return a ?? b;\n\treturn b.group > a.group || (b.group === a.group && b.frame > a.frame) ? b : a;\n}\n\n// Register both readiness sources in the same turn after the caller observed neither ready.\n// The winner disposes both registrations, so an idle subscription accumulates nothing no\n// matter how many times it wakes.\nfunction waitForSubscription(\n\tcontrols: SubscriptionControls,\n\tsubscriber: track.Subscriber,\n\tdrops: Signal<number>,\n): Promise<void> {\n\treturn armSubscription(controls, subscriber, drops).woke;\n}\n\n// `waitForSubscription`, registered now and awaited later, so a change between the two still wakes\n// it. `dispose` drops a registration left unawaited.\nfunction armSubscription(\n\tcontrols: SubscriptionControls,\n\tsubscriber: track.Subscriber,\n\tdrops: Signal<number>,\n): { woke: Promise<void>; dispose: Dispose } {\n\tconst dispose: Dispose[] = [];\n\tlet settled = false;\n\tconst settle = () => {\n\t\tif (settled) return false;\n\t\tsettled = true;\n\t\tfor (const close of dispose) close();\n\t\treturn true;\n\t};\n\tconst woke = new Promise<void>((resolve) => {\n\t\tconst wake = () => {\n\t\t\tif (settle()) resolve();\n\t\t};\n\t\tdispose.push(controls.changed(wake), hooks.groupChanged(subscriber, wake));\n\t\tdispose.push(drops.changed(wake));\n\t});\n\treturn { woke, dispose: () => void settle() };\n}\n\n/** Resolves once the subscriber's next control (an update, its FIN, or a failure) arrives. */\nfunction waitForControl(controls: SubscriptionControls): Promise<void> {\n\treturn new Promise((resolve) => {\n\t\tconst dispose = controls.changed(() => {\n\t\t\tdispose();\n\t\t\tresolve();\n\t\t});\n\t});\n}\n\n/**\n * The floor of a subscription's read cursor for the wire serving it.\n *\n * Lite-07 has none: its ranges name the group containing a time start, which a floor at the time\n * would cut. Before lite-07 a start names the first group starting at or after it, so the floor\n * is the start the subscription named (or 0 on lite-06), and its max delay decides what above the\n * floor is worth delivering. Mirrors the Rust `Frames::floor`.\n *\n * Pre-06 wires are the exception: their drafts define an absent `Group Start` as the\n * latest group, so say so explicitly rather than letting the budget reach back. Lite-03/04/05\n * carry a `Subscriber Max Age`, but there it is a staleness tolerance only; lite-01/02 additionally get\n * an unbounded budget so nothing is dropped under them (they carry no max age, which decodes as none), which\n * must not read as a request to replay the whole cache on join.\n */\nfunction cursorFloor(version: Version, startGroup: bigint | undefined, latest: bigint | undefined): bigint {\n\tif (hasRanges(version)) return 0n;\n\tif (startGroup !== undefined) return startGroup;\n\tif (resolvesStart(version)) return 0n;\n\treturn latest ?? 0n;\n}\n\n/**\n * Handles publishing broadcasts and managing their lifecycle.\n *\n * @internal\n */\nexport class Publisher {\n\t#withdrawal = new Withdrawal();\n\n\t// Served SUBSCRIBE, DATAGRAMS, and TRACK requests, from dispatch until they end, which a\n\t// draining close waits for.\n\t#owed = new Set<Promise<void>>();\n\n\t// The version of the connection.\n\treadonly version: Version;\n\n\t// Per-connection origin appended to outbound Announce hops, so the peer\n\t// can detect loops and prefer shorter paths. Created by Connection and\n\t// shared with Subscriber, which can optionally use it to filter out its\n\t// own announcements.\n\treadonly hop: Hop;\n\n\t#quic: WebTransport;\n\n\t// Select the transport's current or legacy datagram send API once at setup.\n\t#datagramWriter?: ReturnType<typeof DatagramStream.datagramWriter>;\n\n\t// Originated advertisements this session forwards.\n\t#advertised: Getter<Advertisements | undefined>;\n\n\t#publish?: OriginConsumer;\n\n\t// Our grant: only what it lets us publish is announced and served, and a shrink\n\t// withdraws what it no longer covers. Undefined until the peer answers, and forever on a\n\t// version without AUTH, which allows everything.\n\t#grant?: Getter<Grant | undefined>;\n\t// Holds every incoming request to that grant from dispatch to its end.\n\t#gate: Gate;\n\n\t// Resolves once the tokens this session presented at setup are answered, so nothing is\n\t// announced before the grant it would be checked against.\n\t#ready: Promise<void>;\n\n\t// Lite-07: answers the prefixes the peer asks for, and its loop once the peer asked.\n\t#answer?: Answer;\n\t#answering?: Promise<void>;\n\n\t// TRACK_INFO is immutable per track, so resolve it from the application once\n\t// (via a throwaway subscribe whose info() resolves when the app calls accept)\n\t// and reuse it for every later TRACK request of the same track. Keyed by the\n\t// routing front rather than the path: immutability holds for one broadcast, and a\n\t// republish puts a different one on the path, so its entries must not be reused.\n\t// A rejected lookup is evicted so a retry can re-probe.\n\t#trackInfo = new WeakMap<broadcast.Consumer, Map<string, TrackInfoEntry>>();\n\n\t// Lite-05/06: the datagram tracks this session's answered TRACKs hold, read from each\n\t// answer on, oldest first. The requester reads TRACK_INFO as the publisher accepting the\n\t// name, but the datagrams flow on the SUBSCRIBE it sends alongside, which can arrive later.\n\t// That SUBSCRIBE reads from a clone of the hold, keeping its position, rather than from its\n\t// own arrival, which would lose what was written in between. The requester keeps its TRACK\n\t// open until the SUBSCRIBE has a response, so the hold outlasts its arrival. A hold is\n\t// matched by the track it reads, not by name, so one left on a replaced track never stands\n\t// in for the current one. It is a passive observer: it keeps a position without adding\n\t// demand, which the SUBSCRIBE adds when it reads the track.\n\t#heldDatagrams = new Set<datagram.Consumer>();\n\n\t/**\n\t * Creates a new Publisher instance.\n\t * @param quic - The WebTransport session to use\n\t * @param version - Negotiated protocol version\n\t * @param origin - Hop id shared with the Subscriber\n\t * @param publish - The origin whose broadcasts this session serves; omit to publish nothing\n\t * @param auth - The union of our tokens' grants, which bounds what we publish, and when the\n\t * setup tokens are answered\n\t *\n\t * @internal\n\t */\n\tconstructor(\n\t\tquic: WebTransport,\n\t\tversion: Version,\n\t\thop: Hop,\n\t\tpublish?: OriginConsumer,\n\t\tauth?: { grant: Getter<Grant | undefined>; ready: Promise<void> },\n\t) {\n\t\tthis.#quic = quic;\n\t\tthis.#grant = auth?.grant;\n\t\tthis.#gate = new Gate(auth?.grant);\n\t\tthis.#ready = auth?.ready ?? Promise.resolve();\n\t\tthis.version = version;\n\t\tthis.hop = hop;\n\t\tconst origin = publish && wireOf(publish);\n\t\tthis.#advertised = origin?.advertised ?? new Signal(new Map());\n\t\tthis.#publish = publish;\n\t\tif (hasRoutes(version)) {\n\t\t\tthis.#answer = new Answer({\n\t\t\t\tversion,\n\t\t\t\tadvertised: this.#advertised,\n\t\t\t\torigin,\n\t\t\t\tgrant: this.#grant,\n\t\t\t\tready: this.#ready,\n\t\t\t\tclosing: this.#withdrawal.closing,\n\t\t\t\tstream: AnnounceStream.of(quic, version),\n\t\t\t});\n\t\t}\n\n\t\t// Grab the datagram writer up front when the transport carries datagrams (no group\n\t\t// fallback, so it stays undefined otherwise). One writer for all subscriptions.\n\t\tif (hasDatagrams(version)) {\n\t\t\tthis.#datagramWriter = DatagramStream.datagramWriter(quic);\n\t\t}\n\t}\n\n\t/**\n\t * Whether the peer's edit continues in its next message, which must be its next ANNOUNCE_REQUEST.\n\t *\n\t * @internal\n\t */\n\tcontinuing(): boolean {\n\t\treturn this.#answer?.continuing() ?? false;\n\t}\n\n\t/**\n\t * Lite-07 ANNOUNCE_REQUEST: the peer edits the prefixes it asks for, answered on this\n\t * session's Announce Stream. Throws a {@link ProtocolViolation} for an edit the peer may not send.\n\t *\n\t * @internal\n\t */\n\trequest(more: boolean, remove: bigint[], add: Add[]): void {\n\t\tif (!this.#answer) throw new ProtocolViolation(\"ANNOUNCE_REQUEST before lite-07\");\n\t\tconst started = this.#answering === undefined;\n\t\tconst answering = this.#answer.request(more, remove, add);\n\t\tif (!started) return;\n\t\tthis.#answering = this.#withdrawal.track(answering);\n\t\t// The session is ending under it, or its Announce Stream broke, which closes it: its close\n\t\t// says why.\n\t\tthis.#answering.catch((err: unknown) => console.debug(\"announce stream failed:\", err));\n\t}\n\n\t/**\n\t * Handles a pre-lite-07 announce interest message.\n\t * @param msg - The announce interest message\n\t * @param stream - The stream to write announcements to\n\t *\n\t * @internal\n\t */\n\trunAnnounce(msg: AnnounceRequest, stream: Stream): Promise<void> {\n\t\treturn this.#withdrawal.track(this.#runAnnounce(msg, stream));\n\t}\n\n\tasync #runAnnounce(msg: AnnounceRequest, stream: Stream) {\n\t\tif (this.#withdrawal.closing.peek()) return;\n\t\tconsole.debug(`announce: prefix=${msg.prefix}`);\n\n\t\t// Keyed by suffix, valued by ref plus route, so a republish diffs as a restart\n\t\t// and a re-price as an update.\n\t\tlet active = new Map<Path.Valid, Advertised>();\n\n\t\t// Lite06+: announce ids. Every active we send implicitly assigns the next per-stream\n\t\t// ordinal; ended/update/restart reference the id instead of repeating the path.\n\t\tlet nextAnnounceId = 0n;\n\t\tconst announceIds = new Map<Path.Valid, bigint>();\n\n\t\tconst wireHops = (route: WireRoute): Hop[] => {\n\t\t\tif (hasAnnounceOk(this.version)) return [...route.hops];\n\t\t\treturn [...route.hops, this.hop];\n\t\t};\n\n\t\t// What the peer decodes for a route: pre-lite-06 wires carry no cost, so a re-price\n\t\t// there must not restart.\n\t\t// moq-lite carries no per-request auth, so a swap alone sends nothing.\n\t\t// A drain is this node's ranking, never an announcement: the peer hears the route as it is.\n\t\tconst onWire = (route: WireRoute): WireRoute => ({\n\t\t\t...route,\n\t\t\tcost: hasRouteCost(this.version) ? route.cost : Cost.zero,\n\t\t\tauth: undefined,\n\t\t\tdraining: undefined,\n\t\t});\n\n\t\t// Another identity is another stream, which these versions announce as an end and a start.\n\t\tconst restarted = (prev: Advertised, next: Advertised): boolean => !sameIdentity(prev, next);\n\n\t\tconst announce = async (suffix: Path.Valid, route: WireRoute) => {\n\t\t\tconsole.debug(`announce: broadcast=${suffix} active=true identity=${route.identity}`);\n\t\t\tif (hasAnnounceId(this.version)) announceIds.set(suffix, nextAnnounceId++);\n\t\t\tawait encodeAnnounceBroadcast(\n\t\t\t\tstream.writer,\n\t\t\t\t{ status: \"active\", suffix, hops: wireHops(route), cost: route.cost },\n\t\t\t\tthis.version,\n\t\t\t);\n\t\t};\n\n\t\tconst update = async (suffix: Path.Valid, route: WireRoute) => {\n\t\t\tif (!hasAnnounceId(this.version)) {\n\t\t\t\tawait retract(suffix);\n\t\t\t\tawait announce(suffix, route);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst id = announceIds.get(suffix);\n\t\t\tif (id === undefined) {\n\t\t\t\tawait announce(suffix, route);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconsole.debug(`announce: broadcast=${suffix} update=true`);\n\t\t\tawait encodeAnnounceBroadcast(\n\t\t\t\tstream.writer,\n\t\t\t\t{ status: \"update\", id, hops: wireHops(route), cost: route.cost },\n\t\t\t\tthis.version,\n\t\t\t);\n\t\t};\n\n\t\t// Another identity: an end and a start.\n\t\tconst restart = async (suffix: Path.Valid, route: WireRoute) => {\n\t\t\tawait retract(suffix);\n\t\t\tawait announce(suffix, route);\n\t\t};\n\n\t\t// Lite06+ retracts by announce id; older versions repeat the path (ended announces\n\t\t// don't need hops).\n\t\tconst retract = async (suffix: Path.Valid) => {\n\t\t\tconsole.debug(`announce: broadcast=${suffix} active=false`);\n\t\t\tif (!hasAnnounceId(this.version)) {\n\t\t\t\tawait encodeAnnounceBroadcast(stream.writer, { status: \"ended\", suffix }, this.version);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst id = announceIds.get(suffix);\n\t\t\tannounceIds.delete(suffix);\n\t\t\tif (id === undefined) return; // never announced\n\t\t\tawait encodeAnnounceBroadcast(stream.writer, { status: \"endedId\", id }, this.version);\n\t\t};\n\n\t\t// A hidden route stays off the wire: only a lite-07 request can opt in.\n\t\tconst carries = (covered: Path.Valid) => !hiddenBelow(msg.prefix, covered);\n\n\t\t// What the peer currently sees: the table under the prefix, less whatever our grant\n\t\t// does not let us publish.\n\t\tconst visible = (table: Advertisements): Map<Path.Valid, Advertised> => {\n\t\t\tconst out = presented(msg.prefix, table, carries, { root: this.#publish && wireOf(this.#publish).root });\n\t\t\tconst grant = this.#grant?.peek();\n\t\t\tif (grant) {\n\t\t\t\tfor (const suffix of [...out.keys()]) {\n\t\t\t\t\tif (!grant.publish.matches(Path.join(msg.prefix, suffix))) out.delete(suffix);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out;\n\t\t};\n\n\t\t// Subscribe BEFORE writing anything: every encode below awaits the wire, and a publish\n\t\t// landing in that window only notifies the listeners already registered. One created\n\t\t// afterwards would sleep through it, leaving the change unannounced until something\n\t\t// unrelated moved. A grant change re-diffs the same way, withdrawing what it no longer\n\t\t// covers and announcing what it now does.\n\t\tconst arm = () => nextChange(this.#advertised, this.#grant);\n\t\tlet { changed, dispose } = arm();\n\n\t\ttry {\n\t\t\t// Nothing is announced before the grant it would be checked against. A local close\n\t\t\t// meanwhile finishes the stream with nothing announced.\n\t\t\tconst ready = this.#ready.then(() => \"ready\" as const);\n\t\t\tif ((await race([ready, stream.reader.closed, this.#withdrawal.closing])) !== \"ready\") {\n\t\t\t\tif (this.#withdrawal.closing.peek()) {\n\t\t\t\t\tstream.close();\n\t\t\t\t\tawait stream.writer.closed;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst initial = this.#advertised.peek();\n\t\t\tif (!initial) return; // closed\n\n\t\t\tfor (const [name, snap] of visible(initial)) {\n\t\t\t\tactive.set(name, snap);\n\t\t\t}\n\n\t\t\tswitch (this.version) {\n\t\t\t\tcase Version.DRAFT_01:\n\t\t\t\tcase Version.DRAFT_02: {\n\t\t\t\t\tfor (const suffix of active.keys()) {\n\t\t\t\t\t\tconsole.debug(`announce: broadcast=${suffix} active=true`);\n\t\t\t\t\t}\n\t\t\t\t\tconst init = new AnnounceInit([...active.keys()]);\n\t\t\t\t\tawait init.encode(stream.writer, this.version);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tif (!hasAnnounceOk(this.version)) {\n\t\t\t\t\t\tfor (const [suffix, snap] of active) {\n\t\t\t\t\t\t\tawait announce(suffix, snap.route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst ok = new AnnounceOk(this.hop, active.size);\n\t\t\t\t\tawait ok.encode(stream.writer, this.version);\n\t\t\t\t\tfor (const [suffix, snap] of active) {\n\t\t\t\t\t\tawait announce(suffix, snap.route);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (;;) {\n\t\t\t\tconst woke = await race([changed, stream.reader.closed, this.#withdrawal.closing]);\n\t\t\t\tdispose();\n\t\t\t\tif (woke !== \"changed\") break;\n\n\t\t\t\t// Re-arm before reading, so an advertise that lands while we write is not lost.\n\t\t\t\t({ changed, dispose } = arm());\n\n\t\t\t\tconst latest = this.#advertised.peek();\n\t\t\t\tif (!latest) break;\n\n\t\t\t\tconst updated = visible(latest);\n\n\t\t\t\tfor (const suffix of active.keys()) {\n\t\t\t\t\tif (!updated.has(suffix)) await retract(suffix);\n\t\t\t\t}\n\t\t\t\tfor (const [suffix, snap] of updated) {\n\t\t\t\t\tconst prev = active.get(suffix);\n\t\t\t\t\tif (!prev) {\n\t\t\t\t\t\tawait announce(suffix, snap.route);\n\t\t\t\t\t} else if (restarted(prev, snap)) {\n\t\t\t\t\t\tawait restart(suffix, snap.route);\n\t\t\t\t\t} else if (!routesEqual(onWire(prev.route), onWire(snap.route))) {\n\t\t\t\t\t\tawait update(suffix, snap.route);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tactive = updated;\n\t\t\t}\n\t\t\tif (this.#withdrawal.closing.peek()) {\n\t\t\t\tfor (const suffix of active.keys()) await retract(suffix);\n\t\t\t\tstream.close();\n\t\t\t\tawait stream.writer.closed;\n\t\t\t}\n\t\t} finally {\n\t\t\tdispose();\n\t\t}\n\t}\n\n\t/** The broadcast a request names, from this session's origin. */\n\tasync #resolve(\n\t\tmsg: { broadcast: Path.Valid; identity?: Identity.Valid },\n\t\tsignal: AbortSignal,\n\t): Promise<broadcast.Consumer | undefined> {\n\t\tconst origin = this.#publish && wireOf(this.#publish);\n\t\tif (!origin) return undefined;\n\t\treturn origin.local(msg.broadcast, msg.identity) ?? (await origin.demand(msg.broadcast, msg.identity, signal));\n\t}\n\n\t/**\n\t * Handles a subscribe message.\n\t * @param msg - The subscribe message\n\t * @param stream - The stream to write track data to\n\t *\n\t * @internal\n\t */\n\tasync runSubscribe(msg: Subscribe, stream: Stream) {\n\t\t// Serve only what our grant lets us publish, and stop once it no longer does. The\n\t\t// watch is armed before the first check and held to the end, so a shrink while the\n\t\t// broadcast resolves is never missed.\n\t\tconst revoked = unauthorized(msg.broadcast);\n\t\tlet serving: track.Subscriber | undefined;\n\t\tconst watch = this.#gate.watch(msg.broadcast, () => {\n\t\t\tconsole.debug(`publish revoked: broadcast=${msg.broadcast} track=${msg.track}`);\n\t\t\tserving?.close(revoked);\n\t\t\tstream.abort(revoked);\n\t\t});\n\t\ttry {\n\t\t\tawait this.#serveSubscribe(msg, stream, watch, (track) => {\n\t\t\t\tserving = track;\n\t\t\t});\n\t\t} finally {\n\t\t\twatch.dispose();\n\t\t}\n\t}\n\n\tasync #serveSubscribe(\n\t\tmsg: Subscribe,\n\t\tstream: Stream,\n\t\twatch: { revoked: () => boolean },\n\t\tserving: (track: track.Subscriber) => void,\n\t) {\n\t\t// Checked before resolving, so a denied request never reaches the origin.\n\t\tif (watch.revoked()) {\n\t\t\tstream.writer.reset(unauthorized(msg.broadcast));\n\t\t\treturn;\n\t\t}\n\n\t\t// The requester leaving while the broadcast and track resolve ends the request, as\n\t\t// Rust polls the requester throughout, so a cancelled subscription gives back its\n\t\t// charge instead of holding it until the track is answered, which may be never. A\n\t\t// subscriber's close (STOP_SENDING) and its abort (RESET_STREAM) both land here.\n\t\tconst left = new AbortController();\n\t\tconst cancel = new StreamError(StreamCode.Cancel, { message: \"cancel\" });\n\t\tconst leave = () => left.abort(cancel);\n\t\t// On lite-07, clean subscriber FIN means \"no further updates; deliver what was requested\",\n\t\t// so only STOP_SENDING (writer.closed) or RESET_STREAM (reader.closed rejection) cancels.\n\t\tif (keepsSubscribeOpen(this.version)) {\n\t\t\tvoid stream.writer.closed.then(leave, leave);\n\t\t\tvoid stream.reader.closed.then(undefined, leave);\n\t\t} else {\n\t\t\tvoid race([stream.reader.closed, stream.writer.closed]).then(leave, leave);\n\t\t}\n\n\t\tlet front: broadcast.Consumer | undefined;\n\t\ttry {\n\t\t\tfront = await this.#resolve(msg, left.signal);\n\t\t} catch (err: unknown) {\n\t\t\tstream.writer.reset(servedError(error(err)));\n\t\t\treturn;\n\t\t}\n\t\t// Revoked while the broadcast resolved: the watch already reset the stream.\n\t\tif (watch.revoked()) return;\n\t\tif (!front) {\n\t\t\tconsole.debug(`publish unknown: broadcast=${msg.broadcast}`);\n\t\t\tstream.writer.reset(new NotFound(`broadcast ${msg.broadcast}`));\n\t\t\treturn;\n\t\t}\n\n\t\tconst consumer = subscribed(front, msg);\n\t\t// The live joins already placed, which start where they were placed.\n\t\tconst absent = legacyStart(this.version, msg.maxDelay);\n\t\tconst placed = requestedPlaced(msg, absent);\n\t\tconst subscription = (ranges: track.Range[]): track.Subscription => {\n\t\t\tconst out: track.Subscription = { ranges };\n\t\t\tif (placed.size > 0) out.placed = placed;\n\t\t\treturn out;\n\t\t};\n\t\tlet ranges: track.Range[];\n\t\ttry {\n\t\t\tranges = requestedRanges(msg, absent);\n\t\t} catch (err: unknown) {\n\t\t\tstream.writer.reset(error(err));\n\t\t\treturn;\n\t\t}\n\t\t// Parked past a bounded window's end: the peer reads this stream's end as the track's.\n\t\tconst track = hooks.parked(consumer.subscribe(subscription(ranges)));\n\t\t// Lite-07: how each live range counts toward a fetch, as its subscriber asked it: pinning a\n\t\t// time start to the group it resolved to leaves it no fetch.\n\t\tconst exact = new ExactRanges(rangesOf(msg));\n\t\tif (hasRanges(this.version)) hooks.fetches(track, exact.fetches());\n\t\tserving(track);\n\t\tif (watch.revoked()) {\n\t\t\ttrack.close();\n\t\t\treturn;\n\t\t}\n\t\tconst latest = hooks.latestKey(track);\n\t\tlet floor = cursorFloor(this.version, msg.startGroup, latest);\n\t\t// The ranges cap what is served; the floor only pins where an older wire starts.\n\t\ttrack.withRange({ start: { included: floor } });\n\n\t\t// An old subscription carries both kinds until its stream track ends.\n\t\tlet datagrams = Promise.resolve();\n\t\tconst bounds: FrameBounds = {\n\t\t\tstartGroup: msg.startGroup,\n\t\t\tstartFrame: msg.startFrame,\n\t\t\tendGroup: msg.endGroup,\n\t\t\tendFrame: msg.endFrame,\n\t\t\tstarts: hasRanges(this.version) ? positionFrames(msg.ranges ?? []) : new Map(),\n\t\t\tstartsAfter: new WeakMap(),\n\t\t\tstops: new Signal<ReadonlyMap<bigint, number>>(\n\t\t\t\thasRanges(this.version) ? positionStops(msg.ranges ?? []) : new Map(),\n\t\t\t),\n\t\t\tstopsAfter: new WeakMap(),\n\t\t};\n\t\t// A group is served whole from the frame asked: the reader fetches what its copy lacks.\n\t\thooks.wholeGroups(track, (key) => frameRange(bounds, key).start);\n\t\tlet legacy: datagram.Consumer | undefined;\n\t\t// The sequences the carried datagrams went out under, which the end declares.\n\t\tconst sent = new DatagramEnd();\n\t\tconst legacyPriority = new Signal(msg.priority);\n\t\tlet controls: SubscriptionControls | undefined;\n\t\t// Lite-05 and later name every key below the end that this subscription never\n\t\t// got with SUBSCRIBE_DROP, so the subscriber settles without waiting out its grace\n\t\t// for a group that will not come. A gap that never arrived stays until the end sweep\n\t\t// names it: this side cannot tell when the subscriber stopped waiting for it.\n\t\tconst named = hasTrackStream(this.version);\n\n\t\ttry {\n\t\t\t// Every draft waits for the track's info, as Rust does: it surfaces a rejected track\n\t\t\t// (accept never called, track closed) as an error here, which resets the stream, and\n\t\t\t// its priority breaks ties between this session's subscriptions at one subscriber\n\t\t\t// priority.\n\t\t\tlet info: track.Info;\n\t\t\ttry {\n\t\t\t\tinfo = await untilAborted(track.info(), left.signal);\n\t\t\t} catch (err) {\n\t\t\t\tif (\n\t\t\t\t\thasDatagrams(this.version) &&\n\t\t\t\t\t!hasDatagramTracks(this.version) &&\n\t\t\t\t\ttoStreamCode(error(err)) === StreamCode.NotFound\n\t\t\t\t) {\n\t\t\t\t\ttrack.close();\n\t\t\t\t\tawait this.#serveLegacyDatagrams(front, msg, stream, left.signal);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tconst publisher = info.priority;\n\t\t\t// A SUBSCRIBE can arrive before its track resolves, such as one a relay serves from a\n\t\t\t// copy still fetching upstream, or on lite-05 one sent alongside its TRACK: the newest\n\t\t\t// group known once it resolves stands in, including a largest the upstream's answer\n\t\t\t// reported, whether or not the copy already held a group. A newer group the answer\n\t\t\t// brings later is not waited for. Lite-01/02 keep their arrival floor, as Rust does.\n\t\t\tif (this.version !== Version.DRAFT_01 && this.version !== Version.DRAFT_02) {\n\t\t\t\tlet newest = latest;\n\t\t\t\tfor (const known of [hooks.latestKey(track), hooks.peekLargest(track).largest?.group]) {\n\t\t\t\t\tif (known !== undefined) newest = newest === undefined ? known : max(newest, known);\n\t\t\t\t}\n\t\t\t\tconst resolved = cursorFloor(this.version, msg.startGroup, newest);\n\t\t\t\tif (resolved !== floor) {\n\t\t\t\t\tfloor = resolved;\n\t\t\t\t\ttrack.withRange({ start: { included: floor } });\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Older drafts carry no timestamps.\n\t\t\tlet stamp: Stamp | undefined;\n\t\t\tlet compress = false;\n\n\t\t\tif (hasTrackStream(this.version)) {\n\t\t\t\t// Lite-05+ accepts implicitly: no SUBSCRIBE_OK (the immutable\n\t\t\t\t// properties live in TRACK_INFO), and the resolved range arrives as\n\t\t\t\t// SUBSCRIBE_START / SUBSCRIBE_END emitted from #runTrack.\n\t\t\t\t//\n\t\t\t\t// The timescale is an immutable property, so serving MUST use exactly\n\t\t\t\t// what TRACK_INFO advertised. It comes from the producer's accept(), so\n\t\t\t\t// they always agree.\n\t\t\t\tstamp = stamping(this.version, info);\n\t\t\t\tcompress = hasCompression(this.version) && info.compression === \"deflate\";\n\t\t\t} else {\n\t\t\t\t// Older drafts acknowledge with SUBSCRIBE_OK and stream frames verbatim.\n\t\t\t\tconst ok = new SubscribeOk({\n\t\t\t\t\tpriority: msg.priority,\n\t\t\t\t\tmaxDelay: msg.maxDelay ?? 0,\n\t\t\t\t\tstartGroup: msg.startGroup,\n\t\t\t\t\tendGroup: msg.endGroup,\n\t\t\t\t});\n\t\t\t\tawait encodeSubscribeResponse(stream.writer, { ok }, this.version);\n\t\t\t}\n\n\t\t\tconsole.debug(`publish ok: broadcast=${msg.broadcast} track=${track.name}`);\n\n\t\t\t// Serve datagrams concurrently with groups whenever the transport carries them\n\t\t\t// (the writer exists iff so). No group fallback: otherwise they simply aren't sent.\n\t\t\tif (this.#datagramWriter && !hasDatagramTracks(this.version)) {\n\t\t\t\tconst live = wireOf(front).liveDatagrams(msg.track);\n\t\t\t\tlegacy = live && this.#adopt(live);\n\t\t\t\tif (legacy) {\n\t\t\t\t\tif (wireOf(front).localDatagrams) legacy.setPriority(msg.priority);\n\t\t\t\t\tdatagrams = this.#runDatagrams(legacy, { sub: msg.id, stamp, priority: legacyPriority, sent })\n\t\t\t\t\t\t.then(() => {})\n\t\t\t\t\t\t.catch((err) => console.debug(`datagram send stopped: ${reason(err)}`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// The SUBSCRIBE's ranges, whose positions are their Range IDs, which key them in the model.\n\t\t\tconst asked = rangesOf(msg);\n\t\t\t// The ranges as the model holds them, pinned, by Range ID, with the read cursor's bounds.\n\t\t\tconst requested = new Requested(asked);\n\t\t\t// Lite-07: the Range IDs of the live ranges that start partway through a group, so an\n\t\t\t// edit recomputes the frame starts only while one is live.\n\t\t\tconst positions = new Set<bigint>();\n\t\t\tfor (const [id, range] of asked.entries()) if (framed(range)) positions.add(BigInt(id));\n\t\t\t// Lite-07: the Range IDs of the live ranges that end partway through a group, likewise.\n\t\t\tconst stopping = new Set<bigint>();\n\t\t\tfor (const [id, range] of asked.entries())\n\t\t\t\tif (range.end?.absolute !== undefined && range.end.frame) stopping.add(BigInt(id));\n\t\t\t// Lite-07: the ranges whose starts or time ends may still resolve.\n\t\t\tconst unpinned = new Unpinned();\n\t\t\tif (hasRanges(this.version))\n\t\t\t\tfor (const [id, range] of asked.entries()) unpinned.insert(BigInt(id), due(range, false));\n\t\t\t// Each live range due once the latest group reached where it may resolve, with its start and\n\t\t\t// end replaced by the groups they resolved to: a range resolves once, so an update that\n\t\t\t// leaves it live never places a live join again against a newer live edge, nor looks a time\n\t\t\t// start up again in newer holdings, here or on a relay's copies. Only the ranges still\n\t\t\t// waiting are asked, and each is let go once its anchors settle, so this costs those ranges\n\t\t\t// rather than every range. Mirrors the Rust `TrackRun::pin`.\n\t\t\tconst pinDue = (): [bigint, WireRange][] => {\n\t\t\t\tconst latest = hooks.latestKey(track);\n\t\t\t\tif (latest === undefined) return [];\n\t\t\t\tconst pins: [bigint, WireRange][] = [];\n\t\t\t\tconst asking: [bigint, WireRange][] = [];\n\t\t\t\tfor (const id of unpinned.due(latest)) {\n\t\t\t\t\tconst range = requested.get(id);\n\t\t\t\t\tif (range === undefined) unpinned.remove(id);\n\t\t\t\t\telse asking.push([id, range]);\n\t\t\t\t}\n\t\t\t\tconst resolution = hooks.servingResolvedKeys(\n\t\t\t\t\ttrack,\n\t\t\t\t\tasking.map(([id]) => id),\n\t\t\t\t);\n\t\t\t\tfor (const [index, [id, range]] of asking.entries()) {\n\t\t\t\t\tconst resolved = resolution[index];\n\t\t\t\t\tif (!resolved) continue;\n\t\t\t\t\tconst pinned = pin(range, resolved);\n\t\t\t\t\t// The start settled; the end is due again once it may settle.\n\t\t\t\t\tunpinned.insert(id, resolved.end === undefined ? due(pinned, true) : undefined);\n\t\t\t\t\t// One pinned to the groups it already names holds the same model range.\n\t\t\t\t\tif (rangeKey(requestedRange(pinned)) === rangeKey(requestedRange(range)))\n\t\t\t\t\t\trequested.insert(id, pinned);\n\t\t\t\t\telse pins.push([id, pinned]);\n\t\t\t\t}\n\t\t\t\treturn pins;\n\t\t\t};\n\t\t\tcontrols = new SubscriptionControls({\n\t\t\t\tquic: this.#quic,\n\t\t\t\treader: stream.reader,\n\t\t\t\twriter: stream.writer,\n\t\t\t\tversion: this.version,\n\t\t\t\tlive: new LiveRanges(this.version, asked),\n\t\t\t\tapply: (update, { retired, added, retuned }) => {\n\t\t\t\t\tlegacyPriority.set(update.priority);\n\t\t\t\t\tif (wireOf(front).localDatagrams) legacy?.setPriority(update.priority);\n\t\t\t\t\t// Every update restates the wanted group. Past our largest it is a refresh, which\n\t\t\t\t\t// repeats the pending ask; at or below it the group already exists.\n\t\t\t\t\tconst largest = hooks.peekLargest(track).largest?.group;\n\t\t\t\t\tif (update.wantedGroup !== undefined && (largest === undefined || update.wantedGroup > largest))\n\t\t\t\t\t\thooks.askSubscriber(track, \"refresh\");\n\t\t\t\t\tif (!hasRanges(this.version)) {\n\t\t\t\t\t\t// An older update restates its one span, replacing every range: an absent start is\n\t\t\t\t\t\t// placed afresh within the new max age rather than retuned where the old one joined.\n\t\t\t\t\t\tconst absent = legacyStart(this.version, update.maxDelay);\n\t\t\t\t\t\tconst restated: track.Subscription = { ranges: requestedRanges(update, absent) };\n\t\t\t\t\t\tconst placed = requestedPlaced(update, absent);\n\t\t\t\t\t\tif (placed.size > 0) restated.placed = placed;\n\t\t\t\t\t\thooks.restateSubscriber(track, restated);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Lite-07 hands the model the edit by Range ID, so it costs the ranges it names\n\t\t\t\t\t// whatever else is live. A pinned or retuned range is replaced in place, keeping its\n\t\t\t\t\t// Range ID. A retune changes only a range's policy and a live join's max: it keeps the\n\t\t\t\t\t// range as it resolved, pinned in this same edit or before, so a time start is never\n\t\t\t\t\t// looked up again. Mirrors the Rust `TrackRun::edit`.\n\t\t\t\t\tfor (const id of retired) unpinned.remove(id);\n\t\t\t\t\tconst pinned = new Map(pinDue());\n\t\t\t\t\tconst tuned: [bigint, WireRange][] = [];\n\t\t\t\t\tfor (const [id, asked] of retuned) {\n\t\t\t\t\t\tconst current = pinned.get(id) ?? requested.get(id);\n\t\t\t\t\t\tif (current === undefined) continue;\n\t\t\t\t\t\tpinned.delete(id);\n\t\t\t\t\t\ttuned.push([id, retunedRange(current, asked)]);\n\t\t\t\t\t}\n\t\t\t\t\tconst replaced = [...pinned, ...tuned];\n\t\t\t\t\tfor (const id of retired) requested.remove(id);\n\t\t\t\t\tfor (const [id, range] of [...replaced, ...added]) requested.insert(id, range);\n\t\t\t\t\tfor (const [id, range] of added) unpinned.insert(id, due(range, false));\n\t\t\t\t\tfor (const id of retired) positions.delete(id);\n\t\t\t\t\tfor (const [id, range] of added) if (framed(range)) positions.add(id);\n\t\t\t\t\tbounds.startsAfter.set(\n\t\t\t\t\t\tupdate,\n\t\t\t\t\t\tpositions.size > 0 ? positionFrames([...requested.values()]) : new Map(),\n\t\t\t\t\t);\n\t\t\t\t\tfor (const id of retired) stopping.delete(id);\n\t\t\t\t\tfor (const [id, range] of added)\n\t\t\t\t\t\tif (range.end?.absolute !== undefined && range.end.frame) stopping.add(id);\n\t\t\t\t\tbounds.stopsAfter.set(\n\t\t\t\t\t\tupdate,\n\t\t\t\t\t\tstopping.size > 0 ? positionStops([...requested.values()]) : new Map(),\n\t\t\t\t\t);\n\t\t\t\t\t// Refused before the model moves, as one SUBSCRIBE asking for nothing is.\n\t\t\t\t\tObject.assign(update, spanBetween(this.version, requested.start(), requested.end()));\n\t\t\t\t\tconst add = [...replaced, ...added].map(([id, range]) => [id, requestedRange(range)] as const);\n\t\t\t\t\t// A placed join or exact-group Position range stays placed where it was.\n\t\t\t\t\tconst placed = new Map<bigint, bigint>();\n\t\t\t\t\tfor (const [id, range] of [...replaced, ...added]) {\n\t\t\t\t\t\tconst at = range.start?.joined?.absolute ?? range.start?.absolute;\n\t\t\t\t\t\tif (at !== undefined) placed.set(id, at);\n\t\t\t\t\t}\n\t\t\t\t\tfor (const id of retired) exact.delete(id);\n\t\t\t\t\tfor (const [id, range] of added) exact.set(id, range);\n\t\t\t\t\t// An update editing no range leaves a fetch apart from the demand, as the Rust\n\t\t\t\t\t// `Preferences::edit` does.\n\t\t\t\t\tif (retired.length > 0 || add.length > 0) hooks.fetches(track, exact.fetches());\n\t\t\t\t\thooks.editSubscriber(track, {\n\t\t\t\t\t\tretire: [...retired, ...replaced.map(([id]) => id)],\n\t\t\t\t\t\tadd,\n\t\t\t\t\t\tplaced,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t\tconst finished = await this.#runTrack(track, stream.writer, controls, {\n\t\t\t\tsub: msg.id,\n\t\t\t\tbroadcast: msg.broadcast,\n\t\t\t\tstamp,\n\t\t\t\tpublisher,\n\t\t\t\tcompress,\n\t\t\t\tmeta: msg.meta,\n\t\t\t\tnamed,\n\t\t\t\tfloor,\n\t\t\t\tmaxDelay: msg.maxDelay,\n\t\t\t\tbounds,\n\t\t\t\tinitial: BigInt(asked.length),\n\t\t\t\trequested,\n\t\t\t\tmaxAge: info.maxAge?.asMillis(),\n\t\t\t\tcarried: legacy && { consumer: legacy, sent },\n\t\t\t});\n\n\t\t\tconsole.debug(`publish done: broadcast=${msg.broadcast} track=${track.name}`);\n\t\t\t// A lite-05+ subscriber FINs once it has read the tail, so leave its half open and\n\t\t\t// wait for that: a receiver may drop unread bytes on close. Older versions stop it\n\t\t\t// here, which ends the decoder.\n\t\t\tif (waitsForSubscriberFin(this.version)) stream.writer.close();\n\t\t\telse stream.close();\n\t\t\t// Ends both kinds carried by this old subscription.\n\t\t\ttrack.close();\n\t\t\tlegacy?.close();\n\t\t\t// A subscriber that left is owed nothing more, and its stream may already be reset.\n\t\t\tawait Promise.all([datagrams, controls.decoding, finished && acknowledged(stream.writer)]);\n\t\t} catch (err: unknown) {\n\t\t\t// The served track's error, such as a malformed group upstream, ends only this\n\t\t\t// subscription: its decoder (`SubscriptionControls`) closes the session for its own input.\n\t\t\tconst e = servedError(error(err));\n\t\t\tif (e === cancel) console.debug(`publish cancelled: broadcast=${msg.broadcast} track=${track.name}`);\n\t\t\telse console.warn(`publish error: broadcast=${msg.broadcast} track=${track.name} error=${reason(e)}`);\n\t\t\ttrack.close(e);\n\t\t\tlegacy?.close(e);\n\t\t\tstream.abort(e);\n\t\t\tawait Promise.all([datagrams, controls?.decoding]);\n\t\t}\n\t}\n\n\t/**\n\t * Runs a track and sends its data to the stream.\n\t * @param sub - The subscription ID\n\t * @param broadcast - The broadcast name\n\t * @param track - The track to run\n\t * @param stream - The stream to write to\n\t * @returns Whether the track finished with every group stream done, rather than the\n\t * subscriber leaving\n\t *\n\t * @internal\n\t */\n\tasync #runTrack(\n\t\ttrack: track.Subscriber,\n\t\tstream: Writer,\n\t\tcontrols: SubscriptionControls,\n\t\tserving: {\n\t\t\tsub: bigint;\n\t\t\tbroadcast: Path.Valid;\n\t\t\tstamp: Stamp | undefined;\n\t\t\t/** The track's publisher priority, breaking ties between subscriptions. */\n\t\t\tpublisher: number;\n\t\t\tcompress: boolean;\n\t\t\t/** Whether each frame goes out as its header alone (lite-07 `Meta`). */\n\t\t\tmeta: boolean;\n\t\t\t// Whether the wire names what it never served (lite-05 and later), recording what it\n\t\t\t// told in the reader's own record.\n\t\t\tnamed: boolean;\n\t\t\t// The read cursor's floor; see {@link cursorFloor}.\n\t\t\tfloor: bigint;\n\t\t\t// Before lite-07: the SUBSCRIBE's one max age in milliseconds, null for none.\n\t\t\tmaxDelay: number | null;\n\t\t\tbounds: FrameBounds;\n\t\t\t// How many ranges the SUBSCRIBE carried, which take Range IDs from 0.\n\t\t\tinitial: bigint;\n\t\t\t// Live ranges currently requested on this subscription.\n\t\t\trequested: Requested;\n\t\t\t// The track's Publisher Max Age in milliseconds, undefined for none: no subscriber\n\t\t\t// budget reaches past it.\n\t\t\tmaxAge?: number;\n\t\t\t// Lite-05/06: the name's datagram track riding this subscription, and the sequences sent.\n\t\t\tcarried?: { consumer: datagram.Consumer; sent: DatagramEnd };\n\t\t},\n\t): Promise<boolean> {\n\t\tconst { sub, broadcast, stamp, publisher, compress, meta, named, bounds, initial, requested } = serving;\n\t\t// What the wire was told of each key: served, or given up, and how. Kept in the\n\t\t// reader's own record, which its drops consult too. Undefined before lite-05.\n\t\tconst record = named ? hooks.wire(track) : undefined;\n\t\t// The read cursor's floor; the subscription's ranges cap it.\n\t\tlet floor = serving.floor;\n\t\t// Before lite-07: the one max age the subscription last asked, null for none.\n\t\tlet maxDelay = serving.maxDelay;\n\t\tconst moveCursor = () => track.withRange({ start: { included: floor } });\n\t\t// Raise the floor to `start`, keeping any higher floor already set.\n\t\tconst raiseFloor = (start: bigint) => {\n\t\t\tif (start <= floor) return;\n\t\t\tfloor = start;\n\t\t\tmoveCursor();\n\t\t};\n\t\t// Lite-05+ resolves the range on the subscribe stream: SUBSCRIBE_START once the\n\t\t// first group is known, SUBSCRIBE_END when the track finishes.\n\t\tconst emitRange = hasTrackStream(this.version);\n\t\t// Dispositions before delivery resolves refine its start; later ones are named as drops. Each\n\t\t// replaces the runs it covers, as a skip may go out over a drop, so they stay sorted and\n\t\t// disjoint. Where delivery resolved is lowered by an update that asks for groups below it.\n\t\tlet answer = startAnswer(this.version);\n\t\t// Before lite-07: where delivery first started, once a lowered start owes the drops below it.\n\t\t// Mirrors the Rust `TrackRun::first_start`.\n\t\tlet firstStart: bigint | undefined;\n\t\t// Before lite-07: the keys `nameOwed` has walked, untold or not, contiguous. Mirrors the Rust\n\t\t// `TrackRun::scanned`.\n\t\tlet scanned: Run = { start: 0n, end: 0n };\n\t\t// Before lite-07, for a subscription naming no start: where delivery starts, below which no drop\n\t\t// is owed. A budget change places its live join afresh, reaching back to the oldest group held,\n\t\t// so the scan judges the whole history again, or after a change that landed before the\n\t\t// SUBSCRIBE_START, everything the start left untold below it; a relay's front also learns of\n\t\t// history below its copy's feed start from upstream. Those drops stay untold until a start\n\t\t// lowered to them owes them, one per gap and stale group otherwise. Mirrors the Rust\n\t\t// `TrackRun::drop_floor`.\n\t\tconst dropFloor = (): bigint | undefined =>\n\t\t\tanswer.kind === \"started\" && resolvesStart(this.version) && bounds.startGroup === undefined\n\t\t\t\t? answer.from\n\t\t\t\t: undefined;\n\t\t// Lower where delivery starts to `start`, once resolved, owing the drops the track holds below\n\t\t// the old start from there up that settle the reader, within the ranges, which the scan left\n\t\t// untold (see `owed`). Mirrors the Rust `TrackRun::lower_from`.\n\t\tconst lowerFrom = (start: bigint) => {\n\t\t\tif (answer.kind === \"started\" && start < answer.from) firstStart ??= answer.from;\n\t\t\tif (answer.kind === \"started\" || answer.kind === \"withheld\" || answer.kind === \"answered\")\n\t\t\t\tanswer.from = min(answer.from, start);\n\t\t};\n\t\t// Before lite-07: the keys a lowered start owes the drops of now, which nothing stores: below\n\t\t// where delivery first started, from where it starts now, within the ranges' start and end.\n\t\t// Mirrors the Rust `TrackRun::owed`.\n\t\tconst owed = (): Run => {\n\t\t\tif (!record || firstStart === undefined || answer.kind !== \"started\") return { start: 0n, end: 0n };\n\t\t\tconst end = bounds.endGroup === undefined ? firstStart : min(firstStart, bounds.endGroup + 1n);\n\t\t\treturn { start: max(answer.from, floor), end };\n\t\t};\n\t\t// The next drop a lowered start owes, told already: its untold runs, or none when the step found\n\t\t// nothing to name; undefined once nothing is owed. Walks `owed` from where it left off, seeking\n\t\t// past what the wire was told through the record, so history told already costs nothing. A walk\n\t\t// below where the last one began starts over there, rejoining it once it reaches it. Mirrors the\n\t\t// Rust `TrackRun::name_owed`.\n\t\tconst nameOwed = (): DropRun[] | undefined => {\n\t\t\tconst window = owed();\n\t\t\tif (!record || window.start >= window.end) return undefined;\n\t\t\tconst resumed = scanned.start <= window.start && window.start <= scanned.end;\n\t\t\tconst from = resumed ? scanned.end : window.start;\n\t\t\tconst gap = from < window.end ? record.firstUntold(from, window.end) : undefined;\n\t\t\tconst run = gap && hooks.nextSettledDrop(track, gap.start, gap.end);\n\t\t\t// A front whose serving route has yet to answer knows no verdict there yet: the walk waits\n\t\t\t// on it rather than passing the gap by.\n\t\t\tif (run === \"pending\") return undefined;\n\t\t\t// Nothing untold is left, so no step goes here until the window moves.\n\t\t\tconst walked = !gap\n\t\t\t\t? max(window.end, from)\n\t\t\t\t: !run\n\t\t\t\t\t? gap.end\n\t\t\t\t\t: run.reason === \"skip\"\n\t\t\t\t\t\t? run.end\n\t\t\t\t\t\t: reach(run.end);\n\t\t\tconst start = resumed ? scanned.start : window.start;\n\t\t\tconst rejoined = start <= scanned.start && scanned.start <= walked;\n\t\t\tscanned = { start, end: rejoined ? max(walked, scanned.end) : walked };\n\t\t\tif (!gap) return undefined;\n\t\t\tif (!run) return [];\n\t\t\tconst gaps = record.untold(run.start, walked);\n\t\t\tfor (const told of gaps) record.tell(told.start, told.end);\n\t\t\treturn gaps.map((told) => ({ ...run, ...told }));\n\t\t};\n\t\t// What this hop knows of the largest position, `position` the newest it saw: nothing on a\n\t\t// relay's copy its upstream has yet to answer, whatever its cache holds. Mirrors the Rust\n\t\t// `TrackRun::largest`.\n\t\tconst edge = (position: track.Position | undefined): Edge => {\n\t\t\tif (!hooks.knowsEdge(track)) return \"unknown\";\n\t\t\treturn position ? { position, ended: hooks.largestFinished(track, position) } : \"empty\";\n\t\t};\n\t\tconst newest = () => newer(hooks.bufferedLargest(track), hooks.peekLargest(track).largest);\n\t\tlet endSent = false;\n\t\t// Lite-07: the ranges no SUBSCRIBE_START answered yet, by Range ID, each as it was asked.\n\t\tconst unstarted = new Map<bigint, Asked>();\n\t\tif (hasRanges(this.version)) {\n\t\t\tfor (let id = 0n; id < initial; id++) {\n\t\t\t\tconst range = controls.range(id);\n\t\t\t\tif (range) unstarted.set(id, asked(range));\n\t\t\t}\n\t\t}\n\t\t// Lite-07: the narrowest Max Age as each outcome was given up before the first START. A held\n\t\t// OLD keeps it even once queued behind the START write; any other unjudged OLD is capped by it\n\t\t// only until the held drops go out (`pendingNarrowest`), as the Rust `Ranges::held_narrowest`.\n\t\tlet heldNarrowest: number | undefined;\n\t\tlet pendingNarrowest: number | undefined;\n\t\tconst holdMaxAge = (maxAge: number | undefined) => {\n\t\t\theldNarrowest = narrower(heldNarrowest, maxAge);\n\t\t\tpendingNarrowest = narrower(pendingNarrowest, maxAge);\n\t\t};\n\t\t// Use the budget when the outcome is accepted (`asked`, if captured earlier), before a control\n\t\t// update can retune it. Every outcome held before the first START contributes to its shared minimum.\n\t\tconst snapshotHole = (hole: Hole, asked?: { maxAge: number | undefined }): QueuedHole => {\n\t\t\tif (!hasRanges(this.version)) return hole;\n\t\t\tconst held = answer.kind === \"unresolved\" || answer.kind === \"withheld\";\n\t\t\tconst unjudged = hole.reason === \"old\" && hole.maxAge === undefined;\n\t\t\tif (!held && !unjudged) return hole;\n\t\t\tconst maxAge = asked ? asked.maxAge : requested.narrowest();\n\t\t\tif (held) holdMaxAge(maxAge);\n\t\t\tif (!unjudged) return hole;\n\t\t\tif (maxAge === undefined) return dropHole();\n\t\t\treturn held ? { reason: \"held-old\" } : staleHole(maxAge);\n\t\t};\n\t\t// Hold `[start, end)` given up before delivery resolved, which the start names. Mirrors the Rust\n\t\t// `TrackRun::hold_hole`.\n\t\tconst holdSkipped = (skipped: Runs<QueuedDrop>, start: bigint, end: bigint, run: QueuedDrop) => {\n\t\t\tif (hasRanges(this.version)) holdMaxAge(requested.narrowest());\n\t\t\tskipped.set(start, end, run);\n\t\t};\n\t\t// Send a range's SUBSCRIBE_START, then whatever was withheld for the first one.\n\t\tconst sendStart = async (start: SubscribeStart): Promise<boolean> => {\n\t\t\tif (!(await controls.response(encodeSubscribeResponse(stream, { start }, this.version)))) return false;\n\t\t\tif (answer.kind !== \"withheld\") return true;\n\t\t\tconst { from, held } = answer;\n\t\t\tanswer = { kind: \"answered\", from };\n\t\t\t// Empty while delivery resolves, whose own held drops go out after its starts.\n\t\t\tif (held.length === 0) return true;\n\t\t\tfor (const [low, high, hole] of held) {\n\t\t\t\tconst msg = holeMessage(low, high, hole);\n\t\t\t\tif (!(await controls.response(encodeSubscribeResponse(stream, msg, this.version)))) return false;\n\t\t\t}\n\t\t\tpendingNarrowest = undefined;\n\t\t\treturn true;\n\t\t};\n\t\t// Send `[start, end)` given up as `hole`, or hold it until a lite-07 subscription's first\n\t\t// SUBSCRIBE_START: one given up before delivery resolved, such as a group served meanwhile whose\n\t\t// stream failed, is named once it does.\n\t\tconst sendHole = (start: bigint, end: bigint, hole: QueuedHole): Promise<boolean> => {\n\t\t\tif (answer.kind === \"unresolved\") holdSkipped(answer.skipped, start, end, { ...hole, start, end });\n\t\t\telse if (answer.kind === \"withheld\") {\n\t\t\t\tholdMaxAge(requested.narrowest());\n\t\t\t\tanswer.held.push([start, end, hole]);\n\t\t\t} else\n\t\t\t\treturn controls.response(encodeSubscribeResponse(stream, holeMessage(start, end, hole), this.version));\n\t\t\treturn Promise.resolve(true);\n\t\t};\n\t\t// Lite-07: whether the track is a relay's copy that places each range only where its upstream\n\t\t// would, from that upstream's answer for it or groups proving it, so a range it placed waits\n\t\t// on no other. A copy that places ranges from whatever groups it holds, or a local track,\n\t\t// waits for where its whole feed starts. Mirrors the Rust `TrackRun::per_range`.\n\t\tconst perRange = () => hasRanges(this.version) && hooks.placesAsUpstream(track);\n\n\t\t// A time range reaching back before the first group held names drops from its time: start\n\t\t// there when a drop is recorded at the time or between it and that group, so the subscriber\n\t\t// does not pass over it. Mirrors the Rust `TrackState::source_start`.\n\t\tconst historyStart = (ask: Asked | undefined, range: Resolved, from: bigint): bigint => {\n\t\t\tconst start = max(range.start, from);\n\t\t\tconst time = ask?.time;\n\t\t\tif (time !== undefined && !range.floored && !perRange() && (range.end === undefined || time < range.end)) {\n\t\t\t\tconst reach = max(start, time + 1n);\n\t\t\t\tconst until = range.end === undefined ? reach : min(reach, range.end);\n\t\t\t\tfor (let at = time; at < until; ) {\n\t\t\t\t\tconst run = hooks.nextSettledDrop(track, at, until);\n\t\t\t\t\tif (!run || run === \"pending\") break;\n\t\t\t\t\tif (run.reason !== \"skip\") return time;\n\t\t\t\t\tat = run.end;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn start;\n\t\t};\n\n\t\t// Resolve delivery at `from`, `position` the newest this hop saw, then name the groups given up\n\t\t// above it while it was held back. Before lite-07 the one start answers the subscription. On\n\t\t// lite-07 each of the SUBSCRIBE's ranges resolved there is answered now; one still waiting, or\n\t\t// one following the live edge before this hop knows where it is, is answered later by\n\t\t// `reportStarted`, and the drops given up meanwhile wait for the first answer. The only way out\n\t\t// of an unresolved answer, so none leaves its held drops unsent. Mirrors the Rust\n\t\t// `TrackRun::resolve`.\n\t\tconst resolveStart = async (from: bigint, position: track.Position | undefined): Promise<boolean> => {\n\t\t\tif (answer.kind === \"waiting\") {\n\t\t\t\tconst { skipped } = answer;\n\t\t\t\tanswer = { kind: \"started\", from };\n\t\t\t\tif (!(await sendStart(new SubscribeStart({ id: 0n, start: from, largest: \"unknown\" })))) return false;\n\t\t\t\treturn nameSkipped(from, skipped);\n\t\t\t}\n\t\t\tif (answer.kind !== \"unresolved\") throw new Error(`delivery resolves once, not when ${answer.kind}`);\n\t\t\tconst { skipped } = answer;\n\t\t\tanswer = { kind: \"withheld\", from, held: [] };\n\t\t\tconst largest = edge(position);\n\t\t\tconst ids = [...unstarted.keys()].filter((id) => id < initial && controls.holds(id));\n\t\t\tconst resolution = hooks.servingResolvedKeys(track, ids);\n\t\t\t// A range reaching back to the oldest group, on a copy placing each range as its upstream\n\t\t\t// answered it, starts where the copy's feed does, which it may not know yet.\n\t\t\tconst reaches = perRange() && hooks.sourceStart(track) === \"pending\";\n\t\t\tfor (const [index, id] of ids.entries()) {\n\t\t\t\tconst range = resolution[index];\n\t\t\t\t// An update taken while an earlier start went out may have retired it.\n\t\t\t\tif (!range || !controls.holds(id) || (unstarted.get(id)?.live && largest === \"unknown\")) continue;\n\t\t\t\t// A live join starts at the history this hop vouches for from where it was placed, whatever\n\t\t\t\t// its max, which may be below where delivery starts: a relay serves first the groups it\n\t\t\t\t// holds, before those the join is owed arrive. It moves delivery down to it. Any other\n\t\t\t\t// range starts no earlier than delivery.\n\t\t\t\tconst ask = unstarted.get(id);\n\t\t\t\tconst joins = ask?.joins === true;\n\t\t\t\tif (!joins && reaches && !range.floored) continue;\n\t\t\t\tconst start = joins\n\t\t\t\t\t? hooks.joinStart(track, range.start, NO_MAX_DELAY)\n\t\t\t\t\t: historyStart(ask, range, from);\n\t\t\t\tunstarted.delete(id);\n\t\t\t\tconst at = range.end === undefined || range.end > start ? start : undefined;\n\t\t\t\tif (at !== undefined) lowerFrom(at);\n\t\t\t\tif (!(await sendStart(new SubscribeStart({ id, start: at, largest })))) return false;\n\t\t\t}\n\t\t\t// A range an update added before this start is answered with it, before the drops held\n\t\t\t// for it, which a subscriber reads only once a range has started.\n\t\t\tif (!(await reportStarted(false))) return false;\n\t\t\tconst resolved = answerFrom(answer);\n\t\t\tif (resolved !== undefined && !(await nameSkipped(resolved, skipped))) return false;\n\t\t\t// Sent now unless still withheld for the first START, which releases them then.\n\t\t\tif (answer.kind !== \"withheld\" || answer.held.length === 0) pendingNarrowest = undefined;\n\t\t\treturn true;\n\t\t};\n\n\t\t// Name the runs in `skipped`, given up before delivery resolved at `start`, as they would have\n\t\t// been after it. Nothing below the start is owed. The final runs reaching up to it unbroken are\n\t\t// named all the same, so a reader filling below the start (a relay whose reader reaches lower)\n\t\t// learns nothing there exists. The rest, past a stale run, a group still held, or a key nothing\n\t\t// gave up, stay untold: naming them would send every gap in the track's history, as a lite-06\n\t\t// track keyed by timestamp holds one per group. An update that asks below the start names them\n\t\t// then, and a wider budget may still serve a stale one. On lite-07, whose ranges bound what a\n\t\t// stale verdict was judged within, a run stale under the track's own max age is final all the\n\t\t// same, since no budget reaches past it: a relay reading from the oldest group would otherwise\n\t\t// wait on it forever. Earlier drafts name a drop with no range, which a capped read could still\n\t\t// serve, so they stop there. Mirrors the Rust `TrackRun::name_skipped`, whose bound also takes in\n\t\t// the hop's cache ceiling, which a TypeScript publisher does not have.\n\t\tconst nameSkipped = async (start: bigint, skipped: Runs<QueuedDrop>): Promise<boolean> => {\n\t\t\tif (skipped.size === 0) return true;\n\t\t\tconst bound = hasRanges(this.version) ? serving.maxAge : undefined;\n\t\t\tconst finalStale = (stale: number) => bound !== undefined && stale >= bound;\n\t\t\tlet reach = start;\n\t\t\tfor (let i = skipped.size - 1; i >= 0; i--) {\n\t\t\t\tconst range = skipped.all[i];\n\t\t\t\tif (range.start >= reach) continue;\n\t\t\t\tif (\n\t\t\t\t\trange.end < reach ||\n\t\t\t\t\t(range.reason !== \"held-old\" && range.maxAge !== undefined && !finalStale(range.maxAge))\n\t\t\t\t)\n\t\t\t\t\tbreak;\n\t\t\t\treach = range.start;\n\t\t\t}\n\t\t\t// On lite-07, a subscription can also name disjoint history ranges below `reach` whose groups\n\t\t\t// were already given up before delivery resolved: forward their drops too.\n\t\t\tconst send: Run[] = [];\n\t\t\tconst maxEnd = 1n << 64n;\n\t\t\tinsertRun(send, reach, maxEnd);\n\t\t\tif (hasRanges(this.version)) {\n\t\t\t\tfor (const askedRange of requested.values()) {\n\t\t\t\t\tconst model = requestedRange(askedRange);\n\t\t\t\t\tif (typeof model.start !== \"bigint\") continue;\n\t\t\t\t\tconst to = model.end !== undefined ? model.end + 1n : maxEnd;\n\t\t\t\t\tif (model.start < to) insertRun(send, model.start, to);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Below reach they stay untold: a start lowered to them owes them (see `lowerFrom`), and\n\t\t\t// otherwise only a rescan names them again.\n\t\t\tfor (const range of skipped.all) {\n\t\t\t\tfor (const gap of runGaps(send, range.start, range.end)) record?.untell(gap.start, gap.end);\n\t\t\t\tfor (const part of send) {\n\t\t\t\t\tconst from = max(part.start, range.start);\n\t\t\t\t\tconst to = min(part.end, range.end);\n\t\t\t\t\tif (from < to && !(await forward(from, to, range))) return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\t// While the source has yet to say where its whole feed starts, `position` the newest this hop\n\t\t// saw: whether a range still unanswered, one the SUBSCRIBE carried or an update added since,\n\t\t// names a group the copy placed as its upstream answered (see `perRange`), so `resolveStart`\n\t\t// answers it now rather than wait on a live join or older history upstream still places.\n\t\t// Mirrors the Rust `TrackRun::places_any`.\n\t\tconst placesAny = (position: track.Position | undefined): boolean => {\n\t\t\tif (!perRange()) return false;\n\t\t\tconst known = edge(position) !== \"unknown\";\n\t\t\tconst ids = [...unstarted.keys()].filter((id) => controls.holds(id));\n\t\t\tconst resolution = hooks.servingResolvedKeys(track, ids);\n\t\t\treturn ids.some((id, index) => resolution[index]?.floored && (known || !unstarted.get(id)?.live));\n\t\t};\n\n\t\t// Lite-07: resolve delivery from the lowest group served while unresolved, `position` the newest\n\t\t// this hop saw, once the source says where its feed starts, or once one of the SUBSCRIBE's\n\t\t// ranges is placed, with delivery at the floor, at or below where any range still unplaced\n\t\t// starts, so its answer later is never raised past its own start. Undefined while neither\n\t\t// holds. Mirrors the Rust `TrackRun::start`.\n\t\tconst resolveServed = async (position: track.Position | undefined): Promise<boolean | undefined> => {\n\t\t\tif (answer.kind !== \"unresolved\" || answer.served === undefined) return undefined;\n\t\t\tlet source = hooks.sourceStart(track);\n\t\t\tif (source === \"pending\" && placesAny(position)) source = floor;\n\t\t\tif (source === \"pending\") return undefined;\n\t\t\tconst from = hooks.deliveryStart(track, { first: answer.served, source, givenUp: answer.skipped });\n\t\t\treturn resolveStart(from, position);\n\t\t};\n\n\t\t// Lite-07: whether a range still unanswered waits on this copy's upstream to place it, which\n\t\t// answers every range once the track ends: only while the copy's source has yet to say where\n\t\t// its feed starts. Mirrors the Rust `TrackRun::awaits_upstream`.\n\t\tconst awaitsUpstream = (): boolean => {\n\t\t\tif (!perRange()) return false;\n\t\t\tconst held = [...unstarted.keys()].filter((id) => controls.holds(id));\n\t\t\tif (hooks.servingResolvedKeys(track, held).every((range) => range !== undefined)) return false;\n\t\t\treturn hooks.sourceStart(track) === \"pending\";\n\t\t};\n\n\t\t// `edge(newest())`, or once `finished` with the edge unknown, what this hop holds: nothing more\n\t\t// arrives to tell it, so a range following the edge is answered with what it has. Mirrors the\n\t\t// Rust `TrackRun::settled_largest`.\n\t\tconst settledLargest = (finished: boolean): Edge => {\n\t\t\tconst position = newest();\n\t\t\tconst largest = edge(position);\n\t\t\tif (largest !== \"unknown\" || !finished || position === undefined) return largest;\n\t\t\treturn { position, ended: hooks.largestFinished(track, position) };\n\t\t};\n\n\t\t// Answer each range still waiting for its SUBSCRIBE_START once it resolves, or with no start\n\t\t// once nothing can resolve it (`finished`). One following the live edge also waits until this\n\t\t// hop knows where it is, unless the track finished, after which nothing more tells it. Waits\n\t\t// for delivery to resolve, which `resolveStart` does. Mirrors the Rust\n\t\t// `TrackRun::report_started`.\n\t\tconst reportStarted = async (finished: boolean): Promise<boolean> => {\n\t\t\tconst resolved = answerFrom(answer);\n\t\t\tif (resolved === undefined || unstarted.size === 0) return true;\n\t\t\tconst largest = settledLargest(finished);\n\t\t\t// An update not taken yet retired one, and taking that update forgets it. In Range ID\n\t\t\t// order, as the Rust `TrackRun::report_started` reports them.\n\t\t\tconst held = [...unstarted.keys()]\n\t\t\t\t.filter((id) => controls.holds(id))\n\t\t\t\t.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));\n\t\t\t// Every range clamps against where delivery started before this batch, so one reported\n\t\t\t// later isn't clamped against a start an earlier join in the batch lowered.\n\t\t\tconst from = resolved;\n\t\t\tconst per = perRange();\n\t\t\tconst resolution = hooks.servingResolvedKeys(track, held);\n\t\t\tfor (const [index, id] of held.entries()) {\n\t\t\t\t// Or one taken while an earlier start went out.\n\t\t\t\tif (!controls.holds(id)) continue;\n\t\t\t\tconst ask = unstarted.get(id);\n\t\t\t\t// Never answered without the largest, even once nothing else can resolve it: this hop's\n\t\t\t\t// feed answering or ending tells it.\n\t\t\t\tif (ask?.live && largest === \"unknown\") continue;\n\t\t\t\tconst range = resolution[index];\n\t\t\t\tif (!range && !finished) continue;\n\t\t\t\tlet start: bigint | undefined;\n\t\t\t\tif (range) {\n\t\t\t\t\t// A live join placed behind where delivery started, further from the live edge than\n\t\t\t\t\t// the first ranges, starts at the history this hop vouches for from where it was\n\t\t\t\t\t// placed, even past groups its max expired, which delivery names as old, so a wider max\n\t\t\t\t\t// reads them later: the subscriber reads its answer as the join's start, so its groups\n\t\t\t\t\t// from there are owed, and delivery now starts there too. So does a range naming a\n\t\t\t\t\t// group on a copy that places it as its upstream answered. One reaching back there starts where the copy's\n\t\t\t\t\t// feed does, once the copy knows. Any other range starts no earlier than delivery.\n\t\t\t\t\tif (ask?.joins) start = hooks.joinStart(track, range.start, NO_MAX_DELAY);\n\t\t\t\t\telse if (per && range.floored) start = range.start;\n\t\t\t\t\telse if (per) {\n\t\t\t\t\t\tconst source = hooks.sourceStart(track);\n\t\t\t\t\t\tif (source === \"pending\" && !finished) continue;\n\t\t\t\t\t\tstart = max(range.start, source === \"pending\" ? from : (source ?? from));\n\t\t\t\t\t} else start = historyStart(ask, range, from);\n\t\t\t\t\tif (range.end !== undefined && range.end <= start) start = undefined;\n\t\t\t\t\telse lowerFrom(start);\n\t\t\t\t}\n\t\t\t\tunstarted.delete(id);\n\t\t\t\tif (!(await sendStart(new SubscribeStart({ id, start, largest })))) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\t// Lite-07, on a track this hop knows has no group yet: answer each range starting at the\n\t\t// oldest group at once, since every group the track produces is owed, so the subscriber\n\t\t// learns the track is empty rather than wait on a group. A time start above the floor, or a\n\t\t// live join, waits for a group to place it; one at or below the floor starts where delivery\n\t\t// does. Mirrors the Rust `TrackRun::resolve_empty`.\n\t\tconst resolveEmpty = async (): Promise<boolean | undefined> => {\n\t\t\tif (!hasRanges(this.version) || ![...unstarted.values()].some((ask) => ask.oldest)) return undefined;\n\t\t\tif (newest() !== undefined || !hooks.knowsEdge(track) || hooks.subscriberEnd(track) !== undefined)\n\t\t\t\treturn undefined;\n\t\t\tif (!(await resolveStart(0n, undefined))) return false;\n\t\t\tfor (const [id, ask] of [...unstarted]) {\n\t\t\t\tif (!ask.oldest || !controls.holds(id)) continue;\n\t\t\t\tunstarted.delete(id);\n\t\t\t\tif (!(await sendStart(new SubscribeStart({ id, start: 0n, largest: \"empty\" })))) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\t// Lite-07, on a track that ended before its first group: its SUBSCRIBE_END at group 0 answers\n\t\t// every range, so none waits for a start, and nothing given up is owed. Mirrors the Rust\n\t\t// `TrackRun::answer_empty`.\n\t\tconst answerEmpty = () => {\n\t\t\tunstarted.clear();\n\t\t\tanswer = { kind: \"answered\", from: 0n };\n\t\t};\n\n\t\t// An unjudged OLD names the narrowest live budget, capped while drops are held. A held OLD had a\n\t\t// finite Max Age when queued and shares the pre-START minimum. Mirrors the Rust `TrackRun::hole`.\n\t\tconst holeMessage = (start: bigint, end: bigint, hole: QueuedHole): SubscribeResponse => {\n\t\t\tif (hole.reason !== \"held-old\")\n\t\t\t\treturn givenUp(start, end, hole, narrower(requested.narrowest(), pendingNarrowest), this.version);\n\t\t\treturn givenUp(start, end, { reason: \"old\" }, narrower(heldNarrowest, requested.narrowest()), this.version);\n\t\t};\n\n\t\t// A drop of a group held whole names its span, `[start, max(End, start + 1))`, so the\n\t\t// subscriber accounts for the starts inside it too: no other group starts there. The\n\t\t// group is the highest one below `end`, starting at `end - 1n` or holding it in its span,\n\t\t// as the Rust `TrackState::span_end` takes it.\n\t\tconst reach = (end: bigint): bigint =>\n\t\t\tmax(end, hooks.wholeEnd(track, end - 1n) ?? hooks.wholeAround(track, end - 1n)?.end ?? end);\n\n\t\t// The starts of the groups whose stream is still serving, which may yet send GROUP_END.\n\t\tconst streaming = new Set<bigint>();\n\n\t\t// Give up, as `hole` says, whatever part of `[start, end)` this subscription has not been\n\t\t// served or given up yet.\n\t\tconst drop = async (start: bigint, end: bigint, hole: Hole): Promise<boolean> => {\n\t\t\tif (!record) return true;\n\t\t\tfor (const gap of record.untold(start, end)) {\n\t\t\t\t// The starts inside a whole group whose stream is still serving are its GROUP_END's to\n\t\t\t\t// account for, which may still be on its way, or its drop's, which names its span. A\n\t\t\t\t// stream that already ended without one left them untold, so they are named here.\n\t\t\t\tconst around = hooks.wholeAround(track, gap.start);\n\t\t\t\tconst from = around && streaming.has(around.start) ? min(around.end, gap.end) : gap.start;\n\t\t\t\tif (from >= gap.end) continue;\n\t\t\t\trecord.tell(from, gap.end);\n\t\t\t\tif (!(await sendHole(from, gap.end, hole))) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\t// Forward a verdict the reader reached on `[start, end)`, which its record already took in, so\n\t\t// nothing went out over it. A drop of a group held whole names its span.\n\t\tconst forward = async (start: bigint, end: bigint, hole: QueuedHole): Promise<boolean> => {\n\t\t\tif (!record || start >= end) return true;\n\t\t\tif (hole.reason !== \"skip\") end = reach(end);\n\t\t\trecord.tell(start, end);\n\t\t\treturn sendHole(start, end, hole);\n\t\t};\n\n\t\t// The track's exclusive final boundary. A Rust subscriber feeds SUBSCRIBE_END\n\t\t// straight into finish_at, so it must name the track's boundary (which counts\n\t\t// datagram sequences too), not the delivered range: a subscription cap can hold\n\t\t// produced groups back. The latest() fallback covers a subscription torn down\n\t\t// before the producer declared it.\n\t\t// Lite cannot name a frame, so a mid-group end rounds up past its group, whose own\n\t\t// stream FIN says where it stops.\n\t\tconst boundary = () => {\n\t\t\tconst end = hooks.subscriberEnd(track);\n\t\t\treturn end ? finalKey(end) : (hooks.latestKey(track) ?? -1n) + 1n;\n\t\t};\n\n\t\t// Declare the boundary immediately; groups below it can still be in flight.\n\t\tconst sendEnd = async (): Promise<boolean> => {\n\t\t\tendSent = true;\n\t\t\tif (!emitRange) return true;\n\t\t\t// Lite-05/06 carry the name's datagrams on this subscription, keyed in the groups' space:\n\t\t\t// the end covers the highest datagram sent, everything above the stream's own end is\n\t\t\t// dropped, and no later datagram goes out. Keys below the stream's own end stay open,\n\t\t\t// since its groups may be in flight.\n\t\t\tlet end = boundary();\n\t\t\tconst { carried } = serving;\n\t\t\tif (carried) {\n\t\t\t\tconst settled = carried.sent.settle(end);\n\t\t\t\tcarried.consumer.close();\n\t\t\t\tend = settled.end;\n\t\t\t\tif (settled.span) {\n\t\t\t\t\tconst [from, to] = settled.span;\n\t\t\t\t\tif (!(await drop(from, to, dropHole()))) return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn controls.response(encodeSubscribeResponse(stream, { end: new SubscribeEnd(end) }, this.version));\n\t\t};\n\n\t\t// The FIN tells the subscriber every group is accounted for, so it waits until each group\n\t\t// stream finished or reset. False once the subscriber left instead, which cancels whatever\n\t\t// is still queued. `race`, since this repeats per batch of drops against the subscription's end.\n\t\tconst drained = async (): Promise<boolean> => {\n\t\t\tconst done = Symbol(\"drained\");\n\t\t\tconst end = await race([Promise.all(groups).then(() => done), controls.ended]);\n\t\t\tif (end instanceof Error) throw end;\n\t\t\treturn end === done;\n\t\t};\n\t\t// Lite-07: true once every group settled, or `undefined` once a control is there to take,\n\t\t// its FIN or failure included. An update may move a stop a group is parked at, which only\n\t\t// the loop applies, so the drain waits for it no longer. Each wait is disposed once it\n\t\t// wakes, so updates that leave a group parked leave nothing behind.\n\t\tconst drainedOrControl = async (): Promise<true | undefined> => {\n\t\t\tfor (;;) {\n\t\t\t\tif (controls.pending()) return undefined;\n\t\t\t\tif (groups.size === 0) return true;\n\t\t\t\tconst dispose: Dispose[] = [];\n\t\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\t\tdispose.push(\n\t\t\t\t\t\tcontrols.changed(resolve),\n\t\t\t\t\t\tgroupEnded.changed(() => resolve()),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\tfor (const close of dispose) close();\n\t\t\t}\n\t\t};\n\t\t// One ranking for the whole subscription, shared by every group it serves.\n\t\tconst priority = new Priority(track, publisher);\n\t\t// Lite-07: the policy and budget of the live range with Range ID `id`, as the latest update\n\t\t// left it, so a retuned max moves a group already going out. Mirrors the Rust `Steering::of`.\n\t\tconst rangeSteering = (id: bigint) => {\n\t\t\tconst range = controls.range(id);\n\t\t\tif (!range) return undefined;\n\t\t\tconst max = range.start?.live?.max ?? range.start?.joined?.max;\n\t\t\treturn { policy: policyOf(range), budget: typeof max === \"number\" ? max : NO_MAX_DELAY };\n\t\t};\n\t\t// Lite-07: a group goes out at the top of the live ranges still wanting it, falling as it ages\n\t\t// past the ones above, so its stream ranks by its own policy. The ranges covering it are read\n\t\t// again each time it is ranked, so an update that adds a range over it, or re-adds its span\n\t\t// under a new Range ID, moves it, as the Rust `Steer::inflight` does.\n\t\tconst rankingOf = (group: group.Consumer): Ranking | undefined => {\n\t\t\tif (!hasRanges(this.version)) return undefined;\n\t\t\tconst expiry = hooks.groupExpiry(group);\n\t\t\t// The widest budget the group is known to have aged past, which only grows.\n\t\t\tlet aged: number | undefined;\n\t\t\treturn {\n\t\t\t\tpolicy: (whole) => {\n\t\t\t\t\tconst covers = hooks.servingCovering(track, group.start).map(([id]) => id);\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\tconst { policy, lasts } = groupPolicy({ whole, steering: rangeSteering }, covers, aged);\n\t\t\t\t\t\tif (lasts === undefined || !expiry?.aged?.(lasts)) return policy;\n\t\t\t\t\t\taged = lasts;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tchanged: expiry?.changed ?? [],\n\t\t\t};\n\t\t};\n\n\t\t// Every group this subscription started serving, until its stream finishes or resets.\n\t\tconst groups = new Set<Promise<void>>();\n\t\t// Bumped each time one of `groups` ends.\n\t\tconst groupEnded = new Signal(0);\n\t\tconst drops = new Signal(0);\n\t\t// Groups whose stream failed, with why, for the control stream to name, as runs: a group held\n\t\t// whole names its span.\n\t\tconst pendingDrops: { start: bigint; end: bigint; hole: QueuedHole }[] = [];\n\t\t// Lite-07: the starts inside whole groups' spans whose GROUP_END a reset may have cut, to name\n\t\t// again as a skip. Mirrors the Rust `GroupOutcomes::cut`.\n\t\tconst pendingCuts: Run[] = [];\n\n\t\t// Cancels groups still queued for a stream slot. Only the subscriber leaving counts:\n\t\t// a track that ran out of groups still has to flush the ones already queued, and the\n\t\t// caller FINs the subscribe stream to say so.\n\t\tlet finished = false;\n\t\t// Lite-07: the subscriber cleanly FIN'd its send half (no further updates).\n\t\tlet peerFin = false;\n\t\tlet armed: { woke: Promise<void>; dispose: Dispose } | undefined;\n\t\t// Park until the subscription changes, from the wait armed this pass if any.\n\t\tconst park = () => armed?.woke ?? waitForSubscription(controls, track, drops);\n\t\tlet unsubscribe!: () => void;\n\t\tconst unsubscribed = new Promise<void>((resolve) => {\n\t\t\tunsubscribe = resolve;\n\t\t});\n\t\t// Unlike `unsubscribed`, settles however the run ends: a group parked at a stop waits on an\n\t\t// update, which no longer comes.\n\t\tlet end!: () => void;\n\t\tconst ended = new Promise<void>((resolve) => {\n\t\t\tend = resolve;\n\t\t});\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tfor (const { start, end } of pendingCuts.splice(0)) {\n\t\t\t\t\trecord?.tell(start, end);\n\t\t\t\t\tif (!(await sendHole(start, end, skipHole()))) return false;\n\t\t\t\t}\n\t\t\t\tif (pendingDrops.length > 0) {\n\t\t\t\t\tfor (const { start, end, hole } of pendingDrops.splice(0)) {\n\t\t\t\t\t\t// The rest of the span is told with it; the served start keeps its record.\n\t\t\t\t\t\tfor (const gap of record?.untold(start, end) ?? []) record?.tell(gap.start, gap.end);\n\t\t\t\t\t\tif (!(await sendHole(start, end, hole))) return false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// While a range waits for its START, the wait below is armed before `reportStarted` reads\n\t\t\t\t// what this hop knows, so an answer landing while this pass awaits still wakes it.\n\t\t\t\tarmed?.dispose();\n\t\t\t\tarmed = unstarted.size > 0 ? armSubscription(controls, track, drops) : undefined;\n\t\t\t\tif (!(await reportStarted(false))) return false;\n\t\t\t\t// Control before data, matching the Rust publisher: every control decoded while\n\t\t\t\t// the loop was parked applies to the next pop, never to one already made. This\n\t\t\t\t// drain is synchronous, so nothing the decoder holds can land between the pop\n\t\t\t\t// below and its frame range.\n\t\t\t\tconst control = controls.take();\n\t\t\t\tif (control) {\n\t\t\t\t\tswitch (control.kind) {\n\t\t\t\t\t\tcase \"fin\":\n\t\t\t\t\t\t\tpeerFin = true;\n\t\t\t\t\t\t\t// Already finished and waiting for updates or FIN: close cleanly now.\n\t\t\t\t\t\t\tif (finished) return true;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase \"done\":\n\t\t\t\t\t\t\t// The subscriber left. Its queued groups are pointless now, which\n\t\t\t\t\t\t\t// the finally below acts on since `finished` stays false. On lite-07 it\n\t\t\t\t\t\t\t// also FINs once it read a finished track's tail, which ends the\n\t\t\t\t\t\t\t// subscription as finished.\n\t\t\t\t\t\t\treturn finished;\n\t\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\t\tthrow control.error;\n\t\t\t\t\t\tcase \"update\": {\n\t\t\t\t\t\t\t// An update may reach the finished track's history, so it is served again.\n\t\t\t\t\t\t\tfinished = false;\n\t\t\t\t\t\t\tconst update = control.update;\n\t\t\t\t\t\t\tif (hasRanges(this.version)) {\n\t\t\t\t\t\t\t\t// A range retired before its start resolved is owed no SUBSCRIBE_START.\n\t\t\t\t\t\t\t\tfor (const id of control.applied.retired) unstarted.delete(id);\n\t\t\t\t\t\t\t\tfor (const [id, range] of control.applied.added) unstarted.set(id, asked(range));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconsole.debug(`subscribe update: broadcast=${broadcast} track=${track.name}`);\n\t\t\t\t\t\t\t// `cursorFloor` pins an unfloored pre-06 SUBSCRIBE to the latest\n\t\t\t\t\t\t\t// group, so an update that drops a named floor re-pins there too. On\n\t\t\t\t\t\t\t// an empty track the next group is the latest, whatever its key.\n\t\t\t\t\t\t\t// Lite-06 encodes an absent start as no floor, so one that had a floor above\n\t\t\t\t\t\t\t// 0 drops back to 0: the cursor only rises on its own, and a finished group\n\t\t\t\t\t\t\t// below the old floor (a quiet catalog) is never served otherwise. One at 0\n\t\t\t\t\t\t\t// already keeps where delivery started, as the Rust `lower_floor` does.\n\t\t\t\t\t\t\tconst requested = bounds.startGroup;\n\t\t\t\t\t\t\tconst start = hasRanges(this.version)\n\t\t\t\t\t\t\t\t? 0n\n\t\t\t\t\t\t\t\t: update.startGroup === undefined &&\n\t\t\t\t\t\t\t\t\t\trequested !== undefined &&\n\t\t\t\t\t\t\t\t\t\t!resolvesStart(this.version)\n\t\t\t\t\t\t\t\t\t? (hooks.latestKey(track) ?? 0n)\n\t\t\t\t\t\t\t\t\t: (update.startGroup ??\n\t\t\t\t\t\t\t\t\t\t(resolvesStart(this.version) && requested !== undefined && requested > 0n\n\t\t\t\t\t\t\t\t\t\t\t? 0n\n\t\t\t\t\t\t\t\t\t\t\t: undefined));\n\t\t\t\t\t\t\tif (start !== undefined) {\n\t\t\t\t\t\t\t\tfloor = start;\n\t\t\t\t\t\t\t\t// Before SUBSCRIBE_START nothing is owed yet; the start accounts for it.\n\t\t\t\t\t\t\t\t// A lowered floor owes the groups it newly asks for, so the end sweep\n\t\t\t\t\t\t\t\t// covers them. A raised one sends no early drop: the subscriber already\n\t\t\t\t\t\t\t\t// stops owing below its floor, and a later update may lower it again to\n\t\t\t\t\t\t\t\t// ask for the groups the wire was told nothing of.\n\t\t\t\t\t\t\t\tlowerFrom(start);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// An update starts the walk of what is owed over: moving the cursor may leave keys\n\t\t\t\t\t\t\t// the walk passed untold again. The walk seeks past what is told, so going over it\n\t\t\t\t\t\t\t// again costs nothing there.\n\t\t\t\t\t\t\tscanned = { start: 0n, end: 0n };\n\t\t\t\t\t\t\t// Before lite-07, an update that names no start and changes the budget places delivery\n\t\t\t\t\t\t\t// afresh, which judges the history again. A rescan would name it gap by gap and group by\n\t\t\t\t\t\t\t// group, though the subscriber is owed none of it: a lite-06 track keyed by timestamp\n\t\t\t\t\t\t\t// holds a gap per group, thousands a minute. So the history below the first group the\n\t\t\t\t\t\t\t// budget reaches, and below where delivery started, goes out as one stale drop: only\n\t\t\t\t\t\t\t// what this copy vouches for, from where a join with no budget would start, since a\n\t\t\t\t\t\t\t// relay's copy below where its own feed starts may still receive the groups a wider\n\t\t\t\t\t\t\t// budget re-offers upstream, and the upstream's drops of the rest. Each group re-offered\n\t\t\t\t\t\t\t// lowers the start as it is served, owing the gaps between them. Mirrors the Rust\n\t\t\t\t\t\t\t// `TrackRun::name_history`.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tanswer.kind === \"started\" &&\n\t\t\t\t\t\t\t\tresolvesStart(this.version) &&\n\t\t\t\t\t\t\t\tupdate.startGroup === undefined &&\n\t\t\t\t\t\t\t\tupdate.maxDelay !== maxDelay\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst budget = update.maxDelay ?? NO_MAX_DELAY;\n\t\t\t\t\t\t\t\tconst cap = update.endGroup === undefined ? undefined : update.endGroup + 1n;\n\t\t\t\t\t\t\t\t// Nor at or past the first key a relay's copy has yet to account for, which its\n\t\t\t\t\t\t\t\t// upstream may still deliver (`joinStart` stops there).\n\t\t\t\t\t\t\t\tconst placed = min(\n\t\t\t\t\t\t\t\t\tmin(\n\t\t\t\t\t\t\t\t\t\thooks.freshStart(track, floor, budget, cap),\n\t\t\t\t\t\t\t\t\t\thooks.joinStart(track, floor, budget, true),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tanswer.from,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst vouched = hooks.joinStart(track, floor, NO_MAX_DELAY, true);\n\t\t\t\t\t\t\t\tif (vouched < placed) {\n\t\t\t\t\t\t\t\t\t// The scan leaves what it reached below the start untold, so it is named with\n\t\t\t\t\t\t\t\t\t// the rest and the drop is one run per stretch untold. The wire is told, so these\n\t\t\t\t\t\t\t\t\t// keys stay settled, as every drop leaves them.\n\t\t\t\t\t\t\t\t\tconst hole = staleHole(budget);\n\t\t\t\t\t\t\t\t\tfor (const gap of record?.untold(vouched, placed) ?? []) {\n\t\t\t\t\t\t\t\t\t\trecord?.tell(gap.start, gap.end);\n\t\t\t\t\t\t\t\t\t\tif (!(await sendHole(gap.start, gap.end, hole))) return false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmaxDelay = update.maxDelay;\n\t\t\t\t\t\t\tbounds.startGroup = update.startGroup;\n\t\t\t\t\t\t\tbounds.startFrame = update.startFrame;\n\t\t\t\t\t\t\tbounds.endGroup = update.endGroup;\n\t\t\t\t\t\t\tbounds.endFrame = update.endFrame;\n\t\t\t\t\t\t\tbounds.starts = bounds.startsAfter.get(update) ?? new Map();\n\t\t\t\t\t\t\tconst stops = bounds.stopsAfter.get(update);\n\t\t\t\t\t\t\tif (stops && !sameStops(stops, bounds.stops.peek())) bounds.stops.set(stops);\n\t\t\t\t\t\t\tmoveCursor();\n\t\t\t\t\t\t\t// A microtask is too short: decoding one framed update crosses several\n\t\t\t\t\t\t\t// awaits, each of which can requeue behind the serving continuation. A\n\t\t\t\t\t\t\t// task boundary usually lets the decoder finish whatever the transport\n\t\t\t\t\t\t\t// already delivered before the next group pop. It orders nothing: an update\n\t\t\t\t\t\t\t// decoded later applies from the pop after it. Updates are rare, so groups\n\t\t\t\t\t\t\t// do not pay this scheduling cost on the normal path.\n\t\t\t\t\t\t\tawait yieldNow();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// One step of what a lowered start owes per pass, after the controls, as the Rust\n\t\t\t\t// `poll_step` takes it: an update raising the start or moving the end applies before the\n\t\t\t\t// next step.\n\t\t\t\tconst owedRuns = nameOwed();\n\t\t\t\tif (owedRuns) {\n\t\t\t\t\tfor (const run of owedRuns) if (!(await sendHole(run.start, run.end, run))) return false;\n\t\t\t\t\t// A long walk over history with nothing to name lets the host's other work run.\n\t\t\t\t\tconst yielded = replayBudget.poll();\n\t\t\t\t\tif (yielded !== undefined) await yielded;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Exactly-once arrival-order serving. This synchronous package-internal pop\n\t\t\t\t// and frameRange call are the operation's linearization point.\n\t\t\t\t// Popping or filtering a group removes the subscriber's view of its edge.\n\t\t\t\t// A relay can hold just the first group of a backlog its source already\n\t\t\t\t// answered past, so the source's largest says where the live feed is.\n\t\t\t\tconst held = answer.kind === \"waiting\" ? answer.first : undefined;\n\t\t\t\tconst largest =\n\t\t\t\t\t(answer.kind === \"waiting\" || answer.kind === \"unresolved\") && hasLargest(this.version)\n\t\t\t\t\t\t? newer(held?.largest, newest())\n\t\t\t\t\t\t: undefined;\n\t\t\t\t// Lite-05/06 hold their first group until the source says where its feed starts (below);\n\t\t\t\t// lite-07 serves its groups meanwhile, so a range waiting on its start holds back no\n\t\t\t\t// other's, and resolves from the lowest it served once it can.\n\t\t\t\tif (answer.kind === \"unresolved\" && answer.served !== undefined) {\n\t\t\t\t\tconst resolved = await resolveServed(largest);\n\t\t\t\t\tif (resolved === false) return false;\n\t\t\t\t\tif (resolved) continue;\n\t\t\t\t}\n\t\t\t\tif (answer.kind === \"waiting\") answer.first = undefined;\n\t\t\t\tconst recv = held\n\t\t\t\t\t? ({ kind: \"group\", group: held.group } as const)\n\t\t\t\t\t: hooks.tryRecvGroup(track, emitRange);\n\t\t\t\tswitch (recv.kind) {\n\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\tthrow recv.error;\n\t\t\t\t\tcase \"drop\": {\n\t\t\t\t\t\t// Below where delivery starts, only a final run reaching up to it is named, as at the\n\t\t\t\t\t\t// join: one learned after the start resolved still tells the subscriber the start's\n\t\t\t\t\t\t// group has nothing before it. The rest stays untold until a start lowered to it owes\n\t\t\t\t\t\t// it, a stale one too, which a wider budget may still serve. Mirrors the Rust\n\t\t\t\t\t\t// `TrackRun::poll_forward_drop`.\n\t\t\t\t\t\tconst floor = dropFloor();\n\t\t\t\t\t\tlet start = recv.start;\n\t\t\t\t\t\tif (floor !== undefined && start < floor && (recv.end < floor || recv.maxAge !== undefined)) {\n\t\t\t\t\t\t\trecord?.untell(start, min(recv.end, floor));\n\t\t\t\t\t\t\tstart = min(floor, recv.end);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (start >= recv.end) continue;\n\t\t\t\t\t\tconst hole = snapshotHole(recv);\n\t\t\t\t\t\tif (answer.kind === \"waiting\" || answer.kind === \"unresolved\")\n\t\t\t\t\t\t\tholdSkipped(answer.skipped, start, recv.end, { ...hole, start, end: recv.end });\n\t\t\t\t\t\telse if (answer.kind !== \"legacy\" && !(await forward(start, recv.end, hole))) return false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"idle\":\n\t\t\t\t\t\t// A lite-07 window whose bounded ranges all resolved empty owes nothing: say so at\n\t\t\t\t\t\t// once, and the subscription ends as covered below. No group would ever answer it.\n\t\t\t\t\t\tif (answer.kind === \"unresolved\") {\n\t\t\t\t\t\t\tconst end = hooks.servingEnd(track);\n\t\t\t\t\t\t\tif (end !== undefined && hooks.servingRuns(track, 0n, end).length === 0) {\n\t\t\t\t\t\t\t\tif (!(await resolveStart(end, largest))) return false;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// A declared end goes out while lower groups are still being produced.\n\t\t\t\t\t\tif (!endSent && hooks.subscriberEnd(track) !== undefined) {\n\t\t\t\t\t\t\tif (!(await sendEnd())) return false;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Lite-07 keeps a covered subscription open for an update. One none of whose groups\n\t\t\t\t\t\t// can be served has no group to resolve its start: answer it now, as the Rust\n\t\t\t\t\t\t// publisher does, and the loop then names what it held back.\n\t\t\t\t\t\tif (answer.kind === \"unresolved\" && answer.served === undefined) {\n\t\t\t\t\t\t\tconst end = hooks.servingEnd(track);\n\t\t\t\t\t\t\tconst runs = end === undefined ? [] : hooks.servingRuns(track, 0n, end);\n\t\t\t\t\t\t\tconst given: Run[] = [];\n\t\t\t\t\t\t\tfor (const range of answer.skipped.all) insertRun(given, range.start, range.end);\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\truns.length > 0 &&\n\t\t\t\t\t\t\t\truns.every((run) => runGaps(given, run.start, run.end).length === 0)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (!(await resolveStart(runs[0].start, largest))) return false;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (answer.kind === \"unresolved\" && answer.served === undefined) {\n\t\t\t\t\t\t\tconst empty = await resolveEmpty();\n\t\t\t\t\t\t\tif (empty === false) return false;\n\t\t\t\t\t\t\tif (empty) continue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Lite-07 SUBSCRIBE + FIN: once every bounded range is resolved,\n\t\t\t\t\t\t// accounted for, and every group stream has finished, close cleanly.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tkeepsSubscribeOpen(this.version) &&\n\t\t\t\t\t\t\tpeerFin &&\n\t\t\t\t\t\t\trequested.end() !== undefined &&\n\t\t\t\t\t\t\tanswer.kind === \"answered\" &&\n\t\t\t\t\t\t\tunstarted.size === 0 &&\n\t\t\t\t\t\t\tgroups.size === 0 &&\n\t\t\t\t\t\t\tpendingDrops.length === 0 &&\n\t\t\t\t\t\t\tpendingCuts.length === 0 &&\n\t\t\t\t\t\t\trecord\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst end = hooks.servingEnd(track);\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tend !== undefined &&\n\t\t\t\t\t\t\t\thooks\n\t\t\t\t\t\t\t\t\t.servingRuns(track, 0n, end)\n\t\t\t\t\t\t\t\t\t.every((run) => record.untold(run.start, run.end).length === 0)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfinished = true;\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait park();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"boundary\":\n\t\t\t\t\t\t// The producer finished but is still holding groups above the cap.\n\t\t\t\t\t\t// Declare the boundary, then wait for an update to release them.\n\t\t\t\t\t\tif (!endSent) {\n\t\t\t\t\t\t\tif (!(await sendEnd())) return false;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tkeepsSubscribeOpen(this.version) &&\n\t\t\t\t\t\t\tpeerFin &&\n\t\t\t\t\t\t\trequested.end() !== undefined &&\n\t\t\t\t\t\t\tanswer.kind === \"answered\" &&\n\t\t\t\t\t\t\tunstarted.size === 0 &&\n\t\t\t\t\t\t\tgroups.size === 0 &&\n\t\t\t\t\t\t\tpendingDrops.length === 0 &&\n\t\t\t\t\t\t\tpendingCuts.length === 0 &&\n\t\t\t\t\t\t\trecord\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst end = hooks.servingEnd(track);\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tend !== undefined &&\n\t\t\t\t\t\t\t\thooks\n\t\t\t\t\t\t\t\t\t.servingRuns(track, 0n, end)\n\t\t\t\t\t\t\t\t\t.every((run) => record.untold(run.start, run.end).length === 0)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfinished = true;\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tawait park();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase \"done\": {\n\t\t\t\t\t\t// A relay's copy places a range only as its upstream would, so one its upstream has yet\n\t\t\t\t\t\t// to answer may start below every group held: nothing it owes is final until then.\n\t\t\t\t\t\tif (awaitsUpstream()) {\n\t\t\t\t\t\t\tawait park();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Lite-07 sends no FIN to say nothing was served, so a track that ended before\n\t\t\t\t\t\t// delivery resolved still says where it starts, at or below any group served; the\n\t\t\t\t\t\t// drops below then account for the rest. One that ended before its first group is\n\t\t\t\t\t\t// answered by its SUBSCRIBE_END at 0 alone.\n\t\t\t\t\t\tif (answer.kind === \"unresolved\") {\n\t\t\t\t\t\t\tconst fin = boundary();\n\t\t\t\t\t\t\tif (fin === 0n) answerEmpty();\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tconst first = hooks.servingRuns(track, 0n, fin)[0]?.start ?? fin;\n\t\t\t\t\t\t\t\tconst from = answer.served === undefined ? first : min(first, answer.served);\n\t\t\t\t\t\t\t\tif (!(await resolveStart(from, largest))) return false;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Nothing arrives to resolve a range still waiting on the live feed.\n\t\t\t\t\t\tif (!(await reportStarted(true))) return false;\n\t\t\t\t\t\t// Name every key from the start to the end this subscription never\n\t\t\t\t\t\t// got. A cap below the end bounds what the subscriber is owed, as on its side.\n\t\t\t\t\t\tconst from = answerFrom(answer);\n\t\t\t\t\t\tif (from !== undefined) {\n\t\t\t\t\t\t\t// A key the publisher declared skipped went out as a skip already; one\n\t\t\t\t\t\t\t// it never declared might have existed, so it is not found.\n\t\t\t\t\t\t\tconst unserved = dropHole();\n\t\t\t\t\t\t\t// Only the groups inside the ranges are owed.\n\t\t\t\t\t\t\tfor (const run of hooks.servingRuns(track, from, boundary())) {\n\t\t\t\t\t\t\t\tif (!(await drop(run.start, run.end, unserved))) return false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!endSent) {\n\t\t\t\t\t\t\tif (!(await sendEnd())) return false;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst drain = keepsSubscribeOpen(this.version) ? await drainedOrControl() : await drained();\n\t\t\t\t\t\tif (drain === undefined) continue;\n\t\t\t\t\t\tif (!drain) return false;\n\t\t\t\t\t\tif (pendingDrops.length > 0 || pendingCuts.length > 0) continue;\n\t\t\t\t\t\t// Lite-07 keeps the stream open past SUBSCRIBE_END until the subscriber FINs\n\t\t\t\t\t\t// (unless the subscriber already FIN'd a bounded SUBSCRIBE).\n\t\t\t\t\t\tif (keepsSubscribeOpen(this.version) && !peerFin) {\n\t\t\t\t\t\t\tfinished = true;\n\t\t\t\t\t\t\tif (!controls.pending()) await waitForControl(controls);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinished = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst group = recv.group;\n\t\t\t\t// Never a second stream for a key this subscription already accounted for (served,\n\t\t\t\t// sent as a datagram, or dropped, stale or not): a subscriber settles every drop for good,\n\t\t\t\t// and a reader wider than a stale one asks for the group with a request of its own.\n\t\t\t\tif (record?.told(group.start)) {\n\t\t\t\t\tgroup.close();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst range = frameRange(bounds, group.start);\n\n\t\t\t\tif (answer.kind === \"waiting\") {\n\t\t\t\t\t// A group stream can beat the upstream START on its own stream, and resolving\n\t\t\t\t\t// from the group alone would give up the backlog that START still promises.\n\t\t\t\t\tconst source = hooks.sourceStart(track);\n\t\t\t\t\tif (source === \"pending\") {\n\t\t\t\t\t\tanswer.first = { group, largest };\n\t\t\t\t\t\tawait park();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// A group given up, or held and not servable, cannot be where the feed starts. A\n\t\t\t\t\t// lite-06 live join with a bounded budget owes nothing that budget does not still\n\t\t\t\t\t// read, so it starts at the lowest group held unread, never where a relay's copy\n\t\t\t\t\t// started its feed, which would owe every drop above. An unbounded join reads all\n\t\t\t\t\t// the copy vouches for, so the feed start stands. Mirrors the Rust `TrackRun::start`.\n\t\t\t\t\tconst boundedJoin =\n\t\t\t\t\t\tresolvesStart(this.version) && bounds.startGroup === undefined && maxDelay !== null;\n\t\t\t\t\tconst from = hooks.deliveryStart(track, {\n\t\t\t\t\t\tfirst: group.start,\n\t\t\t\t\t\tsource: boundedJoin ? undefined : source,\n\t\t\t\t\t\tgivenUp: answer.skipped,\n\t\t\t\t\t});\n\t\t\t\t\t// A later group above an explicit floor is still delivered, so the cursor stays put.\n\t\t\t\t\t// A pre-06 subscribe that named no group is the exception: an absent\n\t\t\t\t\t// Group Start is the latest group, and this key becomes the floor.\n\t\t\t\t\t// Lite-06 encodes a floor of group 0 as 0, so an omitted start is not pinned.\n\t\t\t\t\tif (bounds.startGroup === undefined && !resolvesStart(this.version)) raiseFloor(from);\n\t\t\t\t\tif (!(await resolveStart(from, largest))) return false;\n\t\t\t\t} else if (answer.kind === \"unresolved\") {\n\t\t\t\t\tanswer.served = answer.served === undefined ? group.start : min(answer.served, group.start);\n\t\t\t\t\t// Resolved before the group goes out when the source already answered, so its START\n\t\t\t\t\t// leads the group's stream.\n\t\t\t\t\tif ((await resolveServed(largest)) === false) return false;\n\t\t\t\t}\n\t\t\t\t// A group a wider budget re-offers below the start starts delivery there.\n\t\t\t\tif (dropFloor() !== undefined) lowerFrom(group.start);\n\t\t\t\trecord?.tell(group.start, group.start + 1n);\n\t\t\t\tstreaming.add(group.start);\n\n\t\t\t\tlet atReset: { maxAge: number | undefined } | undefined;\n\t\t\t\tconst options: RunGroup = {\n\t\t\t\t\tsub,\n\t\t\t\t\tgroup,\n\t\t\t\t\tgivenUp: new GivenUp(group),\n\t\t\t\t\tstamp,\n\t\t\t\t\tcompress,\n\t\t\t\t\tmeta,\n\t\t\t\t\tpriority,\n\t\t\t\t\tranking: rankingOf(group),\n\t\t\t\t\tunsubscribed,\n\t\t\t\t\tstart: range.start,\n\t\t\t\t\tend: range.end,\n\t\t\t\t\tstops: hasRanges(this.version) ? { at: bounds.stops, ended } : undefined,\n\t\t\t\t\t// The starts inside a group sent whole are accounted for by its GROUP_END, so the\n\t\t\t\t\t// end-of-track scan never drops them.\n\t\t\t\t\tended: (end) => {\n\t\t\t\t\t\tif (end > group.start + 1n) record?.tell(group.start + 1n, end);\n\t\t\t\t\t},\n\t\t\t\t\tcut: (start, end) => {\n\t\t\t\t\t\tif (answer.kind === \"unresolved\" || answer.kind === \"withheld\")\n\t\t\t\t\t\t\tholdMaxAge(requested.narrowest());\n\t\t\t\t\t\tpendingCuts.push({ start, end });\n\t\t\t\t\t\tdrops.update((revision) => revision + 1);\n\t\t\t\t\t},\n\t\t\t\t\tresetting: () => {\n\t\t\t\t\t\tatReset ??= { maxAge: requested.narrowest() };\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\t// The FIN waits for every stream to finish or reset, including one that has not opened yet.\n\t\t\t\t// A stream reset to make room fails the group like any other reset, so it is dropped,\n\t\t\t\t// unless a lite-07 reset delivered its header, which accounts for the group.\n\t\t\t\tconst task = (async () => {\n\t\t\t\t\tconst writer = await this.#openGroup(options);\n\t\t\t\t\tlet failed: Error | undefined;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfailed = writer instanceof Error ? writer : await this.#serveGroup(writer, options);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\toptions.givenUp.close();\n\t\t\t\t\t\tstreaming.delete(group.start);\n\t\t\t\t\t}\n\t\t\t\t\tif (failed && emitRange) {\n\t\t\t\t\t\tconst end = max(group.end ?? group.start, group.start + 1n);\n\t\t\t\t\t\t// A group that went stale names the budget it was judged under, a superseded or skipped\n\t\t\t\t\t\t// one says so, and any other failure is dropped for this subscription alone.\n\t\t\t\t\t\tconst budget = group.staleUnder;\n\t\t\t\t\t\tconst hole = snapshotHole(budget === undefined ? holeOf(failed) : staleHole(budget), atReset);\n\t\t\t\t\t\tpendingDrops.push({ start: group.start, end, hole });\n\t\t\t\t\t\tdrops.update((revision) => revision + 1);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\tgroups.add(task);\n\t\t\t\tvoid task.finally(() => {\n\t\t\t\t\tgroups.delete(task);\n\t\t\t\t\tgroupEnded.update((ended) => ended + 1);\n\t\t\t\t\tif (groups.size === 0) drops.update((revision) => revision + 1);\n\t\t\t\t});\n\t\t\t}\n\t\t} finally {\n\t\t\tarmed?.dispose();\n\t\t\t// A group held for the upstream START has no one left to read it.\n\t\t\tif (answer.kind === \"waiting\") answer.first?.group.close();\n\t\t\tif (!finished) unsubscribe();\n\t\t\tend();\n\t\t\t// A lite-07 subscriber FINs once it read the finished track's tail, or once it wants\n\t\t\t// nothing more, even while a reply is still being written. Either way the groups still\n\t\t\t// waiting for a slot are cancelled, but an opened stream may be a final group whose FIN\n\t\t\t// is still being acknowledged, so a draining close still waits for it; a reader that\n\t\t\t// wants none of it resets it.\n\t\t\tif (keepsSubscribeOpen(this.version) && groups.size > 0)\n\t\t\t\tvoid this.owe(Promise.allSettled(groups).then(() => undefined));\n\t\t\tpriority.close();\n\t\t}\n\t}\n\n\t/**\n\t * Answers a TRACK stream (0x6) with a single TRACK_INFO, then FINs.\n\t *\n\t * The open stream is interest in the track, held until the requester closes its side,\n\t * so demand holds while the requester moves on to SUBSCRIBE. Only the reply is owed.\n\t *\n\t * @internal\n\t */\n\tasync runTrackInfo(msg: TrackMessage, stream: Stream) {\n\t\tconst hold = new AbortController();\n\t\t// Armed before the first check and held until the answer is acknowledged, so a grant\n\t\t// that shrinks while the answer is blocked on flow control resets it, never sends it.\n\t\tconst watch = this.#gate.watch(msg.broadcast, () => {\n\t\t\tconsole.debug(`track info revoked: broadcast=${msg.broadcast} track=${msg.track}`);\n\t\t\thold.abort();\n\t\t\tstream.writer.reset(unauthorized(msg.broadcast));\n\t\t});\n\t\tif (watch.revoked()) {\n\t\t\twatch.dispose();\n\t\t\thold.abort();\n\t\t\tstream.writer.reset(unauthorized(msg.broadcast));\n\t\t\treturn;\n\t\t}\n\t\t// Watched from the start, so a requester leaving while the reply is still blocked on\n\t\t// flow control lets go of the track too.\n\t\tvoid stream.reader.done().then(\n\t\t\t(fin) => {\n\t\t\t\thold.abort();\n\t\t\t\tif (fin) return;\n\t\t\t\t// TRACK is the requester's only message, so more breaks the session, as in Rust.\n\t\t\t\tconst violation = new ProtocolViolation(\"data after TRACK\");\n\t\t\t\tcloseViolation(this.#quic, violation);\n\t\t\t\tstream.abort(violation);\n\t\t\t},\n\t\t\t() => hold.abort(),\n\t\t);\n\t\ttry {\n\t\t\tconst front = await this.#resolve(msg, hold.signal);\n\t\t\tif (!front) throw new NotFound(`broadcast ${msg.broadcast}`);\n\n\t\t\tlet info: TrackInfoMessage;\n\t\t\tlet datagrams: datagram.Consumer | undefined;\n\t\t\ttry {\n\t\t\t\tinfo = await this.#resolveTrackInfo(front, msg.track, hold.signal);\n\t\t\t} catch (err) {\n\t\t\t\tif (\n\t\t\t\t\t!hasDatagrams(this.version) ||\n\t\t\t\t\thasDatagramTracks(this.version) ||\n\t\t\t\t\ttoStreamCode(error(err)) !== StreamCode.NotFound\n\t\t\t\t)\n\t\t\t\t\tthrow err;\n\t\t\t\tconst asked = front.datagrams(msg.track);\n\t\t\t\ttry {\n\t\t\t\t\tinfo = trackInfoMessage(\n\t\t\t\t\t\tdatagramTrackInfo(await untilAborted(asked.info(), hold.signal)),\n\t\t\t\t\t\tthis.version,\n\t\t\t\t\t);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tasked.close();\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tdatagrams = asked;\n\t\t\t}\n\t\t\t// Lite-05/06: the name's datagram track, read from this answer on, held for the\n\t\t\t// SUBSCRIBE alongside, beside a stream track too.\n\t\t\tif (hasDatagrams(this.version) && !hasDatagramTracks(this.version)) {\n\t\t\t\tdatagrams ??= wireOf(front).liveDatagrams(msg.track);\n\t\t\t}\n\t\t\tif (datagrams) this.#holdDatagrams(datagrams, hold.signal);\n\t\t\tif (watch.revoked()) throw unauthorized(msg.broadcast);\n\t\t\tawait info.encode(stream.writer, this.version);\n\t\t\tconsole.debug(`track info: broadcast=${msg.broadcast} track=${msg.track}`);\n\t\t\tstream.writer.close();\n\t\t\tawait acknowledged(stream.writer);\n\t\t} catch (err) {\n\t\t\thold.abort();\n\t\t\tconsole.debug(`track unknown: broadcast=${msg.broadcast} track=${msg.track}`);\n\t\t\tstream.writer.reset(servedError(error(err)));\n\t\t} finally {\n\t\t\twatch.dispose();\n\t\t}\n\t}\n\n\t/**\n\t * Answers a TRACKS stream (0x8): the broadcast's listed tracks, SYNCED, then each change,\n\t * until the broadcast ends (FIN) or a newer listing of it on this session replaces this one.\n\t *\n\t * Each listing queues the broadcast's whole listed set, so the session lists each broadcast\n\t * once: a newer listing replaces the older rather than being refused, since a subscriber\n\t * that stops listing and lists again can open the new stream before we see the old one\n\t * close. The requester's FIN or reset cancels it. Not owed: it lasts as long as the broadcast.\n\t *\n\t * @internal\n\t */\n\tasync runTracks(msg: TracksMessage, stream: Stream) {\n\t\tconst cancel = new AbortController();\n\t\tconst watch = this.#gate.watch(msg.broadcast, () => {\n\t\t\tconsole.debug(`tracks revoked: broadcast=${msg.broadcast}`);\n\t\t\tcancel.abort(unauthorized(msg.broadcast));\n\t\t});\n\t\t// TRACKS is the requester's only message: its FIN or reset ends the listing.\n\t\tvoid stream.reader.done().then(\n\t\t\t(fin) => {\n\t\t\t\tif (fin) {\n\t\t\t\t\tcancel.abort(new StreamError(StreamCode.Cancel, { message: \"listing cancelled\" }));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst violation = new ProtocolViolation(\"data after TRACKS\");\n\t\t\t\tcloseViolation(this.#quic, violation);\n\t\t\t\tcancel.abort(violation);\n\t\t\t},\n\t\t\t(err: unknown) => cancel.abort(error(err)),\n\t\t);\n\t\tlet tracks: broadcast.Tracks | undefined;\n\t\ttry {\n\t\t\tif (watch.revoked()) throw unauthorized(msg.broadcast);\n\t\t\tconst front = await this.#resolve(msg, cancel.signal);\n\t\t\tif (!front) throw new NotFound(`broadcast ${msg.broadcast}`);\n\n\t\t\ttracks = wireOf(front).tracks(this);\n\t\t\tconsole.debug(`tracks: broadcast=${msg.broadcast}`);\n\t\t\tfor (;;) {\n\t\t\t\t// Pull an event only once the last is written, so a stalled requester's changes\n\t\t\t\t// collapse in the listing's queue rather than pile up here.\n\t\t\t\tconst event = await untilAborted(tracks.next(), cancel.signal);\n\t\t\t\tif (!event) break;\n\t\t\t\tawait untilAborted(\n\t\t\t\t\tencodeTracksEvent(stream.writer, tracksEvent(event, this.version), this.version),\n\t\t\t\t\tcancel.signal,\n\t\t\t\t);\n\t\t\t}\n\t\t\tstream.writer.close();\n\t\t} catch (err) {\n\t\t\tconst e = cancel.signal.aborted ? error(cancel.signal.reason) : error(err);\n\t\t\tconsole.debug(`tracks end: broadcast=${msg.broadcast} error=${reason(e)}`);\n\t\t\tstream.writer.reset(servedError(e));\n\t\t} finally {\n\t\t\ttracks?.close();\n\t\t\twatch.dispose();\n\t\t}\n\t}\n\n\t// Hold `consumer`'s track from its position for the SUBSCRIBE alongside until `hold`\n\t// aborts, as a passive observer in place of `consumer`.\n\t#holdDatagrams(consumer: datagram.Consumer, hold: AbortSignal) {\n\t\tconst held = hooks.observeDatagramConsumer(consumer);\n\t\tconsumer.close();\n\t\tthis.#heldDatagrams.add(held);\n\t\tconst release = () => {\n\t\t\tthis.#heldDatagrams.delete(held);\n\t\t\theld.close();\n\t\t};\n\t\tif (hold.aborted) release();\n\t\telse hold.addEventListener(\"abort\", release, { once: true });\n\t}\n\n\t// `consumer`, or a clone of the oldest hold of the same track, read from that hold's answer on.\n\t// Several TRACKs of one track may be open, and the SUBSCRIBE could follow any of them, so it\n\t// reads from the earliest answer: a replay only duplicates, a later one would lose.\n\t#adopt(consumer: datagram.Consumer): datagram.Consumer {\n\t\tfor (const held of this.#heldDatagrams) {\n\t\t\tif (!hooks.datagramSameTrack(held, consumer)) continue;\n\t\t\tconsumer.close();\n\t\t\treturn held.clone();\n\t\t}\n\t\treturn consumer;\n\t}\n\n\t// Resolve (and cache) a track's immutable TRACK_INFO by asking the application.\n\t// `resolveTrackInfo` triggers a TrackRequest the app answers with accept(TrackInfo);\n\t// only the immutable properties are needed (not the groups). Cached because they're\n\t// fixed for the track's lifetime. Rejects if the track is unavailable, or once `hold`\n\t// aborts. Each requester holds the lookup until `hold` aborts, and the lookup ends with\n\t// its last holder, answered or not, so the next requester asks again.\n\t#resolveTrackInfo(front: broadcast.Consumer, track: string, hold: AbortSignal): Promise<TrackInfoMessage> {\n\t\thold.throwIfAborted();\n\t\tlet tracks = this.#trackInfo.get(front);\n\t\tif (!tracks) {\n\t\t\ttracks = new Map();\n\t\t\tthis.#trackInfo.set(front, tracks);\n\t\t}\n\n\t\tlet entry = tracks.get(track);\n\t\tif (!entry) {\n\t\t\tconst release = new AbortController();\n\t\t\tconst info = (async () =>\n\t\t\t\ttrackInfoMessage(await wireOf(front).resolveTrackInfo(track, release.signal), this.version))();\n\n\t\t\tconst created: TrackInfoEntry = { info, holders: 0, release };\n\t\t\t// Don't poison the cache on failure: a later request may succeed.\n\t\t\tinfo.catch(() => {\n\t\t\t\tif (tracks.get(track) === created) tracks.delete(track);\n\t\t\t});\n\t\t\ttracks.set(track, created);\n\t\t\tentry = created;\n\t\t}\n\n\t\tconst held = entry;\n\t\theld.holders++;\n\t\thold.addEventListener(\n\t\t\t\"abort\",\n\t\t\t() => {\n\t\t\t\tif (--held.holders > 0) return;\n\t\t\t\tif (tracks.get(track) === held) tracks.delete(track);\n\t\t\t\theld.release.abort();\n\t\t\t},\n\t\t\t{ once: true },\n\t\t);\n\t\treturn untilAborted(held.info, hold);\n\t}\n\n\t/** Serve a lite-07 datagram-track request until its publisher or subscriber ends it. */\n\tasync runDatagrams(msg: Datagrams, stream: Stream): Promise<void> {\n\t\tconst cancel = new AbortController();\n\t\tlet track: datagram.Consumer | undefined;\n\t\tconst watch = this.#gate.watch(msg.broadcast, () => cancel.abort(unauthorized(msg.broadcast)));\n\t\tlet updates: Promise<void> | undefined;\n\t\ttry {\n\t\t\tif (watch.revoked()) throw unauthorized(msg.broadcast);\n\t\t\tif (!this.#datagramWriter) throw new Error(\"transport does not support datagrams\");\n\t\t\t// Read updates from dispatch so a requester leaving releases even an unanswered lookup.\n\t\t\tupdates = (async () => {\n\t\t\t\tlet next = msg.priority;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst yielded = datagramBudget.poll();\n\t\t\t\t\tif (yielded !== undefined) await yielded;\n\t\t\t\t\tconst update = await DatagramsUpdate.decodeMaybe(stream.reader, this.version);\n\t\t\t\t\tif (!update) return;\n\t\t\t\t\tnext = update.priority;\n\t\t\t\t\tmsg.priority = next;\n\t\t\t\t\ttrack?.setPriority(next);\n\t\t\t\t}\n\t\t\t})();\n\t\t\tvoid updates.then(\n\t\t\t\t() => cancel.abort(new StreamError(StreamCode.Cancel)),\n\t\t\t\t(err) => {\n\t\t\t\t\tcloseViolation(this.#quic, err);\n\t\t\t\t\tcancel.abort(error(err));\n\t\t\t\t},\n\t\t\t);\n\t\t\tconst front = await this.#resolve(msg, cancel.signal);\n\t\t\tif (!front) throw new NotFound(`broadcast ${msg.broadcast}`);\n\t\t\ttrack = front.datagrams(msg.track);\n\t\t\ttrack.setPriority(msg.priority);\n\t\t\tconst info = await untilAborted(track.info(), cancel.signal);\n\t\t\tawait untilAborted(new DatagramsInfo(info).encode(stream.writer, this.version), cancel.signal);\n\t\t\tawait untilAborted(\n\t\t\t\tthis.#runDatagrams(track, { sub: msg.id, stamp: stamping(this.version, info) }),\n\t\t\t\tcancel.signal,\n\t\t\t);\n\t\t\tstream.writer.close();\n\t\t\tawait updates;\n\t\t} catch (err) {\n\t\t\t// Only the update reader's own errors close the session, above; the track's end here.\n\t\t\tstream.abort(error(err));\n\t\t} finally {\n\t\t\ttrack?.close();\n\t\t\twatch.dispose();\n\t\t\tstream.reader.stop(StreamCode.Cancel);\n\t\t\tawait updates?.catch(() => {});\n\t\t}\n\t}\n\n\t// Lite-05/06: a name with no stream track serves its datagram track alone.\n\tasync #serveLegacyDatagrams(\n\t\tfront: broadcast.Consumer,\n\t\tmsg: Subscribe,\n\t\tstream: Stream,\n\t\tsignal: AbortSignal,\n\t): Promise<void> {\n\t\tconst track = this.#adopt(front.datagrams(msg.track));\n\t\ttrack.setPriority(msg.priority);\n\t\tconst sent = new DatagramEnd();\n\t\tconst updates = (async () => {\n\t\t\tfor (;;) {\n\t\t\t\tconst yielded = datagramBudget.poll();\n\t\t\t\tif (yielded !== undefined) await yielded;\n\t\t\t\tconst update = await SubscribeUpdate.decodeMaybe(stream.reader, this.version);\n\t\t\t\tif (!update) return;\n\t\t\t\ttrack.setPriority(update.priority);\n\t\t\t}\n\t\t})();\n\t\tvoid updates.then(\n\t\t\t() => track.close(),\n\t\t\t(err) => {\n\t\t\t\tcloseViolation(this.#quic, err);\n\t\t\t\ttrack.close(error(err));\n\t\t\t},\n\t\t);\n\t\ttry {\n\t\t\tconst info = await untilAborted(track.info(), signal);\n\t\t\tawait encodeSubscribeResponse(\n\t\t\t\tstream.writer,\n\t\t\t\t{ start: new SubscribeStart({ id: 0n, start: 0n, largest: \"unknown\" }) },\n\t\t\t\tthis.version,\n\t\t\t);\n\t\t\tawait untilAborted(\n\t\t\t\tthis.#runDatagrams(track, { sub: msg.id, stamp: stamping(this.version, info), sent }),\n\t\t\t\tsignal,\n\t\t\t);\n\t\t\t// No stream track holds groups below the end, so every key is dropped, and the subscriber\n\t\t\t// settles without its tail grace.\n\t\t\tconst settled = sent.settle(0n);\n\t\t\tif (settled.span) {\n\t\t\t\tconst [from, to] = settled.span;\n\t\t\t\tconst drop = new SubscribeDrop({ start: from, end: to });\n\t\t\t\tawait encodeSubscribeResponse(stream.writer, { drop }, this.version);\n\t\t\t}\n\t\t\tawait encodeSubscribeResponse(stream.writer, { end: new SubscribeEnd(settled.end) }, this.version);\n\t\t\tstream.writer.close();\n\t\t\tawait updates;\n\t\t} finally {\n\t\t\ttrack.close();\n\t\t\tstream.reader.stop(StreamCode.Cancel);\n\t\t\tawait updates.catch(() => {});\n\t\t}\n\t}\n\n\t// Shared by dedicated lite-07 requests and the old SUBSCRIBE carry-both mapping.\n\tasync #runDatagrams(\n\t\ttrack: datagram.Consumer,\n\t\toptions: { sub: bigint; stamp?: Stamp; priority?: Getter<number>; sent?: DatagramEnd },\n\t): Promise<void> {\n\t\tif (!this.#datagramWriter) throw new Error(\"transport does not support datagrams\");\n\t\tconst info = await track.info();\n\t\tconst priority = options.priority ?? hooks.datagramPriority(track);\n\t\tconst rank = () => sendOrder({ priority: priority.peek(), publisher: info.priority });\n\t\tconst sender = this.#datagramWriter.open(rank());\n\t\tconst dispose = priority.subscribe(() => sender.setPriority(rank()));\n\t\tconst left = hooks.datagramClosed(track);\n\t\tconst { writer } = sender;\n\t\tconst maxSize = Math.min(DatagramMessage.MAX_SIZE, DatagramStream.maxDatagramSize(this.#quic));\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tconst next = await hooks.recvDatagramWire(track);\n\t\t\t\tif (!next) return;\n\t\t\t\tconst { datagram, wire } = next;\n\t\t\t\t// The key before any rescaling, so datagrams a microsecond apart keep distinct\n\t\t\t\t// sequences on a version that carries one.\n\t\t\t\tconst sequence = wire ?? BigInt(datagram.timestamp.value);\n\t\t\t\t// An old subscription uses its stream track's timescale for both kinds. Without one\n\t\t\t\t// the track is a scale-less lite-07 one, whose timestamp goes out bare.\n\t\t\t\tconst timestamp = wireTime(datagram.timestamp, options.stamp ?? {});\n\t\t\t\tconst body = new DatagramMessage(\n\t\t\t\t\toptions.sub,\n\t\t\t\t\thasDatagramTracks(this.version) ? undefined : sequence,\n\t\t\t\t\ttimestamp,\n\t\t\t\t\tdatagram.payload,\n\t\t\t\t).encode(this.version);\n\t\t\t\tif (body.byteLength > maxSize) {\n\t\t\t\t\tconsole.debug(\n\t\t\t\t\t\t`dropping oversize datagram: sub=${options.sub} size=${body.byteLength} max=${maxSize}`,\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// The legacy writer is shared, so another request's write can hold back this one:\n\t\t\t\t// stop waiting once this request ends, and send nothing after it does.\n\t\t\t\t// Raced directly, so a ready writer drops its close listener rather than keep one per send.\n\t\t\t\tawait race([writer.ready, left]);\n\t\t\t\t// As recv() does: a clean close ends the request, an error close fails it.\n\t\t\t\tconst reason = left.peek();\n\t\t\t\tif (reason !== undefined) {\n\t\t\t\t\tif (reason) throw reason;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Counted as it is handed over, since the end may settle while the write is pending.\n\t\t\t\tif (!hasDatagramTracks(this.version)) options.sent?.record(sequence);\n\t\t\t\tawait writer.write(body);\n\t\t\t}\n\t\t} finally {\n\t\t\tdispose();\n\t\t\tawait sender.close();\n\t\t}\n\t}\n\n\t/**\n\t * Opens the unidirectional stream for one group, or closes the group and resolves\n\t * an error when it cannot get one.\n\t *\n\t * @internal\n\t */\n\tasync #openGroup(options: RunGroup): Promise<Writer | Error> {\n\t\tconst { group, givenUp, priority, ranking, unsubscribed, start } = options;\n\t\ttry {\n\t\t\t// The transport drains streams by send order, and opens wait for stream credit in\n\t\t\t// it, so this is what makes a high-priority track (and a newer group within it) win\n\t\t\t// the link and the peer's credit when there isn't room for both. The place ranks the\n\t\t\t// open against the subscription's other groups while it waits.\n\t\t\t// Watch the group while the open waits, and release that watch once it settles.\n\t\t\tconst place = priority.reserve(group.start, start, ranking);\n\t\t\tconst opened = Promise.withResolvers<void>();\n\t\t\tlet failure: Error | undefined;\n\t\t\tconst abandoned = givenUp\n\t\t\t\t.write(() => opened.promise)\n\t\t\t\t.then((stop) => {\n\t\t\t\t\tfailure = stop;\n\t\t\t\t});\n\t\t\tlet stream: Writer | undefined;\n\t\t\ttry {\n\t\t\t\tstream = await Writer.tryOpen(this.#quic, {\n\t\t\t\t\tversion: this.version,\n\t\t\t\t\tsendOrder: place.rank,\n\t\t\t\t\tcancel: race([unsubscribed, abandoned]),\n\t\t\t\t\tgroup: true,\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\topened.resolve();\n\t\t\t\tplace.release();\n\t\t\t}\n\t\t\tif (!stream) {\n\t\t\t\tconst failed = failure ?? new Error(\"unsubscribed while waiting for a stream\");\n\t\t\t\thooks.releaseGroupReader(group, failed);\n\t\t\t\treturn failed;\n\t\t\t}\n\t\t\treturn stream;\n\t\t} catch (err: unknown) {\n\t\t\tconst failed = error(err);\n\t\t\thooks.releaseGroupReader(group, failed);\n\t\t\treturn failed;\n\t\t}\n\t}\n\n\t/**\n\t * Serves one group on the stream {@link #openGroup} opened for it, resolving the error a\n\t * SUBSCRIBE_DROP names it with, or undefined when the stream accounts for the group.\n\t *\n\t * @internal\n\t */\n\tasync #serveGroup(stream: Writer, options: RunGroup) {\n\t\tconst {\n\t\t\tsub,\n\t\t\tgroup,\n\t\t\tgivenUp,\n\t\t\tstamp,\n\t\t\tcompress,\n\t\t\tpriority,\n\t\t\tranking,\n\t\t\tstart: startFrame,\n\t\t\tend: endFrame,\n\t\t\tstops,\n\t\t} = options;\n\t\t// The header names the requested position, so a copy missing it must be refused.\n\t\tconst msg = new GroupMessage({ subscribe: sub, key: group.start, frameStart: startFrame });\n\t\t// The subscription's budget, or an eviction of what is left to read, may give up on the\n\t\t// group mid-write, which abandons the stream. A group already given up never starts the write.\n\t\tconst write = async (op: () => Promise<unknown>) => {\n\t\t\tconst stop = await givenUp.write(op);\n\t\t\tif (stop) throw stop;\n\t\t};\n\t\t// Lite-07: the transport took the whole GROUP header, which every later reset still delivers.\n\t\tlet held = false;\n\t\t// Lite-07: the end of the span a buffered GROUP_END accounted for.\n\t\tlet spanEnd: bigint | undefined;\n\t\t// Everything past this point runs inside the cleanup scope, so a failure never leaves\n\t\t// a finished group's stream being ranked.\n\t\ttry {\n\t\t\tif (hooks.groupIndex(group) > startFrame) throw new Error(`group lacks frame ${startFrame}`);\n\t\t\t// A SUBSCRIBE_UPDATE re-ranks the subscription, so a group already on the wire\n\t\t\t// follows it too rather than keeping a stale rank until it finishes.\n\t\t\tpriority.add(stream, group.start, startFrame, ranking);\n\n\t\t\tawait write(async () => {\n\t\t\t\tawait stream.u53(0); // stream type\n\t\t\t\tawait msg.encode(stream, this.version);\n\t\t\t});\n\t\t\tif (hasReliableReset(this.version)) held = stream.hold();\n\n\t\t\t// Lite-07 omits frame 0's delta, since the group starts at it, counts a later stream's first\n\t\t\t// delta from the group's start, and GROUP_END from the last timestamp sent.\n\t\t\tlet prevTs = hasGroupEnd(this.version) ? group.start : 0n;\n\t\t\tlet implicit = startFrame === 0;\n\t\t\t// Whether the cursor ever reached the requested start, which decides how the\n\t\t\t// end of the group is read below. A received tail may already begin there.\n\t\t\tlet reached = hooks.groupIndex(group) === startFrame;\n\t\t\t// Whether every frame went out, which a finished group's GROUP_END then claims.\n\t\t\tlet whole = false;\n\n\t\t\t// Kept across loop iterations so waking on a Position End change never starts a\n\t\t\t// second concurrent readGroupFrame(), and stream.closed is derived lazily once\n\t\t\t// the first read starts (avoiding unhandled rejections if a cap breaks early).\n\t\t\tlet pendingRead: ReturnType<typeof hooks.readGroupFrame> | undefined;\n\t\t\tlet closed: Promise<undefined> | undefined;\n\t\t\tconst stopWake = Symbol(\"stop-wake\");\n\t\t\t// Track the next unsent frame index separately from `hooks.groupIndex(group)`,\n\t\t\t// which an in-flight `pendingRead` may advance before its frame is consumed.\n\t\t\tlet nextUnsent = Math.max(hooks.groupIndex(group), startFrame);\n\n\t\t\tfor (;;) {\n\t\t\t\t// Lite-07: reaching a Position end closes the stream cleanly without GROUP_END\n\t\t\t\t// (a slice, not the whole group) instead of parking open. If the group itself\n\t\t\t\t// already finished at or before `nextUnsent`, let the read below observe EOF so\n\t\t\t\t// GROUP_END is still sent.\n\t\t\t\tconst stopBefore = stops?.at.peek().get(group.start);\n\t\t\t\tconst settled = hooks.groupSettledFrames(group);\n\t\t\t\tif (\n\t\t\t\t\t((stopBefore !== undefined && nextUnsent >= stopBefore) ||\n\t\t\t\t\t\t(endFrame !== undefined && nextUnsent > endFrame)) &&\n\t\t\t\t\t(settled === undefined || settled > nextUnsent)\n\t\t\t\t) {\n\t\t\t\t\tpendingRead?.catch(() => {});\n\t\t\t\t\tclosed?.catch(() => {});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpendingRead ??= hooks.readGroupFrame(group, compress, 0, options.meta);\n\t\t\t\tclosed ??= stream.closed.then(() => undefined);\n\t\t\t\tlet disposeStop: Dispose | undefined;\n\t\t\t\tlet outcome: Awaited<ReturnType<typeof hooks.readGroupFrame>> | undefined | typeof stopWake;\n\t\t\t\ttry {\n\t\t\t\t\tif (stops) {\n\t\t\t\t\t\tconst moved = new Promise<typeof stopWake>((resolve) => {\n\t\t\t\t\t\t\tdisposeStop = stops.at.changed(() => resolve(stopWake));\n\t\t\t\t\t\t});\n\t\t\t\t\t\toutcome = await race([pendingRead, closed, moved]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutcome = await race([pendingRead, closed]);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tdisposeStop?.();\n\t\t\t\t}\n\t\t\t\tif (outcome === stopWake) continue;\n\t\t\t\tpendingRead = undefined;\n\t\t\t\tconst read = outcome;\n\t\t\t\tif (!read) {\n\t\t\t\t\t// The group ended before the frame the subscriber asked to start\n\t\t\t\t\t// at, so this publisher can't serve the range at all. FINning here\n\t\t\t\t\t// would claim an empty group under that index; reset so it reads\n\t\t\t\t\t// as the gap it is.\n\t\t\t\t\tif (!reached) throw new Error(`group ended before frame ${startFrame}`);\n\t\t\t\t\twhole = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// A group that ends exactly at the start is a valid, empty range.\n\t\t\t\tif (read.index + 1 >= startFrame) reached = true;\n\t\t\t\t// Frames below the requested start were excluded, and the receiver\n\t\t\t\t// numbers what it gets from `startFrame`.\n\t\t\t\tif (read.index < startFrame) {\n\t\t\t\t\tnextUnsent = Math.max(nextUnsent, read.index + 1);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst stop = stops?.at.peek().get(group.start);\n\t\t\t\tif ((endFrame !== undefined && read.index > endFrame) || (stop !== undefined && read.index >= stop)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnextUnsent = read.index + 1;\n\n\t\t\t\tlet delta: bigint | undefined;\n\t\t\t\tif (stamp !== undefined) {\n\t\t\t\t\t// Convert each frame to the track's wire timescale.\n\t\t\t\t\tconst ts = wireTime(read.frame.timestamp, stamp);\n\t\t\t\t\tdelta = ts - prevTs;\n\t\t\t\t\tprevTs = ts;\n\t\t\t\t}\n\n\t\t\t\tconst header = options.meta\n\t\t\t\t\t? frameHeader(stream.version, delta, undefined, read.inflated ?? readSize(read), true, implicit)\n\t\t\t\t\t: frameHeader(\n\t\t\t\t\t\t\tstream.version,\n\t\t\t\t\t\t\tdelta,\n\t\t\t\t\t\t\tread.inflated,\n\t\t\t\t\t\t\treadSize(read),\n\t\t\t\t\t\t\thasLengthFirst(this.version),\n\t\t\t\t\t\t\timplicit,\n\t\t\t\t\t\t);\n\t\t\t\timplicit = false;\n\t\t\t\t// A metadata FRAME is its header: the frame's bytes are never read, so nothing waits for them.\n\t\t\t\tconst chunks = options.meta ? undefined : read.chunks;\n\t\t\t\tconst payload = options.meta || chunks ? undefined : read.frame.payload;\n\t\t\t\t// One budget race covers the frame's header and payload.\n\t\t\t\tawait write(async () => {\n\t\t\t\t\tawait stream.write(header);\n\t\t\t\t\tif (chunks) await sendPayload(chunks, (chunk) => stream.write(chunk), stream.closed);\n\t\t\t\t\telse if (payload && payload.length > 0) await stream.write(payload);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Lite-07 ends a finished group with GROUP_END, after one frame at least on a stream from\n\t\t\t// frame 0, since a group starts at its first frame.\n\t\t\tconst end = hasGroupEnd(this.version) && whole && !(implicit && startFrame === 0) ? group.end : undefined;\n\t\t\tif (end !== undefined) {\n\t\t\t\toptions.ended?.(end);\n\t\t\t\tspanEnd = end;\n\t\t\t\tawait write(() => stream.write(groupEnd(stream.version, end, prevTs)));\n\t\t\t}\n\t\t\tstream.close();\n\t\t\tgroup.close();\n\t\t\t// A stream that fails after its FIN may have lost its header, so report it for a DROP,\n\t\t\t// unless a lite-07 reset still delivers it. Its bytes still hold the connection until\n\t\t\t// acknowledged, so a group gone stale meanwhile is reset like one still serving, as the\n\t\t\t// Rust `GroupServe` does: stale bytes must not fill the send window ahead of the streams\n\t\t\t// behind them.\n\t\t\tawait write(() => stream.closed);\n\t\t\treturn undefined;\n\t\t} catch (err: unknown) {\n\t\t\tconst e = servedError(error(err));\n\t\t\toptions.resetting?.();\n\t\t\tstream.reset(e);\n\t\t\thooks.releaseGroupReader(group, e);\n\t\t\tif (hasReliableReset(this.version) && (await accounts(stream, held))) {\n\t\t\t\t// The reset may cut the GROUP_END, so the starts it accounted for are named again.\n\t\t\t\tif (spanEnd !== undefined && spanEnd > group.start + 1n) options.cut?.(group.start + 1n, spanEnd);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn e;\n\t\t} finally {\n\t\t\tpriority.remove(stream);\n\t\t}\n\t}\n\n\t/**\n\t * Handles a probe stream by periodically reporting estimated bitrate.\n\t * @param stream - The probe bidi stream\n\t *\n\t * @internal\n\t */\n\tasync runProbe(stream: Stream) {\n\t\tconst getStats = statsOf(this.#quic);\n\t\tif (!getStats) {\n\t\t\t// Best-effort: we can't supply bandwidth estimates, so close the\n\t\t\t// whole bidi (FIN + STOP_SENDING) to let the peer release its end.\n\t\t\tstream.close();\n\t\t\treturn;\n\t\t}\n\n\t\tlet lastSent: Probe | undefined;\n\t\tlet lastSentTime: Instant | undefined;\n\n\t\t// Whether a metric moved enough to be worth another report. Gaining or\n\t\t// losing a value always counts; both unknown never does.\n\t\tconst moved = (prev?: number, next?: number, threshold = 0): boolean => {\n\t\t\tif (prev === undefined && next === undefined) return false;\n\t\t\tif (prev === undefined || next === undefined) return true;\n\t\t\tif (prev === 0) return next !== 0;\n\t\t\treturn Math.abs(next - prev) / prev >= threshold;\n\t\t};\n\n\t\tconst ended = new Once<Error | null>();\n\t\tconst reading = (async () => {\n\t\t\t// Report ignores target values, but must consume them to observe the FIN.\n\t\t\twhile (await Probe.decodeMaybe(stream.reader, this.version)) {}\n\t\t})().then(\n\t\t\t() => ended.set(null),\n\t\t\t(err: unknown) => {\n\t\t\t\tcloseViolation(this.#quic, err);\n\t\t\t\tended.set(error(err));\n\t\t\t},\n\t\t);\n\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tconst timer = new AbortController();\n\t\t\t\tconst timeout = sleep(Duration.millis(PROBE_INTERVAL), { signal: timer.signal }).then(\n\t\t\t\t\t() => \"timeout\" as const,\n\t\t\t\t\t() => \"timeout\" as const,\n\t\t\t\t);\n\t\t\t\tlet result: \"timeout\" | Error | null;\n\t\t\t\ttry {\n\t\t\t\t\tresult = await race([timeout, ended]);\n\t\t\t\t} finally {\n\t\t\t\t\ttimer.abort();\n\t\t\t\t}\n\t\t\t\tif (result instanceof Error) throw result;\n\t\t\t\tif (result !== \"timeout\") break;\n\n\t\t\t\t// The two fields are independent on the wire, each using 0 for\n\t\t\t\t// unknown, so a transport exposing only one still has something to\n\t\t\t\t// report. Anything this version can't carry is dropped here rather\n\t\t\t\t// than by the encoder, so it reads as unknown to every check below.\n\t\t\t\tconst stats = await getStats();\n\t\t\t\t// `smoothedRtt` is a DOMHighResTimeStamp, i.e. a double, but the wire\n\t\t\t\t// carries whole milliseconds and the varint encoder throws on a\n\t\t\t\t// fractional value. Round before it ever reaches `Probe`.\n\t\t\t\tconst rtt = stats.smoothedRtt != null ? Math.round(stats.smoothedRtt) : undefined;\n\t\t\t\tconst report = new Probe({\n\t\t\t\t\tbitrate: probeBitrate(stats.estimatedSendRate),\n\t\t\t\t\trtt: hasProbeRtt(this.version) ? rtt : undefined,\n\t\t\t\t});\n\n\t\t\t\t// Nothing left to report. Say so once if it retracts a value the peer\n\t\t\t\t// is still holding, then stay quiet rather than repeating \"unknown\"\n\t\t\t\t// every time the max age comes around.\n\t\t\t\tif (report.bitrate === undefined && report.rtt === undefined) {\n\t\t\t\t\tconst retracts =\n\t\t\t\t\t\tlastSent !== undefined && (lastSent.bitrate !== undefined || lastSent.rtt !== undefined);\n\t\t\t\t\tif (!retracts) continue;\n\t\t\t\t}\n\n\t\t\t\tlet shouldSend: boolean;\n\t\t\t\tif (lastSent === undefined || lastSentTime === undefined) {\n\t\t\t\t\tshouldSend = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst elapsed = now().since(lastSentTime).asMillis();\n\t\t\t\t\t// The bitrate threshold decays to zero as the last report ages: a\n\t\t\t\t\t// stale estimate is worth refreshing for a smaller move.\n\t\t\t\t\tconst t = Math.max(PROBE_INTERVAL, Math.min(PROBE_MAX_AGE, elapsed));\n\t\t\t\t\tconst range = PROBE_MAX_AGE - PROBE_INTERVAL;\n\t\t\t\t\tconst threshold = (PROBE_MAX_DELTA * (PROBE_MAX_AGE - t)) / range;\n\t\t\t\t\tshouldSend =\n\t\t\t\t\t\telapsed >= PROBE_MAX_AGE ||\n\t\t\t\t\t\tmoved(lastSent.bitrate, report.bitrate, threshold) ||\n\t\t\t\t\t\tmoved(lastSent.rtt, report.rtt, PROBE_RTT_DELTA);\n\t\t\t\t}\n\n\t\t\t\tif (shouldSend) {\n\t\t\t\t\tawait report.encode(stream.writer, this.version);\n\t\t\t\t\tlastSent = report;\n\t\t\t\t\tlastSentTime = now();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err: unknown) {\n\t\t\tcloseViolation(this.#quic, err);\n\t\t\tconsole.warn(\"probe stream error\", err);\n\t\t} finally {\n\t\t\tstream.close();\n\t\t\tawait reading;\n\t\t}\n\t}\n\n\t/**\n\t * Close the session when our origin publishes a broadcast our grant does not cover;\n\t * see {@link enforceGrant}.\n\t *\n\t * @internal\n\t */\n\tasync runEnforce(setupAnswered: Promise<void>, auth?: AuthSession): Promise<void> {\n\t\tif (!this.#grant) return;\n\t\tawait enforceGrant({ quic: this.#quic, advertised: this.#advertised, grant: this.#grant, setupAnswered, auth });\n\t}\n\n\t/**\n\t * Owes the peer `task`, a served SUBSCRIBE, DATAGRAMS, or TRACK request, until it ends.\n\t *\n\t * @internal\n\t */\n\towe(task: Promise<void>): Promise<void> {\n\t\tconst tracked = task.finally(() => this.#owed.delete(tracked));\n\t\tthis.#owed.add(tracked);\n\t\treturn tracked;\n\t}\n\n\t/**\n\t * Withdraws announcements and waits for every owed request to end, including any that\n\t * arrive meanwhile. Rejects if a withdrawal failed; an owed request ends either way.\n\t *\n\t * @internal\n\t */\n\tasync drain(): Promise<void> {\n\t\tconst [withdrawn] = await Promise.allSettled([\n\t\t\t// Lite-07: the stream finishes once every route on it is ended, which says this side is leaving.\n\t\t\tthis.#withdrawal.close().then(async () => {\n\t\t\t\tif (hasRoutes(this.version)) await AnnounceStream.of(this.#quic, this.version).finish();\n\t\t\t}),\n\t\t]);\n\t\t// Only after the withdrawals, so a request that arrived while they were in flight is\n\t\t// waited for too. Owed requests run on their own meanwhile, so this adds no delay.\n\t\twhile (this.#owed.size > 0) await Promise.allSettled(this.#owed);\n\t\tif (withdrawn.status === \"rejected\") throw withdrawn.reason;\n\t}\n\n\tclose() {\n\t\t// The broadcasts belong to the origin, which outlives this session; closing here\n\t\t// only drops the borrow. The peer sees the unannounce when the streams die.\n\t\tthis.#answer?.close();\n\n\t\t// Release the datagram writer's lock so the stream can be torn down.\n\t\tthis.#datagramWriter?.close();\n\t\tthis.#datagramWriter = undefined;\n\t}\n}\n"]}