@dxos/teleport 0.3.4 → 0.3.5-main.1ae5af4

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.
@@ -48,7 +48,8 @@ module.exports = __toCommonJS(src_exports);
48
48
  var import_node_stream = require("node:stream");
49
49
  var import_async = require("@dxos/async");
50
50
  var import_invariant = require("@dxos/invariant");
51
- var __dxlog_file = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/muxing/framer.ts";
51
+ var import_log = require("@dxos/log");
52
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/framer.ts";
52
53
  var FRAME_LENGTH_SIZE = 2;
53
54
  var Framer = class {
54
55
  constructor() {
@@ -70,7 +71,7 @@ var Framer = class {
70
71
  write: (chunk, encoding, callback) => {
71
72
  (0, import_invariant.invariant)(!this._subscribeCb, "Internal Framer bug. Concurrent writes detected.", {
72
73
  F: __dxlog_file,
73
- L: 39,
74
+ L: 40,
74
75
  S: this,
75
76
  A: [
76
77
  "!this._subscribeCb",
@@ -114,7 +115,7 @@ var Framer = class {
114
115
  subscribe: (callback) => {
115
116
  (0, import_invariant.invariant)(!this._messageCb, "Rpc port already has a message listener.", {
116
117
  F: __dxlog_file,
117
- L: 78,
118
+ L: 79,
118
119
  S: this,
119
120
  A: [
120
121
  "!this._messageCb",
@@ -168,6 +169,22 @@ var Framer = class {
168
169
  }
169
170
  }
170
171
  destroy() {
172
+ if (this._stream.readableLength > 0) {
173
+ import_log.log.warn("framer destroyed while there are still read bytes in the buffer.", void 0, {
174
+ F: __dxlog_file,
175
+ L: 140,
176
+ S: this,
177
+ C: (f, a) => f(...a)
178
+ });
179
+ }
180
+ if (this._stream.writableLength > 0) {
181
+ import_log.log.warn("framer destroyed while there are still write bytes in the buffer.", void 0, {
182
+ F: __dxlog_file,
183
+ L: 143,
184
+ S: this,
185
+ C: (f, a) => f(...a)
186
+ });
187
+ }
171
188
  this._stream.destroy();
172
189
  }
173
190
  };
@@ -199,14 +216,14 @@ var import_async3 = require("@dxos/async");
199
216
  var import_context = require("@dxos/context");
200
217
  var import_debug = require("@dxos/debug");
201
218
  var import_invariant2 = require("@dxos/invariant");
202
- var import_log2 = require("@dxos/log");
219
+ var import_log3 = require("@dxos/log");
203
220
  var import_protocols = require("@dxos/protocols");
204
221
 
205
222
  // packages/core/mesh/teleport/src/muxing/balancer.ts
206
223
  var varint = __toESM(require("varint"));
207
224
  var import_async2 = require("@dxos/async");
208
- var import_log = require("@dxos/log");
209
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/muxing/balancer.ts";
225
+ var import_log2 = require("@dxos/log");
226
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/balancer.ts";
210
227
  var MAX_CHUNK_SIZE = 8192;
211
228
  var Balancer = class {
212
229
  constructor(_sysChannelId) {
@@ -258,7 +275,7 @@ var Balancer = class {
258
275
  });
259
276
  });
260
277
  if (noCalls) {
261
- this._sendChunk().catch((err) => import_log.log.catch(err, void 0, {
278
+ this._sendChunk().catch((err) => import_log2.log.catch(err, void 0, {
262
279
  F: __dxlog_file2,
263
280
  L: 100,
264
281
  S: this,
@@ -267,6 +284,14 @@ var Balancer = class {
267
284
  }
268
285
  }
269
286
  destroy() {
287
+ if (this._sendBuffers.size !== 0) {
288
+ import_log2.log.warn("destroying balancer with pending calls", void 0, {
289
+ F: __dxlog_file2,
290
+ L: 106,
291
+ S: this,
292
+ C: (f, a) => f(...a)
293
+ });
294
+ }
270
295
  this._sendBuffers.clear();
271
296
  this._framer.destroy();
272
297
  }
@@ -363,11 +388,12 @@ var decodeChunk = (data, withLength) => {
363
388
  };
364
389
 
365
390
  // packages/core/mesh/teleport/src/muxing/muxer.ts
366
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/muxing/muxer.ts";
391
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/muxing/muxer.ts";
367
392
  var Command = import_protocols.schema.getCodecForType("dxos.mesh.muxer.Command");
368
393
  var STATS_INTERVAL = 1e3;
369
394
  var MAX_SAFE_FRAME_SIZE = 1e6;
370
395
  var SYSTEM_CHANNEL_ID = 0;
396
+ var GRACEFUL_CLOSE_TIMEOUT = 3e3;
371
397
  var Muxer = class {
372
398
  constructor() {
373
399
  this._balancer = new Balancer(SYSTEM_CHANNEL_ID);
@@ -377,9 +403,10 @@ var Muxer = class {
377
403
  this._nextId = 1;
378
404
  this._destroyed = false;
379
405
  this._destroying = false;
406
+ this._closing = false;
380
407
  this._lastStats = void 0;
381
408
  this._lastChannelStats = /* @__PURE__ */ new Map();
382
- this.close = new import_async3.Event();
409
+ this.afterClosed = new import_async3.Event();
383
410
  this.statsUpdated = new import_async3.Event();
384
411
  this.stream = this._balancer.stream;
385
412
  this._balancer.incomingData.on(async (msg) => {
@@ -400,7 +427,7 @@ var Muxer = class {
400
427
  });
401
428
  (0, import_invariant2.invariant)(!channel.push, `Channel already open: ${tag}`, {
402
429
  F: __dxlog_file3,
403
- L: 136,
430
+ L: 138,
404
431
  S: this,
405
432
  A: [
406
433
  "!channel.push",
@@ -448,7 +475,7 @@ var Muxer = class {
448
475
  });
449
476
  (0, import_invariant2.invariant)(!channel.push, `Channel already open: ${tag}`, {
450
477
  F: __dxlog_file3,
451
- L: 188,
478
+ L: 190,
452
479
  S: this,
453
480
  A: [
454
481
  "!channel.push",
@@ -472,7 +499,7 @@ var Muxer = class {
472
499
  subscribe: (cb) => {
473
500
  (0, import_invariant2.invariant)(!callback, "Only one subscriber is allowed", {
474
501
  F: __dxlog_file3,
475
- L: 210,
502
+ L: 212,
476
503
  S: this,
477
504
  A: [
478
505
  "!callback",
@@ -500,61 +527,153 @@ var Muxer = class {
500
527
  }
501
528
  return port;
502
529
  }
503
- /**
504
- * Force-close with optional error.
505
- */
506
- async destroy(err) {
530
+ // initiate graceful close
531
+ async close(err) {
507
532
  if (this._destroying) {
533
+ (0, import_log3.log)("already destroying, ignoring graceful close request", void 0, {
534
+ F: __dxlog_file3,
535
+ L: 245,
536
+ S: this,
537
+ C: (f, a) => f(...a)
538
+ });
508
539
  return;
509
540
  }
510
- this._destroying = true;
511
- this._sendCommand({
512
- destroy: {
541
+ if (this._closing) {
542
+ (0, import_log3.log)("already closing, ignoring graceful close request", void 0, {
543
+ F: __dxlog_file3,
544
+ L: 249,
545
+ S: this,
546
+ C: (f, a) => f(...a)
547
+ });
548
+ return;
549
+ }
550
+ this._closing = true;
551
+ await this._sendCommand({
552
+ close: {
513
553
  error: err?.message
514
554
  }
515
- }, SYSTEM_CHANNEL_ID).then(() => {
516
- this._dispose();
517
- }).catch((err2) => {
518
- this._dispose(err2);
555
+ }, SYSTEM_CHANNEL_ID).catch(async (err2) => {
556
+ (0, import_log3.log)("error sending close command", {
557
+ err: err2
558
+ }, {
559
+ F: __dxlog_file3,
560
+ L: 263,
561
+ S: this,
562
+ C: (f, a) => f(...a)
563
+ });
564
+ await this.dispose(err2);
519
565
  });
566
+ await Promise.race([
567
+ new Promise((_resolve, reject) => {
568
+ setTimeout(() => {
569
+ reject(new import_protocols.TimeoutError("gracefully closing muxer"));
570
+ }, GRACEFUL_CLOSE_TIMEOUT);
571
+ }),
572
+ (async () => {
573
+ await this.dispose(err);
574
+ })()
575
+ ]);
576
+ }
577
+ // force close without confirmation
578
+ async destroy(err) {
579
+ if (this._destroying) {
580
+ (0, import_log3.log)("already destroying, ignoring destroy request", void 0, {
581
+ F: __dxlog_file3,
582
+ L: 284,
583
+ S: this,
584
+ C: (f, a) => f(...a)
585
+ });
586
+ return;
587
+ }
588
+ this._destroying = true;
520
589
  void this._ctx.dispose();
590
+ if (this._closing) {
591
+ (0, import_log3.log)("destroy cancelling graceful close", void 0, {
592
+ F: __dxlog_file3,
593
+ L: 290,
594
+ S: this,
595
+ C: (f, a) => f(...a)
596
+ });
597
+ this._closing = false;
598
+ } else {
599
+ await this._sendCommand({
600
+ close: {
601
+ error: err?.message
602
+ }
603
+ }, SYSTEM_CHANNEL_ID).catch(async (err2) => {
604
+ (0, import_log3.log)("error sending courtesy close command", {
605
+ err: err2
606
+ }, {
607
+ F: __dxlog_file3,
608
+ L: 303,
609
+ S: this,
610
+ C: (f, a) => f(...a)
611
+ });
612
+ });
613
+ }
614
+ this.dispose(err).catch((err2) => {
615
+ (0, import_log3.log)("error disposing after destroy", {
616
+ err: err2
617
+ }, {
618
+ F: __dxlog_file3,
619
+ L: 308,
620
+ S: this,
621
+ C: (f, a) => f(...a)
622
+ });
623
+ });
521
624
  }
522
- _dispose(err) {
625
+ // complete the termination, graceful or otherwise
626
+ async dispose(err) {
523
627
  if (this._destroyed) {
628
+ (0, import_log3.log)("already destroyed, ignoring dispose request", void 0, {
629
+ F: __dxlog_file3,
630
+ L: 316,
631
+ S: this,
632
+ C: (f, a) => f(...a)
633
+ });
524
634
  return;
525
635
  }
526
- this._destroyed = true;
527
- this._balancer.destroy();
636
+ void this._ctx.dispose();
637
+ await this._balancer.destroy();
528
638
  for (const channel of this._channelsByTag.values()) {
529
639
  channel.destroy?.(err);
530
640
  }
531
- this.close.emit(err);
641
+ this._destroyed = true;
642
+ this.afterClosed.emit(err);
532
643
  this._channelsByLocalId.clear();
533
644
  this._channelsByTag.clear();
534
645
  }
535
646
  async _handleCommand(cmd) {
536
- (0, import_log2.log)("Received command", {
537
- cmd
538
- }, {
539
- F: __dxlog_file3,
540
- L: 286,
541
- S: this,
542
- C: (f, a) => f(...a)
543
- });
544
- if (this._destroyed || this._destroying) {
545
- if (cmd.destroy) {
546
- return;
547
- }
548
- import_log2.log.warn("Received command after destroy", {
647
+ if (this._destroyed) {
648
+ import_log3.log.warn("Received command after destroy", {
549
649
  cmd
550
650
  }, {
551
651
  F: __dxlog_file3,
552
- L: 293,
652
+ L: 338,
553
653
  S: this,
554
654
  C: (f, a) => f(...a)
555
655
  });
556
656
  return;
557
657
  }
658
+ if (cmd.close) {
659
+ if (!this._closing) {
660
+ (0, import_log3.log)("received peer close, initiating my own graceful close", void 0, {
661
+ F: __dxlog_file3,
662
+ L: 344,
663
+ S: this,
664
+ C: (f, a) => f(...a)
665
+ });
666
+ await this.close();
667
+ } else {
668
+ (0, import_log3.log)("received close from peer, already closing", void 0, {
669
+ F: __dxlog_file3,
670
+ L: 347,
671
+ S: this,
672
+ C: (f, a) => f(...a)
673
+ });
674
+ }
675
+ return;
676
+ }
558
677
  if (cmd.openChannel) {
559
678
  const channel = this._getOrCreateStream({
560
679
  tag: cmd.openChannel.tag,
@@ -573,19 +692,17 @@ var Muxer = class {
573
692
  } else if (cmd.data) {
574
693
  const stream = this._channelsByLocalId.get(cmd.data.channelId) ?? (0, import_debug.failUndefined)();
575
694
  if (!stream.push) {
576
- import_log2.log.warn("Received data for channel before it was opened", {
695
+ import_log3.log.warn("Received data for channel before it was opened", {
577
696
  tag: stream.tag
578
697
  }, {
579
698
  F: __dxlog_file3,
580
- L: 320,
699
+ L: 376,
581
700
  S: this,
582
701
  C: (f, a) => f(...a)
583
702
  });
584
703
  return;
585
704
  }
586
705
  stream.push(cmd.data.data);
587
- } else if (cmd.destroy) {
588
- this._dispose();
589
706
  }
590
707
  }
591
708
  async _sendCommand(cmd, channelId = -1) {
@@ -621,12 +738,12 @@ var Muxer = class {
621
738
  }
622
739
  async _sendData(channel, data) {
623
740
  if (data.length > MAX_SAFE_FRAME_SIZE) {
624
- import_log2.log.warn("frame size exceeds maximum safe value", {
741
+ import_log3.log.warn("frame size exceeds maximum safe value", {
625
742
  size: data.length,
626
743
  threshold: MAX_SAFE_FRAME_SIZE
627
744
  }, {
628
745
  F: __dxlog_file3,
629
- L: 365,
746
+ L: 419,
630
747
  S: this,
631
748
  C: (f, a) => f(...a)
632
749
  });
@@ -698,7 +815,7 @@ var import_context2 = require("@dxos/context");
698
815
  var import_debug2 = require("@dxos/debug");
699
816
  var import_invariant3 = require("@dxos/invariant");
700
817
  var import_keys = require("@dxos/keys");
701
- var import_log3 = require("@dxos/log");
818
+ var import_log4 = require("@dxos/log");
702
819
  var import_protocols2 = require("@dxos/protocols");
703
820
  var import_rpc = require("@dxos/rpc");
704
821
  var import_util = require("@dxos/util");
@@ -712,13 +829,13 @@ function _ts_decorate(decorators, target, key, desc) {
712
829
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
713
830
  return c > 3 && r && Object.defineProperty(target, key, r), r;
714
831
  }
715
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/teleport.ts";
832
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/teleport.ts";
716
833
  var Teleport = class {
717
834
  constructor({ initiator, localPeerId, remotePeerId }) {
718
835
  this._ctx = new import_context2.Context({
719
836
  onError: (err) => {
720
837
  void this.destroy(err).catch(() => {
721
- import_log3.log.error("Error during destroy", err, {
838
+ import_log4.log.error("Error during destroy", err, {
722
839
  F: __dxlog_file4,
723
840
  L: 44,
724
841
  S: this,
@@ -735,13 +852,13 @@ var Teleport = class {
735
852
  if (this._destroying || this._aborting) {
736
853
  return;
737
854
  }
738
- (0, import_log3.log)("destroy teleport due to onTimeout in ControlExtension", void 0, {
855
+ (0, import_log4.log)("destroy teleport due to onTimeout in ControlExtension", void 0, {
739
856
  F: __dxlog_file4,
740
857
  L: 59,
741
858
  S: this,
742
859
  C: (f, a) => f(...a)
743
860
  });
744
- this.destroy(new import_protocols2.TimeoutError("control extension")).catch((err) => import_log3.log.catch(err, void 0, {
861
+ this.destroy(new import_protocols2.TimeoutError("control extension")).catch((err) => import_log4.log.catch(err, void 0, {
745
862
  F: __dxlog_file4,
746
863
  L: 60,
747
864
  S: this,
@@ -785,7 +902,7 @@ var Teleport = class {
785
902
  this.localPeerId = localPeerId;
786
903
  this.remotePeerId = remotePeerId;
787
904
  this._control.onExtensionRegistered.set(async (name) => {
788
- (0, import_log3.log)("remote extension", {
905
+ (0, import_log4.log)("remote extension", {
789
906
  name
790
907
  }, {
791
908
  F: __dxlog_file4,
@@ -814,7 +931,7 @@ var Teleport = class {
814
931
  {
815
932
  this._muxer.stream.on("close", async () => {
816
933
  if (this._destroying || this._aborting) {
817
- (0, import_log3.log)("destroy teleport due to muxer stream close, skipping due to already destroying/aborting", void 0, {
934
+ (0, import_log4.log)("destroy teleport due to muxer stream close, skipping due to already destroying/aborting", void 0, {
818
935
  F: __dxlog_file4,
819
936
  L: 97,
820
937
  S: this,
@@ -829,7 +946,7 @@ var Teleport = class {
829
946
  });
830
947
  }
831
948
  this._muxer.statsUpdated.on((stats) => {
832
- import_log3.log.trace("dxos.mesh.teleport.stats", {
949
+ import_log4.log.trace("dxos.mesh.teleport.stats", {
833
950
  localPeerId,
834
951
  remotePeerId,
835
952
  bytesSent: stats.bytesSent,
@@ -875,7 +992,7 @@ var Teleport = class {
875
992
  try {
876
993
  await extension.onAbort(err);
877
994
  } catch (err2) {
878
- import_log3.log.catch(err2, void 0, {
995
+ import_log4.log.catch(err2, void 0, {
879
996
  F: __dxlog_file4,
880
997
  L: 163,
881
998
  S: this,
@@ -898,7 +1015,7 @@ var Teleport = class {
898
1015
  try {
899
1016
  await extension.onClose(err);
900
1017
  } catch (err2) {
901
- import_log3.log.catch(err2, void 0, {
1018
+ import_log4.log.catch(err2, void 0, {
902
1019
  F: __dxlog_file4,
903
1020
  L: 187,
904
1021
  S: this,
@@ -906,13 +1023,13 @@ var Teleport = class {
906
1023
  });
907
1024
  }
908
1025
  }
909
- await this._muxer.destroy(err);
1026
+ await this._muxer.close();
910
1027
  }
911
1028
  addExtension(name, extension) {
912
1029
  if (!this._open) {
913
1030
  throw new Error("Not open");
914
1031
  }
915
- (0, import_log3.log)("addExtension", {
1032
+ (0, import_log4.log)("addExtension", {
916
1033
  name
917
1034
  }, {
918
1035
  F: __dxlog_file4,
@@ -959,7 +1076,7 @@ var Teleport = class {
959
1076
  this._extensions.set(extensionName, extension);
960
1077
  }
961
1078
  async _openExtension(extensionName) {
962
- (0, import_log3.log)("open extension", {
1079
+ (0, import_log4.log)("open extension", {
963
1080
  extensionName
964
1081
  }, {
965
1082
  F: __dxlog_file4,
@@ -1003,7 +1120,7 @@ var Teleport = class {
1003
1120
  }
1004
1121
  };
1005
1122
  await extension.onOpen(context);
1006
- (0, import_log3.log)("extension opened", {
1123
+ (0, import_log4.log)("extension opened", {
1007
1124
  extensionName
1008
1125
  }, {
1009
1126
  F: __dxlog_file4,
@@ -1079,8 +1196,8 @@ var ControlExtension = class {
1079
1196
  var import_node_stream3 = require("node:stream");
1080
1197
  var import_invariant4 = require("@dxos/invariant");
1081
1198
  var import_keys2 = require("@dxos/keys");
1082
- var import_log4 = require("@dxos/log");
1083
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/testing/test-builder.ts";
1199
+ var import_log5 = require("@dxos/log");
1200
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-builder.ts";
1084
1201
  var TestBuilder = class {
1085
1202
  constructor() {
1086
1203
  this._peers = /* @__PURE__ */ new Set();
@@ -1248,7 +1365,7 @@ var TestPeer = class {
1248
1365
  var pipeStreams = (stream1, stream2) => {
1249
1366
  (0, import_node_stream3.pipeline)(stream1, stream2, (err) => {
1250
1367
  if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
1251
- import_log4.log.catch(err, void 0, {
1368
+ import_log5.log.catch(err, void 0, {
1252
1369
  F: __dxlog_file5,
1253
1370
  L: 106,
1254
1371
  S: void 0,
@@ -1258,7 +1375,7 @@ var pipeStreams = (stream1, stream2) => {
1258
1375
  });
1259
1376
  (0, import_node_stream3.pipeline)(stream2, stream1, (err) => {
1260
1377
  if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
1261
- import_log4.log.catch(err, void 0, {
1378
+ import_log5.log.catch(err, void 0, {
1262
1379
  F: __dxlog_file5,
1263
1380
  L: 111,
1264
1381
  S: void 0,
@@ -1283,10 +1400,10 @@ var TestConnection = class {
1283
1400
  // packages/core/mesh/teleport/src/testing/test-extension.ts
1284
1401
  var import_async5 = require("@dxos/async");
1285
1402
  var import_invariant5 = require("@dxos/invariant");
1286
- var import_log5 = require("@dxos/log");
1403
+ var import_log6 = require("@dxos/log");
1287
1404
  var import_protocols3 = require("@dxos/protocols");
1288
1405
  var import_rpc2 = require("@dxos/rpc");
1289
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/testing/test-extension.ts";
1406
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-extension.ts";
1290
1407
  var TestExtension = class {
1291
1408
  constructor(callbacks = {}) {
1292
1409
  this.callbacks = callbacks;
@@ -1298,7 +1415,7 @@ var TestExtension = class {
1298
1415
  return this.extensionContext?.remotePeerId;
1299
1416
  }
1300
1417
  async onOpen(context) {
1301
- (0, import_log5.log)("onOpen", {
1418
+ (0, import_log6.log)("onOpen", {
1302
1419
  localPeerId: context.localPeerId,
1303
1420
  remotePeerId: context.remotePeerId
1304
1421
  }, {
@@ -1336,7 +1453,7 @@ var TestExtension = class {
1336
1453
  this.open.wake();
1337
1454
  }
1338
1455
  async onClose(err) {
1339
- (0, import_log5.log)("onClose", {
1456
+ (0, import_log6.log)("onClose", {
1340
1457
  err
1341
1458
  }, {
1342
1459
  F: __dxlog_file6,
@@ -1349,7 +1466,7 @@ var TestExtension = class {
1349
1466
  await this._rpc?.close();
1350
1467
  }
1351
1468
  async onAbort(err) {
1352
- (0, import_log5.log)("onAbort", {
1469
+ (0, import_log6.log)("onAbort", {
1353
1470
  err
1354
1471
  }, {
1355
1472
  F: __dxlog_file6,
@@ -1390,10 +1507,10 @@ var TestExtension = class {
1390
1507
  var import_node_crypto = require("node:crypto");
1391
1508
  var import_async6 = require("@dxos/async");
1392
1509
  var import_invariant6 = require("@dxos/invariant");
1393
- var import_log6 = require("@dxos/log");
1510
+ var import_log7 = require("@dxos/log");
1394
1511
  var import_protocols4 = require("@dxos/protocols");
1395
1512
  var import_rpc3 = require("@dxos/rpc");
1396
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/testing/test-extension-with-streams.ts";
1513
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-extension-with-streams.ts";
1397
1514
  var TestExtensionWithStreams = class {
1398
1515
  constructor(callbacks = {}) {
1399
1516
  this.callbacks = callbacks;
@@ -1455,7 +1572,7 @@ var TestExtensionWithStreams = class {
1455
1572
  });
1456
1573
  streamEntry.reportingTimer = setInterval(() => {
1457
1574
  const { bytesSent, bytesReceived, sendErrors, receiveErrors } = streamEntry;
1458
- import_log6.log.trace("dxos.test.stream-stats", {
1575
+ import_log7.log.trace("dxos.test.stream-stats", {
1459
1576
  streamTag,
1460
1577
  bytesSent,
1461
1578
  bytesReceived,
@@ -1496,7 +1613,7 @@ var TestExtensionWithStreams = class {
1496
1613
  };
1497
1614
  }
1498
1615
  async onOpen(context) {
1499
- (0, import_log6.log)("onOpen", {
1616
+ (0, import_log7.log)("onOpen", {
1500
1617
  localPeerId: context.localPeerId,
1501
1618
  remotePeerId: context.remotePeerId
1502
1619
  }, {
@@ -1546,7 +1663,7 @@ var TestExtensionWithStreams = class {
1546
1663
  this.open.wake();
1547
1664
  }
1548
1665
  async onClose(err) {
1549
- (0, import_log6.log)("onClose", {
1666
+ (0, import_log7.log)("onClose", {
1550
1667
  err
1551
1668
  }, {
1552
1669
  F: __dxlog_file7,
@@ -1557,7 +1674,7 @@ var TestExtensionWithStreams = class {
1557
1674
  await this.callbacks.onClose?.();
1558
1675
  this.closed.wake();
1559
1676
  for (const [streamTag, stream] of Object.entries(this._streams)) {
1560
- (0, import_log6.log)("closing stream", {
1677
+ (0, import_log7.log)("closing stream", {
1561
1678
  streamTag
1562
1679
  }, {
1563
1680
  F: __dxlog_file7,
@@ -1571,7 +1688,7 @@ var TestExtensionWithStreams = class {
1571
1688
  await this._rpc?.close();
1572
1689
  }
1573
1690
  async onAbort(err) {
1574
- (0, import_log6.log)("onAbort", {
1691
+ (0, import_log7.log)("onAbort", {
1575
1692
  err
1576
1693
  }, {
1577
1694
  F: __dxlog_file7,
@@ -1649,7 +1766,7 @@ var TestExtensionWithStreams = class {
1649
1766
  // packages/core/mesh/teleport/src/rpc-extension.ts
1650
1767
  var import_invariant7 = require("@dxos/invariant");
1651
1768
  var import_rpc4 = require("@dxos/rpc");
1652
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/core/mesh/teleport/src/rpc-extension.ts";
1769
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/rpc-extension.ts";
1653
1770
  var RpcExtension = class {
1654
1771
  constructor(_rpcParams) {
1655
1772
  this._rpcParams = _rpcParams;