@macula-io/ts 0.17.0 → 0.18.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.
package/dist/session.js CHANGED
@@ -50,20 +50,26 @@ export class Session {
50
50
  #identity;
51
51
  #activeServe = null;
52
52
  #activeSubscription = null;
53
- // Serializes every native call that uses this Session's control
54
- // stream: call()/callWithUcan()/the DHT methods, plus serve()'s
55
- // advertise, each poll tick and unadvertise, plus subscribe()'s start
56
- // and stop, so only one of them is in flight at a time. It was added
57
- // when macula-go read the control stream without a lock, so two reads
58
- // racing it corrupted the stream -- verified live: `Promise.all` of 4
59
- // concurrent call()s on one Session left EVERY later read on that
60
- // Session permanently failing "claimed frame length ... exceeds the
61
- // 16777215-byte cap". macula-go v0.10.0, which this release embeds,
62
- // reads the control stream on one goroutine and routes each reply,
63
- // event and inbound CALL to what is waiting for it, so concurrent calls
64
- // no longer race; this release keeps the queue as it was.
65
- // publish()/putContent()/getContent() do NOT go through it -- see their
66
- // own docs (a pure write, and each own dedicated QUIC stream).
53
+ // Serializes every operation that reads this Session's shared
54
+ // control stream: call()/callWithUcan()/the DHT methods, plus
55
+ // serve()'s advertise + each poll tick + unadvertise, plus
56
+ // subscribe()'s start + stop. macula-go's connection/frame_stream.go
57
+ // RecvFrame mutates a shared buffer with no mutex of its own, so two
58
+ // reads racing it corrupt the stream -- verified live: `Promise.all`
59
+ // of 4 concurrent call()s on one Session left EVERY later read on
60
+ // that same Session permanently failing "claimed frame length ...
61
+ // exceeds the 16777215-byte cap" (a torn buffer), not just that one
62
+ // batch. The `#activeServe`/`#activeSubscription` checks above only
63
+ // ever protected call()-family operations from an ACTIVE serve()/
64
+ // subscribe() -- they did nothing to stop two ordinary call()s (or a
65
+ // call() racing a DHT method) from racing each other, since neither
66
+ // flag is set in that case. This queue is what actually closes that
67
+ // gap: every control-stream-reading native call funnels through
68
+ // #enqueue, so only one is ever in flight at a time, regardless of
69
+ // which method it came from. publish()/putContent()/getContent() do
70
+ // NOT go through this -- see their own docs for why (a pure write,
71
+ // and each own dedicated QUIC stream, respectively -- neither reads
72
+ // this shared stream at all).
67
73
  #queue = Promise.resolve();
68
74
  #enqueue(fn) {
69
75
  const result = this.#queue.then(fn, fn);
@@ -102,27 +108,31 @@ export class Session {
102
108
  }
103
109
  return this.#handle;
104
110
  }
105
- /** call()'s own handle-plus-one-role check, factored out since the DHT
106
- * methods below and the direct-dial methods are CALLs too (macula-go's
107
- * dht.FindRecord et al. are a connection.Session.Call under the hood,
108
- * see cabi/dht.go). A Session takes one role at a time: calls, one
109
- * serve(), or one subscribe(). macula-go v0.10.0 routes each reply,
110
- * event and inbound CALL on its own, so a call beside a serve() or
111
- * subscribe() no longer races; this release keeps the check as it was.
112
- * publish() is deliberately NOT checked: it only ever WRITES a
113
- * fire-and-forget frame (connection.Session.Publish), and the live
114
- * pubsub round trip this SDK's own test performs (subscribe(), then
115
- * publish() on the SAME Session while that subscription is active)
116
- * depends on publish() staying unchecked here. */
111
+ /** call()'s own handle-plus-exclusivity guard, factored out since the
112
+ * DHT methods below (findRecord/findRecords/findRecordsByType/
113
+ * putRecord) all end up on this Session's same shared control stream
114
+ * too -- macula-go's dht.FindRecord et al. are themselves just a
115
+ * connection.Session.Call under the hood (see cabi/dht.go), so mixing
116
+ * one of these with an active serve() OR subscribe() on this Session
117
+ * races exactly the way call() itself would: serve()'s poll loop and
118
+ * subscribe()'s background reader both read frames off this same
119
+ * stream on their own schedule, same as call()'s own blocking read
120
+ * does. publish() is deliberately NOT guarded by this: it only ever
121
+ * WRITES a fire-and-forget frame (connection.Session.Publish), never
122
+ * reads, so it does not race a concurrent reader the way call()/
123
+ * serve()/subscribe()/the DHT methods do -- and the live pubsub round
124
+ * trip this SDK's own test performs (subscribe(), then publish() on
125
+ * the SAME Session while that subscription is active) depends on
126
+ * publish() staying unguarded here. */
117
127
  #requireHandleNotServing(caller) {
