@caprid/moq-core 0.0.0 → 0.1.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 (57) hide show
  1. package/LICENSE +20 -0
  2. package/NOTICE +5 -0
  3. package/README.md +26 -2
  4. package/UPSTREAM.json +34 -0
  5. package/dist/index.d.ts +18 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +10 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/protocol/bytes.d.ts +58 -0
  10. package/dist/protocol/bytes.d.ts.map +1 -0
  11. package/dist/protocol/bytes.js +210 -0
  12. package/dist/protocol/bytes.js.map +1 -0
  13. package/dist/protocol/control-messages.d.ts +544 -0
  14. package/dist/protocol/control-messages.d.ts.map +1 -0
  15. package/dist/protocol/control-messages.js +1110 -0
  16. package/dist/protocol/control-messages.js.map +1 -0
  17. package/dist/protocol/errors.d.ts +64 -0
  18. package/dist/protocol/errors.d.ts.map +1 -0
  19. package/dist/protocol/errors.js +67 -0
  20. package/dist/protocol/errors.js.map +1 -0
  21. package/dist/protocol/object-stream.d.ts +128 -0
  22. package/dist/protocol/object-stream.d.ts.map +1 -0
  23. package/dist/protocol/object-stream.js +255 -0
  24. package/dist/protocol/object-stream.js.map +1 -0
  25. package/dist/protocol/publish-session.d.ts +175 -0
  26. package/dist/protocol/publish-session.d.ts.map +1 -0
  27. package/dist/protocol/publish-session.js +1026 -0
  28. package/dist/protocol/publish-session.js.map +1 -0
  29. package/dist/protocol/request-stream.d.ts +51 -0
  30. package/dist/protocol/request-stream.d.ts.map +1 -0
  31. package/dist/protocol/request-stream.js +94 -0
  32. package/dist/protocol/request-stream.js.map +1 -0
  33. package/dist/protocol/session.d.ts +334 -0
  34. package/dist/protocol/session.d.ts.map +1 -0
  35. package/dist/protocol/session.js +908 -0
  36. package/dist/protocol/session.js.map +1 -0
  37. package/dist/protocol/stream-reset.d.ts +10 -0
  38. package/dist/protocol/stream-reset.d.ts.map +1 -0
  39. package/dist/protocol/stream-reset.js +24 -0
  40. package/dist/protocol/stream-reset.js.map +1 -0
  41. package/dist/protocol/subgroup-writer.d.ts +67 -0
  42. package/dist/protocol/subgroup-writer.d.ts.map +1 -0
  43. package/dist/protocol/subgroup-writer.js +172 -0
  44. package/dist/protocol/subgroup-writer.js.map +1 -0
  45. package/dist/protocol/transport-error.d.ts +29 -0
  46. package/dist/protocol/transport-error.d.ts.map +1 -0
  47. package/dist/protocol/transport-error.js +39 -0
  48. package/dist/protocol/transport-error.js.map +1 -0
  49. package/dist/protocol/varint.d.ts +20 -0
  50. package/dist/protocol/varint.d.ts.map +1 -0
  51. package/dist/protocol/varint.js +99 -0
  52. package/dist/protocol/varint.js.map +1 -0
  53. package/dist/track-source.d.ts +13 -0
  54. package/dist/track-source.d.ts.map +1 -0
  55. package/dist/track-source.js +2 -0
  56. package/dist/track-source.js.map +1 -0
  57. package/package.json +31 -4
