@moqtap/codec 0.8.1 → 0.10.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 (194) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +16 -4
  3. package/dist/{chunk-KCH4BQXK.cjs → chunk-AQ445VV7.cjs} +15 -9
  4. package/dist/{chunk-UZO5Z2XT.cjs → chunk-BIBMDTU5.cjs} +12 -6
  5. package/dist/chunk-BMJMY6FX.cjs +868 -0
  6. package/dist/{chunk-23KRITJ6.js → chunk-BX2N7TZM.js} +14 -8
  7. package/dist/{chunk-XQGEOFGE.js → chunk-CF5DDD3Q.js} +14 -8
  8. package/dist/chunk-FT3HDNIB.js +2374 -0
  9. package/dist/{chunk-TMXRYOBS.js → chunk-G53WYUXL.js} +13 -7
  10. package/dist/{chunk-JKMYAUGY.js → chunk-K2B3OVFK.js} +11 -8
  11. package/dist/{chunk-3YAR3I3S.js → chunk-KGDVC4O6.js} +36 -22
  12. package/dist/{chunk-VWXUT5R2.cjs → chunk-KTNERCTZ.cjs} +36 -22
  13. package/dist/{chunk-H6DTAIWM.js → chunk-L5DRACXS.js} +22 -16
  14. package/dist/{chunk-UA5XFP4O.cjs → chunk-OUNN4IQB.cjs} +14 -8
  15. package/dist/{chunk-NH4L6NIY.js → chunk-OZRK73NQ.js} +12 -6
  16. package/dist/{chunk-PU2KV7VP.cjs → chunk-RYKQXBG6.cjs} +12 -6
  17. package/dist/{chunk-EVCPBFSR.cjs → chunk-SDJTSMOW.cjs} +23 -17
  18. package/dist/chunk-T4VWPKDG.cjs +2374 -0
  19. package/dist/{chunk-2XH6PHXR.js → chunk-TSUZ6GJV.js} +12 -6
  20. package/dist/{chunk-QGIHC6BA.cjs → chunk-UKKDOOUO.cjs} +12 -9
  21. package/dist/{chunk-BV6MITLO.js → chunk-WCPENYNE.js} +14 -8
  22. package/dist/{chunk-IADVBKEJ.cjs → chunk-WCTMPDUX.cjs} +15 -9
  23. package/dist/chunk-WX5PU7HF.js +868 -0
  24. package/dist/{chunk-7ENEWAMZ.cjs → chunk-XCRCAUGI.cjs} +15 -9
  25. package/dist/{codec-BLYAy2OP.d.ts → codec--CVeqGQv.d.ts} +1 -1
  26. package/dist/{codec-BNS3gS77.d.ts → codec-08ZOr5wI.d.ts} +2 -2
  27. package/dist/{codec-DujHf55Z.d.ts → codec-BJ7BHuiZ.d.ts} +1 -1
  28. package/dist/{codec-CI0BjmHc.d.ts → codec-BNy5syCU.d.ts} +1 -1
  29. package/dist/{codec-N3g1lxQQ.d.cts → codec-Bd60SGKH.d.cts} +2 -2
  30. package/dist/{codec-xeuGZY77.d.cts → codec-BrTi4K7r.d.cts} +3 -3
  31. package/dist/{codec-DJmV04i0.d.ts → codec-Bux_Q40X.d.ts} +2 -2
  32. package/dist/{codec-BqqoYdh_.d.cts → codec-BxQTybUX.d.cts} +2 -2
  33. package/dist/{codec-D2JbI2tp.d.ts → codec-C3mdsGx3.d.ts} +2 -2
  34. package/dist/{codec-DQWQSam3.d.cts → codec-C6Mx4bwz.d.cts} +1 -1
  35. package/dist/{codec-DAePx2NL.d.ts → codec-CBdOIfMY.d.ts} +3 -3
  36. package/dist/codec-CFWu5KVT.d.cts +49 -0
  37. package/dist/{codec-CyApDKwf.d.cts → codec-CWnf8mn_.d.cts} +2 -2
  38. package/dist/{codec-DvcJgYKq.d.cts → codec-CXCjya_G.d.cts} +1 -1
  39. package/dist/{codec-BOyrk_C9.d.cts → codec-Cfo_z5ET.d.cts} +1 -1
  40. package/dist/{codec-v6Vloc7H.d.ts → codec-Cm3D261p.d.ts} +2 -2
  41. package/dist/codec-CwZ6OCPP.d.ts +49 -0
  42. package/dist/{codec-NMsTK0GX.d.cts → codec-Czejcmxr.d.cts} +2 -2
  43. package/dist/{codec-hvkJfCF5.d.cts → codec-DNmiG2e0.d.cts} +2 -2
  44. package/dist/{codec-CWj5iTxA.d.ts → codec-DOmAmFkI.d.ts} +2 -2
  45. package/dist/{codec-WwwUipaU.d.ts → codec-DaXjRrOV.d.ts} +2 -2
  46. package/dist/{codec-DplRgIKq.d.ts → codec-Dl_QIXMz.d.ts} +1 -1
  47. package/dist/{codec-D95gT98n.d.cts → codec-DzkdW4kO.d.cts} +1 -1
  48. package/dist/{codec-cou9XBMF.d.cts → codec-EvybrBuY.d.cts} +2 -2
  49. package/dist/{codec-DL0njGkL.d.ts → codec-alVA27Uc.d.ts} +2 -2
  50. package/dist/{codec-D89DWXbv.d.cts → codec-f7vxeVIS.d.cts} +2 -2
  51. package/dist/{codec-D47r_-Rl.d.ts → codec-gl4_QEva.d.ts} +2 -2
  52. package/dist/{codec-BOtv3R5j.d.cts → codec-guzqtfMk.d.cts} +2 -2
  53. package/dist/draft07-session.d.cts +3 -3
  54. package/dist/draft07-session.d.ts +3 -3
  55. package/dist/draft07.d.cts +3 -3
  56. package/dist/draft07.d.ts +3 -3
  57. package/dist/draft08-session.d.cts +3 -3
  58. package/dist/draft08-session.d.ts +3 -3
  59. package/dist/draft08.d.cts +4 -4
  60. package/dist/draft08.d.ts +4 -4
  61. package/dist/draft09-session.d.cts +3 -3
  62. package/dist/draft09-session.d.ts +3 -3
  63. package/dist/draft09.d.cts +4 -4
  64. package/dist/draft09.d.ts +4 -4
  65. package/dist/draft10-session.d.cts +3 -3
  66. package/dist/draft10-session.d.ts +3 -3
  67. package/dist/draft10.d.cts +4 -4
  68. package/dist/draft10.d.ts +4 -4
  69. package/dist/draft11-session.d.cts +4 -4
  70. package/dist/draft11-session.d.ts +4 -4
  71. package/dist/draft11.cjs +2 -2
  72. package/dist/draft11.d.cts +6 -6
  73. package/dist/draft11.d.ts +6 -6
  74. package/dist/draft11.js +1 -1
  75. package/dist/draft12-session.d.cts +4 -4
  76. package/dist/draft12-session.d.ts +4 -4
  77. package/dist/draft12.cjs +2 -2
  78. package/dist/draft12.d.cts +6 -6
  79. package/dist/draft12.d.ts +6 -6
  80. package/dist/draft12.js +1 -1
  81. package/dist/draft13-session.d.cts +4 -4
  82. package/dist/draft13-session.d.ts +4 -4
  83. package/dist/draft13.cjs +2 -2
  84. package/dist/draft13.d.cts +6 -6
  85. package/dist/draft13.d.ts +6 -6
  86. package/dist/draft13.js +1 -1
  87. package/dist/draft14-session.d.cts +4 -4
  88. package/dist/draft14-session.d.ts +4 -4
  89. package/dist/draft14.cjs +2 -2
  90. package/dist/draft14.d.cts +6 -6
  91. package/dist/draft14.d.ts +6 -6
  92. package/dist/draft14.js +1 -1
  93. package/dist/draft15-session.d.cts +4 -4
  94. package/dist/draft15-session.d.ts +4 -4
  95. package/dist/draft15.cjs +2 -2
  96. package/dist/draft15.d.cts +6 -6
  97. package/dist/draft15.d.ts +6 -6
  98. package/dist/draft15.js +1 -1
  99. package/dist/draft16-session.d.cts +4 -4
  100. package/dist/draft16-session.d.ts +4 -4
  101. package/dist/draft16.cjs +2 -2
  102. package/dist/draft16.d.cts +6 -6
  103. package/dist/draft16.d.ts +6 -6
  104. package/dist/draft16.js +1 -1
  105. package/dist/draft17-session.d.cts +4 -4
  106. package/dist/draft17-session.d.ts +4 -4
  107. package/dist/draft17.cjs +2 -2
  108. package/dist/draft17.d.cts +5 -5
  109. package/dist/draft17.d.ts +5 -5
  110. package/dist/draft17.js +1 -1
  111. package/dist/draft18-session.d.cts +4 -4
  112. package/dist/draft18-session.d.ts +4 -4
  113. package/dist/draft18.cjs +2 -2
  114. package/dist/draft18.d.cts +5 -5
  115. package/dist/draft18.d.ts +5 -5
  116. package/dist/draft18.js +1 -1
  117. package/dist/draft19-session.d.cts +4 -4
  118. package/dist/draft19-session.d.ts +4 -4
  119. package/dist/draft19.cjs +2 -2
  120. package/dist/draft19.d.cts +5 -5
  121. package/dist/draft19.d.ts +5 -5
  122. package/dist/draft19.js +1 -1
  123. package/dist/draft20-session.cjs +8 -0
  124. package/dist/draft20-session.d.cts +195 -0
  125. package/dist/draft20-session.d.ts +195 -0
  126. package/dist/draft20-session.js +8 -0
  127. package/dist/draft20.cjs +217 -0
  128. package/dist/draft20.d.cts +175 -0
  129. package/dist/draft20.d.ts +175 -0
  130. package/dist/draft20.js +217 -0
  131. package/dist/index.cjs +25 -19
  132. package/dist/index.d.cts +41 -26
  133. package/dist/index.d.ts +41 -26
  134. package/dist/index.js +16 -10
  135. package/dist/{session-types-KsqyVp6y.d.cts → session-types-B9idsih-.d.cts} +13 -1
  136. package/dist/{session-types-C0l_-Ups.d.ts → session-types-Dn7b3RZM.d.ts} +13 -1
  137. package/dist/session.cjs +5 -1
  138. package/dist/session.d.cts +14 -12
  139. package/dist/session.d.ts +14 -12
  140. package/dist/session.js +5 -1
  141. package/dist/{types-Cqp10JtB.d.cts → types-Bg86GGVZ.d.cts} +2 -2
  142. package/dist/{types-Cqp10JtB.d.ts → types-Bg86GGVZ.d.ts} +2 -2
  143. package/dist/{types-zHgCS6o5.d.cts → types-C1rxh-id.d.cts} +7 -7
  144. package/dist/{types-zHgCS6o5.d.ts → types-C1rxh-id.d.ts} +7 -7
  145. package/dist/{types-Bio-91Rt.d.cts → types-CI_SX4Xe.d.cts} +2 -2
  146. package/dist/{types-Bio-91Rt.d.ts → types-CI_SX4Xe.d.ts} +2 -2
  147. package/dist/types-CY-QWxd-.d.cts +359 -0
  148. package/dist/types-CY-QWxd-.d.ts +359 -0
  149. package/dist/{types-Cm9fjeYC.d.cts → types-CZTzbIzQ.d.cts} +2 -2
  150. package/dist/{types-Cm9fjeYC.d.ts → types-CZTzbIzQ.d.ts} +2 -2
  151. package/dist/{types-HI_bbXka.d.cts → types-CmqT0jUf.d.cts} +1 -1
  152. package/dist/{types-HI_bbXka.d.ts → types-CmqT0jUf.d.ts} +1 -1
  153. package/dist/{types-Ck45Ex5S.d.cts → types-D0kTgUuL.d.cts} +1 -1
  154. package/dist/{types-Ck45Ex5S.d.ts → types-D0kTgUuL.d.ts} +1 -1
  155. package/dist/{types-D9eiB_9A.d.cts → types-D4bmW8rY.d.cts} +2 -2
  156. package/dist/{types-D9eiB_9A.d.ts → types-D4bmW8rY.d.ts} +2 -2
  157. package/dist/{types-CdCSIfvI.d.cts → types-DG5_iKuv.d.cts} +1 -1
  158. package/dist/{types-CdCSIfvI.d.ts → types-DG5_iKuv.d.ts} +1 -1
  159. package/dist/{types-CXlSn0I9.d.cts → types-DjxexghA.d.cts} +2 -2
  160. package/dist/{types-CXlSn0I9.d.ts → types-DjxexghA.d.ts} +2 -2
  161. package/dist/{types-CPaYBsMG.d.cts → types-pShrs3fN.d.cts} +2 -2
  162. package/dist/{types-CPaYBsMG.d.ts → types-pShrs3fN.d.ts} +2 -2
  163. package/package.json +16 -3
  164. package/src/core/session-types.ts +7 -0
  165. package/src/core/types.ts +1 -0
  166. package/src/drafts/draft11/codec.ts +11 -8
  167. package/src/drafts/draft11/types.ts +1 -1
  168. package/src/drafts/draft12/codec.ts +22 -16
  169. package/src/drafts/draft12/types.ts +2 -2
  170. package/src/drafts/draft13/codec.ts +14 -8
  171. package/src/drafts/draft13/types.ts +2 -2
  172. package/src/drafts/draft14/codec.ts +14 -8
  173. package/src/drafts/draft14/types.ts +1 -1
  174. package/src/drafts/draft15/codec.ts +14 -8
  175. package/src/drafts/draft15/types.ts +2 -2
  176. package/src/drafts/draft16/codec.ts +13 -7
  177. package/src/drafts/draft16/types.ts +2 -2
  178. package/src/drafts/draft17/codec.ts +12 -6
  179. package/src/drafts/draft17/types.ts +2 -2
  180. package/src/drafts/draft18/codec.ts +12 -6
  181. package/src/drafts/draft18/types.ts +2 -2
  182. package/src/drafts/draft19/codec.ts +37 -23
  183. package/src/drafts/draft19/types.ts +10 -7
  184. package/src/drafts/draft20/codec.ts +1749 -0
  185. package/src/drafts/draft20/data-streams.ts +1291 -0
  186. package/src/drafts/draft20/error-codes.ts +135 -0
  187. package/src/drafts/draft20/index.ts +165 -0
  188. package/src/drafts/draft20/messages.ts +68 -0
  189. package/src/drafts/draft20/rules.ts +107 -0
  190. package/src/drafts/draft20/session-fsm.ts +1063 -0
  191. package/src/drafts/draft20/session.ts +21 -0
  192. package/src/drafts/draft20/types.ts +461 -0
  193. package/src/index.ts +20 -2
  194. package/src/session.ts +4 -0
