@norskvideo/moq-net 0.1.8 → 0.2.1

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 (286) hide show
  1. package/README.md +2 -2
  2. package/announce.d.ts +7 -0
  3. package/announce.d.ts.map +1 -0
  4. package/announce.js +8 -0
  5. package/announce.js.map +1 -0
  6. package/announced.d.ts +49 -91
  7. package/announced.d.ts.map +1 -1
  8. package/announced.js +21 -156
  9. package/announced.js.map +1 -1
  10. package/bandwidth.d.ts +163 -0
  11. package/bandwidth.d.ts.map +1 -0
  12. package/bandwidth.js +304 -0
  13. package/bandwidth.js.map +1 -0
  14. package/bandwidth_api.d.ts +7 -0
  15. package/bandwidth_api.d.ts.map +1 -0
  16. package/bandwidth_api.js +8 -0
  17. package/bandwidth_api.js.map +1 -0
  18. package/broadcast.d.ts +44 -35
  19. package/broadcast.d.ts.map +1 -1
  20. package/broadcast.js +104 -60
  21. package/broadcast.js.map +1 -1
  22. package/connection/accept.d.ts +16 -1
  23. package/connection/accept.d.ts.map +1 -1
  24. package/connection/accept.js +52 -28
  25. package/connection/accept.js.map +1 -1
  26. package/connection/browser.d.ts.map +1 -1
  27. package/connection/browser.js +9 -7
  28. package/connection/browser.js.map +1 -1
  29. package/connection/connect.d.ts +30 -6
  30. package/connection/connect.d.ts.map +1 -1
  31. package/connection/connect.js +110 -54
  32. package/connection/connect.js.map +1 -1
  33. package/connection/established.d.ts +17 -21
  34. package/connection/established.d.ts.map +1 -1
  35. package/connection/established.js.map +1 -1
  36. package/connection/forward.d.ts +2 -0
  37. package/connection/forward.d.ts.map +1 -0
  38. package/connection/forward.js +173 -0
  39. package/connection/forward.js.map +1 -0
  40. package/connection/handshake.d.ts +1 -0
  41. package/connection/handshake.d.ts.map +1 -1
  42. package/connection/handshake.js +5 -2
  43. package/connection/handshake.js.map +1 -1
  44. package/connection/index.d.ts +5 -5
  45. package/connection/index.d.ts.map +1 -1
  46. package/connection/index.js +4 -5
  47. package/connection/index.js.map +1 -1
  48. package/connection/pool.d.ts +186 -0
  49. package/connection/pool.d.ts.map +1 -0
  50. package/connection/pool.js +361 -0
  51. package/connection/pool.js.map +1 -0
  52. package/connection/reload.d.ts +14 -93
  53. package/connection/reload.d.ts.map +1 -1
  54. package/connection/reload.js +217 -81
  55. package/connection/reload.js.map +1 -1
  56. package/connection/stats.d.ts +3 -26
  57. package/connection/stats.d.ts.map +1 -1
  58. package/connection/stats.js.map +1 -1
  59. package/connection/transport.d.ts +0 -7
  60. package/connection/transport.d.ts.map +1 -1
  61. package/consume.d.ts +1 -43
  62. package/consume.d.ts.map +1 -1
  63. package/consume.js +1 -1
  64. package/consume.js.map +1 -1
  65. package/error.d.ts +180 -29
  66. package/error.d.ts.map +1 -1
  67. package/error.js +331 -16
  68. package/error.js.map +1 -1
  69. package/errors.d.ts +7 -0
  70. package/errors.d.ts.map +1 -0
  71. package/errors.js +8 -0
  72. package/errors.js.map +1 -0
  73. package/group.d.ts +9 -43
  74. package/group.d.ts.map +1 -1
  75. package/group.js +284 -69
  76. package/group.js.map +1 -1
  77. package/hop.d.ts +115 -0
  78. package/hop.d.ts.map +1 -0
  79. package/hop.js +119 -0
  80. package/hop.js.map +1 -0
  81. package/ietf/adapter.d.ts +5 -1
  82. package/ietf/adapter.d.ts.map +1 -1
  83. package/ietf/adapter.js +105 -60
  84. package/ietf/adapter.js.map +1 -1
  85. package/ietf/aliases.d.ts +1 -78
  86. package/ietf/aliases.d.ts.map +1 -1
  87. package/ietf/cluster.d.ts +9 -123
  88. package/ietf/cluster.d.ts.map +1 -1
  89. package/ietf/cluster.js +84 -44
  90. package/ietf/cluster.js.map +1 -1
  91. package/ietf/connection.d.ts +6 -72
  92. package/ietf/connection.d.ts.map +1 -1
  93. package/ietf/connection.js +62 -56
  94. package/ietf/connection.js.map +1 -1
  95. package/ietf/error.d.ts +11 -0
  96. package/ietf/error.d.ts.map +1 -0
  97. package/ietf/error.js +193 -0
  98. package/ietf/error.js.map +1 -0
  99. package/ietf/fetch.d.ts +7 -20
  100. package/ietf/fetch.d.ts.map +1 -1
  101. package/ietf/fetch.js +52 -22
  102. package/ietf/fetch.js.map +1 -1
  103. package/ietf/filter.d.ts +2 -0
  104. package/ietf/filter.d.ts.map +1 -1
  105. package/ietf/filter.js +10 -1
  106. package/ietf/filter.js.map +1 -1
  107. package/ietf/goaway.d.ts.map +1 -1
  108. package/ietf/goaway.js +22 -5
  109. package/ietf/goaway.js.map +1 -1
  110. package/ietf/hidden.d.ts +2 -0
  111. package/ietf/hidden.d.ts.map +1 -0
  112. package/ietf/hidden.js +30 -0
  113. package/ietf/hidden.js.map +1 -0
  114. package/ietf/index.d.ts +2 -0
  115. package/ietf/index.d.ts.map +1 -1
  116. package/ietf/index.js +2 -0
  117. package/ietf/index.js.map +1 -1
  118. package/ietf/object.d.ts +15 -8
  119. package/ietf/object.d.ts.map +1 -1
  120. package/ietf/object.js +51 -36
  121. package/ietf/object.js.map +1 -1
  122. package/ietf/parameters.d.ts +14 -2
  123. package/ietf/parameters.d.ts.map +1 -1
  124. package/ietf/parameters.js +97 -29
  125. package/ietf/parameters.js.map +1 -1
  126. package/ietf/properties.d.ts +1 -0
  127. package/ietf/properties.d.ts.map +1 -1
  128. package/ietf/properties.js +14 -0
  129. package/ietf/properties.js.map +1 -1
  130. package/ietf/publish.d.ts +19 -2
  131. package/ietf/publish.d.ts.map +1 -1
  132. package/ietf/publish.js +40 -6
  133. package/ietf/publish.js.map +1 -1
  134. package/ietf/publish_namespace.d.ts +25 -0
  135. package/ietf/publish_namespace.d.ts.map +1 -1
  136. package/ietf/publish_namespace.js +63 -0
  137. package/ietf/publish_namespace.js.map +1 -1
  138. package/ietf/publisher.d.ts +1 -82
  139. package/ietf/publisher.d.ts.map +1 -1
  140. package/ietf/publisher.js +483 -235
  141. package/ietf/publisher.js.map +1 -1
  142. package/ietf/solicit.d.ts +1 -40
  143. package/ietf/solicit.d.ts.map +1 -1
  144. package/ietf/subscribe.d.ts +8 -6
  145. package/ietf/subscribe.d.ts.map +1 -1
  146. package/ietf/subscribe.js +33 -27
  147. package/ietf/subscribe.js.map +1 -1
  148. package/ietf/subscribe_namespace.d.ts +8 -2
  149. package/ietf/subscribe_namespace.d.ts.map +1 -1
  150. package/ietf/subscribe_namespace.js +18 -8
  151. package/ietf/subscribe_namespace.js.map +1 -1
  152. package/ietf/subscriber.d.ts +1 -65
  153. package/ietf/subscriber.d.ts.map +1 -1
  154. package/ietf/subscriber.js +337 -123
  155. package/ietf/subscriber.js.map +1 -1
  156. package/ietf/token.d.ts +2 -0
  157. package/ietf/token.d.ts.map +1 -0
  158. package/ietf/token.js +99 -0
  159. package/ietf/token.js.map +1 -0
  160. package/ietf/track.d.ts +4 -0
  161. package/ietf/track.d.ts.map +1 -1
  162. package/ietf/track.js +6 -20
  163. package/ietf/track.js.map +1 -1
  164. package/ietf/version.d.ts +12 -1
  165. package/ietf/version.d.ts.map +1 -1
  166. package/ietf/version.js +13 -0
  167. package/ietf/version.js.map +1 -1
  168. package/index.d.ts +12 -7
  169. package/index.d.ts.map +1 -1
  170. package/index.js +10 -5
  171. package/index.js.map +1 -1
  172. package/internal.d.ts +115 -1
  173. package/internal.d.ts.map +1 -1
  174. package/internal.js +108 -0
  175. package/internal.js.map +1 -1
  176. package/lite/announce.d.ts +60 -10
  177. package/lite/announce.d.ts.map +1 -1
  178. package/lite/announce.js +176 -31
  179. package/lite/announce.js.map +1 -1
  180. package/lite/connection.d.ts +9 -59
  181. package/lite/connection.d.ts.map +1 -1
  182. package/lite/connection.js +34 -35
  183. package/lite/connection.js.map +1 -1
  184. package/lite/datagram.d.ts +3 -2
  185. package/lite/datagram.d.ts.map +1 -1
  186. package/lite/datagram.js +7 -8
  187. package/lite/datagram.js.map +1 -1
  188. package/lite/fetch.d.ts +15 -1
  189. package/lite/fetch.d.ts.map +1 -1
  190. package/lite/fetch.js +39 -7
  191. package/lite/fetch.js.map +1 -1
  192. package/lite/goaway.d.ts.map +1 -1
  193. package/lite/goaway.js +7 -1
  194. package/lite/goaway.js.map +1 -1
  195. package/lite/group.d.ts +30 -12
  196. package/lite/group.d.ts.map +1 -1
  197. package/lite/group.js +68 -26
  198. package/lite/group.js.map +1 -1
  199. package/lite/message.d.ts +2 -2
  200. package/lite/message.d.ts.map +1 -1
  201. package/lite/message.js +14 -5
  202. package/lite/message.js.map +1 -1
  203. package/lite/priority.d.ts +1 -61
  204. package/lite/priority.d.ts.map +1 -1
  205. package/lite/priority.js +4 -5
  206. package/lite/priority.js.map +1 -1
  207. package/lite/publisher.d.ts +1 -69
  208. package/lite/publisher.d.ts.map +1 -1
  209. package/lite/publisher.js +630 -262
  210. package/lite/publisher.js.map +1 -1
  211. package/lite/setup.d.ts +8 -8
  212. package/lite/setup.d.ts.map +1 -1
  213. package/lite/setup.js +33 -30
  214. package/lite/setup.js.map +1 -1
  215. package/lite/subscribe.d.ts +71 -17
  216. package/lite/subscribe.d.ts.map +1 -1
  217. package/lite/subscribe.js +205 -53
  218. package/lite/subscribe.js.map +1 -1
  219. package/lite/subscriber.d.ts +15 -56
  220. package/lite/subscriber.d.ts.map +1 -1
  221. package/lite/subscriber.js +451 -247
  222. package/lite/subscriber.js.map +1 -1
  223. package/lite/track.d.ts +4 -10
  224. package/lite/track.d.ts.map +1 -1
  225. package/lite/track.js +34 -29
  226. package/lite/track.js.map +1 -1
  227. package/lite/version.d.ts +42 -6
  228. package/lite/version.d.ts.map +1 -1
  229. package/lite/version.js +126 -10
  230. package/lite/version.js.map +1 -1
  231. package/origin.d.ts +256 -29
  232. package/origin.d.ts.map +1 -1
  233. package/origin.js +1427 -37
  234. package/origin.js.map +1 -1
  235. package/package.json +8 -3
  236. package/path.d.ts +25 -7
  237. package/path.d.ts.map +1 -1
  238. package/path.js +5 -3
  239. package/path.js.map +1 -1
  240. package/stream.d.ts +73 -14
  241. package/stream.d.ts.map +1 -1
  242. package/stream.js +372 -141
  243. package/stream.js.map +1 -1
  244. package/tail.d.ts +18 -0
  245. package/tail.d.ts.map +1 -0
  246. package/tail.js +167 -0
  247. package/tail.js.map +1 -0
  248. package/time.d.ts +15 -2
  249. package/time.d.ts.map +1 -1
  250. package/time.js +28 -9
  251. package/time.js.map +1 -1
  252. package/track.d.ts +211 -83
  253. package/track.d.ts.map +1 -1
  254. package/track.js +816 -205
  255. package/track.js.map +1 -1
  256. package/util/abort.d.ts +2 -0
  257. package/util/abort.d.ts.map +1 -0
  258. package/util/abort.js +20 -0
  259. package/util/abort.js.map +1 -0
  260. package/util/log.d.ts +5 -0
  261. package/util/log.d.ts.map +1 -0
  262. package/util/log.js +17 -0
  263. package/util/log.js.map +1 -0
  264. package/util/u64.d.ts +39 -0
  265. package/util/u64.d.ts.map +1 -0
  266. package/util/u64.js +83 -0
  267. package/util/u64.js.map +1 -0
  268. package/util/varint.d.ts +29 -0
  269. package/util/varint.d.ts.map +1 -0
  270. package/util/varint.js +198 -0
  271. package/util/varint.js.map +1 -0
  272. package/varint.d.ts +10 -6
  273. package/varint.d.ts.map +1 -1
  274. package/varint.js +40 -237
  275. package/varint.js.map +1 -1
  276. package/wire.d.ts +80 -0
  277. package/wire.d.ts.map +1 -0
  278. package/wire.js +32 -0
  279. package/wire.js.map +1 -0
  280. package/zod.d.ts +1 -1
  281. package/zod.d.ts.map +1 -1
  282. package/zod.js.map +1 -1
  283. package/mock.d.ts +0 -66
  284. package/mock.d.ts.map +0 -1
  285. package/mock.js +0 -243
  286. package/mock.js.map +0 -1
