@dxos/teleport 0.3.8-main.598e316 → 0.3.8-main.6e95d31

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.
@@ -4,165 +4,25 @@ import "@dxos/node-std/globals";
4
4
  import { pipeline } from "@dxos/node-std/stream";
5
5
  import { invariant as invariant5 } from "@dxos/invariant";
6
6
  import { PublicKey as PublicKey2 } from "@dxos/keys";
7
- import { log as log6 } from "@dxos/log";
7
+ import { log as log5 } from "@dxos/log";
8
8
 
9
9
  // packages/core/mesh/teleport/src/teleport.ts
10
- import { runInContextAsync, synchronized, scheduleTask } from "@dxos/async";
11
- import { Context as Context3 } from "@dxos/context";
10
+ import { asyncTimeout, scheduleTaskInterval as scheduleTaskInterval2, runInContextAsync, synchronized, scheduleTask } from "@dxos/async";
11
+ import { Context as Context2 } from "@dxos/context";
12
12
  import { failUndefined as failUndefined2 } from "@dxos/debug";
13
13
  import { invariant as invariant4 } from "@dxos/invariant";
14
14
  import { PublicKey } from "@dxos/keys";
15
- import { log as log5 } from "@dxos/log";
16
- import { RpcClosedError as RpcClosedError2, TimeoutError as TimeoutError2 } from "@dxos/protocols";
17
-
18
- // packages/core/mesh/teleport/src/control-extension.ts
19
- import { asyncTimeout, scheduleTaskInterval, TimeoutError as AsyncTimeoutError } from "@dxos/async";
20
- import { Context } from "@dxos/context";
21
- import { log } from "@dxos/log";
22
- import { schema, RpcClosedError } from "@dxos/protocols";
15
+ import { log as log4 } from "@dxos/log";
16
+ import { schema as schema2, RpcClosedError, TimeoutError as TimeoutError2 } from "@dxos/protocols";
23
17
  import { createProtoRpcPeer } from "@dxos/rpc";
24
18
  import { Callback } from "@dxos/util";
25
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/control-extension.ts";
26
- var HEARTBEAT_RTT_WARN_THRESH = 1e4;
27
- var ControlExtension = class {
28
- constructor(opts, localPeerId, remotePeerId) {
29
- this.opts = opts;
30
- this.localPeerId = localPeerId;
31
- this.remotePeerId = remotePeerId;
32
- this._ctx = new Context({
33
- onError: (err) => {
34
- this._extensionContext.close(err);
35
- }
36
- });
37
- this.onExtensionRegistered = new Callback();
38
- }
39
- async registerExtension(name) {
40
- await this._rpc.rpc.Control.registerExtension({
41
- name
42
- });
43
- }
44
- async onOpen(extensionContext) {
45
- this._extensionContext = extensionContext;
46
- this._rpc = createProtoRpcPeer({
47
- requested: {
48
- Control: schema.getService("dxos.mesh.teleport.control.ControlService")
49
- },
50
- exposed: {
51
- Control: schema.getService("dxos.mesh.teleport.control.ControlService")
52
- },
53
- handlers: {
54
- Control: {
55
- registerExtension: async (request) => {
56
- this.onExtensionRegistered.call(request.name);
57
- },
58
- heartbeat: async (request) => {
59
- log("received heartbeat request", {
60
- ts: request.requestTimestamp,
61
- localPeerId: this.localPeerId.truncate(),
62
- remotePeerId: this.remotePeerId.truncate()
63
- }, {
64
- F: __dxlog_file,
65
- L: 66,
66
- S: this,
67
- C: (f, a) => f(...a)
68
- });
69
- return {
70
- requestTimestamp: request.requestTimestamp
71
- };
72
- }
73
- }
74
- },
75
- port: await extensionContext.createPort("rpc", {
76
- contentType: 'application/x-protobuf; messageType="dxos.rpc.Message"'
77
- }),
78
- timeout: this.opts.heartbeatTimeout
79
- });
80
- await this._rpc.open();
81
- scheduleTaskInterval(this._ctx, async () => {
82
- const reqTS = /* @__PURE__ */ new Date();
83
- try {
84
- const resp = await asyncTimeout(this._rpc.rpc.Control.heartbeat({
85
- requestTimestamp: reqTS
86
- }), this.opts.heartbeatTimeout);
87
- const now = Date.now();
88
- if (resp.requestTimestamp instanceof Date) {
89
- if (now - resp.requestTimestamp.getTime() > (HEARTBEAT_RTT_WARN_THRESH < this.opts.heartbeatTimeout ? HEARTBEAT_RTT_WARN_THRESH : this.opts.heartbeatTimeout / 2)) {
90
- log.warn(`heartbeat RTT for Teleport > ${HEARTBEAT_RTT_WARN_THRESH / 1e3}s`, {
91
- rtt: now - resp.requestTimestamp.getTime(),
92
- localPeerId: this.localPeerId.truncate(),
93
- remotePeerId: this.remotePeerId.truncate()
94
- }, {
95
- F: __dxlog_file,
96
- L: 103,
97
- S: this,
98
- C: (f, a) => f(...a)
99
- });
100
- } else {
101
- log("heartbeat RTT", {
102
- rtt: now - resp.requestTimestamp.getTime(),
103
- localPeerId: this.localPeerId.truncate(),
104
- remotePeerId: this.remotePeerId.truncate()
105
- }, {
106
- F: __dxlog_file,
107
- L: 109,
108
- S: this,
109
- C: (f, a) => f(...a)
110
- });
111
- }
112
- }
113
- } catch (err) {
114
- const now = Date.now();
115
- if (err instanceof RpcClosedError) {
116
- log("ignoring RpcClosedError in heartbeat", void 0, {
117
- F: __dxlog_file,
118
- L: 119,
119
- S: this,
120
- C: (f, a) => f(...a)
121
- });
122
- return;
123
- }
124
- if (err instanceof AsyncTimeoutError) {
125
- log("timeout waiting for heartbeat response", {
126
- err,
127
- delay: now - reqTS.getTime()
128
- }, {
129
- F: __dxlog_file,
130
- L: 123,
131
- S: this,
132
- C: (f, a) => f(...a)
133
- });
134
- this.opts.onTimeout(err);
135
- } else {
136
- log.info("other error waiting for heartbeat response", {
137
- err,
138
- delay: now - reqTS.getTime()
139
- }, {
140
- F: __dxlog_file,
141
- L: 126,
142
- S: this,
143
- C: (f, a) => f(...a)
144
- });
145
- this.opts.onTimeout(err);
146
- }
147
- }
148
- }, this.opts.heartbeatInterval);
149
- }
150
- async onClose(err) {
151
- await this._ctx.dispose();
152
- await this._rpc.close();
153
- }
154
- async onAbort(err) {
155
- await this._ctx.dispose();
156
- await this._rpc.abort();
157
- }
158
- };
159
19
 