package/dist/index.d.cts CHANGED
@@ -1,31 +1,33 @@
1
- import { C as CodecOptions } from './types-CdCSIfvI.cjs';
2
- export { B as BaseCodec, D as DecodeError, a as DecodeErrorCode, b as DecodeResult, c as Draft } from './types-CdCSIfvI.cjs';
3
- import { D as Draft07Codec } from './codec-DQWQSam3.cjs';
4
- import { D as Draft08Codec } from './codec-D95gT98n.cjs';
5
- import { D as Draft09Codec } from './codec-DvcJgYKq.cjs';
6
- import { D as Draft10Codec } from './codec-BOyrk_C9.cjs';
7
- import { D as Draft11Codec } from './codec-cou9XBMF.cjs';
8
- import { D as Draft12Codec } from './codec-BOtv3R5j.cjs';
9
- import { D as Draft13Codec } from './codec-hvkJfCF5.cjs';
10
- import { D as Draft14Codec } from './codec-N3g1lxQQ.cjs';
11
- import { D as Draft15Codec } from './codec-BqqoYdh_.cjs';
12
- import { D as Draft16Codec } from './codec-CyApDKwf.cjs';
13
- import { D as Draft17Codec } from './codec-NMsTK0GX.cjs';
14
- import { D as Draft18Codec } from './codec-D89DWXbv.cjs';
15
- import { D as Draft19Codec } from './codec-xeuGZY77.cjs';
1
+ import { C as CodecOptions } from './types-DG5_iKuv.cjs';
2
+ export { B as BaseCodec, D as DecodeError, a as DecodeErrorCode, b as DecodeResult, c as Draft } from './types-DG5_iKuv.cjs';
3
+ import { D as Draft07Codec } from './codec-C6Mx4bwz.cjs';
4
+ import { D as Draft08Codec } from './codec-DzkdW4kO.cjs';
5
+ import { D as Draft09Codec } from './codec-CXCjya_G.cjs';
6
+ import { D as Draft10Codec } from './codec-Cfo_z5ET.cjs';
7
+ import { D as Draft11Codec } from './codec-EvybrBuY.cjs';
8
+ import { D as Draft12Codec } from './codec-guzqtfMk.cjs';
9
+ import { D as Draft13Codec } from './codec-DNmiG2e0.cjs';
10
+ import { D as Draft14Codec } from './codec-Bd60SGKH.cjs';
11
+ import { D as Draft15Codec } from './codec-BxQTybUX.cjs';
12
+ import { D as Draft16Codec } from './codec-CWnf8mn_.cjs';
13
+ import { D as Draft17Codec } from './codec-Czejcmxr.cjs';
14
+ import { D as Draft18Codec } from './codec-f7vxeVIS.cjs';
15
+ import { D as Draft19Codec } from './codec-BrTi4K7r.cjs';
16
+ import { D as Draft20Codec } from './codec-CFWu5KVT.cjs';
16
17
  import './types-Dl4IaAHR.cjs';
