@moq/net 0.3.5 → 0.4.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 (210) hide show
  1. package/announce.d.ts +7 -0
  2. package/announce.d.ts.map +1 -0
  3. package/announce.js +8 -0
  4. package/announce.js.map +1 -0
  5. package/announced.d.ts +35 -91
  6. package/announced.d.ts.map +1 -1
  7. package/announced.js +21 -156
  8. package/announced.js.map +1 -1
  9. package/bandwidth.d.ts +163 -0
  10. package/bandwidth.d.ts.map +1 -0
  11. package/bandwidth.js +304 -0
  12. package/bandwidth.js.map +1 -0
  13. package/bandwidth_api.d.ts +7 -0
  14. package/bandwidth_api.d.ts.map +1 -0
  15. package/bandwidth_api.js +8 -0
  16. package/bandwidth_api.js.map +1 -0
  17. package/broadcast.d.ts +20 -28
  18. package/broadcast.d.ts.map +1 -1
  19. package/broadcast.js +55 -38
  20. package/broadcast.js.map +1 -1
  21. package/connection/accept.d.ts +16 -1
  22. package/connection/accept.d.ts.map +1 -1
  23. package/connection/accept.js +39 -24
  24. package/connection/accept.js.map +1 -1
  25. package/connection/browser.d.ts.map +1 -1
  26. package/connection/browser.js +9 -7
  27. package/connection/browser.js.map +1 -1
  28. package/connection/connect.d.ts +30 -6
  29. package/connection/connect.d.ts.map +1 -1
  30. package/connection/connect.js +85 -45
  31. package/connection/connect.js.map +1 -1
  32. package/connection/established.d.ts +16 -21
  33. package/connection/established.d.ts.map +1 -1
  34. package/connection/established.js.map +1 -1
  35. package/connection/forward.d.ts +2 -0
  36. package/connection/forward.d.ts.map +1 -0
  37. package/connection/forward.js +159 -0
  38. package/connection/forward.js.map +1 -0
  39. package/connection/handshake.d.ts.map +1 -1
  40. package/connection/handshake.js +2 -2
  41. package/connection/handshake.js.map +1 -1
  42. package/connection/index.d.ts +5 -5
  43. package/connection/index.d.ts.map +1 -1
  44. package/connection/index.js +4 -5
  45. package/connection/index.js.map +1 -1
  46. package/connection/pool.d.ts +188 -0
  47. package/connection/pool.d.ts.map +1 -0
  48. package/connection/pool.js +351 -0
  49. package/connection/pool.js.map +1 -0
  50. package/connection/reload.d.ts +14 -93
  51. package/connection/reload.d.ts.map +1 -1
  52. package/connection/reload.js +216 -80
  53. package/connection/reload.js.map +1 -1
  54. package/connection/stats.d.ts +3 -26
  55. package/connection/stats.d.ts.map +1 -1
  56. package/connection/stats.js.map +1 -1
  57. package/connection/transport.d.ts +0 -7
  58. package/connection/transport.d.ts.map +1 -1
  59. package/consume.d.ts +1 -43
  60. package/consume.d.ts.map +1 -1
  61. package/consume.js +1 -1
  62. package/consume.js.map +1 -1
  63. package/error.d.ts +180 -29
  64. package/error.d.ts.map +1 -1
  65. package/error.js +310 -16
  66. package/error.js.map +1 -1
  67. package/errors.d.ts +7 -0
  68. package/errors.d.ts.map +1 -0
  69. package/errors.js +8 -0
  70. package/errors.js.map +1 -0
  71. package/group.d.ts +9 -43
  72. package/group.d.ts.map +1 -1
  73. package/group.js +283 -69
  74. package/group.js.map +1 -1
  75. package/hop.d.ts +107 -0
  76. package/hop.d.ts.map +1 -0
  77. package/hop.js +103 -0
  78. package/hop.js.map +1 -0
  79. package/ietf/aliases.d.ts +1 -78
  80. package/ietf/aliases.d.ts.map +1 -1
  81. package/ietf/cluster.d.ts +6 -120
  82. package/ietf/cluster.d.ts.map +1 -1
  83. package/ietf/cluster.js +81 -41
  84. package/ietf/cluster.js.map +1 -1
  85. package/ietf/connection.d.ts +6 -72
  86. package/ietf/connection.d.ts.map +1 -1
  87. package/ietf/connection.js +11 -47
  88. package/ietf/connection.js.map +1 -1
  89. package/ietf/error.d.ts +11 -0
  90. package/ietf/error.d.ts.map +1 -0
  91. package/ietf/error.js +168 -0
  92. package/ietf/error.js.map +1 -0
  93. package/ietf/filter.d.ts.map +1 -1
  94. package/ietf/filter.js +6 -1
  95. package/ietf/filter.js.map +1 -1
  96. package/ietf/goaway.d.ts.map +1 -1
  97. package/ietf/goaway.js +22 -5
  98. package/ietf/goaway.js.map +1 -1
  99. package/ietf/parameters.d.ts +2 -2
  100. package/ietf/parameters.d.ts.map +1 -1
  101. package/ietf/parameters.js +15 -17
  102. package/ietf/parameters.js.map +1 -1
  103. package/ietf/publish_namespace.d.ts +25 -0
  104. package/ietf/publish_namespace.d.ts.map +1 -1
  105. package/ietf/publish_namespace.js +63 -0
  106. package/ietf/publish_namespace.js.map +1 -1
  107. package/ietf/publisher.d.ts +1 -82
  108. package/ietf/publisher.d.ts.map +1 -1
  109. package/ietf/publisher.js +203 -136
  110. package/ietf/publisher.js.map +1 -1
  111. package/ietf/solicit.d.ts +1 -40
  112. package/ietf/solicit.d.ts.map +1 -1
  113. package/ietf/subscribe.d.ts +1 -5
  114. package/ietf/subscribe.d.ts.map +1 -1
  115. package/ietf/subscribe.js +8 -9
  116. package/ietf/subscribe.js.map +1 -1
  117. package/ietf/subscriber.d.ts +1 -65
  118. package/ietf/subscriber.d.ts.map +1 -1
  119. package/ietf/subscriber.js +154 -73
  120. package/ietf/subscriber.js.map +1 -1
  121. package/ietf/version.d.ts +12 -1
  122. package/ietf/version.d.ts.map +1 -1
  123. package/ietf/version.js +13 -0
  124. package/ietf/version.js.map +1 -1
  125. package/index.d.ts +11 -6
  126. package/index.d.ts.map +1 -1
  127. package/index.js +10 -5
  128. package/index.js.map +1 -1
  129. package/internal.d.ts +97 -1
  130. package/internal.d.ts.map +1 -1
  131. package/internal.js +65 -0
  132. package/internal.js.map +1 -1
  133. package/lite/announce.d.ts +15 -9
  134. package/lite/announce.d.ts.map +1 -1
  135. package/lite/announce.js +47 -20
  136. package/lite/announce.js.map +1 -1
  137. package/lite/connection.d.ts +9 -59
  138. package/lite/connection.d.ts.map +1 -1
  139. package/lite/connection.js +20 -32
  140. package/lite/connection.js.map +1 -1
  141. package/lite/fetch.d.ts +15 -1
  142. package/lite/fetch.d.ts.map +1 -1
  143. package/lite/fetch.js +39 -7
  144. package/lite/fetch.js.map +1 -1
  145. package/lite/goaway.d.ts.map +1 -1
  146. package/lite/goaway.js +7 -1
  147. package/lite/goaway.js.map +1 -1
  148. package/lite/group.d.ts +18 -4
  149. package/lite/group.d.ts.map +1 -1
  150. package/lite/group.js +31 -10
  151. package/lite/group.js.map +1 -1
  152. package/lite/priority.d.ts +1 -61
  153. package/lite/priority.d.ts.map +1 -1
  154. package/lite/priority.js +4 -5
  155. package/lite/priority.js.map +1 -1
  156. package/lite/publisher.d.ts +1 -69
  157. package/lite/publisher.d.ts.map +1 -1
  158. package/lite/publisher.js +507 -200
  159. package/lite/publisher.js.map +1 -1
  160. package/lite/setup.d.ts +7 -7
  161. package/lite/setup.d.ts.map +1 -1
  162. package/lite/setup.js +13 -13
  163. package/lite/setup.js.map +1 -1
  164. package/lite/subscribe.d.ts +61 -13
  165. package/lite/subscribe.d.ts.map +1 -1
  166. package/lite/subscribe.js +186 -44
  167. package/lite/subscribe.js.map +1 -1
  168. package/lite/subscriber.d.ts +8 -57
  169. package/lite/subscriber.d.ts.map +1 -1
  170. package/lite/subscriber.js +179 -117
  171. package/lite/subscriber.js.map +1 -1
  172. package/lite/track.d.ts +4 -10
  173. package/lite/track.d.ts.map +1 -1
  174. package/lite/track.js +34 -29
  175. package/lite/track.js.map +1 -1
  176. package/lite/version.d.ts +31 -6
  177. package/lite/version.d.ts.map +1 -1
  178. package/lite/version.js +71 -11
  179. package/lite/version.js.map +1 -1
  180. package/origin.d.ts +229 -29
  181. package/origin.d.ts.map +1 -1
  182. package/origin.js +1087 -37
  183. package/origin.js.map +1 -1
  184. package/package.json +3 -2
  185. package/path.d.ts +25 -7
  186. package/path.d.ts.map +1 -1
  187. package/path.js +5 -3
  188. package/path.js.map +1 -1
  189. package/stream.d.ts.map +1 -1
  190. package/stream.js +23 -14
  191. package/stream.js.map +1 -1
  192. package/time.d.ts +15 -2
  193. package/time.d.ts.map +1 -1
  194. package/time.js +28 -9
  195. package/time.js.map +1 -1
  196. package/track.d.ts +166 -83
  197. package/track.d.ts.map +1 -1
  198. package/track.js +617 -187
  199. package/track.js.map +1 -1
  200. package/wire.d.ts +67 -0
  201. package/wire.d.ts.map +1 -0
  202. package/wire.js +32 -0
  203. package/wire.js.map +1 -0
  204. package/zod.d.ts +1 -1
  205. package/zod.d.ts.map +1 -1
  206. package/zod.js.map +1 -1
  207. package/mock.d.ts +0 -66
  208. package/mock.d.ts.map +0 -1
  209. package/mock.js +0 -243
  210. package/mock.js.map +0 -1