package/lite/version.d.ts CHANGED
@@ -5,6 +5,7 @@ export declare const Version: {
5
5
  readonly DRAFT_04: 4279086340;
6
6
  readonly DRAFT_05: 4279086341;
7
7
  readonly DRAFT_06: 4279086342;
8
+ readonly DRAFT_07: 4279086343;
8
9
  };
9
10
  export type Version = (typeof Version)[keyof typeof Version];
10
11
  /**
@@ -27,7 +28,7 @@ export declare function restartSupported(version: Version): boolean;
27
28
  * path. Added in lite-06. */
28
29
  export declare function hasAnnounceId(version: Version): boolean;
29
30
  /** Whether ANNOUNCE_REQUEST carries the Exclude Hop field: the subscriber's own
30
- * origin id, which the publisher uses to skip announces whose hop chain already
31
+ * Hop ID, which the publisher uses to skip announces whose hop chain already
31
32
  * passed through the subscriber. Present in lite-04 and lite-05 only.
32
33
  *
33
34
  * The receiver's own reflected-announce check drops those announces anyway (and
@@ -37,15 +38,50 @@ export declare function hasAnnounceId(version: Version): boolean;
37
38
  * Unlike the gates above, this lists the versions that *have* the field: it was
38
39
  * removed rather than added, so future versions default to not carrying it. */