17
18
  import './types-jV1yDDBA.cjs';
18
19
  import './types-B3g5G9KP.cjs';
19
20
  import './types-0IWbU9Z_.cjs';
20
- import './types-Ck45Ex5S.cjs';
21
- import './types-Bio-91Rt.cjs';
22
- import './types-CXlSn0I9.cjs';
23
- import './types-HI_bbXka.cjs';
24
- import './types-CPaYBsMG.cjs';
25
- import './types-Cm9fjeYC.cjs';
26
- import './types-D9eiB_9A.cjs';
27
- import './types-Cqp10JtB.cjs';
28
- import './types-zHgCS6o5.cjs';
21
+ import './types-D0kTgUuL.cjs';
22
+ import './types-CI_SX4Xe.cjs';
23
+ import './types-DjxexghA.cjs';
24
+ import './types-CmqT0jUf.cjs';
25
+ import './types-pShrs3fN.cjs';
26
+ import './types-CZTzbIzQ.cjs';
27
+ import './types-D4bmW8rY.cjs';
28
+ import './types-Bg86GGVZ.cjs';
29
+ import './types-C1rxh-id.cjs';
30
+ import './types-CY-QWxd-.cjs';
29
31
 
30
32
  /**
31
33
  * Draft-agnostic readers for decoded control messages.
@@ -111,7 +113,17 @@ declare function joiningRequestIdOf(msg: AnyMessage): bigint | undefined;
111
113
  */