@@ -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,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAUrD;AAID,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAWxD;AAKD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAWtD;AAED,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAWvD;AAED;;mEAEmE;AACnE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAW1D;AAED;;6BAE6B;AAC7B,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAYvD;AAED;;;;;;;;;+EAS+E;AAC/E,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAQvD;AAED;;;6DAG6D;AAC7D,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAYtD;AAID,eAAO,MAAM,IA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AgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAYxD;AAED;;;;;iEAKiE;AACjE,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAYvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAYvD;AAID,eAAO,MAAM,IAAI,SAAS,CAAC;AAG3B,eAAO,MAAM,OAAO,gBAAgB,CAAC;AAGrC,eAAO,MAAM,OAAO,gBAAgB,CAAC;AAGrC,eAAO,MAAM,OAAO,gBAAgB,CAAC;AAGrC,eAAO,MAAM,OAAO,gBAAgB,CAAC;AAWrC,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE9C"}
package/lite/version.js CHANGED
@@ -5,9 +5,10 @@ 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,
12
13
  };
13
14
  /**
@@ -101,7 +102,7 @@ export function hasAnnounceId(version) {
101
102
  }
102
103
  }
103
104
  /** 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
105
+ * Hop ID, which the publisher uses to skip announces whose hop chain already
105
106
  * passed through the subscriber. Present in lite-04 and lite-05 only.
106
107
  *
107
108
  * The receiver's own reflected-announce check drops those announces anyway (and
@@ -119,10 +120,10 @@ export function hasExcludeHop(version) {
119
120
  return false;
120
121
  }
121
122
  }
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. */
123
+ /** Whether announcements carry the route cost varints alongside the hop chain: the
124
+ * warm and cold cost of pulling the broadcast via this route, accumulated per link.
125
+ * Added in lite-06. Older versions carry neither, so a received route has no cost
126
+ * at all and routing falls back to the hop-count tie-break. */
126
127
  export function hasRouteCost(version) {
127
128
  // Explicitly list older versions so future versions keep the lite-06+ behavior.
128
129
  switch (version) {
@@ -136,6 +137,67 @@ export function hasRouteCost(version) {
136
137
  return true;
137
138
  }
138
139
  }
140
+ /** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, FETCH, and GROUP carry frame indices alongside
141
+ * their group sequences, so a subscription or fetch can start and end partway through a
142
+ * group. Added in lite-06. Older versions only address whole groups, so a route change
143
+ * has to wait for the next group before it can resume.
144
+ *
145
+ * SUBSCRIBE_OK is deliberately not in that list: the resolved start frame follows from
146
+ * its group plus the subscriber's own request, so it needs no frame field. */
147
+ export function hasFrameBounds(version) {
148
+ // Explicitly list older versions so future versions keep the lite-06+ behavior.
149
+ switch (version) {
150
+ case Version.DRAFT_01:
151
+ case Version.DRAFT_02:
152
+ case Version.DRAFT_03:
153
+ case Version.DRAFT_04:
154
+ case Version.DRAFT_05:
155
+ return false;
156
+ default:
157
+ return true;
158
+ }
159
+ }
160
+ /** Whether SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_OK, and TRACK_INFO carry the retired
161
+ * `Ordered` byte.
162
+ *
163
+ * The field is gone from the model: a publisher transmits newest-first within a track,
164
+ * always. Deployed drafts still have the byte in their layout, so it is written as 0 and
165
+ * ignored on read rather than shifting every field behind it. */
166
+ export function hasGroupOrder(version) {
167
+ // Explicitly list older versions so future versions keep the lite-06+ behavior.
168
+ switch (version) {
169
+ case Version.DRAFT_01:
170
+ case Version.DRAFT_02:
171
+ case Version.DRAFT_03:
172
+ case Version.DRAFT_04:
173
+ case Version.DRAFT_05:
174
+ return true;
175
+ default:
176
+ return false;
177
+ }
178
+ }
179
+ /**
180
+ * Whether SUBSCRIBE's `Group Start` is an absolute floor the publisher resolves a start
181
+ * from: the raw minimum group sequence (default 0), with `Subscriber Max Age` as the only
182
+ * gate on how far back delivery begins. Changed in lite-06.
183
+ *
184
+ * Older versions encode `Group Start` as the sequence + 1, with 0 meaning the latest
185
+ * group, so an absent start there pins the cursor to the live edge instead of letting the
186
+ * budget reach back.
187
+ */
188
+ export function resolvesStart(version) {
189
+ // Explicitly list older versions so future versions keep the lite-06+ behavior.
190
+ switch (version) {
191
+ case Version.DRAFT_01:
192
+ case Version.DRAFT_02:
193
+ case Version.DRAFT_03:
194
+ case Version.DRAFT_04:
195
+ case Version.DRAFT_05:
196
+ return false;
197
+ default:
198
+ return true;
199
+ }
200
+ }
139
201
  /// The WebTransport subprotocol identifier for moq-lite.
140
202
  /// Version negotiation still happens via SETUP when this is used.
141
203
  export const ALPN = "moql";
@@ -145,17 +207,15 @@ export const ALPN_03 = "moq-lite-03";
145
207
  export const ALPN_04 = "moq-lite-04";
146
208
  /// The ALPN string for Draft05, which uses ALPN-based version negotiation.
147
209
  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
150
- /// default; a peer only reaches it when both sides explicitly offer this ALPN.
151
- export const ALPN_06_WIP = "moq-lite-06-wip";
210
+ /// The ALPN string for Draft06.
211
+ export const ALPN_06 = "moq-lite-06";
152
212
  const VERSION_NAMES = {
153
213
  [Version.DRAFT_01]: "moq-lite-01",
154
214
  [Version.DRAFT_02]: "moq-lite-02",
155
215
  [Version.DRAFT_03]: "moq-lite-03",
156
216
  [Version.DRAFT_04]: "moq-lite-04",
157
217
  [Version.DRAFT_05]: "moq-lite-05",
158
- [Version.DRAFT_06]: "moq-lite-06-wip",
218
+ [Version.DRAFT_06]: "moq-lite-06",
159
219
  };
160
220
  export function versionName(v) {
161
221
  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;IACjF,+EAA+E;IAC/E,QAAQ,EAAE,UAAU;CACX,CAAC;AAIX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC3C,6EAA6E;IAC7E,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ;YACpB,OAAO,KAAK,CAAC;QACd;YACC,OAAO,IAAI,CAAC;IACd,CAAC;AACF,CAAC;AAED,2FAA2F;AAC3F,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC9C,kFAAkF;IAClF,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ;YACpB,OAAO,KAAK,CAAC;QACd;YACC,OAAO,IAAI,CAAC;IACd,CAAC;AACF,CAAC;AAED,yFAAyF;AACzF,mGAAmG;AACnG,mGAAmG;AACnG,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC5C,iFAAiF;IACjF,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,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AC,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,QAAQ,EAAE,UAAU;IACpB,kEAAkE;IAClE,iFAAiF;IACjF,+EAA+E;IAC/E,4EAA4E;IAC5E,QAAQ,EAAE,UAAU;CACX,CAAC;AAIX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC3C,6EAA6E;IAC7E,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ;YACpB,OAAO,KAAK,CAAC;QACd;YACC,OAAO,IAAI,CAAC;IACd,CAAC;AACF,CAAC;AAED,2FAA2F;AAC3F,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC9C,kFAAkF;IAClF,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ;YACpB,OAAO,KAAK,CAAC;QACd;YACC,OAAO,IAAI,CAAC;IACd,CAAC;AACF,CAAC;AAED,yFAAyF;AACzF,mGAAmG;AACnG,mGAAmG;AACnG,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC5C,iFAAiF;IACjF,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,QAAQ,CAAC;QACtB,KAAK,OAAO,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FT_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} 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/// 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\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};\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,249 @@
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 "@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 a locally announced 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 broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
39
+ announced(scope?: Path.Pattern): announce.Consumer;
40
+ }
41
+ /** Options for resolving a broadcast path. */
42
+ export interface RequestOptions {
43
+ /** Wait for a routed announcement when discovery is supported; otherwise subscribe blindly. */
44
+ announced?: boolean;
45
+ }
46
+ /**
47
+ * The write side of an origin: create broadcasts by path and advertise them.
48
+ *
49
+ * Independent of any connection. A connection given this origin (via its `publish` option)
50
+ * announces and serves the table's originated advertisements for as long as the session
51
+ * lasts; the broadcasts themselves live until their producer closes or {@link close} tears
52
+ * the origin down. A reconnecting session re-announces the table on each attach, so
53
+ * advertisements made while offline surface on the next connection.
54
+ *
55
+ * Create, attach {@link dynamic} for tracks served on demand, populate, then
56
+ * {@link broadcast.Producer.announce}: an exact-path subscribe before the tracks exist is
57
+ * refused, and announcing advertises the path to peers.
58
+ *
59
+ * @public
18
60
  */