39
40
  export declare function hasExcludeHop(version: Version): boolean;
40
- /** Whether announcements carry a route cost varint alongside the hop chain: the
41
- * marginal cost of pulling the broadcast via this route, accumulated per link.
42
- * Added in lite-06. Older versions carry nothing, so a received route stays at
43
- * zero and routing falls back to the hop-count tie-break. */
41
+ /** Whether announcements carry the route cost varints alongside the hop chain: the
42
+ * warm and cold cost of pulling the broadcast via this route, accumulated per link.
43
+ * Added in lite-06. Older versions carry neither, so a received route has no cost
44
+ * at all and routing falls back to the hop-count tie-break. */
44
45
  export declare function hasRouteCost(version: Version): boolean;
46
+ /** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, FETCH, and GROUP carry frame indices alongside
47
+ * their group sequences, so a subscription or fetch can start and end partway through a
48
+ * group. Added in lite-06. Older versions only address whole groups, so a route change
49
+ * has to wait for the next group before it can resume.
50
+ *
51
+ * SUBSCRIBE_OK is deliberately not in that list: the resolved start frame follows from
52
+ * its group plus the subscriber's own request, so it needs no frame field. */
53
+ export declare function hasFrameBounds(version: Version): boolean;
54
+ /** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_OK, and TRACK_INFO carry the retired
55
+ * `Ordered` byte.
56
+ *
57
+ * The field is gone from the model: a publisher transmits newest-first within a track,
58
+ * always. Deployed drafts still have the byte in their layout, so it is written as 0 and
59
+ * ignored on read rather than shifting every field behind it. */
60
+ export declare function hasGroupOrder(version: Version): boolean;
61
+ /**
62
+ * Whether SUBSCRIBE's `Group Start` is an absolute floor the publisher resolves a start
63
+ * from: the raw minimum group sequence (default 0), with `Subscriber Max Age` as the only
64
+ * gate on how far back delivery begins. Changed in lite-06.
65
+ *
66
+ * Older versions encode `Group Start` as the sequence + 1, with 0 meaning the latest
67
+ * group, so an absent start there pins the cursor to the live edge instead of letting the
68
+ * budget reach back.
69
+ */
70
+ export declare function resolvesStart(version: Version): boolean;
71
+ /** Whether ANNOUNCE_REQUEST carries the hidden opt-in. Added in lite-07. */
72
+ export declare function hasHidden(version: Version): boolean;
73
+ /**
74
+ * Whether SUBSCRIBE_END carries the subscription's group stream count, sent once every
75
+ * counted stream is open, in place of SUBSCRIBE_DROP. Added in lite-07.
76
+ */
77
+ export declare function hasStreamCount(version: Version): boolean;
78
+ /** Whether ANNOUNCE_START and ANNOUNCE_UPDATE may copy a path head or hop-chain tail from a live announcement. Added in lite-07. */
79
+ export declare function hasAnnounceCompression(version: Version): boolean;
45
80
  export declare const ALPN = "moql";
46
81
  export declare const ALPN_03 = "moq-lite-03";
47
82
  export declare const ALPN_04 = "moq-lite-04";
48
83
  export declare const ALPN_05 = "moq-lite-05";
49
- export declare const ALPN_06_WIP = "moq-lite-06-wip";
84
+ export declare const ALPN_06 = "moq-lite-06";
85
+ export declare const ALPN_07_WIP = "moq-lite-07-wip";
50
86
  export declare function versionName(v: Version): string;
51
87
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/lite/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;aACnB,QAAQ,EAAE,UAAU;aACpB,QAAQ,EAAE,UAAU;aACpB,QAAQ,EAAE,UAAU;aACpB,QAAQ,EAAE,UAAU;aACpB,QAAQ,EAAE,UAAU;aAIpB,QAAQ,EAAE,UAAU;CACX,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,WAAW,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AAO,MAAM,OAAO,gBAAgB,CAAC;AAKrC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAY7C,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE9C"}
package/lite/version.js CHANGED
@@ -5,10 +5,14 @@ export const Version = {
5
5
  DRAFT_03: 0xff0dad03,
6
6
  DRAFT_04: 0xff0dad04,
7
7
  DRAFT_05: 0xff0dad05,
8
- /// Work-in-progress lite-06, advertised as the preferred WebTransport subprotocol.
8
+ /// Lite-06, advertised as the preferred WebTransport subprotocol.
9
9
  /// Adds announce ids: each active ANNOUNCE_BROADCAST implicitly assigns the next
10
10
  /// ordinal, and ended/restart reference that id instead of repeating the path.
11
+ /// Also adds frame-precise subscribe/fetch bounds and a GROUP frame offset.
11
12
  DRAFT_06: 0xff0dad06,
13
+ /// Work-in-progress lite-07, only negotiated when explicitly offered.
14
+ /// Adds the ANNOUNCE_REQUEST hidden opt-in.
15
+ DRAFT_07: 0xff0dad07,
12
16
  };