112
114
 
113
115
  /**
114
- * Wire version numbers for each MoQT draft, keyed by short aliases.
116
+ * Version identifiers for each MoQT draft, keyed by short aliases.
117
+ *
118
+ * Only the entries up to '14' are wire values: those drafts negotiated the
119
+ * version inside CLIENT_SETUP/SERVER_SETUP and really do put `0xff0000NN` on
120
+ * the wire. From draft-15 on, the version is negotiated by ALPN (raw QUIC) or
121
+ * `WT-Available-Protocols` (WebTransport) as the string `moqt-NN`, and no
122
+ * version number is sent at all — so '15' through '20' are *derived*
123
+ * identifiers kept as stable numeric keys, not observed values. Do not report
124
+ * one to a user as a version seen on the wire; report the protocol string.
125
+ * Each draft's own module exports it (e.g. `PROTOCOL_STRING` in
126
+ * `@moqtap/codec/draft20`).
115
127
  */
116
128
  declare const DRAFT_VERSIONS: Record<string, bigint>;
117
129
  declare function createCodec(options: CodecOptions & {
@@ -153,12 +165,15 @@ declare function createCodec(options: CodecOptions & {
153
165
  declare function createCodec(options: CodecOptions & {
154
166
  draft: '19';
155
167
  }): Draft19Codec;
168
+ declare function createCodec(options: CodecOptions & {
169
+ draft: '20';
170
+ }): Draft20Codec;
156
171
  /**
157
172
  * Create a codec for the specified draft version.
158
173
  *
159
174
  * A draft must always be specified — there is no default while the
160
175
  * MoQT specification is still in draft stage.
161
176
  */
162
- declare function createCodec(options: CodecOptions): Draft07Codec | Draft08Codec | Draft09Codec | Draft10Codec | Draft11Codec | Draft12Codec | Draft13Codec | Draft14Codec | Draft15Codec | Draft16Codec | Draft17Codec | Draft18Codec | Draft19Codec;
177
+ declare function createCodec(options: CodecOptions): Draft07Codec | Draft08Codec | Draft09Codec | Draft10Codec | Draft11Codec | Draft12Codec | Draft13Codec | Draft14Codec | Draft15Codec | Draft16Codec | Draft17Codec | Draft18Codec | Draft19Codec | Draft20Codec;
163
178
 
164
179
  export { type AnyMessage, CodecOptions, DRAFT_VERSIONS, type TrackIdentity, createCodec, joiningRequestIdOf, requestIdOf, trackAliasOf, trackOf };
package/dist/index.d.ts CHANGED
@@ -1,31 +1,33 @@
1
- import { C as CodecOptions } from './types-CdCSIfvI.js';
2
- export { B as BaseCodec, D as DecodeError, a as DecodeErrorCode, b as DecodeResult, c as Draft } from './types-CdCSIfvI.js';
3
- import { D as Draft07Codec } from './codec-DujHf55Z.js';
4
- import { D as Draft08Codec } from './codec-DplRgIKq.js';
5
- import { D as Draft09Codec } from './codec-CI0BjmHc.js';
6
- import { D as Draft10Codec } from './codec-BLYAy2OP.js';
7
- import { D as Draft11Codec } from './codec-DL0njGkL.js';
8
- import { D as Draft12Codec } from './codec-D47r_-Rl.js';
9
- import { D as Draft13Codec } from './codec-CWj5iTxA.js';
10
- import { D as Draft14Codec } from './codec-v6Vloc7H.js';
11
- import { D as Draft15Codec } from './codec-BNS3gS77.js';
12
- import { D as Draft16Codec } from './codec-D2JbI2tp.js';
13
- import { D as Draft17Codec } from './codec-DJmV04i0.js';
14
- import { D as Draft18Codec } from './codec-WwwUipaU.js';
15
- import { D as Draft19Codec } from './codec-DAePx2NL.js';
1
+ import { C as CodecOptions } from './types-DG5_iKuv.js';
2
+ export { B as BaseCodec, D as DecodeError, a as DecodeErrorCode, b as DecodeResult, c as Draft } from './types-DG5_iKuv.js';
3
+ import { D as Draft07Codec } from './codec-BJ7BHuiZ.js';
4
+ import { D as Draft08Codec } from './codec-Dl_QIXMz.js';
5
+ import { D as Draft09Codec } from './codec-BNy5syCU.js';
6
+ import { D as Draft10Codec } from './codec--CVeqGQv.js';
7
+ import { D as Draft11Codec } from './codec-alVA27Uc.js';
8
+ import { D as Draft12Codec } from './codec-gl4_QEva.js';
9
+ import { D as Draft13Codec } from './codec-DOmAmFkI.js';
10
+ import { D as Draft14Codec } from './codec-Cm3D261p.js';
11
+ import { D as Draft15Codec } from './codec-08ZOr5wI.js';
12
+ import { D as Draft16Codec } from './codec-C3mdsGx3.js';
13
+ import { D as Draft17Codec } from './codec-Bux_Q40X.js';
14
+ import { D as Draft18Codec } from './codec-DaXjRrOV.js';
15
+ import { D as Draft19Codec } from './codec-CBdOIfMY.js';
16
+ import { D as Draft20Codec } from './codec-CwZ6OCPP.js';
16
17
  import './types-Dl4IaAHR.js';
17
18
  import './types-jV1yDDBA.js';
18
19
  import './types-B3g5G9KP.js';
19
20
  import './types-0IWbU9Z_.js';
20
- import './types-Ck45Ex5S.js';
21
- import './types-Bio-91Rt.js';
22
- import './types-CXlSn0I9.js';
23
- import './types-HI_bbXka.js';
24
- import './types-CPaYBsMG.js';
25
- import './types-Cm9fjeYC.js';
26
- import './types-D9eiB_9A.js';
27
- import './types-Cqp10JtB.js';
28
- import './types-zHgCS6o5.js';
21
+ import './types-D0kTgUuL.js';
22
+ import './types-CI_SX4Xe.js';
23
+ import './types-DjxexghA.js';
24
+ import './types-CmqT0jUf.js';
25
+ import './types-pShrs3fN.js';
26
+ import './types-CZTzbIzQ.js';
27
+ import './types-D4bmW8rY.js';
28
+ import './types-Bg86GGVZ.js';
29
+ import './types-C1rxh-id.js';
30
+ import './types-CY-QWxd-.js';
29
31
 
30
32
  /**
31
33
  * Draft-agnostic readers for decoded control messages.
@@ -111,7 +113,17 @@ declare function joiningRequestIdOf(msg: AnyMessage): bigint | undefined;
111
113
  */
112
114
 
113
115
  /**
114
- * Wire version numbers for each MoQT draft, keyed by short aliases.
116
+ * Version identifiers for each MoQT draft, keyed by short aliases.
117
+ *
118
+ * Only the entries up to '14' are wire values: those drafts negotiated the
119
+ * version inside CLIENT_SETUP/SERVER_SETUP and really do put `0xff0000NN` on
120
+ * the wire. From draft-15 on, the version is negotiated by ALPN (raw QUIC) or
121
+ * `WT-Available-Protocols` (WebTransport) as the string `moqt-NN`, and no
122
+ * version number is sent at all — so '15' through '20' are *derived*
123
+ * identifiers kept as stable numeric keys, not observed values. Do not report
124
+ * one to a user as a version seen on the wire; report the protocol string.
125
+ * Each draft's own module exports it (e.g. `PROTOCOL_STRING` in
126
+ * `@moqtap/codec/draft20`).
115
127
  */
116
128
  declare const DRAFT_VERSIONS: Record<string, bigint>;
117
129
  declare function createCodec(options: CodecOptions & {
@@ -153,12 +165,15 @@ declare function createCodec(options: CodecOptions & {
153
165
  declare function createCodec(options: CodecOptions & {
154
166
  draft: '19';
155
167
  }): Draft19Codec;
168
+ declare function createCodec(options: CodecOptions & {
169
+ draft: '20';
170
+ }): Draft20Codec;
156
171
  /**
157
172
  * Create a codec for the specified draft version.
158
173
  *
159
174
  * A draft must always be specified — there is no default while the
160
175
  * MoQT specification is still in draft stage.
161
176
  */
162
- declare function createCodec(options: CodecOptions): Draft07Codec | Draft08Codec | Draft09Codec | Draft10Codec | Draft11Codec | Draft12Codec | Draft13Codec | Draft14Codec | Draft15Codec | Draft16Codec | Draft17Codec | Draft18Codec | Draft19Codec;
177
+ declare function createCodec(options: CodecOptions): Draft07Codec | Draft08Codec | Draft09Codec | Draft10Codec | Draft11Codec | Draft12Codec | Draft13Codec | Draft14Codec | Draft15Codec | Draft16Codec | Draft17Codec | Draft18Codec | Draft19Codec | Draft20Codec;
163
178
 
164
179
  export { type AnyMessage, CodecOptions, DRAFT_VERSIONS, type TrackIdentity, createCodec, joiningRequestIdOf, requestIdOf, trackAliasOf, trackOf };
package/dist/index.js CHANGED
@@ -1,33 +1,36 @@
1
1
  import {
2
2
  createDraft18Codec
3
- } from "./chunk-2XH6PHXR.js";
3
+ } from "./chunk-TSUZ6GJV.js";
4
4
  import {
5
5
  createDraft19Codec
6
- } from "./chunk-3YAR3I3S.js";
6
+ } from "./chunk-KGDVC4O6.js";
7
+ import {
8
+ createDraft20Codec
9
+ } from "./chunk-FT3HDNIB.js";
7
10
  import {
8
11
  createDraft14Codec
9
- } from "./chunk-XQGEOFGE.js";
12
+ } from "./chunk-CF5DDD3Q.js";
10
13
  import {
11
14
  createDraft15Codec
12
- } from "./chunk-BV6MITLO.js";
15
+ } from "./chunk-WCPENYNE.js";
13
16
  import {
14
17
  createDraft16Codec
15
- } from "./chunk-TMXRYOBS.js";
18
+ } from "./chunk-G53WYUXL.js";
16
19
  import {
17
20
  createDraft17Codec
18
- } from "./chunk-NH4L6NIY.js";
21
+ } from "./chunk-OZRK73NQ.js";
19
22
  import {
20
23
  createDraft10Codec
21
24
  } from "./chunk-N2V7Z37J.js";
22
25
  import {
23
26
  createDraft11Codec
24
- } from "./chunk-JKMYAUGY.js";
27
+ } from "./chunk-K2B3OVFK.js";
25
28
  import {
26
29
  createDraft12Codec
27
- } from "./chunk-H6DTAIWM.js";
30
+ } from "./chunk-L5DRACXS.js";
28
31
  import {
29
32
  createDraft13Codec
30
- } from "./chunk-23KRITJ6.js";
33
+ } from "./chunk-BX2N7TZM.js";
31
34
  import {
32
35
  createDraft07Codec
33
36
  } from "./chunk-KYVTM5VI.js";