19
- export declare const OriginSchema: z.core.$ZodBranded<z.ZodMiniBigInt<bigint>, "Origin", "out">;
20
- export type Origin = z.infer<typeof OriginSchema>;
61
+ export declare class Producer implements Table {
62
+ #private;
63
+ constructor();
64
+ /**
65
+ * Settles once the origin closes: `null` on a clean close, or the abort {@link Error}.
66
+ * Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
67
+ */
68
+ get closed(): GetPromise<Error | null>;
69
+ /**
70
+ * Create a broadcast at `path`, returning its producer.
71
+ *
72
+ * The broadcast appears on this origin's local announce streams immediately.
73
+ * Call {@link broadcast.Producer.announce} to advertise it to peers once its
74
+ * tracks exist. Local consumers can discover and request it without that call.
75
+ *
76
+ * Close the producer to drop it. Creating a path again supersedes the previous
77
+ * broadcast: the origin drops its handle on the old one, which closes it unless the
78
+ * application still holds a consumer clone. A local broadcast also shadows any
79
+ * remote broadcast at the same path.
80
+ */
81
+ createBroadcast(path: Path.Valid): broadcast.Producer;
82
+ /**
83
+ * Advertise `prefix` and serve the requests beneath it.
84
+ *
85
+ * A route is always a prefix: it claims `prefix` and every path beneath it (the
86
+ * empty prefix claims every path). A service that only serves some of them
87
+ * advertises the covering prefix and rejects the rest as they are requested;
88
+ * consumers narrow with a {@link Path.Pattern} locally. The advertisement is
89
+ * visible to {@link Consumer.announced} and forwarded by sessions for as long as
90
+ * the returned {@link Dynamic} lives. A consumer resolving a path under it that
91
+ * no local broadcast covers is handed to the handle as a {@link Request}.
92
+ */
93
+ dynamic(prefix: Path.Valid, route?: Route | {
94
+ hops?: Route["hops"];
95
+ cost?: Route["cost"] | bigint;
96
+ }): Dynamic;
97
+ /** A read handle for this origin, the side a connection's `publish` option borrows. */
98
+ consume(): Consumer;
99
+ /** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
100
+ get discovery(): Getter<boolean | undefined>;
101
+ /** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
102
+ request(path: Path.Valid, options?: RequestOptions): Requesting;
103
+ /** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
104
+ announced(scope?: Path.Pattern): announce.Consumer;
105
+ /** Close the origin, every broadcast it still routes, and its announcement streams. Idempotent. */
106
+ close(abort?: Error): void;
107
+ }
21
108
  /**
22
- * The reserved id 0, meaning "no identity".
109
+ * An open request for a path nothing announced; see {@link Consumer.request}.
23
110
  *
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.
111
+ * @public
27
112
  */