13
17
  /**
14
18
  * Whether the PROBE message carries the RTT field.
@@ -101,7 +105,7 @@ export function hasAnnounceId(version) {
101
105
  }
102
106
  }
103
107
  /** Whether ANNOUNCE_REQUEST carries the Exclude Hop field: the subscriber's own
104
- * origin id, which the publisher uses to skip announces whose hop chain already
108
+ * Hop ID, which the publisher uses to skip announces whose hop chain already
105
109
  * passed through the subscriber. Present in lite-04 and lite-05 only.
106
110
  *
107
111
  * The receiver's own reflected-announce check drops those announces anyway (and
@@ -119,10 +123,10 @@ export function hasExcludeHop(version) {
119
123
  return false;
120
124
  }
121
125
  }
122
- /** Whether announcements carry a route cost varint alongside the hop chain: the
123
- * marginal cost of pulling the broadcast via this route, accumulated per link.
124
- * Added in lite-06. Older versions carry nothing, so a received route stays at
125
- * zero and routing falls back to the hop-count tie-break. */
126
+ /** Whether announcements carry the route cost varints alongside the hop chain: the
127
+ * warm and cold cost of pulling the broadcast via this route, accumulated per link.
128
+ * Added in lite-06. Older versions carry neither, so a received route has no cost
129
+ * at all and routing falls back to the hop-count tie-break. */
126
130
  export function hasRouteCost(version) {
127
131
  // Explicitly list older versions so future versions keep the lite-06+ behavior.
128
132
  switch (version) {
@@ -136,6 +140,115 @@ export function hasRouteCost(version) {
136
140
  return true;
137
141
  }
138
142
  }
143
+ /** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, FETCH, and GROUP carry frame indices alongside
144
+ * their group sequences, so a subscription or fetch can start and end partway through a
145
+ * group. Added in lite-06. Older versions only address whole groups, so a route change
146
+ * has to wait for the next group before it can resume.
147
+ *
148
+ * SUBSCRIBE_OK is deliberately not in that list: the resolved start frame follows from
149
+ * its group plus the subscriber's own request, so it needs no frame field. */
150
+ export function hasFrameBounds(version) {
151
+ // Explicitly list older versions so future versions keep the lite-06+ behavior.
152
+ switch (version) {
153
+ case Version.DRAFT_01:
154
+ case Version.DRAFT_02:
155
+ case Version.DRAFT_03:
156
+ case Version.DRAFT_04:
157
+ case Version.DRAFT_05:
158
+ return false;
159
+ default:
160
+ return true;
161
+ }
162
+ }
163
+ /** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_OK, and TRACK_INFO carry the retired
164
+ * `Ordered` byte.
165
+ *
166
+ * The field is gone from the model: a publisher transmits newest-first within a track,
167
+ * always. Deployed drafts still have the byte in their layout, so it is written as 0 and
168
+ * ignored on read rather than shifting every field behind it. */
169
+ export function hasGroupOrder(version) {
170
+ // Explicitly list older versions so future versions keep the lite-06+ behavior.
171
+ switch (version) {
172
+ case Version.DRAFT_01:
173
+ case Version.DRAFT_02:
174
+ case Version.DRAFT_03:
175
+ case Version.DRAFT_04:
176
+ case Version.DRAFT_05:
177
+ return true;
178
+ default:
179
+ return false;
180
+ }
181
+ }
182
+ /**
183
+ * Whether SUBSCRIBE's `Group Start` is an absolute floor the publisher resolves a start
184
+ * from: the raw minimum group sequence (default 0), with `Subscriber Max Age` as the only
185
+ * gate on how far back delivery begins. Changed in lite-06.
186
+ *
187
+ * Older versions encode `Group Start` as the sequence + 1, with 0 meaning the latest
188
+ * group, so an absent start there pins the cursor to the live edge instead of letting the
189
+ * budget reach back.
190
+ */
191
+ export function resolvesStart(version) {
192
+ // Explicitly list older versions so future versions keep the lite-06+ behavior.
193
+ switch (version) {
194
+ case Version.DRAFT_01:
195
+ case Version.DRAFT_02:
196
+ case Version.DRAFT_03:
197
+ case Version.DRAFT_04:
198
+ case Version.DRAFT_05:
199
+ return false;
200
+ default:
201
+ return true;
202
+ }
203
+ }
204
+ /** Whether ANNOUNCE_REQUEST carries the hidden opt-in. Added in lite-07. */
205
+ export function hasHidden(version) {
206
+ // Explicitly list older versions so future versions keep the lite-07+ behavior.
207
+ switch (version) {
208
+ case Version.DRAFT_01:
209
+ case Version.DRAFT_02:
210
+ case Version.DRAFT_03:
211
+ case Version.DRAFT_04:
212
+ case Version.DRAFT_05:
213
+ case Version.DRAFT_06:
214
+ return false;
215
+ default:
216
+ return true;
217
+ }
218
+ }
219
+ /**
220
+ * Whether SUBSCRIBE_END carries the subscription's group stream count, sent once every
221
+ * counted stream is open, in place of SUBSCRIBE_DROP. Added in lite-07.
222
+ */
223
+ export function hasStreamCount(version) {
224
+ // Explicitly list older versions so future versions keep the lite-07+ behavior.
225
+ switch (version) {
226
+ case Version.DRAFT_01:
227
+ case Version.DRAFT_02:
228
+ case Version.DRAFT_03:
229
+ case Version.DRAFT_04:
230
+ case Version.DRAFT_05:
231
+ case Version.DRAFT_06:
232
+ return false;
233
+ default:
234
+ return true;
235
+ }
236
+ }
237
+ /** Whether ANNOUNCE_START and ANNOUNCE_UPDATE may copy a path head or hop-chain tail from a live announcement. Added in lite-07. */
238
+ export function hasAnnounceCompression(version) {
239
+ // Explicitly list older versions so future versions keep the lite-07+ behavior.
240
+ switch (version) {
241
+ case Version.DRAFT_01:
242
+ case Version.DRAFT_02:
243
+ case Version.DRAFT_03:
244
+ case Version.DRAFT_04:
245
+ case Version.DRAFT_05:
246
+ case Version.DRAFT_06:
247
+ return false;
248
+ default:
249
+ return true;
250
+ }
251
+ }
139
252
  /// The WebTransport subprotocol identifier for moq-lite.
140
253
  /// Version negotiation still happens via SETUP when this is used.
141
254
  export const ALPN = "moql";
@@ -145,17 +258,20 @@ export const ALPN_03 = "moq-lite-03";
145
258
  export const ALPN_04 = "moq-lite-04";
146
259
  /// The ALPN string for Draft05, which uses ALPN-based version negotiation.
147
260
  export const ALPN_05 = "moq-lite-05";
148
- /// The ALPN string for the work-in-progress Draft06. It is NOT in the default
149
- /// WebTransport `protocols` list, so lite-06 is never advertised or negotiated by
261
+ /// The ALPN string for Draft06.
262
+ export const ALPN_06 = "moq-lite-06";
263
+ /// The ALPN string for the work-in-progress Draft07. It is NOT in the default
264
+ /// WebTransport `protocols` list, so lite-07 is never advertised or negotiated by
150
265
  /// default; a peer only reaches it when both sides explicitly offer this ALPN.
151
- export const ALPN_06_WIP = "moq-lite-06-wip";
266
+ export const ALPN_07_WIP = "moq-lite-07-wip";
152
267
  const VERSION_NAMES = {
153
268
  [Version.DRAFT_01]: "moq-lite-01",
154
269
  [Version.DRAFT_02]: "moq-lite-02",
155
270
  [Version.DRAFT_03]: "moq-lite-03",
156
271
  [Version.DRAFT_04]: "moq-lite-04",
157
272
  [Version.DRAFT_05]: "moq-lite-05",
158
- [Version.DRAFT_06]: "moq-lite-06-wip",
273
+ [Version.DRAFT_06]: "moq-lite-06",
274
+ [Version.DRAFT_07]: "moq-lite-07-wip",
159
275
  };
160
276
  export function versionName(v) {
161
277
  return VERSION_NAMES[v] ?? `unknown(0x${v.toString(16)})`;
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/lite/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,mFAAmF;IACnF,iFAAiF;IAC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Q,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ;YACpB,OAAO,KAAK,CAAC;QACd;YACC,OAAO,IAAI,CAAC;IACd,CAAC;AACF,CAAC;AAED,yDAAyD;AACzD,kEAAkE;AAClE,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,8EAA8E;AAC9E,kFAAkF;AAClF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE7C,MAAM,aAAa,GAA2B;IAC7C,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,iBAAiB;CACrC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,CAAU;IACrC,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;AAC3D,CAAC","sourcesContent":["export const Version = {\n\tDRAFT_01: 0xff0dad01,\n\tDRAFT_02: 0xff0dad02,\n\tDRAFT_03: 0xff0dad03,\n\tDRAFT_04: 0xff0dad04,\n\tDRAFT_05: 0xff0dad05,\n\t/// Work-in-progress lite-06, advertised as the preferred WebTransport subprotocol.\n\t/// Adds announce ids: each active ANNOUNCE_BROADCAST implicitly assigns the next\n\t/// ordinal, and ended/restart reference that id instead of repeating the path.\n\tDRAFT_06: 0xff0dad06,\n} as const;\n\nexport type Version = (typeof Version)[keyof typeof Version];\n\n/**\n * Whether the PROBE message carries the RTT field.\n *\n * Added in lite-04. Lite-03 carries the bitrate alone, so a report with only an RTT to\n * give says nothing there and must not be sent.\n */\nexport function hasProbeRtt(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to carrying RTT.\n\tswitch (version) {\n\t\tcase Version.DRAFT_01:\n\t\tcase Version.DRAFT_02:\n\t\tcase Version.DRAFT_03:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/// Whether the session opens a unidirectional Setup Stream carrying a single SETUP message\n/// (capabilities + optional Path). Added in lite-05; older drafts have no Setup Stream.\nexport function hasSetupStream(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to having the stream.\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/// Whether the session may deliver groups over unreliable QUIC datagrams (lite-05 §6.4).\n/// A datagram carries one single-frame group's `subscribe | sequence | timestamp | payload` and is\n/// routed over the existing subscription. Added in lite-05; older versions never send/accept them.\nexport function hasDatagrams(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to having datagrams.\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/** Whether announce streams begin with ANNOUNCE_OK and omit the sender's origin from each hop chain. */\nexport function hasAnnounceOk(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-05+ announce behavior.\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/** Whether the version can replace an advertisement in place rather than retracting and\n * re-announcing it. Added in lite-05 as a duplicate ANNOUNCE; lite-06 gave it a message of\n * its own (ANNOUNCE_UPDATE) and made the duplicate a violation. */\nexport function restartSupported(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to supported.\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/** Whether announcements carry implicit announce ids: each `active` assigns the next\n * per-stream ordinal, and `ended`/`restart` reference that id instead of repeating the\n * path. Added in lite-06. */\nexport function hasAnnounceId(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ announce behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/** Whether ANNOUNCE_REQUEST carries the Exclude Hop field: the subscriber's own\n * origin id, which the publisher uses to skip announces whose hop chain already\n * passed through the subscriber. Present in lite-04 and lite-05 only.\n *\n * The receiver's own reflected-announce check drops those announces anyway (and\n * catches loops of any length, not just the two-hop case), so lite-06 drops the\n * field and keeps the check.\n *\n * Unlike the gates above, this lists the versions that *have* the field: it was\n * removed rather than added, so future versions default to not carrying it. */\nexport function hasExcludeHop(version: Version): boolean {\n\tswitch (version) {\n\t\tcase Version.DRAFT_04:\n\t\tcase Version.DRAFT_05:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\n/** Whether announcements carry a route cost varint alongside the hop chain: the\n * marginal cost of pulling the broadcast via this route, accumulated per link.\n * Added in lite-06. Older versions carry nothing, so a received route stays at\n * zero and routing falls back to the hop-count tie-break. */\nexport function hasRouteCost(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/// The WebTransport subprotocol identifier for moq-lite.\n/// Version negotiation still happens via SETUP when this is used.\nexport const ALPN = \"moql\";\n\n/// The ALPN string for Draft03, which uses ALPN-based version negotiation.\nexport const ALPN_03 = \"moq-lite-03\";\n\n/// The ALPN string for Draft04, which uses ALPN-based version negotiation.\nexport const ALPN_04 = \"moq-lite-04\";\n\n/// The ALPN string for Draft05, which uses ALPN-based version negotiation.\nexport const ALPN_05 = \"moq-lite-05\";\n\n/// The ALPN string for the work-in-progress Draft06. It is NOT in the default\n/// WebTransport `protocols` list, so lite-06 is never advertised or negotiated by\n/// default; a peer only reaches it when both sides explicitly offer this ALPN.\nexport const ALPN_06_WIP = \"moq-lite-06-wip\";\n\nconst VERSION_NAMES: Record<number, string> = {\n\t[Version.DRAFT_01]: \"moq-lite-01\",\n\t[Version.DRAFT_02]: \"moq-lite-02\",\n\t[Version.DRAFT_03]: \"moq-lite-03\",\n\t[Version.DRAFT_04]: \"moq-lite-04\",\n\t[Version.DRAFT_05]: \"moq-lite-05\",\n\t[Version.DRAFT_06]: \"moq-lite-06-wip\",\n};\n\nexport function versionName(v: Version): string {\n\treturn VERSION_NAMES[v] ?? `unknown(0x${v.toString(16)})`;\n}\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/lite/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAA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AAC;AAED,yDAAyD;AACzD,kEAAkE;AAClE,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,gCAAgC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,8EAA8E;AAC9E,kFAAkF;AAClF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE7C,MAAM,aAAa,GAA2B;IAC7C,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa;IACjC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,iBAAiB;CACrC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,CAAU;IACrC,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;AAC3D,CAAC","sourcesContent":["export const Version = {\n\tDRAFT_01: 0xff0dad01,\n\tDRAFT_02: 0xff0dad02,\n\tDRAFT_03: 0xff0dad03,\n\tDRAFT_04: 0xff0dad04,\n\tDRAFT_05: 0xff0dad05,\n\t/// Lite-06, advertised as the preferred WebTransport subprotocol.\n\t/// Adds announce ids: each active ANNOUNCE_BROADCAST implicitly assigns the next\n\t/// ordinal, and ended/restart reference that id instead of repeating the path.\n\t/// Also adds frame-precise subscribe/fetch bounds and a GROUP frame offset.\n\tDRAFT_06: 0xff0dad06,\n\t/// Work-in-progress lite-07, only negotiated when explicitly offered.\n\t/// Adds the ANNOUNCE_REQUEST hidden opt-in.\n\tDRAFT_07: 0xff0dad07,\n} as const;\n\nexport type Version = (typeof Version)[keyof typeof Version];\n\n/**\n * Whether the PROBE message carries the RTT field.\n *\n * Added in lite-04. Lite-03 carries the bitrate alone, so a report with only an RTT to\n * give says nothing there and must not be sent.\n */\nexport function hasProbeRtt(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to carrying RTT.\n\tswitch (version) {\n\t\tcase Version.DRAFT_01:\n\t\tcase Version.DRAFT_02:\n\t\tcase Version.DRAFT_03:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/// Whether the session opens a unidirectional Setup Stream carrying a single SETUP message\n/// (capabilities + optional Path). Added in lite-05; older drafts have no Setup Stream.\nexport function hasSetupStream(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to having the stream.\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/// Whether the session may deliver groups over unreliable QUIC datagrams (lite-05 §6.4).\n/// A datagram carries one single-frame group's `subscribe | sequence | timestamp | payload` and is\n/// routed over the existing subscription. Added in lite-05; older versions never send/accept them.\nexport function hasDatagrams(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to having datagrams.\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/** Whether announce streams begin with ANNOUNCE_OK and omit the sender's origin from each hop chain. */\nexport function hasAnnounceOk(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-05+ announce behavior.\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/** Whether the version can replace an advertisement in place rather than retracting and\n * re-announcing it. Added in lite-05 as a duplicate ANNOUNCE; lite-06 gave it a message of\n * its own (ANNOUNCE_UPDATE) and made the duplicate a violation. */\nexport function restartSupported(version: Version): boolean {\n\t// Explicitly list older versions so future versions default to supported.\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/** Whether announcements carry implicit announce ids: each `active` assigns the next\n * per-stream ordinal, and `ended`/`restart` reference that id instead of repeating the\n * path. Added in lite-06. */\nexport function hasAnnounceId(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ announce behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/** Whether ANNOUNCE_REQUEST carries the Exclude Hop field: the subscriber's own\n * Hop ID, which the publisher uses to skip announces whose hop chain already\n * passed through the subscriber. Present in lite-04 and lite-05 only.\n *\n * The receiver's own reflected-announce check drops those announces anyway (and\n * catches loops of any length, not just the two-hop case), so lite-06 drops the\n * field and keeps the check.\n *\n * Unlike the gates above, this lists the versions that *have* the field: it was\n * removed rather than added, so future versions default to not carrying it. */\nexport function hasExcludeHop(version: Version): boolean {\n\tswitch (version) {\n\t\tcase Version.DRAFT_04:\n\t\tcase Version.DRAFT_05:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\n/** Whether announcements carry the route cost varints alongside the hop chain: the\n * warm and cold cost of pulling the broadcast via this route, accumulated per link.\n * Added in lite-06. Older versions carry neither, so a received route has no cost\n * at all and routing falls back to the hop-count tie-break. */\nexport function hasRouteCost(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, FETCH, and GROUP carry frame indices alongside\n * their group sequences, so a subscription or fetch can start and end partway through a\n * group. Added in lite-06. Older versions only address whole groups, so a route change\n * has to wait for the next group before it can resume.\n *\n * SUBSCRIBE_OK is deliberately not in that list: the resolved start frame follows from\n * its group plus the subscriber's own request, so it needs no frame field. */\nexport function hasFrameBounds(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_OK, and TRACK_INFO carry the retired\n * `Ordered` byte.\n *\n * The field is gone from the model: a publisher transmits newest-first within a track,\n * always. Deployed drafts still have the byte in their layout, so it is written as 0 and\n * ignored on read rather than shifting every field behind it. */\nexport function hasGroupOrder(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\n/**\n * Whether SUBSCRIBE's `Group Start` is an absolute floor the publisher resolves a start\n * from: the raw minimum group sequence (default 0), with `Subscriber Max Age` as the only\n * gate on how far back delivery begins. Changed in lite-06.\n *\n * Older versions encode `Group Start` as the sequence + 1, with 0 meaning the latest\n * group, so an absent start there pins the cursor to the live edge instead of letting the\n * budget reach back.\n */\nexport function resolvesStart(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-06+ behavior.\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\tcase Version.DRAFT_05:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/** Whether ANNOUNCE_REQUEST carries the hidden opt-in. Added in lite-07. */\nexport function hasHidden(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-07+ behavior.\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\tcase Version.DRAFT_05:\n\t\tcase Version.DRAFT_06:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/**\n * Whether SUBSCRIBE_END carries the subscription's group stream count, sent once every\n * counted stream is open, in place of SUBSCRIBE_DROP. Added in lite-07.\n */\nexport function hasStreamCount(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-07+ behavior.\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\tcase Version.DRAFT_05:\n\t\tcase Version.DRAFT_06:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/** Whether ANNOUNCE_START and ANNOUNCE_UPDATE may copy a path head or hop-chain tail from a live announcement. Added in lite-07. */\nexport function hasAnnounceCompression(version: Version): boolean {\n\t// Explicitly list older versions so future versions keep the lite-07+ behavior.\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\tcase Version.DRAFT_05:\n\t\tcase Version.DRAFT_06:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n\n/// The WebTransport subprotocol identifier for moq-lite.\n/// Version negotiation still happens via SETUP when this is used.\nexport const ALPN = \"moql\";\n\n/// The ALPN string for Draft03, which uses ALPN-based version negotiation.\nexport const ALPN_03 = \"moq-lite-03\";\n\n/// The ALPN string for Draft04, which uses ALPN-based version negotiation.\nexport const ALPN_04 = \"moq-lite-04\";\n\n/// The ALPN string for Draft05, which uses ALPN-based version negotiation.\nexport const ALPN_05 = \"moq-lite-05\";\n\n/// The ALPN string for Draft06.\nexport const ALPN_06 = \"moq-lite-06\";\n\n/// The ALPN string for the work-in-progress Draft07. It is NOT in the default\n/// WebTransport `protocols` list, so lite-07 is never advertised or negotiated by\n/// default; a peer only reaches it when both sides explicitly offer this ALPN.\nexport const ALPN_07_WIP = \"moq-lite-07-wip\";\n\nconst VERSION_NAMES: Record<number, string> = {\n\t[Version.DRAFT_01]: \"moq-lite-01\",\n\t[Version.DRAFT_02]: \"moq-lite-02\",\n\t[Version.DRAFT_03]: \"moq-lite-03\",\n\t[Version.DRAFT_04]: \"moq-lite-04\",\n\t[Version.DRAFT_05]: \"moq-lite-05\",\n\t[Version.DRAFT_06]: \"moq-lite-06\",\n\t[Version.DRAFT_07]: \"moq-lite-07-wip\",\n};\n\nexport function versionName(v: Version): string {\n\treturn VERSION_NAMES[v] ?? `unknown(0x${v.toString(16)})`;\n}\n"]}
package/origin.d.ts CHANGED
@@ -1,49 +1,276 @@
1
1
  /**
2
- * Endpoint identity within a hop chain, shared by both wire protocols.
2
+ * A broadcast routing table, independent of any connection.
3
3
  *
4
- * moq-lite carries these natively on every announcement; moq-transport carries them
5
- * via the MoQ Cluster extension (see `ietf/cluster.ts`). Mirrors `Origin` in
4
+ * Publish broadcasts into an origin and hand the origin to one or more connections to
5
+ * serve them; the broadcasts outlive any single session. Hand the same (or another)
6
+ * origin to a connection's `consume` option and the peer's announced routes appear
7
+ * in the table too: each route covers a path prefix, and a request for a path under
8
+ * it resolves through the session that announced it. Mirrors the `origin` module in
6
9
  * `rs/moq-net`.
7
10
  *
8
11
  * @module
9
12
  */
10
- import * as z from "zod/mini";
13
+ import { type GetPromise, type Getter } from "@norskvideo/moq-signals";
14
+ import * as announce from "./announced";
15
+ import * as broadcast from "./broadcast";
16
+ import { Route } from "./hop";
17
+ import * as Path from "./path";
18
+ export type { Cost, Hop, Route } from "./hop";
19
+ export { isAnonymous } from "./hop";
11
20
  /**
12
- * A relay origin id, encoded as a 62-bit varint on the wire.
21
+ * A non-owning handle on an origin: publish into it and read it, without its lifecycle.
13
22
  *
14
- * The {@link OriginSchema} validates any incoming value and brands it so the
15
- * type system enforces "only validated origins flow into hop lists." Internal
16
- * code that synthesizes an id (e.g. {@link randomOrigin}) uses
17
- * `OriginSchema.parse(...)` to produce a branded value from the raw bigint.
23
+ * What a shared connection lends out. {@link Producer} implements it, so code that is
24
+ * handed an origin rather than owning one should accept this type: closing the origin
25
+ * stays the owner's alone, and a borrower cannot express it.
26
+ *
27
+ * @public
28
+ */
29
+ export interface Table {
30
+ /** Settles once the origin closes; see {@link Producer.closed}. */
31
+ readonly closed: GetPromise<Error | null>;
32
+ /** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
33
+ readonly discovery: Getter<boolean | undefined>;
34
+ /** Create an unannounced broadcast at `path`; see {@link Producer.createBroadcast}. */
35
+ createBroadcast(path: Path.Valid): broadcast.Producer;
36
+ /** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
37
+ request(path: Path.Valid, options?: RequestOptions): Requesting;
38
+ /** The available announcements under `scope`, as a live map; see {@link Consumer.broadcasts}. */
39
+ broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
40
+ /** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
41
+ announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
42
+ /** Advertise a prefix and serve requests under it; see {@link Producer.dynamic}. */
43
+ dynamic(prefix: Path.Valid, route?: Route | {
44
+ hops?: Route["hops"];
45
+ cost?: Route["cost"] | bigint;
46
+ }): Dynamic;
47
+ }
48
+ /** Options for resolving a broadcast path. */
49
+ export interface RequestOptions {
50
+ /** Wait for a routed announcement when discovery is supported; otherwise subscribe blindly. */
51
+ announced?: boolean;
52
+ }
53
+ /**
54
+ * The write side of an origin: create broadcasts by path and advertise them.
55
+ *
56
+ * Independent of any connection. A connection given this origin (via its `publish` option)
57
+ * announces and serves the table's originated advertisements for as long as the session
58
+ * lasts; the broadcasts themselves live until their producer closes or {@link close} tears
59
+ * the origin down. A reconnecting session re-announces the table on each attach, so
60
+ * advertisements made while offline surface on the next connection.
61
+ *
62
+ * Create, attach {@link dynamic} for tracks served on demand, populate, then
63
+ * {@link broadcast.Producer.announce}: an exact-path subscribe before the tracks exist is
64
+ * refused, and nobody can see or reach a broadcast until it announces.
65
+ *
66
+ * @public
18
67
  */
19
- export declare const OriginSchema: z.core.$ZodBranded<z.ZodMiniBigInt<bigint>, "Origin", "out">;
20
- export type Origin = z.infer<typeof OriginSchema>;
68
+ export declare class Producer implements Table {
69
+ #private;
70
+ constructor();
71
+ /** Narrow this handle to patterns beneath root, presenting paths relative to that root. */
72
+ scope(root: Path.Valid, patterns: Path.Patterns): Producer;
73
+ /**
74
+ * Settles once the origin closes: `null` on a clean close, or the abort {@link Error}.
75
+ * Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
76
+ */
77
+ get closed(): GetPromise<Error | null>;
78
+ /**
79
+ * Create a broadcast at `path`, returning its producer.
80
+ *
81
+ * The broadcast exists for nobody until {@link broadcast.Producer.announce}: announce
82
+ * streams skip it and requests for its path find nothing, on this origin exactly as at
83
+ * a peer. Announce once its tracks exist; {@link broadcast.Producer.unannounce}
84
+ * withdraws it from everyone again.
85
+ *
86
+ * Close the producer to drop it. Creating a path again supersedes the previous
87
+ * broadcast: the origin drops its handle on the old one, which closes it unless the
88
+ * application still holds a consumer clone. An announced local broadcast competes with
89
+ * a remote route at the same path on cost, winning ties.
90
+ */
91
+ createBroadcast(path: Path.Valid): broadcast.Producer;
92
+ /**
93
+ * Advertise `prefix` and serve the requests beneath it.
94
+ *
95
+ * A route is always a prefix: it claims `prefix` and every path beneath it (the
96
+ * empty prefix claims every path). A service that only serves some of them
97
+ * advertises the covering prefix and rejects the rest as they are requested;
98
+ * consumers narrow with a {@link Path.Pattern} locally. The advertisement is
99
+ * visible to {@link Consumer.announced} and forwarded by sessions for as long as
100
+ * the returned {@link Dynamic} lives. A consumer resolving a path under it that
101
+ * no announced local broadcast wins is handed to the handle as a {@link Request}.
102
+ */
103
+ dynamic(prefix: Path.Valid, route?: Route | {
104
+ hops?: Route["hops"];
105
+ cost?: Route["cost"] | bigint;
106
+ }): Dynamic;
107
+ /** A read handle for this origin, the side a connection's `publish` option borrows. */
108
+ consume(): Consumer;
109
+ /** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
110
+ get discovery(): Getter<boolean | undefined>;
111
+ /** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
112
+ request(path: Path.Valid, options?: RequestOptions): Requesting;
113
+ /** The available announcements under `scope`, as a live map; see {@link Consumer.broadcasts}. */
114
+ broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
115
+ /** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
116
+ announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
117
+ /** Close the origin, every broadcast it still routes, and its announcement streams. Idempotent. */
118
+ close(abort?: Error): void;
119
+ }
21
120
  /**
22
- * The reserved id 0, meaning "no identity".
121
+ * An open request for a path nothing announced; see {@link Consumer.request}.
23
122
  *
24
- * It stands in for an endpoint that never declared one, and any number of endpoints can
25
- * be 0, so it identifies nothing: it is never a loop, never a publisher two chains have
26
- * in common, and never excluded from an advertisement.
123
+ * @public
27
124
  */
28
- export declare const UNKNOWN_ORIGIN: Origin;
125
+ export declare class Requesting {
126
+ #private;
127
+ /** The requested path. */
128
+ readonly path: Path.Valid;
129
+ /**
130
+ * The resolved broadcast, or undefined while nothing provides the path.
131
+ *
132
+ * The table's route when it has one: a local publish (no round trip) or an announced
133
+ * broadcast, swapping when a republish takes the path. Otherwise a session's blind
134
+ * answer, which is assumed present rather than known live: a missing broadcast
135
+ * surfaces as a reset on the first track subscription, not here. Drops back to
136
+ * undefined when the providing route dies and resolves again when another appears.
137
+ *
138
+ * Yours for as long as the request is open: it is a handle of this request's own, so
139
+ * closing it ends your view of the path rather than the route everyone else reads.
140
+ * {@link close} releases whatever is current.
141
+ */
142
+ readonly active: Getter<broadcast.Consumer | undefined>;
143
+ /**
144
+ * Whether nothing can serve this path, as opposed to not having served it yet.
145
+ *
146
+ * True when the origin routes nothing here and nothing is prepared to answer: no session
147
+ * attached and no connection reconnecting toward one. False whenever {@link active} is
148
+ * set, and false while a connection is still coming up, so the ordinary page-load window
149
+ * before the first handshake reads as pending rather than as a missing broadcast. Waiting
150
+ * on this is futile by definition; wait for an announcement instead, via the origin's
151
+ * `announced`. True once the request is refused.
152
+ */
153
+ readonly unroutable: Getter<boolean>;
154
+ /**
155
+ * Settles with the error a route's handler refused the path with, or `null` once you
156
+ * {@link close} the request. A refusal is final: no other route is asked, and a fresh
157
+ * request is needed to try again.
158
+ */
159
+ readonly closed: GetPromise<Error | null>;
160
+ private constructor();
161
+ /** Withdraw the request. The path stays routed for any other open request. Idempotent. */
162
+ close(): void;
163
+ }
29
164
  /**
30
- * Maximum length of a hop chain. Must match `MAX_HOPS` in Rust's `model/origin.rs`.
165
+ * The read side of an origin: resolve broadcasts by path and watch what is available.
166
+ *
167
+ * Obtain one from {@link Producer.consume}. Pass it to a connection's `publish` option to
168
+ * serve the origin's local broadcasts to that peer; read it directly to consume anything
169
+ * the origin routes, locally published or discovered by a session.
170
+ *
171
+ * @public
172
+ */
173
+ export declare class Consumer {
174
+ #private;
175
+ private constructor();
176
+ /** Settles once the origin closes; see {@link Producer.closed}. */
177
+ get closed(): GetPromise<Error | null>;
178
+ /**
179
+ * Whether the announcement table sees everything the attached sessions can serve.
180
+ *
181
+ * Undefined while no session is attached (nothing is known yet), true when every attached
182
+ * session announces into the table, and false as soon as one does not, where
183
+ * {@link announced} cannot be complete and consumers should {@link request} paths instead
184
+ * of waiting. One blind session among several is still false: the paths only it carries
185
+ * never reach the table, so a consumer that trusted the gate would never see them.
186
+ */
187
+ get discovery(): Getter<boolean | undefined>;
188
+ /**
189
+ * Resolve `path`, optionally waiting for an announcement.
190
+ *
191
+ * The one way to consume by path. {@link Requesting.active} follows whatever the table
192
+ * routes (an announced local publish, or any feeding session's announcement, swapping
193
+ * on a republish or a retraction); when nothing does, the request stands and whichever
194
+ * attached session answers first provides a blind subscription instead, re-answered
195
+ * across reconnects.
196
+ * With `announced: true`, an unrouted request waits while discovery is supported and
197
+ * falls back to that blind behavior only when discovery is unavailable. Close the request
198
+ * when done. On a closed origin it never resolves.
199
+ *
200
+ * With several sessions on one origin the first to answer wins, and it may be one that
201
+ * does not carry the path. Nothing corrects that: a missing broadcast surfaces as a reset
202
+ * on the first track and deliberately leaves the handle open, since the wire cannot tell
203
+ * "not here" from "not yet" and a blind handle is expected to survive until a publisher
204
+ * arrives. It matters only on an origin mixing sessions that announce with sessions that
205
+ * cannot, where a path only the silent session carries may sit behind another session's
206
+ * answer. Prefer {@link unroutable} and announcements over blind requests when the origin
207
+ * feeds from more than one connection.
208
+ */
209
+ request(path: Path.Valid, options?: RequestOptions): Requesting;
210
+ /**
211
+ * The announced routes matching `scope`, as a live map from covered prefix to route.
212
+ * Local broadcasts appear once announced; received and dynamic routes retain their
213
+ * advertised prefixes. Reads are synchronous, and the getter needs no teardown.
214
+ * Hidden routes are left out unless `options.hidden` opts in (see {@link announce.Options}).
215
+ * Unscoped readers share one snapshot; each distinct scope filters the table on changes.
216
+ */
217
+ broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
218
+ /**
219
+ * The announced routes matching `scope`, as a live stream: every currently advertised
220
+ * route arrives first as active, then additions and retractions as they happen.
221
+ * Any pattern is accepted. A local broadcast appears once it announces, exactly as a
222
+ * peer sees it. A dynamic or received route announces the prefix it covers when its
223
+ * subtree overlaps the scope. The stream ends when the origin closes or the consumer is
224
+ * closed. Hidden routes are left out unless `options.hidden` opts in (see {@link announce.Options}).
225
+ */
226
+ announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
227
+ }
228
+ /**
229
+ * A served route from {@link Producer.dynamic}: advertises a prefix and answers the
230
+ * requests beneath it.
231
+ *
232
+ * Drop it (or {@link close}) to retract the route and reject anything still waiting
233
+ * with {@link StreamCode.NoCapacity}. {@link update} re-prices it in place.
31
234
  *
32
- * Broadcasts with longer chains are rejected, which bounds loop detection and rejects
33
- * pathological announcements across clusters with unbounded forwarding.
235
+ * @public
34
236
  */
35
- export declare const MAX_HOPS = 32;
237
+ export declare class Dynamic {
238
+ #private;
239
+ /** The prefix this handle advertises. */
240
+ readonly prefix: Path.Valid;
241
+ private constructor();
242
+ /** Re-price the route in place. The prefix is fixed at announce time. */
243
+ update(route: Route | {
244
+ hops?: Route["hops"];
245
+ cost?: Route["cost"] | bigint;
246
+ }): void;
247
+ /** Retract the route and reject anything still waiting. Idempotent. */
248
+ close(): void;
249
+ /** Requests under this prefix, as they arrive, each to {@link Request.accept} or reject. */
250
+ requested(): AsyncIterableIterator<Request>;
251
+ }
36
252
  /**
37
- * Generate a fresh origin with a random non-zero id.
253
+ * A pending request for a broadcast to be served on demand.
38
254
  *
39
- * `crypto.getRandomValues` is overkill for best-effort loop detection, but
40
- * used for slightly better distribution than `Math.random` at negligible cost.
255
+ * Yielded by {@link Dynamic.requested}. {@link accept} resolves it with a live
256
+ * broadcast; {@link reject} resolves it with an error. Advancing the iterator or
257
+ * closing it without either rejects the request.
41
258
  *
42
- * TEMPORARY: the wire format allows 62 bits, but older `@moq/lite` JS clients
43
- * decode `AnnounceInterest.exclude_hop` as a u53 (number) and throw on anything
44
- * > 2^53-1. To keep those clients alive against fresh peers, we cap the random
45
- * id at 53 bits. Restore to 62 bits once the u62 fix has propagated to deployed
46
- * bundles. Mirrors `Origin::random` in rs/moq-net.
259
+ * @public
47
260
  */
48
- export declare function randomOrigin(): Origin;
261
+ export declare class Request {
262
+ #private;
263
+ /** The path that was requested. */
264
+ readonly path: Path.Valid;
265
+ private constructor();
266
+ /**
267
+ * Accept the request, resolving every awaiting requester with `broadcast`.
268
+ *
269
+ * The caller keeps producing into `broadcast`; repeat requests for the path share
270
+ * it for as long as it stays live.
271
+ */
272
+ accept(source: broadcast.Producer | broadcast.Consumer): void;
273
+ /** Reject the request, resolving every awaiting requester with `err`. */
274
+ reject(err: Error): void;
275
+ }
49
276
  //# sourceMappingURL=origin.d.ts.map
package/origin.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../src/origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,8DAGR,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,MAA+B,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAOrC"}
1
+ {"version":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