160
20
  // packages/core/mesh/teleport/src/muxing/framer.ts
161
21
  import { Duplex } from "@dxos/node-std/stream";
162
22
  import { Event } from "@dxos/async";
163
23
  import { invariant } from "@dxos/invariant";
164
- import { log as log2 } from "@dxos/log";
165
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/framer.ts";
24
+ import { log } from "@dxos/log";
25
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/framer.ts";
166
26
  var FRAME_LENGTH_SIZE = 2;
167
27
  var Framer = class {
168
28
  constructor() {
@@ -183,7 +43,7 @@ var Framer = class {
183
43
  },
184
44
  write: (chunk, encoding, callback) => {
185
45
  invariant(!this._subscribeCb, "Internal Framer bug. Concurrent writes detected.", {
186
- F: __dxlog_file2,
46
+ F: __dxlog_file,
187
47
  L: 40,
188
48
  S: this,
189
49
  A: [
@@ -227,7 +87,7 @@ var Framer = class {
227
87
  },
228
88
  subscribe: (callback) => {
229
89
  invariant(!this._messageCb, "Rpc port already has a message listener.", {
230
- F: __dxlog_file2,
90
+ F: __dxlog_file,
231
91
  L: 79,
232
92
  S: this,
233
93
  A: [
@@ -283,16 +143,16 @@ var Framer = class {
283
143
  }
284
144
  destroy() {
285
145
  if (this._stream.readableLength > 0) {
286
- log2.info("framer destroyed while there are still read bytes in the buffer.", void 0, {
287
- F: __dxlog_file2,
146
+ log.info("framer destroyed while there are still read bytes in the buffer.", void 0, {
147
+ F: __dxlog_file,
288
148
  L: 140,
289
149
  S: this,
290
150
  C: (f, a) => f(...a)
291
151
  });
292
152
  }
293
153
  if (this._stream.writableLength > 0) {
294
- log2.warn("framer destroyed while there are still write bytes in the buffer.", void 0, {
295
- F: __dxlog_file2,
154
+ log.warn("framer destroyed while there are still write bytes in the buffer.", void 0, {
155
+ F: __dxlog_file,
296
156
  L: 143,
297
157
  S: this,
298
158
  C: (f, a) => f(...a)
@@ -325,19 +185,19 @@ var encodeFrame = (payload) => {
325
185
 
326
186
  // packages/core/mesh/teleport/src/muxing/muxer.ts
327
187
  import { Duplex as Duplex2 } from "@dxos/node-std/stream";
328
- import { scheduleTaskInterval as scheduleTaskInterval2, Event as Event3, Trigger } from "@dxos/async";
329
- import { Context as Context2 } from "@dxos/context";
188
+ import { scheduleTaskInterval, Event as Event3, Trigger } from "@dxos/async";
189
+ import { Context } from "@dxos/context";
330
190
  import { failUndefined } from "@dxos/debug";
331
191
  import { invariant as invariant3 } from "@dxos/invariant";
332
- import { log as log4 } from "@dxos/log";
333
- import { schema as schema2, TimeoutError } from "@dxos/protocols";
192
+ import { log as log3 } from "@dxos/log";
193
+ import { schema, TimeoutError } from "@dxos/protocols";
334
194
 
335
195
  // packages/core/mesh/teleport/src/muxing/balancer.ts
336
196
  import * as varint from "varint";
337
197
  import { Event as Event2 } from "@dxos/async";
338
198
  import { invariant as invariant2 } from "@dxos/invariant";
339
- import { log as log3 } from "@dxos/log";
340
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/balancer.ts";
199
+ import { log as log2 } from "@dxos/log";
200
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/balancer.ts";
341
201
  var MAX_CHUNK_SIZE = 8192;
342
202
  var Balancer = class {
343
203
  constructor(_sysChannelId) {
@@ -367,8 +227,8 @@ var Balancer = class {
367
227
  }
368
228
  pushData(data, trigger, channelId) {
369
229
  this._enqueueChunk(data, trigger, channelId);
370
- this._sendChunks().catch((err) => log3.catch(err, void 0, {
371
- F: __dxlog_file3,
230
+ this._sendChunks().catch((err) => log2.catch(err, void 0, {
231
+ F: __dxlog_file2,
372
232
  L: 75,
373
233
  S: this,
374
234
  C: (f, a) => f(...a)
@@ -376,8 +236,8 @@ var Balancer = class {
376
236
  }
377
237
  destroy() {
378
238
  if (this._sendBuffers.size !== 0) {
379
- log3.info("destroying balancer with pending calls", void 0, {
380
- F: __dxlog_file3,
239
+ log2.info("destroying balancer with pending calls", void 0, {
240
+ F: __dxlog_file2,
381
241
  L: 80,
382
242
  S: this,
383
243
  C: (f, a) => f(...a)
@@ -472,15 +332,15 @@ var Balancer = class {
472
332
  chunk = this._getNextChunk();
473
333
  while (chunk) {
474
334
  if (!this._framer.writable) {
475
- log3("PAUSE for drain", void 0, {
476
- F: __dxlog_file3,
335
+ log2("PAUSE for drain", void 0, {
336
+ F: __dxlog_file2,
477
337
  L: 179,
478
338
  S: this,
479
339
  C: (f, a) => f(...a)
480
340
  });
481
341
  await this._framer.drain.waitForCount(1);
482
- log3("RESUME for drain", void 0, {
483
- F: __dxlog_file3,
342
+ log2("RESUME for drain", void 0, {
343
+ F: __dxlog_file2,
484
344
  L: 181,
485
345
  S: this,
486
346
  C: (f, a) => f(...a)
@@ -490,10 +350,10 @@ var Balancer = class {
490
350
  await this._framer.port.send(chunk.msg);
491
351
  chunk.trigger?.wake();
492
352
  } catch (err) {
493
- log3("Error sending chunk", {
353
+ log2("Error sending chunk", {
494
354
  err
495
355
  }, {
496
- F: __dxlog_file3,
356
+ F: __dxlog_file2,
497
357
  L: 187,
498
358
  S: this,
499
359
  C: (f, a) => f(...a)
@@ -503,7 +363,7 @@ var Balancer = class {
503
363
  chunk = this._getNextChunk();
504
364
  }
505
365
  invariant2(this._sendBuffers.size === 0, "sendBuffers not empty", {
506
- F: __dxlog_file3,
366
+ F: __dxlog_file2,
507
367
  L: 192,
508
368
  S: this,
509
369
  A: [
@@ -542,8 +402,8 @@ var decodeChunk = (data, withLength) => {
542
402
  };
543
403
 
544
404
  // packages/core/mesh/teleport/src/muxing/muxer.ts
545
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/muxer.ts";
546
- var Command = schema2.getCodecForType("dxos.mesh.muxer.Command");
405
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/muxer.ts";
406
+ var Command = schema.getCodecForType("dxos.mesh.muxer.Command");
547
407
  var DEFAULT_SEND_COMMAND_TIMEOUT = 6e4;
548
408
  var DESTROY_COMMAND_SEND_TIMEOUT = 5e3;
549
409
  var STATS_INTERVAL = 1e3;
@@ -555,7 +415,7 @@ var Muxer = class {
555
415
  this._balancer = new Balancer(SYSTEM_CHANNEL_ID);
556
416
  this._channelsByLocalId = /* @__PURE__ */ new Map();
557
417
  this._channelsByTag = /* @__PURE__ */ new Map();
558
- this._ctx = new Context2();
418
+ this._ctx = new Context();
559
419
  this._nextId = 1;
560
420
  this._closing = false;
561
421
  this._destroying = false;
@@ -581,7 +441,7 @@ var Muxer = class {
581
441
  contentType: opts.contentType
582
442
  });
583
443
  invariant3(!channel.push, `Channel already open: ${tag}`, {
584
- F: __dxlog_file4,
444
+ F: __dxlog_file3,
585
445
  L: 140,
586
446
  S: this,
587
447
  A: [
@@ -629,7 +489,7 @@ var Muxer = class {
629
489
  contentType: opts.contentType
630
490
  });
631
491
  invariant3(!channel.push, `Channel already open: ${tag}`, {
632
- F: __dxlog_file4,
492
+ F: __dxlog_file3,
633
493
  L: 192,
634
494
  S: this,
635
495
  A: [
@@ -653,7 +513,7 @@ var Muxer = class {
653
513
  },
654
514
  subscribe: (cb) => {
655
515
  invariant3(!callback, "Only one subscriber is allowed", {
656
- F: __dxlog_file4,
516
+ F: __dxlog_file3,
657
517
  L: 214,
658
518
  S: this,
659
519
  A: [
@@ -685,8 +545,8 @@ var Muxer = class {
685
545
  // initiate graceful close
686
546
  async close(err) {
687
547
  if (this._destroying) {
688
- log4("already destroying, ignoring graceful close request", void 0, {
689
- F: __dxlog_file4,
548
+ log3("already destroying, ignoring graceful close request", void 0, {
549
+ F: __dxlog_file3,
690
550
  L: 247,
691
551
  S: this,
692
552
  C: (f, a) => f(...a)
@@ -694,8 +554,8 @@ var Muxer = class {
694
554
  return;
695
555
  }
696
556
  if (this._closing) {
697
- log4("already closing, ignoring graceful close request", void 0, {
698
- F: __dxlog_file4,
557
+ log3("already closing, ignoring graceful close request", void 0, {
558
+ F: __dxlog_file3,
699
559
  L: 251,
700
560
  S: this,
701
561
  C: (f, a) => f(...a)
@@ -708,10 +568,10 @@ var Muxer = class {
708
568
  error: err?.message
709
569
  }
710
570
  }, SYSTEM_CHANNEL_ID, DESTROY_COMMAND_SEND_TIMEOUT).catch(async (err2) => {
711
- log4("error sending close command", {
571
+ log3("error sending close command", {
712
572
  err: err2
713
573
  }, {
714
- F: __dxlog_file4,
574
+ F: __dxlog_file3,
715
575
  L: 266,
716
576
  S: this,
717
577
  C: (f, a) => f(...a)
@@ -732,8 +592,8 @@ var Muxer = class {
732
592
  // force close without confirmation
733
593
  async destroy(err) {
734
594
  if (this._destroying) {
735
- log4("already destroying, ignoring destroy request", void 0, {
736
- F: __dxlog_file4,
595
+ log3("already destroying, ignoring destroy request", void 0, {
596
+ F: __dxlog_file3,
737
597
  L: 287,
738
598
  S: this,
739
599
  C: (f, a) => f(...a)
@@ -743,8 +603,8 @@ var Muxer = class {
743
603
  this._destroying = true;
744
604
  void this._ctx.dispose();
745
605
  if (this._closing) {
746
- log4("destroy cancelling graceful close", void 0, {
747
- F: __dxlog_file4,
606
+ log3("destroy cancelling graceful close", void 0, {
607
+ F: __dxlog_file3,
748
608
  L: 293,
749
609
  S: this,
750
610
  C: (f, a) => f(...a)
@@ -756,10 +616,10 @@ var Muxer = class {
756
616
  error: err?.message
757
617
  }
758
618
  }, SYSTEM_CHANNEL_ID).catch(async (err2) => {
759
- log4("error sending courtesy close command", {
619
+ log3("error sending courtesy close command", {
760
620
  err: err2
761
621
  }, {
762
- F: __dxlog_file4,
622
+ F: __dxlog_file3,
763
623
  L: 306,
764
624
  S: this,
765
625
  C: (f, a) => f(...a)
@@ -767,10 +627,10 @@ var Muxer = class {
767
627
  });
768
628
  }
769
629
  this.dispose(err).catch((err2) => {
770
- log4("error disposing after destroy", {
630
+ log3("error disposing after destroy", {
771
631
  err: err2
772
632
  }, {
773
- F: __dxlog_file4,
633
+ F: __dxlog_file3,
774
634
  L: 311,
775
635
  S: this,
776
636
  C: (f, a) => f(...a)
@@ -780,8 +640,8 @@ var Muxer = class {
780
640
  // complete the termination, graceful or otherwise
781
641
  async dispose(err) {
782
642
  if (this._disposed) {
783
- log4("already destroyed, ignoring dispose request", void 0, {
784
- F: __dxlog_file4,
643
+ log3("already destroyed, ignoring dispose request", void 0, {
644
+ F: __dxlog_file3,
785
645
  L: 319,
786
646
  S: this,
787
647
  C: (f, a) => f(...a)
@@ -800,10 +660,10 @@ var Muxer = class {
800
660
  }
801
661
  async _handleCommand(cmd) {
802
662
  if (this._disposed) {
803
- log4.warn("Received command after disposed", {
663
+ log3.warn("Received command after destroy", {
804
664
  cmd
805
665
  }, {
806
- F: __dxlog_file4,
666
+ F: __dxlog_file3,
807
667
  L: 341,
808
668
  S: this,
809
669
  C: (f, a) => f(...a)
@@ -812,16 +672,16 @@ var Muxer = class {
812
672
  }
813
673
  if (cmd.close) {
814
674
  if (!this._closing) {
815
- log4("received peer close, initiating my own graceful close", void 0, {
816
- F: __dxlog_file4,
675
+ log3("received peer close, initiating my own graceful close", void 0, {
676
+ F: __dxlog_file3,
817
677
  L: 347,
818
678
  S: this,
819
679
  C: (f, a) => f(...a)
820
680
  });
821
681
  await this.close();
822
682
  } else {
823
- log4("received close from peer, already closing", void 0, {
824
- F: __dxlog_file4,
683
+ log3("received close from peer, already closing", void 0, {
684
+ F: __dxlog_file3,
825
685
  L: 350,
826
686
  S: this,
827
687
  C: (f, a) => f(...a)
@@ -847,10 +707,10 @@ var Muxer = class {
847
707
  } else if (cmd.data) {
848
708
  const stream = this._channelsByLocalId.get(cmd.data.channelId) ?? failUndefined();
849
709
  if (!stream.push) {
850
- log4.warn("Received data for channel before it was opened", {
710
+ log3.warn("Received data for channel before it was opened", {
851
711
  tag: stream.tag
852
712
  }, {
853
- F: __dxlog_file4,
713
+ F: __dxlog_file3,
854
714
  L: 379,
855
715
  S: this,
856
716
  C: (f, a) => f(...a)
@@ -861,17 +721,6 @@ var Muxer = class {
861
721
  }
862
722
  }
863
723
  async _sendCommand(cmd, channelId = -1, timeout = DEFAULT_SEND_COMMAND_TIMEOUT) {
864
- if (this._disposed) {
865
- log4.info("ignoring sendCommand after disposed", {
866
- cmd
867
- }, {
868
- F: __dxlog_file4,
869
- L: 388,
870
- S: this,
871
- C: (f, a) => f(...a)
872
- });
873
- return;
874
- }
875
724
  try {
876
725
  const trigger = new Trigger();
877
726
  this._balancer.pushData(Command.encode(cmd), trigger, channelId);
@@ -884,7 +733,7 @@ var Muxer = class {
884
733
  }
885
734
  _getOrCreateStream(params) {
886
735
  if (this._channelsByTag.size === 0) {
887
- scheduleTaskInterval2(this._ctx, async () => this._emitStats(), STATS_INTERVAL);
736
+ scheduleTaskInterval(this._ctx, async () => this._emitStats(), STATS_INTERVAL);
888
737
  }
889
738
  let channel = this._channelsByTag.get(params.tag);
890
739
  if (!channel) {
@@ -909,12 +758,12 @@ var Muxer = class {
909
758
  }
910
759
  async _sendData(channel, data, timeout) {
911
760
  if (data.length > MAX_SAFE_FRAME_SIZE) {
912
- log4.warn("frame size exceeds maximum safe value", {
761
+ log3.warn("frame size exceeds maximum safe value", {
913
762
  size: data.length,
914
763
  threshold: MAX_SAFE_FRAME_SIZE
915
764
  }, {
916
- F: __dxlog_file4,
917
- L: 429,
765
+ F: __dxlog_file3,
766
+ L: 425,
918
767
  S: this,
919
768
  C: (f, a) => f(...a)
920
769
  });
@@ -991,17 +840,17 @@ function _ts_decorate(decorators, target, key, desc) {
991
840
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
992
841
  return c > 3 && r && Object.defineProperty(target, key, r), r;
993
842
  }
994
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/teleport.ts";
843
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/teleport.ts";
995
844
  var CONTROL_HEARTBEAT_INTERVAL = 1e4;
996
845
  var CONTROL_HEARTBEAT_TIMEOUT = 6e4;
997
846
  var Teleport = class {
998
847
  constructor({ initiator, localPeerId, remotePeerId }) {
999
- this._ctx = new Context3({
848
+ this._ctx = new Context2({
1000
849
  onError: (err) => {
1001
850
  void this.destroy(err).catch(() => {
1002
- log5.error("Error during destroy", err, {
1003
- F: __dxlog_file5,
1004
- L: 38,
851
+ log4.error("Error during destroy", err, {
852
+ F: __dxlog_file4,
853
+ L: 47,
1005
854
  S: this,
1006
855
  C: (f, a) => f(...a)
1007
856
  });
@@ -1009,14 +858,35 @@ var Teleport = class {
1009
858
  }
1010
859
  });
1011
860
  this._muxer = new Muxer();
861
+ this._control = new ControlExtension({
862
+ heartbeatInterval: CONTROL_HEARTBEAT_INTERVAL,
863
+ heartbeatTimeout: CONTROL_HEARTBEAT_TIMEOUT,
864
+ onTimeout: () => {
865
+ if (this._destroying || this._aborting) {
866
+ return;
867
+ }
868
+ log4("abort teleport due to onTimeout in ControlExtension", void 0, {
869
+ F: __dxlog_file4,
870
+ L: 62,
871
+ S: this,
872
+ C: (f, a) => f(...a)
873
+ });
874
+ this.abort(new TimeoutError2("control extension")).catch((err) => log4.catch(err, void 0, {
875
+ F: __dxlog_file4,
876
+ L: 63,
877
+ S: this,
878
+ C: (f, a) => f(...a)
879
+ }));
880
+ }
881
+ });
1012
882
  this._extensions = /* @__PURE__ */ new Map();
1013
883
  this._remoteExtensions = /* @__PURE__ */ new Set();
1014
884
  this._open = false;
1015
885
  this._destroying = false;
1016
886
  this._aborting = false;
1017
887
  invariant4(typeof initiator === "boolean", void 0, {
1018
- F: __dxlog_file5,
1019
- L: 55,
888
+ F: __dxlog_file4,
889
+ L: 75,
1020
890
  S: this,
1021
891
  A: [
1022
892
  "typeof initiator === 'boolean'",
@@ -1024,8 +894,8 @@ var Teleport = class {
1024
894
  ]
1025
895
  });
1026
896
  invariant4(PublicKey.isPublicKey(localPeerId), void 0, {
1027
- F: __dxlog_file5,
1028
- L: 56,
897
+ F: __dxlog_file4,
898
+ L: 76,
1029
899
  S: this,
1030
900
  A: [
1031
901
  "PublicKey.isPublicKey(localPeerId)",
@@ -1033,8 +903,8 @@ var Teleport = class {
1033
903
  ]
1034
904
  });
1035
905
  invariant4(PublicKey.isPublicKey(remotePeerId), void 0, {
1036
- F: __dxlog_file5,
1037
- L: 57,
906
+ F: __dxlog_file4,
907
+ L: 77,
1038
908
  S: this,
1039
909
  A: [
1040
910
  "PublicKey.isPublicKey(remotePeerId)",
@@ -1044,39 +914,18 @@ var Teleport = class {
1044
914
  this.initiator = initiator;
1045
915
  this.localPeerId = localPeerId;
1046
916
  this.remotePeerId = remotePeerId;
1047
- this._control = new ControlExtension({
1048
- heartbeatInterval: CONTROL_HEARTBEAT_INTERVAL,
1049
- heartbeatTimeout: CONTROL_HEARTBEAT_TIMEOUT,
1050
- onTimeout: () => {
1051
- if (this._destroying || this._aborting) {
1052
- return;
1053
- }
1054
- log5.info("abort teleport due to onTimeout in ControlExtension", void 0, {
1055
- F: __dxlog_file5,
1056
- L: 70,
1057
- S: this,
1058
- C: (f, a) => f(...a)
1059
- });
1060
- this.abort(new TimeoutError2("control extension")).catch((err) => log5.catch(err, void 0, {
1061
- F: __dxlog_file5,
1062
- L: 71,
1063
- S: this,
1064
- C: (f, a) => f(...a)
1065
- }));
1066
- }
1067
- }, this.localPeerId, this.remotePeerId);
1068
917
  this._control.onExtensionRegistered.set(async (name) => {
1069
- log5("remote extension", {
918
+ log4("remote extension", {
1070
919
  name
1071
920
  }, {
1072
- F: __dxlog_file5,
1073
- L: 79,
921
+ F: __dxlog_file4,
922
+ L: 83,
1074
923
  S: this,
1075
924
  C: (f, a) => f(...a)
1076
925
  });
1077
926
  invariant4(!this._remoteExtensions.has(name), "Remote extension already exists", {
1078
- F: __dxlog_file5,
1079
- L: 80,
927
+ F: __dxlog_file4,
928
+ L: 84,
1080
929
  S: this,
1081
930
  A: [
1082
931
  "!this._remoteExtensions.has(name)",
@@ -1095,9 +944,9 @@ var Teleport = class {
1095
944
  {
1096
945
  this._muxer.stream.on("close", async () => {
1097
946
  if (this._destroying || this._aborting) {
1098
- log5("destroy teleport due to muxer stream close, skipping due to already destroying/aborting", void 0, {
1099
- F: __dxlog_file5,
1100
- L: 96,
947
+ log4("destroy teleport due to muxer stream close, skipping due to already destroying/aborting", void 0, {
948
+ F: __dxlog_file4,
949
+ L: 100,
1101
950
  S: this,
1102
951
  C: (f, a) => f(...a)
1103
952
  });
@@ -1110,7 +959,7 @@ var Teleport = class {
1110
959
  });
1111
960
  }
1112
961
  this._muxer.statsUpdated.on((stats) => {
1113
- log5.trace("dxos.mesh.teleport.stats", {
962
+ log4.trace("dxos.mesh.teleport.stats", {
1114
963
  localPeerId,
1115
964
  remotePeerId,
1116
965
  bytesSent: stats.bytesSent,
@@ -1119,8 +968,8 @@ var Teleport = class {
1119
968
  bytesReceivedRate: stats.bytesReceivedRate,
1120
969
  channels: stats.channels
1121
970
  }, {
1122
- F: __dxlog_file5,
1123
- L: 109,
971
+ F: __dxlog_file4,
972
+ L: 113,
1124
973
  S: this,
1125
974
  C: (f, a) => f(...a)
1126
975
  });
@@ -1156,9 +1005,9 @@ var Teleport = class {
1156
1005
  try {
1157
1006
  await extension.onAbort(err);
1158
1007
  } catch (err2) {
1159
- log5.catch(err2, void 0, {
1160
- F: __dxlog_file5,
1161
- L: 162,
1008
+ log4.catch(err2, void 0, {
1009
+ F: __dxlog_file4,
1010
+ L: 166,
1162
1011
  S: this,
1163
1012
  C: (f, a) => f(...a)
1164
1013
  });
@@ -1179,9 +1028,9 @@ var Teleport = class {
1179
1028
  try {
1180
1029
  await extension.onClose(err);
1181
1030
  } catch (err2) {
1182
- log5.catch(err2, void 0, {
1183
- F: __dxlog_file5,
1184
- L: 186,
1031
+ log4.catch(err2, void 0, {
1032
+ F: __dxlog_file4,
1033
+ L: 190,
1185
1034
  S: this,
1186
1035
  C: (f, a) => f(...a)
1187
1036
  });
@@ -1193,11 +1042,11 @@ var Teleport = class {
1193
1042
  if (!this._open) {
1194
1043
  throw new Error("Not open");
1195
1044
  }
1196
- log5("addExtension", {
1045
+ log4("addExtension", {
1197
1046
  name
1198
1047
  }, {
1199
- F: __dxlog_file5,
1200
- L: 198,
1048
+ F: __dxlog_file4,
1049
+ L: 202,
1201
1050
  S: this,
1202
1051
  C: (f, a) => f(...a)
1203
1052
  });
@@ -1206,7 +1055,7 @@ var Teleport = class {
1206
1055
  try {
1207
1056
  await this._control.registerExtension(name);
1208
1057
  } catch (err) {
1209
- if (err instanceof RpcClosedError2) {
1058
+ if (err instanceof RpcClosedError) {
1210
1059
  return;
1211
1060
  }
1212
1061
  throw err;
@@ -1220,8 +1069,8 @@ var Teleport = class {
1220
1069
  }
1221
1070
  _setExtension(extensionName, extension) {
1222
1071
  invariant4(!extensionName.includes("/"), "Invalid extension name", {
1223
- F: __dxlog_file5,
1224
- L: 222,
1072
+ F: __dxlog_file4,
1073
+ L: 226,
1225
1074
  S: this,
1226
1075
  A: [
1227
1076
  "!extensionName.includes('/')",
@@ -1229,8 +1078,8 @@ var Teleport = class {
1229
1078
  ]
1230
1079
  });
1231
1080
  invariant4(!this._extensions.has(extensionName), "Extension already exists", {
1232
- F: __dxlog_file5,
1233
- L: 223,
1081
+ F: __dxlog_file4,
1082
+ L: 227,
1234
1083
  S: this,
1235
1084
  A: [
1236
1085
  "!this._extensions.has(extensionName)",
@@ -1240,11 +1089,11 @@ var Teleport = class {
1240
1089
  this._extensions.set(extensionName, extension);
1241
1090
  }
1242
1091
  async _openExtension(extensionName) {
1243
- log5("open extension", {
1092
+ log4("open extension", {
1244
1093
  extensionName
1245
1094
  }, {
1246
- F: __dxlog_file5,
1247
- L: 228,
1095
+ F: __dxlog_file4,
1096
+ L: 232,
1248
1097
  S: this,
1249
1098
  C: (f, a) => f(...a)
1250
1099
  });
@@ -1255,8 +1104,8 @@ var Teleport = class {
1255
1104
  remotePeerId: this.remotePeerId,
1256
1105
  createPort: async (channelName, opts) => {
1257
1106
  invariant4(!channelName.includes("/"), "Invalid channel name", {
1258
- F: __dxlog_file5,
1259
- L: 236,
1107
+ F: __dxlog_file4,
1108
+ L: 240,
1260
1109
  S: this,
1261
1110
  A: [
1262
1111
  "!channelName.includes('/')",
@@ -1267,8 +1116,8 @@ var Teleport = class {
1267
1116
  },
1268
1117
  createStream: async (channelName, opts) => {
1269
1118
  invariant4(!channelName.includes("/"), "Invalid channel name", {
1270
- F: __dxlog_file5,
1271
- L: 240,
1119
+ F: __dxlog_file4,
1120
+ L: 244,
1272
1121
  S: this,
1273
1122
  A: [
1274
1123
  "!channelName.includes('/')",
@@ -1284,11 +1133,11 @@ var Teleport = class {
1284
1133
  }
1285
1134
  };
1286
1135
  await extension.onOpen(context);
1287
- log5("extension opened", {
1136
+ log4("extension opened", {
1288
1137
  extensionName
1289
1138
  }, {
1290
- F: __dxlog_file5,
1291
- L: 251,
1139
+ F: __dxlog_file4,
1140
+ L: 255,
1292
1141
  S: this,
1293
1142
  C: (f, a) => f(...a)
1294
1143
  });
@@ -1300,9 +1149,64 @@ _ts_decorate([
1300
1149
  _ts_decorate([
1301
1150
  synchronized
1302
1151
  ], Teleport.prototype, "destroy", null);
1152
+ var ControlExtension = class {
1153
+ constructor(opts) {
1154
+ this.opts = opts;
1155
+ this._ctx = new Context2({
1156
+ onError: (err) => {
1157
+ this._extensionContext.close(err);
1158
+ }
1159
+ });
1160
+ this.onExtensionRegistered = new Callback();
1161
+ }
1162
+ async registerExtension(name) {
1163
+ await this._rpc.rpc.Control.registerExtension({
1164
+ name
1165
+ });
1166
+ }
1167
+ async onOpen(extensionContext) {
1168
+ this._extensionContext = extensionContext;
1169
+ this._rpc = createProtoRpcPeer({
1170
+ requested: {
1171
+ Control: schema2.getService("dxos.mesh.teleport.control.ControlService")
1172
+ },
1173
+ exposed: {
1174
+ Control: schema2.getService("dxos.mesh.teleport.control.ControlService")
1175
+ },
1176
+ handlers: {
1177
+ Control: {
1178
+ registerExtension: async (request) => {
1179
+ this.onExtensionRegistered.call(request.name);
1180
+ },
1181
+ heartbeat: async (request) => {
1182
+ }
1183
+ }
1184
+ },
1185
+ port: await extensionContext.createPort("rpc", {
1186
+ contentType: 'application/x-protobuf; messagType="dxos.rpc.Message"'
1187
+ })
1188
+ });
1189
+ await this._rpc.open();
1190
+ scheduleTaskInterval2(this._ctx, async () => {
1191
+ try {
1192
+ await asyncTimeout(this._rpc.rpc.Control.heartbeat(), this.opts.heartbeatTimeout);
1193
+ } catch (err) {
1194
+ this.opts.onTimeout();
1195
+ }
1196
+ }, this.opts.heartbeatInterval);
1197
+ }
1198
+ async onClose(err) {
1199
+ await this._ctx.dispose();
1200
+ await this._rpc.close();
1201
+ }
1202
+ async onAbort(err) {
1203
+ await this._ctx.dispose();
1204
+ await this._rpc.abort();
1205
+ }
1206
+ };
1303
1207
 
1304
1208
  // packages/core/mesh/teleport/src/testing/test-builder.ts
1305
- var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-builder.ts";
1209
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-builder.ts";
1306
1210
  var TestBuilder = class {
1307
1211
  constructor() {
1308
1212
  this._peers = /* @__PURE__ */ new Set();
@@ -1322,7 +1226,7 @@ var TestBuilder = class {
1322
1226
  }
1323
1227
  async connect(peer1, peer2) {
1324
1228
  invariant5(peer1 !== peer2, void 0, {
1325
- F: __dxlog_file6,
1229
+ F: __dxlog_file5,
1326
1230
  L: 37,
1327
1231
  S: this,
1328
1232
  A: [
@@ -1331,7 +1235,7 @@ var TestBuilder = class {
1331
1235
  ]
1332
1236
  });
1333
1237
  invariant5(this._peers.has(peer1), void 0, {
1334
- F: __dxlog_file6,
1238
+ F: __dxlog_file5,
1335
1239
  L: 38,
1336
1240
  S: this,
1337
1241
  A: [
@@ -1340,7 +1244,7 @@ var TestBuilder = class {
1340
1244
  ]
1341
1245
  });
1342
1246
  invariant5(this._peers.has(peer1), void 0, {
1343
- F: __dxlog_file6,
1247
+ F: __dxlog_file5,
1344
1248
  L: 39,
1345
1249
  S: this,
1346
1250
  A: [
@@ -1368,7 +1272,7 @@ var TestBuilder = class {
1368
1272
  }
1369
1273
  async disconnect(peer1, peer2) {
1370
1274
  invariant5(peer1 !== peer2, void 0, {
1371
- F: __dxlog_file6,
1275
+ F: __dxlog_file5,
1372
1276
  L: 51,
1373
1277
  S: this,
1374
1278
  A: [
@@ -1377,7 +1281,7 @@ var TestBuilder = class {
1377
1281
  ]
1378
1282
  });
1379
1283
  invariant5(this._peers.has(peer1), void 0, {
1380
- F: __dxlog_file6,
1284
+ F: __dxlog_file5,
1381
1285
  L: 52,
1382
1286
  S: this,
1383
1287
  A: [
@@ -1386,7 +1290,7 @@ var TestBuilder = class {
1386
1290
  ]
1387
1291
  });
1388
1292
  invariant5(this._peers.has(peer1), void 0, {
1389
- F: __dxlog_file6,
1293
+ F: __dxlog_file5,
1390
1294
  L: 53,
1391
1295
  S: this,
1392
1296
  A: [
@@ -1397,7 +1301,7 @@ var TestBuilder = class {
1397
1301
  const connection1 = Array.from(peer1.connections).find((connection) => connection.remotePeerId.equals(peer2.peerId));
1398
1302
  const connection2 = Array.from(peer2.connections).find((connection) => connection.remotePeerId.equals(peer1.peerId));
1399
1303
  invariant5(connection1, void 0, {
1400
- F: __dxlog_file6,
1304
+ F: __dxlog_file5,
1401
1305
  L: 62,
1402
1306
  S: this,
1403
1307
  A: [
@@ -1406,7 +1310,7 @@ var TestBuilder = class {
1406
1310
  ]
1407
1311
  });
1408
1312
  invariant5(connection2, void 0, {
1409
- F: __dxlog_file6,
1313
+ F: __dxlog_file5,
1410
1314
  L: 63,
1411
1315
  S: this,
1412
1316
  A: [
@@ -1436,7 +1340,7 @@ var TestPeer = class {
1436
1340
  }
1437
1341
  async openConnection(connection) {
1438
1342
  invariant5(this.connections.has(connection), void 0, {
1439
- F: __dxlog_file6,
1343
+ F: __dxlog_file5,
1440
1344
  L: 84,
1441
1345
  S: this,
1442
1346
  A: [
@@ -1449,7 +1353,7 @@ var TestPeer = class {
1449
1353
  }
1450
1354
  async closeConnection(connection) {
1451
1355
  invariant5(this.connections.has(connection), void 0, {
1452
- F: __dxlog_file6,
1356
+ F: __dxlog_file5,
1453
1357
  L: 90,
1454
1358
  S: this,
1455
1359
  A: [
@@ -1470,8 +1374,8 @@ var TestPeer = class {
1470
1374
  var pipeStreams = (stream1, stream2) => {
1471
1375
  pipeline(stream1, stream2, (err) => {
1472
1376
  if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
1473
- log6.catch(err, void 0, {
1474
- F: __dxlog_file6,
1377
+ log5.catch(err, void 0, {
1378
+ F: __dxlog_file5,
1475
1379
  L: 106,
1476
1380
  S: void 0,
1477
1381
  C: (f, a) => f(...a)
@@ -1480,8 +1384,8 @@ var pipeStreams = (stream1, stream2) => {
1480
1384
  });
1481
1385
  pipeline(stream2, stream1, (err) => {
1482
1386
  if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
1483
- log6.catch(err, void 0, {
1484
- F: __dxlog_file6,
1387
+ log5.catch(err, void 0, {
1388
+ F: __dxlog_file5,
1485
1389
  L: 111,
1486
1390
  S: void 0,
1487
1391
  C: (f, a) => f(...a)
@@ -1505,10 +1409,10 @@ var TestConnection = class {
1505
1409
  // packages/core/mesh/teleport/src/testing/test-extension.ts
1506
1410
  import { asyncTimeout as asyncTimeout2, Trigger as Trigger2 } from "@dxos/async";
1507
1411
  import { invariant as invariant6 } from "@dxos/invariant";
1508
- import { log as log7 } from "@dxos/log";
1412
+ import { log as log6 } from "@dxos/log";
1509
1413
  import { schema as schema3 } from "@dxos/protocols";
1510
1414
  import { createProtoRpcPeer as createProtoRpcPeer2 } from "@dxos/rpc";
1511
- var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-extension.ts";
1415
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-extension.ts";
1512
1416
  var TestExtension = class {
1513
1417
  constructor(callbacks = {}) {
1514
1418
  this.callbacks = callbacks;
@@ -1520,11 +1424,11 @@ var TestExtension = class {
1520
1424
  return this.extensionContext?.remotePeerId;
1521
1425
  }
1522
1426
  async onOpen(context) {
1523
- log7("onOpen", {
1427
+ log6("onOpen", {
1524
1428
  localPeerId: context.localPeerId,
1525
1429
  remotePeerId: context.remotePeerId
1526
1430
  }, {
1527
- F: __dxlog_file7,
1431
+ F: __dxlog_file6,
1528
1432
  L: 34,
1529
1433
  S: this,
1530
1434
  C: (f, a) => f(...a)
@@ -1558,10 +1462,10 @@ var TestExtension = class {
1558
1462
  this.open.wake();
1559
1463
  }
1560
1464
  async onClose(err) {
1561
- log7("onClose", {
1465
+ log6("onClose", {
1562
1466
  err
1563
1467
  }, {
1564
- F: __dxlog_file7,
1468
+ F: __dxlog_file6,
1565
1469
  L: 68,
1566
1470
  S: this,
1567
1471
  C: (f, a) => f(...a)
@@ -1571,10 +1475,10 @@ var TestExtension = class {
1571
1475
  await this._rpc?.close();
1572
1476
  }
1573
1477
  async onAbort(err) {
1574
- log7("onAbort", {
1478
+ log6("onAbort", {
1575
1479
  err
1576
1480
  }, {
1577
- F: __dxlog_file7,
1481
+ F: __dxlog_file6,
1578
1482
  L: 75,
1579
1483
  S: this,
1580
1484
  C: (f, a) => f(...a)
@@ -1591,7 +1495,7 @@ var TestExtension = class {
1591
1495
  data: message
1592
1496
  }), 1500);
1593
1497
  invariant6(res.data === message, void 0, {
1594
- F: __dxlog_file7,
1498
+ F: __dxlog_file6,
1595
1499
  L: 84,
1596
1500
  S: this,
1597
1501
  A: [
@@ -1612,10 +1516,10 @@ var TestExtension = class {
1612
1516
  import { randomBytes } from "@dxos/node-std/crypto";
1613
1517
  import { Trigger as Trigger3 } from "@dxos/async";
1614
1518
  import { invariant as invariant7 } from "@dxos/invariant";
1615
- import { log as log8 } from "@dxos/log";
1519
+ import { log as log7 } from "@dxos/log";
1616
1520
  import { schema as schema4 } from "@dxos/protocols";
1617
1521
  import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
1618
- var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-extension-with-streams.ts";
1522
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-extension-with-streams.ts";
1619
1523
  var TestExtensionWithStreams = class {
1620
1524
  constructor(callbacks = {}) {
1621
1525
  this.callbacks = callbacks;
@@ -1629,7 +1533,7 @@ var TestExtensionWithStreams = class {
1629
1533
  }
1630
1534
  async _openStream(streamTag, interval = 5, chunkSize = 2048) {
1631
1535
  invariant7(!this._streams.has(streamTag), `Stream already exists: ${streamTag}`, {
1632
- F: __dxlog_file8,
1536
+ F: __dxlog_file7,
1633
1537
  L: 39,
1634
1538
  S: this,
1635
1539
  A: [
@@ -1677,7 +1581,7 @@ var TestExtensionWithStreams = class {
1677
1581
  });
1678
1582
  streamEntry.reportingTimer = setInterval(() => {
1679
1583
  const { bytesSent, bytesReceived, sendErrors, receiveErrors } = streamEntry;
1680
- log8.trace("dxos.test.stream-stats", {
1584
+ log7.trace("dxos.test.stream-stats", {
1681
1585
  streamTag,
1682
1586
  bytesSent,
1683
1587
  bytesReceived,
@@ -1686,7 +1590,7 @@ var TestExtensionWithStreams = class {
1686
1590
  from: this.extensionContext?.localPeerId,
1687
1591
  to: this.extensionContext?.remotePeerId
1688
1592
  }, {
1689
- F: __dxlog_file8,
1593
+ F: __dxlog_file7,
1690
1594
  L: 93,
1691
1595
  S: this,
1692
1596
  C: (f, a) => f(...a)
@@ -1695,7 +1599,7 @@ var TestExtensionWithStreams = class {
1695
1599
  }
1696
1600
  _closeStream(streamTag) {
1697
1601
  invariant7(this._streams.has(streamTag), `Stream does not exist: ${streamTag}`, {
1698
- F: __dxlog_file8,
1602
+ F: __dxlog_file7,
1699
1603
  L: 106,
1700
1604
  S: this,
1701
1605
  A: [
@@ -1718,11 +1622,11 @@ var TestExtensionWithStreams = class {
1718
1622
  };
1719
1623
  }
1720
1624
  async onOpen(context) {
1721
- log8("onOpen", {
1625
+ log7("onOpen", {
1722
1626
  localPeerId: context.localPeerId,
1723
1627
  remotePeerId: context.remotePeerId
1724
1628
  }, {
1725
- F: __dxlog_file8,
1629
+ F: __dxlog_file7,
1726
1630
  L: 128,
1727
1631
  S: this,
1728
1632
  C: (f, a) => f(...a)
@@ -1768,10 +1672,10 @@ var TestExtensionWithStreams = class {
1768
1672
  this.open.wake();
1769
1673
  }
1770
1674
  async onClose(err) {
1771
- log8("onClose", {
1675
+ log7("onClose", {
1772
1676
  err
1773
1677
  }, {
1774
- F: __dxlog_file8,
1678
+ F: __dxlog_file7,
1775
1679
  L: 179,
1776
1680
  S: this,
1777
1681
  C: (f, a) => f(...a)
@@ -1779,10 +1683,10 @@ var TestExtensionWithStreams = class {
1779
1683
  await this.callbacks.onClose?.();
1780
1684
  this.closed.wake();
1781
1685
  for (const [streamTag, stream] of Object.entries(this._streams)) {
1782
- log8("closing stream", {
1686
+ log7("closing stream", {
1783
1687
  streamTag
1784
1688
  }, {
1785
- F: __dxlog_file8,
1689
+ F: __dxlog_file7,
1786
1690
  L: 183,
1787
1691
  S: this,
1788
1692
  C: (f, a) => f(...a)
@@ -1793,10 +1697,10 @@ var TestExtensionWithStreams = class {
1793
1697
  await this._rpc?.close();
1794
1698
  }
1795
1699
  async onAbort(err) {
1796
- log8("onAbort", {
1700
+ log7("onAbort", {
1797
1701
  err
1798
1702
  }, {
1799
- F: __dxlog_file8,
1703
+ F: __dxlog_file7,
1800
1704
  L: 191,
1801
1705
  S: this,
1802
1706
  C: (f, a) => f(...a)
@@ -1818,7 +1722,7 @@ var TestExtensionWithStreams = class {
1818
1722
  streamLoadChunkSize
1819
1723
  });
1820
1724
  invariant7(data === streamTag, void 0, {
1821
- F: __dxlog_file8,
1725
+ F: __dxlog_file7,
1822
1726
  L: 207,
1823
1727
  S: this,
1824
1728
  A: [
@@ -1837,7 +1741,7 @@ var TestExtensionWithStreams = class {
1837
1741
  data: streamTag
1838
1742
  });
1839
1743
  invariant7(data === streamTag, void 0, {
1840
- F: __dxlog_file8,
1744
+ F: __dxlog_file7,
1841
1745
  L: 220,
1842
1746
  S: this,
1843
1747
  A: [
@@ -1880,4 +1784,4 @@ export {
1880
1784
  TestExtension,
1881
1785
  TestExtensionWithStreams
1882
1786
  };
1883
- //# sourceMappingURL=chunk-C7IP5EHF.mjs.map
1787
+ //# sourceMappingURL=chunk-S3OA366R.mjs.map