28
- export declare const UNKNOWN_ORIGIN: Origin;
113
+ export declare class Requesting {
114
+ #private;
115
+ /** The requested path. */
116
+ readonly path: Path.Valid;
117
+ /**
118
+ * The resolved broadcast, or undefined while nothing provides the path.
119
+ *
120
+ * The table's route when it has one: a local publish (no round trip) or an announced
121
+ * broadcast, swapping when a republish takes the path. Otherwise a session's blind
122
+ * answer, which is assumed present rather than known live: a missing broadcast
123
+ * surfaces as a reset on the first track subscription, not here. Drops back to
124
+ * undefined when the providing route dies and resolves again when another appears.
125
+ *
126
+ * Yours for as long as the request is open: it is a handle of this request's own, so
127
+ * closing it ends your view of the path rather than the route everyone else reads.
128
+ * {@link close} releases whatever is current.
129
+ */
130
+ readonly active: Getter<broadcast.Consumer | undefined>;
131
+ /**
132
+ * Whether nothing can serve this path, as opposed to not having served it yet.
133
+ *
134
+ * True when the origin routes nothing here and nothing is prepared to answer: no session
135
+ * attached and no connection reconnecting toward one. False whenever {@link active} is
136
+ * set, and false while a connection is still coming up, so the ordinary page-load window
137
+ * before the first handshake reads as pending rather than as a missing broadcast. Waiting
138
+ * on this is futile by definition; wait for an announcement instead, via the origin's
139
+ * `announced`.
140
+ */
141
+ readonly unroutable: Getter<boolean>;
142
+ private constructor();
143
+ /** Withdraw the request. The path stays routed for any other open request. Idempotent. */
144
+ close(): void;
145
+ }
29
146
  /**
30
- * Maximum length of a hop chain. Must match `MAX_HOPS` in Rust's `model/origin.rs`.
147
+ * The read side of an origin: resolve broadcasts by path and watch what is available.
148
+ *
149
+ * Obtain one from {@link Producer.consume}. Pass it to a connection's `publish` option to
150
+ * serve the origin's local broadcasts to that peer; read it directly to consume anything
151
+ * the origin routes, locally published or discovered by a session.
152
+ *
153
+ * @public
154
+ */
155
+ export declare class Consumer {
156
+ #private;
157
+ private constructor();
158
+ /** Settles once the origin closes; see {@link Producer.closed}. */
159
+ get closed(): GetPromise<Error | null>;
160
+ /**
161
+ * Whether the announcement table sees everything the attached sessions can serve.
162
+ *
163
+ * Undefined while no session is attached (nothing is known yet), true when every attached
164
+ * session announces into the table, and false as soon as one does not, where
165
+ * {@link announced} cannot be complete and consumers should {@link request} paths instead
166
+ * of waiting. One blind session among several is still false: the paths only it carries
167
+ * never reach the table, so a consumer that trusted the gate would never see them.
168
+ */
169
+ get discovery(): Getter<boolean | undefined>;
170
+ /**
171
+ * Resolve `path`, optionally waiting for an announcement.
172
+ *
173
+ * The one way to consume by path. {@link Requesting.active} follows whatever the table
174
+ * routes (a local publish, or any feeding session's announcement, swapping on a
175
+ * republish); when nothing does, the request stands and whichever attached session
176
+ * answers first provides a blind subscription instead, re-answered across reconnects.
177
+ * With `announced: true`, an unrouted request waits while discovery is supported and
178
+ * falls back to that blind behavior only when discovery is unavailable. Close the request
179
+ * when done. On a closed origin it never resolves.
180
+ *
181
+ * With several sessions on one origin the first to answer wins, and it may be one that
182
+ * does not carry the path. Nothing corrects that: a missing broadcast surfaces as a reset
183
+ * on the first track and deliberately leaves the handle open, since the wire cannot tell
184
+ * "not here" from "not yet" and a blind handle is expected to survive until a publisher
185
+ * arrives. It matters only on an origin mixing sessions that announce with sessions that
186
+ * cannot, where a path only the silent session carries may sit behind another session's
187
+ * answer. Prefer {@link unroutable} and announcements over blind requests when the origin
188
+ * feeds from more than one connection.
189
+ */
190
+ request(path: Path.Valid, options?: RequestOptions): Requesting;
191
+ /**
192
+ * The announced routes matching `scope`, as a live stream: every currently advertised
193
+ * route arrives first as active, then additions and retractions as they happen.
194
+ * Any pattern is accepted. A local broadcast appears when it is created;
195
+ * {@link broadcast.Producer.announce} only forwards it to peers. A dynamic or
196
+ * received route announces the prefix it covers when its subtree overlaps the scope. The
197
+ * stream ends when the origin closes or the consumer is closed.
198
+ */
199
+ announced(scope?: Path.Pattern): announce.Consumer;
200
+ }
201
+ /**
202
+ * A served route from {@link Producer.dynamic}: advertises a prefix and answers the
203
+ * requests beneath it.
204
+ *
205
+ * Drop it (or {@link close}) to retract the route and reject anything still waiting
206
+ * with {@link StreamCode.NoCapacity}. {@link update} re-prices it in place.
31
207
  *
32
- * Broadcasts with longer chains are rejected, which bounds loop detection and rejects
33
- * pathological announcements across clusters with unbounded forwarding.
208
+ * @public
34
209
  */