@@ -0,0 +1,544 @@
1
+ /**
2
+ * MOQT control-message wire codecs (moq-transport draft-22 §9).
3
+ *
4
+ * Every control or request-stream message is framed as:
5
+ *
6
+ * MOQT Control Message {
7
+ * Message Type (vi64),
8
+ * Message Length (16),
9
+ * Message Body (..),
10
+ * }
11
+ *
12
+ * Scope follows the subscribe-only engine: the encoders cover what a subscriber sends (SETUP, SUBSCRIBE, FETCH,
13
+ * TRACK_STATUS, SUBSCRIBE_NAMESPACE, REQUEST_UPDATE, GOAWAY, and REQUEST_OK / REQUEST_ERROR responses to incoming
14
+ * PUBLISH); the decoders cover what it receives. All draft-version specifics live in this directory — this is the
15
+ * churn-absorption layer for pre-WGLC drafts.
16
+ *
17
+ * Where the draft text and the deployed relay (moq-relay, moq-dev/moq) disagree on a wire detail, the codec follows the
18
+ * relay and says so at the site — interop is with the relay, not the prose.
19
+ *
20
+ * Namespace fields and track names are byte strings on the wire; this codec surfaces them as UTF-8 `string`s, which is
21
+ * what MSF (the streaming format this engine speaks) constrains them to.
22
+ */
23
+ import { ByteReader, ByteWriter } from './bytes.js';
24
+ /**
25
+ * ALPN / WebTransport protocol identifiers the core implements, in the order a client offers them (§6.2: `moqt-` plus
26
+ * the draft number). Version negotiation happens at connection time (`WT-Available-Protocols` in WebTransport, ALPN in
27
+ * native QUIC) — not in SETUP. Draft-22 is the default; draft-20 stays as a fallback for a peer that does not speak
28
+ * draft-22. The two differ on the wire only in the LOCATION_FILTER parameter (§9.20.9), so one codec serves both, and
29
+ * every function that encodes or decodes message parameters takes the negotiated identifier.
30
+ */
31
+ export declare const MOQT_PROTOCOL_IDS: readonly ["moqt-22", "moqt-20"];
32
+ /** A protocol identifier the core implements. */
33
+ export type MoqtProtocolId = (typeof MOQT_PROTOCOL_IDS)[number];
34
+ /** The preferred protocol identifier, and the codec's default when a caller names none. */
35
+ export declare const MOQT_PROTOCOL_ID: MoqtProtocolId;
36
+ /**
37
+ * The codec for a transport's negotiated `protocol`. The connecting layer refuses any protocol outside
38
+ * `MOQT_PROTOCOL_IDS` before a session starts (spec/transport-adapter.md TA-8), so a value outside it here (a test
39
+ * transport that names none) gets the default.
40
+ */
41
+ export declare function resolveMoqtProtocol(protocol: string): MoqtProtocolId;
42
+ /** Control/request message type codes (§9, Table 5). */
43
+ export declare const MESSAGE_TYPE: {
44
+ readonly SETUP: 12032;
45
+ readonly GOAWAY: 16;
46
+ readonly SUBSCRIBE: 3;
47
+ readonly SUBSCRIBE_OK: 4;
48
+ readonly REQUEST_ERROR: 5;
49
+ readonly PUBLISH_NAMESPACE: 6;
50
+ readonly REQUEST_OK: 7;
51
+ readonly NAMESPACE: 8;
52
+ readonly PUBLISH_DONE: 11;
53
+ readonly TRACK_STATUS: 13;
54
+ readonly NAMESPACE_DONE: 14;
55
+ readonly PUBLISH_SKIPPED: 15;
56
+ readonly FETCH: 22;
57
+ readonly FETCH_OK: 24;
58
+ readonly PUBLISH: 29;
59
+ readonly PUBLISH_STATE_NOTIFY: 34;
60
+ readonly REQUEST_UPDATE: 2;
61
+ readonly SUBSCRIBE_NAMESPACE: 80;
62
+ readonly SUBSCRIBE_TRACKS: 81;
63
+ };
64
+ /**
65
+ * Setup Option types (§9.1). A namespace separate from message parameters. A session sends
66
+ * options of these types through its `setupOptions` config, beside the MOQT_IMPLEMENTATION it adds
67
+ * itself.
68
+ */
69
+ export declare const SETUP_OPTION: {
70
+ /** The endpoint's path and query, sent only on native QUIC (§9.1.2). */
71
+ readonly PATH: 1;
72
+ /** A token authorizing the session (§9.1.4). */
73
+ readonly AUTHORIZATION_TOKEN: 3;
74
+ /** How many bytes of registered tokens the sender will cache (§9.1.3). */
75
+ readonly MAX_AUTH_TOKEN_CACHE_SIZE: 4;
76
+ /** The endpoint's host and port, sent only on native QUIC (§9.1.1). */
77
+ readonly AUTHORITY: 5;
78
+ /** The most ranges the sender accepts in one location filter (§9.1.6). */
79
+ readonly MAX_FILTER_RANGES: 6;
80
+ /** The sender's implementation name (§9.1.5). */
81
+ readonly MOQT_IMPLEMENTATION: 7;
82
+ /** The most REQUEST_UPDATE messages the sender accepts unanswered on one request stream (§9.1.7). */
83
+ readonly MAX_REQUEST_UPDATES: 8;
84
+ /**
85
+ * The MoQ Solicit extension (draft-lcurley-moq-solicit-00), not a draft-22 option: `1` asks the peer to advertise
86
+ * namespaces only on a SUBSCRIBE_NAMESPACE, never as unsolicited PUBLISH_NAMESPACE. moq-relay honors it from 0.17.0.
87
+ * Even, so the value is a bare varint.
88
+ */
89
+ readonly SOLICIT: 265050;
90
+ };
91
+ /** Message parameter types (§9.20, §16.7). */
92
+ export declare const PARAMETER_TYPE: {
93
+ readonly OBJECT_DELIVERY_TIMEOUT: 2;
94
+ readonly AUTHORIZATION_TOKEN: 3;
95
+ readonly RENDEZVOUS_TIMEOUT: 4;
96
+ readonly SUBGROUP_DELIVERY_TIMEOUT: 6;
97
+ readonly EXPIRES: 8;
98
+ readonly LARGEST_OBJECT: 9;
99
+ readonly FILL_TIMEOUT: 10;
100
+ readonly FORWARD: 16;
101
+ readonly SUBSCRIBER_PRIORITY: 32;
102
+ readonly LOCATION_FILTER: 33;
103
+ readonly GROUP_ORDER: 34;
104
+ readonly FILL_PARAMETERS: 35;
105
+ readonly SUBGROUP_FILTER: 37;
106
+ readonly OBJECTID_FILTER: 38;
107
+ readonly PRIORITY_FILTER: 39;
108
+ readonly OBJECT_PROPERTY_FILTER: 40;
109
+ readonly TRACK_PROPERTY_FILTER: 41;
110
+ readonly NEW_GROUP_REQUEST: 50;
111
+ readonly TRACK_NAMESPACE_PREFIX: 52;
112
+ readonly INCLUDE_PROPERTIES: 53;
113
+ };
114
+ /**
115
+ * Track Property types (§9.7) — the KVP block trailing SUBSCRIBE_OK / PUBLISH / FETCH_OK. A registry of its own,
116
+ * distinct from both Setup Options and message parameters.
117
+ */
118
+ export declare const TRACK_PROPERTY: {
119
+ /**
120
+ * Units-per-second for the track's object TIMESTAMP extensions. Declaring it in SUBSCRIBE_OK is what opts the track
121
+ * into timestamp forwarding on moq-lite-rs relays — without it they parse and discard the extensions and re-stamp
122
+ * frames on arrival.
123
+ */
124
+ readonly TIMESCALE: 8;
125
+ };
126
+ /** REQUEST_ERROR codes (§16.11.2). */
127
+ export declare const REQUEST_ERROR_CODE: {
128
+ /** An implementation-specific or otherwise unclassified error. */
129
+ readonly INTERNAL_ERROR: 0;
130
+ /** The requester is not authorized for this request. */
131
+ readonly UNAUTHORIZED: 1;
132
+ /** The responder could not complete the request in time. */
133
+ readonly TIMEOUT: 2;
134
+ /** The responder does not support this request. */
135
+ readonly NOT_SUPPORTED: 3;
136
+ /** An authorization token could not be parsed. */
137
+ readonly MALFORMED_AUTH_TOKEN: 4;
138
+ /** An authorization token has expired. */
139
+ readonly EXPIRED_AUTH_TOKEN: 5;
140
+ /** The responder is going away and takes no new requests. */
141
+ readonly GOING_AWAY: 6;
142
+ /** The responder is overloaded. */
143
+ readonly EXCESSIVE_LOAD: 9;
144
+ /** The requested track or namespace does not exist (yet). */
145
+ readonly DOES_NOT_EXIST: 16;
146
+ /** The requested range is invalid. */
147
+ readonly INVALID_RANGE: 17;
148
+ /** The track is malformed and cannot be served as requested. */
149
+ readonly MALFORMED_TRACK: 18;
150
+ /** The responder is not interested in what was offered. */
151
+ readonly UNINTERESTED: 32;
152
+ /** The namespace prefix overlaps one already requested. */
153
+ readonly PREFIX_OVERLAP: 48;
154
+ /** The track namespace is too large. */
155
+ readonly NAMESPACE_TOO_LARGE: 49;
156
+ /** The request needs an extension the responder does not support. */
157
+ readonly UNSUPPORTED_EXTENSION: 51;
158
+ /** The request should be made elsewhere; REQUEST_ERROR carries a {@link Redirect}. */
159
+ readonly REDIRECT: 52;
160
+ /** The request's filters conflict with each other. */
161
+ readonly CONFLICTING_FILTERS: 53;
162
+ /** A filter in the request is invalid. */
163
+ readonly INVALID_FILTER: 54;
164
+ };
165
+ /** PUBLISH_DONE status codes (§12.4). */
166
+ export declare const PUBLISH_DONE_STATUS: {
167
+ /** An implementation-specific or otherwise unclassified error. */
168
+ readonly INTERNAL_ERROR: 0;
169
+ /** The subscriber is no longer authorized. */
170
+ readonly UNAUTHORIZED: 1;
171
+ /** The track ended. */
172
+ readonly TRACK_ENDED: 2;
173
+ /** The publisher or relay is going away. */
174
+ readonly GOING_AWAY: 4;
175
+ /** The subscriber fell too far behind the track. */
176
+ readonly TOO_FAR_BEHIND: 5;
177
+ /** The subscription expired. */
178
+ readonly EXPIRED: 6;
179
+ /** A REQUEST_UPDATE for the subscription could not be applied. */
180
+ readonly UPDATE_FAILED: 8;
181
+ /** The publisher or relay is overloaded. */
182
+ readonly EXCESSIVE_LOAD: 9;
183
+ /** The track is malformed. */
184
+ readonly MALFORMED_TRACK: 18;
185
+ };
186
+ /**
187
+ * Whether a failed request is worth re-issuing unchanged after a backoff. The transient family (`DOES_NOT_EXIST` while
188
+ * a broadcast has not started, `TIMEOUT`, `INTERNAL_ERROR`, overload, `GOING_AWAY`) reflects relay or publisher _state_
189
+ * that time can fix; the permanent family reflects the request itself and loops forever if retried.
190
+ */
191
+ export declare function isRetryableRequestErrorCode(errorCode: number): boolean;
192
+ /** Whether a PUBLISH_DONE'd subscription is worth re-subscribing. */
193
+ export declare function isRetryablePublishDoneStatus(statusCode: number): boolean;
194
+ /** Stream reset / STOP_SENDING error codes (§12.5). */
195
+ export declare const STREAM_RESET_CODE: {
196
+ readonly INTERNAL_ERROR: 0;
197
+ readonly CANCELLED: 1;
198
+ readonly DELIVERY_TIMEOUT: 2;
199
+ readonly SESSION_CLOSED: 3;
200
+ readonly GOING_AWAY: 4;
201
+ readonly TOO_FAR_BEHIND: 5;
202
+ readonly UNKNOWN_OBJECT_STATUS: 6;
203
+ readonly EXPIRED_AUTH_TOKEN: 7;
204
+ readonly EXCESSIVE_LOAD: 9;
205
+ readonly MALFORMED_TRACK: 18;
206
+ };
207
+ /** Maximum body size — the frame length field is 16 bits. */
208
+ export declare const MAX_CONTROL_MESSAGE_LENGTH = 65535;
209
+ /** Most fields a track namespace may have; the codec rejects longer namespaces with `MoqtProtocolError`. */
210
+ export declare const MAX_NAMESPACE_FIELDS = 32;
211
+ /** A particular Object in a Group within a Track (§8.2). */
212
+ export interface Location {
213
+ /** Group ID. */
214
+ group: number;
215
+ /** Object ID within the group. */
216
+ object: number;
217
+ }
218
+ /** `A < B` in Location order (group first, then object). */
219
+ export declare function compareLocations(a: Location, b: Location): number;
220
+ /** Track namespace as an ordered tuple of UTF-8 fields. Byte strings on the wire; MSF constrains them to UTF-8 text. */
221
+ export type TrackNamespace = string[];
222
+ export interface FullTrackName {
223
+ namespace: TrackNamespace;
224
+ name: string;
225
+ }
226
+ /**
227
+ * A generic MOQT Key-Value-Pair. Even types carry a varint value, odd types a byte field. Used for Setup Options and
228
+ * Track/Object Properties (message parameters use per-type encodings instead — see `MessageParameters`).
229
+ */
230
+ export interface KeyValuePair {
231
+ /** Key type; its parity selects the value form. */
232
+ type: number;
233
+ /** A varint `number` for an even `type`, a byte field for an odd one. */
234
+ value: number | Uint8Array;
235
+ }
236
+ /** Serialize pairs in ascending type order with delta-encoded types. */
237
+ export declare function encodeKeyValuePairs(writer: ByteWriter, pairs: readonly KeyValuePair[]): void;
238
+ /** Parse pairs until `reader` reaches `endOffset` (KVP blocks are length-bounded). */
239
+ export declare function decodeKeyValuePairs(reader: ByteReader, endOffset: number): KeyValuePair[];
240
+ /**
241
+ * Which Objects a subscription or fetch covers. Draft-22 opens the LOCATION_FILTER value with a Location Filter Type
242
+ * that selects the fields after it; draft-20 length-prefixes up to four varints (StartGroup, StartObject,
243
+ * EndGroupDelta, EndObject) and the number present selects the meaning. The variants mean the same on both:
244
+ *
245
+ * - `none` — no location constraint, the same as sending no LOCATION_FILTER at all (type 0x00; zero fields on
246
+ * draft-20). A fetch covers `{0,0}` up to Largest Object. A subscription passes all Objects published or received via
247
+ * upstream subscriptions; the draft does not say whether that reaches back into Objects a relay cached before the
248
+ * subscription, so what an ongoing track delivers is the relay's choice, and a relay may start at the live edge.
249
+ * `relative-group` and `absolute` ask for earlier groups explicitly. In REQUEST_UPDATE it clears the filter.
250
+ * - `relative-group` — start at `{Largest.Group + 1 − groupsBeforeNext, 0}`, open-ended: `0` is the next group, `1` the
251
+ * start of the current group (a decodable join), `N` N−1 groups before it (type 0x01; one field on draft-20).
252
+ * - `next-object` — `{Largest.Group, Largest.Object + 1}`, the live edge, which can begin mid-group (type 0x05; the
253
+ * two-field spelling `{0,0}` on draft-20).
254
+ * - `absolute` — an explicit start, optionally bounded by an end group (delta from the start group, whole group
255
+ * included unless `endObject` narrows it) (types 0x02 to 0x04; two to four fields on draft-20). On draft-20 an
256
+ * open-ended absolute `{0,0}` is unfiltered by definition and encodes as `none`, since its two-field spelling reads as
257
+ * `next-object`; draft-22 has a spelling for it.
258
+ */
259
+ export type LocationFilter = {
260
+ /** No location constraint. */
261
+ type: 'none';
262
+ } | {
263
+ /** Start at the live edge, the Object after Largest Object. */
264
+ type: 'next-object';
265
+ } | {
266
+ /** Start a number of groups back from the next group. */
267
+ type: 'relative-group';
268
+ /** `0` for the next group, `1` for the start of the current group, `N` for N−1 groups before it. */
269
+ groupsBeforeNext: number;
270
+ } | {
271
+ /** Start at an explicit Location. */
272
+ type: 'absolute';
273
+ /** First Location covered. */
274
+ start: Location;
275
+ /** End group as a delta from `start.group`; absent leaves the filter open-ended. */
276
+ endGroupDelta?: number;
277
+ /** Last Object ID covered in the end group; requires `endGroupDelta`. Absent covers the whole end group. */
278
+ endObject?: number;
279
+ };
280
+ /**
281
+ * Serialize a filter as the LOCATION_FILTER parameter's value as it follows the Parameter Type: on draft-22 the
282
+ * Location Filter Type and the fields it selects, on draft-20 the field list without its length prefix.
283
+ */
284
+ export declare function encodeLocationFilter(filter: LocationFilter, protocol?: MoqtProtocolId): Uint8Array;
285
+ /** Decode a LOCATION_FILTER value as `encodeLocationFilter` produces it; every byte must belong to the filter. */
286
+ export declare function decodeLocationFilter(bytes: Uint8Array, protocol?: MoqtProtocolId): LocationFilter;
287
+ /** GROUP_ORDER: the order in which the publisher delivers groups. */
288
+ export type GroupOrder = 'ascending' | 'descending';
289
+ /**
290
+ * Decoded message parameters. Unlike Setup Options, message parameters use per-type encodings (uint8 / varint /
291
+ * length-prefixed), so the codec is registry-driven. Per §9.20 an unknown parameter type is a PROTOCOL_VIOLATION
292
+ * (parameters cannot be skipped — the block is bounded by count, not length).
293
+ */
294
+ export interface MessageParameters {
295
+ /** OBJECT_DELIVERY_TIMEOUT value. */
296
+ objectDeliveryTimeout?: number;
297
+ /** SUBGROUP_DELIVERY_TIMEOUT value. */
298
+ subgroupDeliveryTimeout?: number;
299
+ /** RENDEZVOUS_TIMEOUT value. */
300
+ rendezvousTimeout?: number;
301
+ /** FILL_TIMEOUT value. */
302
+ fillTimeout?: number;
303
+ /** Serialized Token structures (§9.20.2). May repeat. */
304
+ authorizationTokens?: Uint8Array[];
305
+ /** EXPIRES value. */
306
+ expires?: number;
307
+ /** LARGEST_OBJECT: the largest Location the responder has for the track. */
308
+ largestObject?: Location;
309
+ /** FORWARD: `1` to send Objects for the subscription, `0` to hold them. */
310
+ forward?: 0 | 1;
311
+ /** SUBSCRIBER_PRIORITY, a single byte. */
312
+ subscriberPriority?: number;
313
+ /** LOCATION_FILTER: which Objects the request covers. */
314
+ locationFilter?: LocationFilter;
315
+ /** GROUP_ORDER: the order the requester wants groups delivered in. */
316
+ groupOrder?: GroupOrder;
317
+ /**
318
+ * FILL_PARAMETERS (§9.20.15): asks the publisher to deliver a fill range on a fetch stream alongside the subscription
319
+ * — its presence alone requests the fill. A nested parameter scope: only the fill-scoped subset is legal inside, and
320
+ * omitted entries inherit the subscription's own values.
321
+ */
322
+ fillParameters?: FillParameters;
323
+ /** NEW_GROUP_REQUEST value. */
324
+ newGroupRequest?: number;
325
+ /** Range-filter parameters (§3.3.2), kept opaque — the engine never sends or interprets them. */
326
+ rangeFilters?: {
327
+ /** Parameter type. */
328
+ type: number;
329
+ /** Encoded parameter value, without its length prefix. */
330
+ value: Uint8Array;
331
+ }[];
332
+ /** TRACK_NAMESPACE_PREFIX: the namespace prefix the request applies to. */
333
+ trackNamespacePrefix?: TrackNamespace;
334
+ /** INCLUDE_PROPERTIES (§9.20.21): `0` asks the responder to send empty Track Properties. Default `1`. */
335
+ includeProperties?: 0 | 1;
336
+ }
337
+ /** The parameters FILL_PARAMETERS may carry (§9.20.15, Table 7). */
338
+ export type FillParameters = Pick<MessageParameters, 'fillTimeout' | 'subscriberPriority' | 'locationFilter' | 'groupOrder' | 'rangeFilters'>;
339
+ type ParameterScope = 'message' | 'fill';
340
+ /**
341
+ * Serialize as `Number of Parameters (vi64)` + delta-typed parameter list. The `'fill'` scope is the nested list inside
342
+ * FILL_PARAMETERS, where only Table 7's types are legal.
343
+ */
344
+ export declare function encodeMessageParameters(writer: ByteWriter, parameters?: MessageParameters, protocol?: MoqtProtocolId, scope?: ParameterScope): void;
345
+ export declare function decodeMessageParameters(reader: ByteReader, protocol?: MoqtProtocolId, scope?: ParameterScope): MessageParameters;
346
+ /**
347
+ * Serialize a Token structure with Alias Type USE_VALUE (0x3) — the stateless form the engine uses to attach an
348
+ * MSF-provided token to a request without alias registration.
349
+ */
350
+ export declare function encodeAuthTokenUseValue(tokenType: number, value: Uint8Array): Uint8Array;
351
+ /** A decoded frame: message type + body bytes (not yet interpreted). */
352
+ export interface ControlMessageFrame {
353
+ type: number;
354
+ body: Uint8Array;
355
+ }
356
+ /**
357
+ * Incremental control-message deframer. Feed it stream chunks; it yields complete `ControlMessageFrame`s as they
358
+ * materialize. Used for both the control streams and request streams (same framing).
359
+ */
360
+ export declare class ControlMessageDeframer {
361
+ #private;
362
+ push(chunk: Uint8Array): ControlMessageFrame[];
363
+ /** Bytes buffered but not yet forming a complete frame. */
364
+ get pendingBytes(): number;
365
+ }
366
+ /** SETUP (§9.1) — first message on the endpoint's control stream. */
367
+ export declare function encodeSetup(options?: readonly KeyValuePair[]): Uint8Array;
368
+ export interface SubscribeRequest {
369
+ requestId: number;
370
+ trackNamespace: TrackNamespace;
371
+ trackName: string;
372
+ parameters?: MessageParameters | undefined;
373
+ }
374
+ /**
375
+ * FETCH (§9.11) has the SUBSCRIBE body: the range is `parameters.locationFilter`, evaluated with the fetch rules of
376
+ * §3.3.1 — relative starts count back from Largest Object, an omitted end stops there, and no filter means the whole
377
+ * track. Nothing selects "standalone" or "joining" any more; a join is a subscription with FILL_PARAMETERS.
378
+ */
379
+ export type FetchRequest = SubscribeRequest;
380
+ /** SUBSCRIBE (§9.6) — first message on a new request stream. */
381
+ export declare function encodeSubscribe(request: SubscribeRequest, protocol?: MoqtProtocolId): Uint8Array;
382
+ /** TRACK_STATUS (§9.13) — identical wire format to SUBSCRIBE. */
383
+ export declare function encodeTrackStatus(request: SubscribeRequest, protocol?: MoqtProtocolId): Uint8Array;
384
+ /** FETCH (§9.11) — first message on a new request stream. */
385
+ export declare function encodeFetch(request: FetchRequest, protocol?: MoqtProtocolId): Uint8Array;
386
+ export interface SubscribeNamespaceRequest {
387
+ requestId: number;
388
+ trackNamespacePrefix: TrackNamespace;
389
+ parameters?: MessageParameters | undefined;
390
+ }
391
+ /** SUBSCRIBE_NAMESPACE (§9.15) — first message on a new request stream. */
392
+ export declare function encodeSubscribeNamespace(request: SubscribeNamespaceRequest, protocol?: MoqtProtocolId): Uint8Array;
393
+ /**
394
+ * REQUEST_UPDATE (§9.5) — sent on an existing request stream. `requestId` is the update's own, freshly allocated
395
+ * Request ID (§6.4.2.1 counts REQUEST_UPDATE among the messages that consume one); the stream identifies the request being
396
+ * updated.
397
+ */
398
+ export declare function encodeRequestUpdate(requestId: number, parameters?: MessageParameters, protocol?: MoqtProtocolId): Uint8Array;
399
+ /**
400
+ * GOAWAY (§9.2). Clients MUST send a zero-length New Session URI, so the encoder takes only the timeout (milliseconds;
401
+ * 0 = no specific timeout).
402
+ */
403
+ export declare function encodeGoaway(timeout?: number): Uint8Array;
404
+ /**
405
+ * REQUEST_OK (§9.3). The subscriber sends this to accept an incoming PUBLISH (PUBLISH_OK). Track Properties are always
406
+ * empty in that role, and since draft-20 so are the parameters — a subscriber changes subscription parameters with
407
+ * REQUEST_UPDATE, not in PUBLISH_OK (§9.8); the session driver's `accept()` therefore takes none. The parameter slot
408
+ * stays for the publisher-side roles of REQUEST_OK (TRACK_STATUS_OK, REQUEST_UPDATE_OK), which the fake peer in tests
409
+ * exercises.
410
+ */
411
+ export declare function encodeRequestOk(parameters?: MessageParameters, protocol?: MoqtProtocolId): Uint8Array;
412
+ /** REQUEST_ERROR (§9.4) without a Redirect — enough to reject incoming requests. */
413
+ export declare function encodeRequestError(errorCode: number, reason?: string, retryInterval?: number): Uint8Array;
414
+ /** SUBSCRIBE_OK (§9.7). */
415
+ export declare function encodeSubscribeOk(trackAlias: number, parameters?: MessageParameters, trackProperties?: readonly KeyValuePair[], protocol?: MoqtProtocolId): Uint8Array;
416
+ /** PUBLISH_DONE (§9.9). */
417
+ export declare function encodePublishDone(statusCode: number, streamCount: number, reason?: string): Uint8Array;
418
+ /** PUBLISH_STATE_NOTIFY (§9.10) — the publisher's unilateral "these subscription parameters changed". */
419
+ export declare function encodePublishStateNotify(parameters?: MessageParameters, protocol?: MoqtProtocolId): Uint8Array;
420
+ /** FETCH_OK (§9.12). */
421
+ export declare function encodeFetchOk(endOfTrack: boolean, endLocation: Location, parameters?: MessageParameters, trackProperties?: readonly KeyValuePair[], protocol?: MoqtProtocolId): Uint8Array;
422
+ /** PUBLISH (§9.8). */
423
+ export declare function encodePublish(request: SubscribeRequest & {
424
+ trackAlias: number;
425
+ }, trackProperties?: readonly KeyValuePair[], protocol?: MoqtProtocolId): Uint8Array;
426
+ export interface PublishNamespaceRequest {
427
+ requestId: number;
428
+ trackNamespace: TrackNamespace;
429
+ parameters?: MessageParameters;
430
+ }
431
+ /** PUBLISH_NAMESPACE (§9.14) — a publisher announcing a namespace. */
432
+ export declare function encodePublishNamespace(request: PublishNamespaceRequest, protocol?: MoqtProtocolId): Uint8Array;
433
+ /**
434
+ * NAMESPACE (§9.16) — announce one namespace on an accepted inbound SUBSCRIBE_NAMESPACE request stream. The body is
435
+ * the namespace suffix relative to that stream's subscribed prefix and nothing else: peers bound-check the tuple
436
+ * against the frame length (moq-lite-rs treats even a zero parameter count as a malformed entry and kills the announce
437
+ * stream), so no parameter block is written.
438
+ */
439
+ export declare function encodeNamespace(trackNamespaceSuffix: TrackNamespace): Uint8Array;
440
+ /** NAMESPACE_DONE (§9.17) — retract a NAMESPACE announcement (same body shape). */
441
+ export declare function encodeNamespaceDone(trackNamespaceSuffix: TrackNamespace): Uint8Array;
442
+ /** Where a REQUEST_ERROR with code `REDIRECT` sends the requester. */
443
+ export interface Redirect {
444
+ /** URI of the endpoint to make the request to. */
445
+ connectUri: string;
446
+ /** Track namespace to request there. */
447
+ trackNamespace: TrackNamespace;
448
+ /** Track name to request there. */
449
+ trackName: string;
450
+ }
451
+ export type ControlMessage = {
452
+ kind: 'setup';
453
+ options: KeyValuePair[];
454
+ } | {
455
+ kind: 'goaway';
456
+ newSessionUri: string;
457
+ timeout: number;
458
+ } | {
459
+ kind: 'subscribe';
460
+ requestId: number;
461
+ trackNamespace: TrackNamespace;
462
+ trackName: string;
463
+ parameters: MessageParameters;
464
+ } | {
465
+ kind: 'track-status';
466
+ requestId: number;
467
+ trackNamespace: TrackNamespace;
468
+ trackName: string;
469
+ parameters: MessageParameters;
470
+ } | {
471
+ kind: 'fetch';
472
+ request: FetchRequest & {
473
+ parameters: MessageParameters;
474
+ };
475
+ } | {
476
+ kind: 'subscribe-namespace';
477
+ requestId: number;
478
+ trackNamespacePrefix: TrackNamespace;
479
+ parameters: MessageParameters;
480
+ } | {
481
+ kind: 'subscribe-ok';
482
+ trackAlias: number;
483
+ parameters: MessageParameters;
484
+ trackProperties: KeyValuePair[];
485
+ } | {
486
+ kind: 'request-ok';
487
+ parameters: MessageParameters;
488
+ trackProperties: KeyValuePair[];
489
+ } | {
490
+ kind: 'request-error';
491
+ errorCode: number;
492
+ retryInterval: number;
493
+ reason: string;
494
+ redirect?: Redirect;
495
+ } | {
496
+ kind: 'request-update';
497
+ requestId: number;
498
+ parameters: MessageParameters;
499
+ } | {
500
+ kind: 'publish-state-notify';
501
+ parameters: MessageParameters;
502
+ } | {
503
+ kind: 'publish-done';
504
+ statusCode: number;
505
+ /** `undefined` when the publisher could not count its streams (the 2^64−1 sentinel, §9.9). */
506
+ streamCount: number | undefined;
507
+ reason: string;
508
+ } | {
509
+ kind: 'publish';
510
+ requestId: number;
511
+ trackNamespace: TrackNamespace;
512
+ trackName: string;
513
+ trackAlias: number;
514
+ parameters: MessageParameters;
515
+ trackProperties: KeyValuePair[];
516
+ } | {
517
+ kind: 'publish-namespace';
518
+ requestId: number;
519
+ trackNamespace: TrackNamespace;
520
+ parameters: MessageParameters;
521
+ } | {
522
+ kind: 'fetch-ok';
523
+ endOfTrack: boolean;
524
+ endLocation: Location;
525
+ parameters: MessageParameters;
526
+ trackProperties: KeyValuePair[];
527
+ } | {
528
+ kind: 'namespace';
529
+ trackNamespaceSuffix: TrackNamespace;
530
+ } | {
531
+ kind: 'namespace-done';
532
+ trackNamespaceSuffix: TrackNamespace;
533
+ } | {
534
+ kind: 'publish-skipped';
535
+ trackNamespaceSuffix: TrackNamespace;
536
+ trackName: string;
537
+ };
538
+ /**
539
+ * Decode one control-message frame into a typed message. Throws `MoqtProtocolError` for unknown message types (§9: "An
540
+ * endpoint that receives an unknown message type MUST close the session") and for malformed bodies.
541
+ */
542
+ export declare function decodeControlMessage(frame: ControlMessageFrame, protocol?: MoqtProtocolId): ControlMessage;
543
+ export {};
544
+ //# sourceMappingURL=control-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-messages.d.ts","sourceRoot":"","sources":["../../src/protocol/control-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAA0B,MAAM,YAAY,CAAC;AAQ5E;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,iCAAkC,CAAC;AAEjE,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,EAAE,cAA0B,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAEpE;AAED,wDAAwD;AACxD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CAoBf,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,wEAAwE;;IAExE,gDAAgD;;IAEhD,0EAA0E;;IAE1E,uEAAuE;;IAEvE,0EAA0E;;IAE1E,iDAAiD;;IAEjD,qGAAqG;;IAErG;;;;OAIG;;CAEK,CAAC;AAEX,8CAA8C;AAC9C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;CAqBjB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,cAAc;IACzB;;;;OAIG;;CAEK,CAAC;AAEX,sCAAsC;AACtC,eAAO,MAAM,kBAAkB;IAC7B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