@@ -103,7 +106,8 @@ var DRAFT_VERSIONS = {
103
106
  "16": 0xff000010n,
104
107
  "17": 0xff000011n,
105
108
  "18": 0xff000012n,
106
- "19": 0xff000013n
109
+ "19": 0xff000013n,
110
+ "20": 0xff000014n
107
111
  };
108
112
  function createCodec(options) {
109
113
  const draft = DRAFT_VERSIONS[options.draft];
@@ -140,6 +144,8 @@ Supported draft values: ${Object.keys(DRAFT_VERSIONS).join(", ")}`
140
144
  return createDraft18Codec();
141
145
  case "19":
142
146
  return createDraft19Codec();
147
+ case "20":
148
+ return createDraft20Codec();
143
149
  default:
144
150
  throw new Error(`Unsupported draft: ${draft}`);
145
151
  }
@@ -1,4 +1,4 @@
1
- import { c as Draft } from './types-CdCSIfvI.cjs';
1
+ import { c as Draft } from './types-DG5_iKuv.cjs';
2
2
 
3
3
  type SessionPhase = 'idle' | 'setup' | 'ready' | 'draining' | 'closed' | 'error';
4
4
  type SubscriptionPhase = 'pending' | 'active' | 'error' | 'done';
@@ -70,6 +70,18 @@ type SideEffect = {
70
70
  type: 'subscription-ended';
71
71
  subscribeId: bigint;
72
72
  reason: string;
73
+ } | {
74
+ type: 'fill-fetch-stream-opened';
75
+ subscribeId: bigint;
76
+ requestId: bigint;
77
+ } | {
78
+ type: 'fill-fetch-stream-closed';
79
+ subscribeId: bigint;
80
+ requestId: bigint;
81
+ reason: string;
82
+ } | {
83
+ type: 'subscription-state-notified';
84
+ subscribeId: bigint;
73
85
  } | {
74
86
  type: 'announce-activated';
75
87
  namespace: string[];
@@ -1,4 +1,4 @@
1
- import { c as Draft } from './types-CdCSIfvI.js';
1
+ import { c as Draft } from './types-DG5_iKuv.js';
2
2
 
3
3
  type SessionPhase = 'idle' | 'setup' | 'ready' | 'draining' | 'closed' | 'error';
4
4
  type SubscriptionPhase = 'pending' | 'active' | 'error' | 'done';
@@ -70,6 +70,18 @@ type SideEffect = {
70
70
  type: 'subscription-ended';
71
71
  subscribeId: bigint;
72
72
  reason: string;
73
+ } | {
74
+ type: 'fill-fetch-stream-opened';
75
+ subscribeId: bigint;
76
+ requestId: bigint;
77
+ } | {
78
+ type: 'fill-fetch-stream-closed';
79
+ subscribeId: bigint;
80
+ requestId: bigint;
81
+ reason: string;
82
+ } | {
83
+ type: 'subscription-state-notified';
84
+ subscribeId: bigint;
73
85
  } | {
74
86
  type: 'announce-activated';
75
87
  namespace: string[];
package/dist/session.cjs CHANGED
@@ -6,6 +6,9 @@ var _chunkA655PHFXcjs = require('./chunk-A655PHFX.cjs');
6
6
  var _chunkCQ65LKPQcjs = require('./chunk-CQ65LKPQ.cjs');
7
7
 
8
8
 
9
+ var _chunkBMJMY6FXcjs = require('./chunk-BMJMY6FX.cjs');
10
+
11
+
9
12
  var _chunkE65QKRSNcjs = require('./chunk-E65QKRSN.cjs');
10
13
 
11
14
 
@@ -55,7 +58,8 @@ function createSessionState(options) {
55
58
  "16": _chunk7RE6KSIYcjs.createDraft16SessionState,
56
59
  "17": _chunkYTPZZI2Mcjs.createDraft17SessionState,
57
60
  "18": _chunkA655PHFXcjs.createDraft18SessionState,
58
- "19": _chunkCQ65LKPQcjs.createDraft19SessionState
61
+ "19": _chunkCQ65LKPQcjs.createDraft19SessionState,
62
+ "20": _chunkBMJMY6FXcjs.createDraft20SessionState
59
63
  };
60
64
  const factory = factories[draft];
61
65
  if (!factory) {
@@ -1,19 +1,20 @@
1
- import { S as SessionStateOptions, a as SessionState } from './session-types-KsqyVp6y.cjs';
2
- export { A as AnnouncePhase, b as AnnounceState, F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-KsqyVp6y.cjs';
3
- import { c as Draft } from './types-CdCSIfvI.cjs';
1
+ import { S as SessionStateOptions, a as SessionState } from './session-types-B9idsih-.cjs';
2
+ export { A as AnnouncePhase, b as AnnounceState, F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-B9idsih-.cjs';
3
+ import { c as Draft } from './types-DG5_iKuv.cjs';
4
4
  import { D as Draft07Message, a as Draft07MessageType } from './types-Dl4IaAHR.cjs';
5
5
  import { D as Draft08Message, a as Draft08MessageType } from './types-jV1yDDBA.cjs';
6
6
  import { D as Draft09Message, a as Draft09MessageType } from './types-B3g5G9KP.cjs';
7
7
  import { D as Draft10Message, a as Draft10MessageType } from './types-0IWbU9Z_.cjs';
8
- import { D as Draft11Message, a as Draft11MessageType } from './types-Ck45Ex5S.cjs';
9
- import { D as Draft12Message, a as Draft12MessageType } from './types-Bio-91Rt.cjs';
10
- import { D as Draft13Message, a as Draft13MessageType } from './types-CXlSn0I9.cjs';
11
- import { D as Draft14Message, a as Draft14MessageType } from './types-HI_bbXka.cjs';
12
- import { D as Draft15Message, a as Draft15MessageType } from './types-CPaYBsMG.cjs';
13
- import { D as Draft16Message, a as Draft16MessageType } from './types-Cm9fjeYC.cjs';
14
- import { D as Draft17Message, a as Draft17MessageType } from './types-D9eiB_9A.cjs';
15
- import { D as Draft18Message, a as Draft18MessageType } from './types-Cqp10JtB.cjs';
16
- import { D as Draft19Message, a as Draft19MessageType } from './types-zHgCS6o5.cjs';
8
+ import { D as Draft11Message, a as Draft11MessageType } from './types-D0kTgUuL.cjs';
9
+ import { D as Draft12Message, a as Draft12MessageType } from './types-CI_SX4Xe.cjs';
10
+ import { D as Draft13Message, a as Draft13MessageType } from './types-DjxexghA.cjs';
11
+ import { D as Draft14Message, a as Draft14MessageType } from './types-CmqT0jUf.cjs';
12
+ import { D as Draft15Message, a as Draft15MessageType } from './types-pShrs3fN.cjs';
13
+ import { D as Draft16Message, a as Draft16MessageType } from './types-CZTzbIzQ.cjs';
14
+ import { D as Draft17Message, a as Draft17MessageType } from './types-D4bmW8rY.cjs';
15
+ import { D as Draft18Message, a as Draft18MessageType } from './types-Bg86GGVZ.cjs';
16
+ import { D as Draft19Message, a as Draft19MessageType } from './types-C1rxh-id.cjs';
17
+ import { D as Draft20Message, a as Draft20MessageType } from './types-CY-QWxd-.cjs';
17
18
 
18
19
  /**
19
20
  * @moqtap/codec/session — MoQT session state machine
@@ -37,6 +38,7 @@ type DraftSessionStateMap = {
37
38
  '17': SessionState<Draft17Message, Draft17MessageType>;
38
39
  '18': SessionState<Draft18Message, Draft18MessageType>;
39
40
  '19': SessionState<Draft19Message, Draft19MessageType>;
41
+ '20': SessionState<Draft20Message, Draft20MessageType>;
40
42
  };
41
43
  /**
42
44
  * Create a session state machine for the given draft version.
package/dist/session.d.ts CHANGED
@@ -1,19 +1,20 @@
1
- import { S as SessionStateOptions, a as SessionState } from './session-types-C0l_-Ups.js';
2
- export { A as AnnouncePhase, b as AnnounceState, F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-C0l_-Ups.js';
3
- import { c as Draft } from './types-CdCSIfvI.js';
1
+ import { S as SessionStateOptions, a as SessionState } from './session-types-Dn7b3RZM.js';
2
+ export { A as AnnouncePhase, b as AnnounceState, F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-Dn7b3RZM.js';
3
+ import { c as Draft } from './types-DG5_iKuv.js';
4
4
  import { D as Draft07Message, a as Draft07MessageType } from './types-Dl4IaAHR.js';
5
5
  import { D as Draft08Message, a as Draft08MessageType } from './types-jV1yDDBA.js';
6
6
  import { D as Draft09Message, a as Draft09MessageType } from './types-B3g5G9KP.js';
7
7
  import { D as Draft10Message, a as Draft10MessageType } from './types-0IWbU9Z_.js';
8
- import { D as Draft11Message, a as Draft11MessageType } from './types-Ck45Ex5S.js';
9
- import { D as Draft12Message, a as Draft12MessageType } from './types-Bio-91Rt.js';
10
- import { D as Draft13Message, a as Draft13MessageType } from './types-CXlSn0I9.js';
11
- import { D as Draft14Message, a as Draft14MessageType } from './types-HI_bbXka.js';
12
- import { D as Draft15Message, a as Draft15MessageType } from './types-CPaYBsMG.js';
13
- import { D as Draft16Message, a as Draft16MessageType } from './types-Cm9fjeYC.js';
14
- import { D as Draft17Message, a as Draft17MessageType } from './types-D9eiB_9A.js';
15
- import { D as Draft18Message, a as Draft18MessageType } from './types-Cqp10JtB.js';
16
- import { D as Draft19Message, a as Draft19MessageType } from './types-zHgCS6o5.js';
8
+ import { D as Draft11Message, a as Draft11MessageType } from './types-D0kTgUuL.js';
9
+ import { D as Draft12Message, a as Draft12MessageType } from './types-CI_SX4Xe.js';
10
+ import { D as Draft13Message, a as Draft13MessageType } from './types-DjxexghA.js';
11
+ import { D as Draft14Message, a as Draft14MessageType } from './types-CmqT0jUf.js';
12
+ import { D as Draft15Message, a as Draft15MessageType } from './types-pShrs3fN.js';
13
+ import { D as Draft16Message, a as Draft16MessageType } from './types-CZTzbIzQ.js';
14
+ import { D as Draft17Message, a as Draft17MessageType } from './types-D4bmW8rY.js';
15
+ import { D as Draft18Message, a as Draft18MessageType } from './types-Bg86GGVZ.js';
16
+ import { D as Draft19Message, a as Draft19MessageType } from './types-C1rxh-id.js';
17
+ import { D as Draft20Message, a as Draft20MessageType } from './types-CY-QWxd-.js';
17
18
 
18
19
  /**
19
20
  * @moqtap/codec/session — MoQT session state machine
@@ -37,6 +38,7 @@ type DraftSessionStateMap = {
37
38
  '17': SessionState<Draft17Message, Draft17MessageType>;
38
39
  '18': SessionState<Draft18Message, Draft18MessageType>;
39
40
  '19': SessionState<Draft19Message, Draft19MessageType>;
41
+ '20': SessionState<Draft20Message, Draft20MessageType>;
40
42
  };
41
43
  /**
42
44
  * Create a session state machine for the given draft version.
package/dist/session.js CHANGED
@@ -4,6 +4,9 @@ import {
4
4
  import {
5
5
  createDraft19SessionState
6
6
  } from "./chunk-O5DQ44TM.js";
7
+ import {
8
+ createDraft20SessionState
9
+ } from "./chunk-WX5PU7HF.js";
7
10
  import {
8
11
  createDraft14SessionState
9
12
  } from "./chunk-MZ7HUCGJ.js";
@@ -55,7 +58,8 @@ function createSessionState(options) {
55
58
  "16": createDraft16SessionState,
56
59
  "17": createDraft17SessionState,
57
60
  "18": createDraft18SessionState,
58
- "19": createDraft19SessionState
61
+ "19": createDraft19SessionState,
62
+ "20": createDraft20SessionState
59
63
  };
60
64
  const factory = factories[draft];
61
65
  if (!factory) {
@@ -11,7 +11,7 @@ interface AuthorizationToken {
11
11
  }
12
12
  interface Draft18SetupOptions {
13
13
  path?: string;
14
- authorization_token?: AuthorizationToken;
14
+ authorization_token?: readonly AuthorizationToken[];
15
15
  max_auth_token_cache_size?: bigint;
16
16
  authority?: string;
17
17
  moqt_implementation?: string;
@@ -29,7 +29,7 @@ interface LargestObject {
29
29
  }
30
30
  interface Draft18Params {
31
31
  object_delivery_timeout?: bigint;
32
- authorization_token?: AuthorizationToken;
32
+ authorization_token?: readonly AuthorizationToken[];
33
33
  rendezvous_timeout?: bigint;
34
34
  subgroup_delivery_timeout?: bigint;
35
35
  expires?: bigint;
@@ -11,7 +11,7 @@ interface AuthorizationToken {
11
11
  }
12
12
  interface Draft18SetupOptions {
13
13
  path?: string;
14
- authorization_token?: AuthorizationToken;
14
+ authorization_token?: readonly AuthorizationToken[];
15
15
  max_auth_token_cache_size?: bigint;
16
16
  authority?: string;
17
17
  moqt_implementation?: string;
@@ -29,7 +29,7 @@ interface LargestObject {
29
29
  }
30
30
  interface Draft18Params {
31
31
  object_delivery_timeout?: bigint;
32
- authorization_token?: AuthorizationToken;
32
+ authorization_token?: readonly AuthorizationToken[];
33
33
  rendezvous_timeout?: bigint;
34
34
  subgroup_delivery_timeout?: bigint;
35
35
  expires?: bigint;
@@ -11,7 +11,7 @@ interface AuthorizationToken {
11
11
  }
12
12
  interface Draft19SetupOptions {
13
13
  path?: string;
14
- authorization_token?: AuthorizationToken;
14
+ authorization_token?: readonly AuthorizationToken[];
15
15
  max_auth_token_cache_size?: bigint;
16
16
  authority?: string;
17
17
  max_filter_ranges?: bigint;
@@ -41,7 +41,7 @@ interface LargestObject {
41
41
  }
42
42
  interface Draft19Params {
43
43
  object_delivery_timeout?: bigint;
44
- authorization_token?: AuthorizationToken;
44
+ authorization_token?: readonly AuthorizationToken[];
45
45
  rendezvous_timeout?: bigint;
46
46
  subgroup_delivery_timeout?: bigint;
47
47
  expires?: bigint;
@@ -51,11 +51,11 @@ interface Draft19Params {
51
51
  subscriber_priority?: bigint;
52
52
  location_filter?: LocationFilter;
53
53
  group_order?: bigint;
54
- subgroup_filter?: RangeFilter;
55
- objectid_filter?: RangeFilter;
56
- priority_filter?: RangeFilter;
57
- object_property_filter?: RangeFilter;
58
- track_property_filter?: RangeFilter;
54
+ subgroup_filter?: readonly RangeFilter[];
55
+ objectid_filter?: readonly RangeFilter[];
56
+ priority_filter?: readonly RangeFilter[];
57
+ object_property_filter?: readonly RangeFilter[];
58
+ track_property_filter?: readonly RangeFilter[];
59
59
  new_group_request?: bigint;
60
60
  track_namespace_prefix?: string[];
61
61
  unknown?: UnknownParam[];
@@ -11,7 +11,7 @@ interface AuthorizationToken {
11
11
  }
12
12
  interface Draft19SetupOptions {
13
13
  path?: string;
14
- authorization_token?: AuthorizationToken;
14
+ authorization_token?: readonly AuthorizationToken[];
15
15
  max_auth_token_cache_size?: bigint;
16
16
  authority?: string;
17
17
  max_filter_ranges?: bigint;
@@ -41,7 +41,7 @@ interface LargestObject {
41
41
  }
42
42
  interface Draft19Params {
43
43
  object_delivery_timeout?: bigint;
44
- authorization_token?: AuthorizationToken;
44
+ authorization_token?: readonly AuthorizationToken[];
45
45
  rendezvous_timeout?: bigint;
46
46
  subgroup_delivery_timeout?: bigint;
47
47
  expires?: bigint;
@@ -51,11 +51,11 @@ interface Draft19Params {
51
51
  subscriber_priority?: bigint;
52
52
  location_filter?: LocationFilter;
53
53
  group_order?: bigint;
54
- subgroup_filter?: RangeFilter;
55
- objectid_filter?: RangeFilter;
56
- priority_filter?: RangeFilter;
57
- object_property_filter?: RangeFilter;
58
- track_property_filter?: RangeFilter;
54
+ subgroup_filter?: readonly RangeFilter[];
55
+ objectid_filter?: readonly RangeFilter[];
56
+ priority_filter?: readonly RangeFilter[];
57
+ object_property_filter?: readonly RangeFilter[];
58
+ track_property_filter?: readonly RangeFilter[];
59
59
  new_group_request?: bigint;
60
60
  track_namespace_prefix?: string[];
61
61
  unknown?: UnknownParam[];
@@ -11,12 +11,12 @@ interface AuthorizationToken {
11
11
  interface Draft12SetupParams {
12
12
  path?: string;
13
13
  max_request_id?: bigint;
14
- authorization_token?: AuthorizationToken;
14
+ authorization_token?: readonly AuthorizationToken[];
15
15
  unknown?: UnknownParam[];
16
16
  }
17
17
  interface Draft12Params {
18
18
  delivery_timeout?: bigint;
19
- authorization_token?: AuthorizationToken;
19
+ authorization_token?: readonly AuthorizationToken[];
20
20
  max_cache_duration?: bigint;
21
21
  unknown?: UnknownParam[];
22
22
  }
@@ -11,12 +11,12 @@ interface AuthorizationToken {
11
11
  interface Draft12SetupParams {
12
12
  path?: string;
13
13
  max_request_id?: bigint;
14
- authorization_token?: AuthorizationToken;
14
+ authorization_token?: readonly AuthorizationToken[];
15
15
  unknown?: UnknownParam[];
16
16
  }
17
17
  interface Draft12Params {
18
18
  delivery_timeout?: bigint;
19
- authorization_token?: AuthorizationToken;
19
+ authorization_token?: readonly AuthorizationToken[];
20
20
  max_cache_duration?: bigint;
21
21
  unknown?: UnknownParam[];
22
22
  }