35
- export declare const MAX_HOPS = 32;
210
+ export declare class Dynamic {
211
+ #private;
212
+ /** The prefix this handle advertises. */
213
+ readonly prefix: Path.Valid;
214
+ private constructor();
215
+ /** Re-price the route in place. The prefix is fixed at announce time. */
216
+ update(route: Route | {
217
+ hops?: Route["hops"];
218
+ cost?: Route["cost"] | bigint;
219
+ }): void;
220
+ /** Retract the route and reject anything still waiting. Idempotent. */
221
+ close(): void;
222
+ /** Requests under this prefix, as they arrive, each to {@link Request.accept} or reject. */
223
+ requested(): AsyncIterableIterator<Request>;
224
+ }
36
225
  /**
37
- * Generate a fresh origin with a random non-zero id.
226
+ * A pending request for a broadcast to be served on demand.
38
227
  *
39
- * `crypto.getRandomValues` is overkill for best-effort loop detection, but
40
- * used for slightly better distribution than `Math.random` at negligible cost.
228
+ * Yielded by {@link Dynamic.requested}. {@link accept} resolves it with a live
229
+ * broadcast; {@link reject} resolves it with an error. Advancing the iterator or
230
+ * closing it without either rejects the request.
41
231
  *
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.
232
+ * @public
47
233
  */
48
- export declare function randomOrigin(): Origin;
234
+ export declare class Request {
235
+ #private;
236
+ /** The path that was requested. */
237
+ readonly path: Path.Valid;
238
+ private constructor();
239
+ /**
240
+ * Accept the request, resolving every awaiting requester with `broadcast`.
241
+ *
242
+ * The caller keeps producing into `broadcast`; repeat requests for the path share
243
+ * it for as long as it stays live.
244
+ */
245
+ accept(source: broadcast.Producer | broadcast.Consumer): void;
246
+ /** Reject the request, resolving every awaiting requester with `err`. */
247
+ reject(err: Error): void;
248
+ }
49
249
  //# 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,WAAW,CAAC;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