@dxos/teleport 0.3.8-main.c3b295a → 0.3.8-main.f4e0086

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