118
128
  const handle = this.#requireHandle();
119
129
  if (this.#activeServe !== null) {
120
130
  throw new Error(`macula-ts: Session.${caller}() while serve("${this.#activeServe.procedure}") is active on the same ` +
121
- `Session is not supported -- open a second Session for the other role.`);
131
+ `Session races on the shared control stream -- open a second Session for the other role.`);
122
132
  }
123
133
  if (this.#activeSubscription !== null) {
124
134
  throw new Error(`macula-ts: Session.${caller}() while subscribe("${this.#activeSubscription.topic}") is active on the ` +
125
- `same Session is not supported -- open a second Session for the other role.`);
135
+ `same Session races on the shared control stream -- open a second Session for the other role.`);
126
136
  }
127
137
  return handle;
128
138
  }
@@ -200,10 +210,13 @@ export class Session {
200
210
  *
201
211
  * Real network I/O -- a signed frame out and a wait for the reply,
202
212
  * up to opts.deadlineMs -- so this runs off the main thread on the
203
- * native side, like connect()/close(). Rejects while a serve() or
204
- * subscribe() is active on the SAME Session (#requireHandleNotServing):
205
- * a Session takes one role at a time, so open a second Session for the
206
- * other role, exactly what this SDK's own live test does. */
213
+ * native side, like connect()/close(). Do not call this
214
+ * concurrently with an active serve() on the SAME Session: both read
215
+ * frames off the one shared control stream, and macula-go's own
216
+ * ServeOneCall/Call docs both warn that mixing roles on one
217
+ * connection races (an unrelated frame arriving first is discarded,
218
+ * not queued) -- open a second Session for the other role instead,
219
+ * exactly what this SDK's own live test does. */
207
220
  async call(procedure, payload, opts = {}) {
208
221
  const handle = this.#requireHandleNotServing("call");
209
222
  const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
@@ -241,8 +254,9 @@ export class Session {
241
254
  * security property that isn't actually enforced.
242
255
  *
243
256
  * Real network I/O, off the main thread on the native side, and
244
- * subject to the same one-role check as `call()`
245
- * (`#requireHandleNotServing`). */
257
+ * subject to the identical same-Session exclusivity rule as `call()`
258
+ * (`#requireHandleNotServing`) -- both end up on the same shared
259
+ * control stream. */
246
260
  async callWithUcan(procedure, payload, ucanToken, opts = {}) {
247
261
  const handle = this.#requireHandleNotServing("callWithUcan");
248
262
  const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
@@ -268,15 +282,11 @@ export class Session {
268
282
  * between this and the JS handler) would map to
269
283
  * TemporaryRelayFailure, per that same file.
270
284
  *
271
- * Only one serve() registration is allowed per Session at a time: each
272
- * poll tick takes the next inbound CALL from the session's one queue
273
- * (macula-go's ServeOneCall) and answers a CALL for a procedure it
274
- * doesn't serve with unknown_next_peer, so a second serve() would answer
275
- * CALLs meant for the first. Open a second Session for a second
276
- * procedure instead of trying to serve two procedures off one. serve()
277
- * also refuses while a subscribe() is active on the same Session, and
278
- * call()/the DHT methods refuse while a serve() is (the one-role rule,
279
- * #requireHandleNotServing).
285
+ * Only one serve() registration is allowed per Session at a time --
286
+ * see call()'s own doc on why mixing roles (or two server loops) on
287
+ * one connection is unsafe, not just inadvisable; open a second
288
+ * Session for a second procedure instead of trying to serve two
289
+ * procedures off one.
280
290
  *
281
291
  * `opts.bytes` picks how bytes in each inbound CALL's payload reach
282
292
  * `handler`: "hex" (the default) or "tagged" (rpc.ts's BytesOutput).
@@ -292,13 +302,13 @@ export class Session {
292
302
  async serve(procedure, handler, opts = {}) {
293
303
  const bytesMode = bytesModeFor(opts.bytes);
294
304
  if (this.#activeServe !== null) {
295
- throw new Error(`macula-ts: Session is already serving "${this.#activeServe.procedure}" -- a second serve() on the ` +
296
- `same Session would answer CALLs meant for the first, since each serve() takes the next inbound CALL ` +
297
- `from the session's one queue; open a second Session instead.`);
305
+ throw new Error(`macula-ts: Session is already serving "${this.#activeServe.procedure}" -- macula-go's ServeOneCall reads ` +
306
+ `one frame at a time off the shared control stream, so a second concurrent serve() (or a serve() ` +
307
+ `alongside call()) on the same Session races; open a second Session instead.`);
298
308
  }
299
309
  if (this.#activeSubscription !== null) {
300
310
  throw new Error(`macula-ts: Session.serve() while subscribe("${this.#activeSubscription.topic}") is active on the same ` +
301
- `Session is not supported -- open a second Session for the other role.`);
311
+ `Session races on the shared control stream -- open a second Session for the other role.`);
302
312
  }
303
313
  const handle = this.#requireHandle();
304
314
  const identityHandle = this.#identity.handleForFfi();
@@ -376,9 +386,9 @@ export class Session {
376
386
  * signature or checks its expiry -- see DhtRecord's own doc (dht.ts).
377
387
  *
378
388
  * Real network I/O, off the main thread on the native side, exactly
379
- * like call() -- and subject to the same one-role rule as call() (see
380
- * #requireHandleNotServing's own doc): it refuses while a serve() or
381
- * subscribe() is active on the same Session. */
389
+ * like call() -- and subject to the same same-Session exclusivity
390
+ * rule as call() (see #requireHandleNotServing's own doc): do not
391
+ * call this while serve() is active on the same Session. */
382
392
  async findRecordsByType(recordType) {
383
393
  const handle = this.#requireHandleNotServing("findRecordsByType");
384
394
  const json = await this.#enqueue(() => native.dhtFindRecordsByType(handle, this.#identity.handleForFfi(), recordType));
@@ -390,7 +400,7 @@ export class Session {
390
400
  * procedure, not just the first one found. `key` must be exactly 32
391
401
  * bytes -- see dht/record.go's ProcedureKey/StationEndpointKey/
392
402
  * ContentKey (macula-go) for how those are derived from the thing
393
- * being looked up. Same I/O and one-role notes as
403
+ * being looked up. Same I/O and exclusivity notes as
394
404
  * findRecordsByType(). */
395
405
  async findRecords(key) {
396
406
  const handle = this.#requireHandleNotServing("findRecords");
@@ -402,7 +412,7 @@ export class Session {
402
412
  * dht.FindRecord). Resolves `null` when none exists -- mirrors
403
413
  * macula-go's own dht.ErrNotFound, translated to a value instead of a
404
414
  * thrown error since "not found" is an expected, routine outcome
405
- * here, not exceptional. Same I/O and one-role notes as
415
+ * here, not exceptional. Same I/O and exclusivity notes as
406
416
  * findRecordsByType(). */
407
417
  async findRecord(key) {
408
418
  const handle = this.#requireHandleNotServing("findRecord");
@@ -444,7 +454,7 @@ export class Session {
444
454
  * silently becomes CBOR text. Typed arguments rule that mistake out
445
455
  * (see DhtRecord's own doc). `ttlMs` defaults to DHT_DEFAULT_TTL_MS
446
456
  * (48h). Resolves with the signed record actually stored. Same I/O
447
- * and one-role notes as findRecordsByType(). */
457
+ * and exclusivity notes as findRecordsByType(). */
448
458
  async putProcedureAdvertisement(procedure, servingStation, opts = {}) {
449
459
  const handle = this.#requireHandleNotServing("putProcedureAdvertisement");
450
460
  requireKey32(servingStation);
@@ -461,7 +471,7 @@ export class Session {
461
471
  * own doc for wrapping macula-go's real constructor instead of a
462
472
  * generic JSON-payload builder (announcer_node/mcid are the same kind
463
473
  * of raw-byte field). `ttlMs` defaults to DHT_DEFAULT_TTL_MS (48h).
464
- * Same I/O and one-role notes as findRecordsByType(). */
474
+ * Same I/O and exclusivity notes as findRecordsByType(). */
465
475
  async putContentAnnouncement(mcid, endpoint, ttlMs = DHT_DEFAULT_TTL_MS) {
466
476
  const handle = this.#requireHandleNotServing("putContentAnnouncement");
467
477
  if (mcid.length !== 34) {
@@ -491,7 +501,7 @@ export class Session {
491
501
  * diagnostics).
492
502
  *
493
503
  * Real network I/O, off the main thread on the native side, subject to
494
- * the same one-role rule as `call()`/the DHT methods
504
+ * the same same-Session exclusivity rule as `call()`/the DHT methods
495
505
  * (`#requireHandleNotServing`). */
496
506
  async resolveDirect(procedure, opts = {}) {
497
507
  if (opts.deadlineMs !== undefined && !(opts.deadlineMs > 0)) {
@@ -522,9 +532,9 @@ export class Session {
522
532
  *
523
533
  * Real network I/O (DHT lookups, a fresh QUIC dial, then the CALL
524
534
  * itself) -- off the main thread on the native side, subject to the
525
- * same one-role rule as `call()` for THIS Session's own DHT-querying use
526
- * (the separate dialed connection this opens internally is not this
527
- * Session and is never exposed as one). */
535
+ * same same-Session exclusivity rule as `call()` for THIS Session's own
536
+ * DHT-querying use (the separate dialed connection this opens
537
+ * internally is not this Session and is never exposed as one). */
528
538
  async callDirect(procedure, payload, opts = {}) {
529
539
  const handle = this.#requireHandleNotServing("callDirect");
530
540
  const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
@@ -548,7 +558,7 @@ export class Session {
548
558
  * method's and ucan.ts's own doc for why: macula's UCAN gate is a
549
559
  * bearer-token check, not an audience match).
550
560
  *
551
- * Same I/O and one-role notes as `callDirect()`. */
561
+ * Same I/O and exclusivity notes as `callDirect()`. */
552
562
  async callDirectWithUcan(procedure, payload, ucanToken, opts = {}) {
553
563
  const handle = this.#requireHandleNotServing("callDirectWithUcan");
554
564
  const timeoutMs = opts.deadlineMs ?? DEFAULT_CALL_TIMEOUT_MS;
@@ -587,8 +597,10 @@ export class Session {
587
597
  *
588
598
  * **Must NOT be called on a Session that is also actively
589
599
  * `serve()`-ing** -- enforced by the same `#requireHandleNotServing`
590
- * one-role check `call()`/the DHT methods use, since this method's own
591
- * `PutRecord` is a CALL. A
600
+ * guard `call()`/the DHT methods use, for the identical reason: this
601
+ * method's own `PutRecord` CALL reads a RESULT off the same shared
602
+ * control stream `serve()`'s poll loop is also reading, and the two
603
+ * would race (matches `directdial.AdvertiseDirect`'s own doc). A
592
604
  * provider that also serves `procedure` needs a SEPARATE Session (and
593
605
  * identity -- this fleet enforces one connection per identity, kicking
594
606
  * whichever connects second) to call this on.
@@ -613,11 +625,13 @@ export class Session {
613
625
  * observes a subscriber's own publish arriving back at it rather than
614
626
  * asserting it as a hard guarantee, for the same reason).
615
627
  *
616
- * Deliberately NOT subject to the one-role rule call()/serve()/
617
- * subscribe()/the DHT methods share (see #requireHandleNotServing's own
618
- * doc) -- publish() only ever writes, so it runs on the SAME Session a
619
- * subscribe() of its own is active on -- exactly what a subscriber
620
- * publishing to (and receiving) its own topic needs.
628
+ * Deliberately NOT guarded by the same-Session exclusivity rule
629
+ * call()/serve()/subscribe()/the DHT methods share (see
630
+ * #requireHandleNotServing's own doc) -- publish() only ever writes,
631
+ * never reads off the shared control stream, so it does not race a
632
+ * concurrent serve()/subscribe() the way those do, and can run safely
633
+ * on the SAME Session a subscribe() of its own is active on -- exactly
634
+ * what a subscriber publishing to (and receiving) its own topic needs.
621
635
  *
622
636
  * `opts.realm` (see CallOptions.realm's own doc for the hex-string
623
637
  * format and exact-match semantics) scopes which realm this EVENT is
@@ -635,18 +649,21 @@ export class Session {
635
649
  await native.sessionPublish(handle, this.#identity.handleForFfi(), realm, topic, payloadJson, opts.ttlMs ?? 0);
636
650
  }
637
651
  /** Pubsub: sends a signed SUBSCRIBE for `topic`, then delivers every
638
- * inbound EVENT for it to `handler` -- a background goroutine on the Go
639
- * side reads the macula-go connection.Subscription that SUBSCRIBE
640
- * opened (see cabi/pubsub.go's own doc for why the SUBSCRIBE goes out
641
- * before that goroutine starts). Delivery is Go-driven, not JS-driven:
642
- * unlike serve()'s
652
+ * inbound EVENT for it to `handler` -- macula-go's own
653
+ * connection.Session.RunSubscriber (connection/subscriber.go) drives
654
+ * the actual read loop on the Go side, in a background goroutine, NOT
655
+ * reimplemented on top of a hand-rolled poll here (see cabi/pubsub.go's
656
+ * own doc for why RunSubscriber specifically, over the lower-level
657
+ * RecvEvent). Delivery is Go-driven, not JS-driven: unlike serve()'s
643
658
  * poll loop, nothing on this side calls into the native layer
644
659
  * repeatedly to ask "did anything arrive yet" -- the addon calls INTO
645
660
  * this handler asynchronously, via a Napi::ThreadSafeFunction wired to
646
661
  * that background goroutine, whenever an EVENT actually shows up.
647
662
  *
648
663
  * Only one subscribe() (and no active serve()) is allowed per Session
649
- * at a time -- the one-role rule (#requireHandleNotServing's own doc).
664
+ * at a time -- same reasoning as serve()'s own one-at-a-time rule
665
+ * (#requireHandleNotServing's own doc): the background reader and any
666
+ * other read off this Session's shared control stream would race.
650
667
  * Open a second Session for a second topic (or to serve/call
651
668
  * concurrently) instead.
652
669
  *
@@ -681,11 +698,12 @@ export class Session {
681
698
  async subscribe(topic, handler, opts = {}) {
682
699
  if (this.#activeServe !== null) {
683
700
  throw new Error(`macula-ts: Session.subscribe() while serve("${this.#activeServe.procedure}") is active on the same ` +
684
- `Session is not supported -- open a second Session for the other role.`);
701
+ `Session races on the shared control stream -- open a second Session for the other role.`);
685
702
  }
686
703
  if (this.#activeSubscription !== null) {
687
- throw new Error(`macula-ts: Session is already subscribed to "${this.#activeSubscription.topic}" -- one ` +
688
- `subscribe() per Session is supported; open a second Session instead.`);
704
+ throw new Error(`macula-ts: Session is already subscribed to "${this.#activeSubscription.topic}" -- macula-go's ` +
705
+ `RunSubscriber reads one frame at a time off the shared control stream, so a second concurrent ` +
706
+ `subscribe() on the same Session races; open a second Session instead.`);
689
707
  }
690
708
  const handle = this.#requireHandle();
691
709
  const identityHandle = this.#identity.handleForFfi();
@@ -751,8 +769,8 @@ export class Session {
751
769
  }
752
770
  /** Content transfer: stores `data` (macula-go's content.Put, on this
753
771
  * Session's own fresh dedicated QUIC stream -- Session.
754
- * OpenDedicatedStream on the Go side, NOT the control stream
755
- * call()/serve()/the DHT methods/subscribe() all use), chunking
772
+ * OpenDedicatedStream on the Go side, NOT the shared control stream
773
+ * call()/serve()/the DHT methods/subscribe() all read from), chunking
756
774
  * automatically above manifest.DefaultChunkSize (256 KiB) and
757
775
  * returning the hex-encoded mcid it's now addressable by. `name` is
758
776
  * used ONLY on the chunked path (attached to the resulting manifest)
@@ -763,11 +781,12 @@ export class Session {
763
781
  * station may forget this content later, and there is no list/delete
764
782
  * operation. Treat this as "hand these bytes to a peer once."
765
783
  *
766
- * Because Put opens its own dedicated stream, this is, unlike call()/
767
- * serve()/the DHT methods/subscribe(), never subject to Session's
768
- * one-role rule (#requireHandleNotServing) -- it can run concurrently
769
- * with an active serve()/subscribe() (or another putContent()/
770
- * getContent()) on the same Session.
784
+ * Because Put opens its own dedicated stream instead of reading the
785
+ * shared control stream, this is, unlike call()/serve()/the DHT
786
+ * methods/subscribe(), never subject to Session's same-Session
787
+ * exclusivity guard (#requireHandleNotServing) -- it can run
788
+ * concurrently with an active serve()/subscribe() (or another
789
+ * putContent()/getContent()) on the same Session without racing.
771
790
  *
772
791
  * Real network I/O (one or more signed CALLs on the new stream) --
773
792
  * runs off the main thread on the native side, like every other
@@ -791,9 +810,9 @@ export class Session {
791
810
  * (a bad session, a malformed mcid, a real transport error) rejects
792
811
  * with a plain Error instead.
793
812
  *
794
- * Not subject to the one-role rule, for the same dedicated-stream
795
- * reason as putContent() -- safe alongside an active serve()/subscribe()
796
- * on the same Session. Real network I/O, runs off the main thread. */
813
+ * Same dedicated-stream, no-exclusivity-guard reasoning as
814
+ * putContent() -- safe alongside an active serve()/subscribe() on the
815
+ * same Session. Real network I/O, runs off the main thread. */
797
816
  async getContent(mcid) {
798
817
  const handle = this.#requireHandle();
799
818
  const data = await native.contentGet(handle, this.#identity.handleForFfi(), mcid);
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kEAAkE;AAClE,uEAAuE;AACvE,oEAAoE;AACpE,sEAAsE;AACtE,uBAAuB;AACvB,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,uEAAuE;AACvE,sEAAsE;AACtE,QAAQ;AACR,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAiC,MAAM,UAAU,CAAC;AAI7E,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,eAAe,EACf,aAAa,GAId,MAAM,UAAU,CAAC;AAyClB,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAE9C;;;;;;;;;;;;oEAYoE;AACpE,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IACzD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,sEAAsE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACnD,CAAC;AAkBD,MAAM,OAAO,OAAO;IAClB,OAAO,CAAgB;IACvB,gEAAgE;IAChE,oEAAoE;IACpE,oEAAoE;IACpE,2DAA2D;IAC3D,gEAAgE;IACh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,EAAE,IAAI,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;uCAuBmC;IACnC,KAAK,CAAC,UAAU,CAAC,IAAgB,EAAE,IAAI,GAAG,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACxF,OAAO,EAAE,IAAI,EAAE,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;mEAgB+D;IAC/D,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC;QAClF,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,YAAY,CAAC,GAAe;IACnC,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,oDAAoD,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACpF,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { type Handle } from "./binding.js";
2
+ import { type BytesOutput, type JsonValue } from "./wire.js";
3
+ /** The three stream modes: the provider sends (server), the caller sends and
4
+ * the provider replies (client), or both send (bidi). */
5
+ export declare enum StreamMode {
6
+ Server = 0,
7
+ Client = 1,
8
+ Bidi = 2
9
+ }
10
+ /** A frame the peer sent: a chunk (raw bytes as hex or tagged, or a value),
11
+ * the end of its sending ("send") or of the stream ("both"), or the
12
+ * provider's reply. */
13
+ export type StreamEvent = {
14
+ readonly kind: "data";
15
+ readonly encoding: "raw" | "msgpack";
16
+ readonly body: JsonValue;
17
+ } | {
18
+ readonly kind: "end";
19
+ readonly role: "send" | "both";
20
+ } | {
21
+ readonly kind: "reply";
22
+ readonly payload: JsonValue;
23
+ };
24
+ /** A stream's open: who opened it, where, and its payload. */
25
+ export interface StreamRequest {
26
+ readonly caller: string;
27
+ readonly realm: string;
28
+ readonly procedure: string;
29
+ readonly payload: JsonValue;
30
+ readonly deadlineMs: number;
31
+ }
32
+ export declare class Stream {
33
+ private readonly handle;
34
+ private readonly bytes;
35
+ private freed;
36
+ /** @internal */
37
+ constructor(handle: Handle, bytes: BytesOutput | undefined);
38
+ /** The stream's open. */
39
+ request(): StreamRequest;
40
+ /** Sends a raw chunk. */
41
+ send(chunk: Uint8Array): Promise<void>;
42
+ /** Sends a structured chunk. */
43
+ sendValue(value: JsonValue): Promise<void>;
44
+ /** Ends this side's sending; the peer may still send. */
45
+ closeSend(): Promise<void>;
46
+ /** Ends the stream on both sides. */
47
+ close(): Promise<void>;
48
+ /** The provider's terminal value; ends the stream. */
49
+ reply(payload: JsonValue): Promise<void>;
50
+ /** Ends the stream with a STREAM_ERROR the peer sees. */
51
+ abort(code: string, message?: string): Promise<void>;
52
+ /** The peer's next frame, or null once the stream has ended normally. A
53
+ * stream error is thrown as a StreamError; `timeoutMs` (0 for none) bounds
54
+ * the wait with an Error("timeout"). */
55
+ recv(options?: {
56
+ timeoutMs?: number;
57
+ }): Promise<StreamEvent | null>;
58
+ /** Every frame until the stream ends. */
59
+ [Symbol.asyncIterator](): AsyncIterator<StreamEvent>;
60
+ /** Releases the stream, aborting it first when it has not ended. */
61
+ free(): Promise<void>;
62
+ private live;
63
+ }
package/dist/stream.js ADDED
@@ -0,0 +1,93 @@
1
+ // A streaming session, on either side: the caller's from Pool.openStream, or
2
+ // a provider's handed to a Pool.serveStream handler. Each session is a QUIC
3
+ // stream of its own, released on every path; frames are signed by each side
4
+ // and verified before they are handed on.
5
+ import { native } from "./binding.js";
6
+ import { StreamError, bytesModeFor } from "./wire.js";
7
+ /** The three stream modes: the provider sends (server), the caller sends and
8
+ * the provider replies (client), or both send (bidi). */
9
+ export var StreamMode;
10
+ (function (StreamMode) {
11
+ StreamMode[StreamMode["Server"] = 0] = "Server";
12
+ StreamMode[StreamMode["Client"] = 1] = "Client";
13
+ StreamMode[StreamMode["Bidi"] = 2] = "Bidi";
14
+ })(StreamMode || (StreamMode = {}));
15
+ export class Stream {
16
+ handle;
17
+ bytes;
18
+ freed = false;
19
+ /** @internal */
20
+ constructor(handle, bytes) {
21
+ this.handle = handle;
22
+ this.bytes = bytes;
23
+ }
24
+ /** The stream's open. */
25
+ request() {
26
+ const r = JSON.parse(native.streamRequest(this.live(), bytesModeFor(this.bytes)));
27
+ return { caller: r.caller, realm: r.realm, procedure: r.procedure, payload: r.payload, deadlineMs: r.deadline_ms };
28
+ }
29
+ /** Sends a raw chunk. */
30
+ async send(chunk) {
31
+ await native.streamSendBytes(this.live(), chunk);
32
+ }
33
+ /** Sends a structured chunk. */
34
+ async sendValue(value) {
35
+ await native.streamSendJson(this.live(), JSON.stringify(value));
36
+ }
37
+ /** Ends this side's sending; the peer may still send. */
38
+ async closeSend() {
39
+ await native.streamCloseSend(this.live());
40
+ }
41
+ /** Ends the stream on both sides. */
42
+ async close() {
43
+ await native.streamClose(this.live());
44
+ }
45
+ /** The provider's terminal value; ends the stream. */
46
+ async reply(payload) {
47
+ await native.streamReply(this.live(), JSON.stringify(payload));
48
+ }
49
+ /** Ends the stream with a STREAM_ERROR the peer sees. */
50
+ async abort(code, message = "") {
51
+ await native.streamAbort(this.live(), code, message);
52
+ }
53
+ /** The peer's next frame, or null once the stream has ended normally. A
54
+ * stream error is thrown as a StreamError; `timeoutMs` (0 for none) bounds
55
+ * the wait with an Error("timeout"). */
56
+ async recv(options = {}) {
57
+ const e = JSON.parse(await native.streamRecv(this.live(), options.timeoutMs ?? 0, bytesModeFor(this.bytes)));
58
+ switch (e.kind) {
59
+ case "eof":
60
+ return null;
61
+ case "error":
62
+ throw new StreamError(e.code, e.message ?? "", e.relay === 1);
63
+ case "data":
64
+ return { kind: "data", encoding: e.encoding, body: e.body };
65
+ case "end":
66
+ return { kind: "end", role: e.role };
67
+ default:
68
+ return { kind: "reply", payload: e.payload };
69
+ }
70
+ }
71
+ /** Every frame until the stream ends. */
72
+ async *[Symbol.asyncIterator]() {
73
+ for (;;) {
74
+ const event = await this.recv();
75
+ if (event === null)
76
+ return;
77
+ yield event;
78
+ }
79
+ }
80
+ /** Releases the stream, aborting it first when it has not ended. */
81
+ async free() {
82
+ if (this.freed)
83
+ return;
84
+ this.freed = true;
85
+ await native.streamFree(this.handle);
86
+ }
87
+ live() {
88
+ if (this.freed)
89
+ throw new Error("macula-ts: this Stream was freed");
90
+ return this.handle;
91
+ }
92
+ }
93
+ //# sourceMappingURL=stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.js","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,0CAA0C;AAC1C,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAoC,MAAM,WAAW,CAAC;AAExF;yDACyD;AACzD,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+CAAU,CAAA;IACV,+CAAU,CAAA;IACV,2CAAQ,CAAA;AACV,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAmBD,MAAM,OAAO,MAAM;IAIY,MAAM;IAA2B,KAAK;IAH3D,KAAK,GAAG,KAAK,CAAC;IAEtB,gBAAgB;IAChB,YAA6B,MAAc,EAAmB,KAA8B;sBAA/D,MAAM;qBAA2B,KAAK;IAA4B,CAAC;IAEhG,yBAAyB;IACzB,OAAO;QACL,MAAM,CAAC,GAAG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