@dxos/teleport 0.3.8-main.a3d042a → 0.3.8-main.a5a9bfc

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.warn("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.warn("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 destroy", {
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)
@@ -721,6 +861,17 @@ var Muxer = class {
721
861
  }
722
862
  }
723
863
  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
+ }
724
875
  try {
725
876
  const trigger = new Trigger();
726
877
  this._balancer.pushData(Command.encode(cmd), trigger, channelId);
@@ -733,7 +884,7 @@ var Muxer = class {
733
884
  }
734
885
  _getOrCreateStream(params) {
735
886
  if (this._channelsByTag.size === 0) {
736
- scheduleTaskInterval(this._ctx, async () => this._emitStats(), STATS_INTERVAL);
887
+ scheduleTaskInterval2(this._ctx, async () => this._emitStats(), STATS_INTERVAL);
737
888
  }
738
889
  let channel = this._channelsByTag.get(params.tag);
739
890
  if (!channel) {
@@ -758,12 +909,12 @@ var Muxer = class {
758
909
  }
759
910
  async _sendData(channel, data, timeout) {
760
911
  if (data.length > MAX_SAFE_FRAME_SIZE) {
761
- log3.warn("frame size exceeds maximum safe value", {
912
+ log4.warn("frame size exceeds maximum safe value", {
762
913
  size: data.length,
763
914
  threshold: MAX_SAFE_FRAME_SIZE
764
915
  }, {
765
- F: __dxlog_file3,
766
- L: 425,
916
+ F: __dxlog_file4,
917
+ L: 429,
767
918
  S: this,
768
919
  C: (f, a) => f(...a)
769
920
  });
@@ -840,17 +991,17 @@ function _ts_decorate(decorators, target, key, desc) {
840
991
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
841
992
  return c > 3 && r && Object.defineProperty(target, key, r), r;
842
993
  }
843
- 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";
844
995
  var CONTROL_HEARTBEAT_INTERVAL = 1e4;
845
996
  var CONTROL_HEARTBEAT_TIMEOUT = 6e4;
846
997
  var Teleport = class {
847
998
  constructor({ initiator, localPeerId, remotePeerId }) {
848
- this._ctx = new Context2({
999
+ this._ctx = new Context3({
849
1000
  onError: (err) => {
850
1001
  void this.destroy(err).catch(() => {
851
- log4.error("Error during destroy", err, {
852
- F: __dxlog_file4,
853
- L: 47,
1002
+ log5.error("Error during destroy", err, {
1003
+ F: __dxlog_file5,
1004
+ L: 38,
854
1005
  S: this,
855
1006
  C: (f, a) => f(...a)
856
1007
  });
@@ -858,35 +1009,14 @@ var Teleport = class {
858
1009
  }
859
1010
  });
860
1011
  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
- });
882
1012
  this._extensions = /* @__PURE__ */ new Map();
883
1013
  this._remoteExtensions = /* @__PURE__ */ new Set();
884
1014
  this._open = false;
885
1015
  this._destroying = false;
886
1016
  this._aborting = false;
887
1017
  invariant4(typeof initiator === "boolean", void 0, {
888
- F: __dxlog_file4,
889
- L: 75,
1018
+ F: __dxlog_file5,
1019
+ L: 55,
890
1020
  S: this,
891
1021
  A: [
892
1022
  "typeof initiator === 'boolean'",
@@ -894,8 +1024,8 @@ var Teleport = class {
894
1024
  ]
895
1025
  });
896
1026
  invariant4(PublicKey.isPublicKey(localPeerId), void 0, {
897
- F: __dxlog_file4,
898
- L: 76,
1027
+ F: __dxlog_file5,
1028
+ L: 56,
899
1029
  S: this,
900
1030
  A: [
901
1031
  "PublicKey.isPublicKey(localPeerId)",
@@ -903,8 +1033,8 @@ var Teleport = class {
903
1033
  ]
904
1034
  });
905
1035
  invariant4(PublicKey.isPublicKey(remotePeerId), void 0, {
906
- F: __dxlog_file4,
907
- L: 77,
1036
+ F: __dxlog_file5,
1037
+ L: 57,
908
1038
  S: this,
909
1039
  A: [
910
1040
  "PublicKey.isPublicKey(remotePeerId)",
@@ -914,18 +1044,39 @@ var Teleport = class {
914
1044
  this.initiator = initiator;
915
1045
  this.localPeerId = localPeerId;
916
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);
917
1068
  this._control.onExtensionRegistered.set(async (name) => {
918
- log4("remote extension", {
1069
+ log5("remote extension", {
919
1070
  name
920
1071
  }, {
921
- F: __dxlog_file4,
922
- L: 83,
1072
+ F: __dxlog_file5,
1073
+ L: 79,
923
1074
  S: this,
924
1075
  C: (f, a) => f(...a)
925
1076
  });
926
1077
  invariant4(!this._remoteExtensions.has(name), "Remote extension already exists", {
927
- F: __dxlog_file4,
928
- L: 84,
1078
+ F: __dxlog_file5,
1079
+ L: 80,
929
1080
  S: this,
930
1081
  A: [
931
1082
  "!this._remoteExtensions.has(name)",
@@ -944,9 +1095,9 @@ var Teleport = class {
944
1095
  {
945
1096
  this._muxer.stream.on("close", async () => {
946
1097
  if (this._destroying || this._aborting) {
947
- log4("destroy teleport due to muxer stream close, skipping due to already destroying/aborting", void 0, {
948
- F: __dxlog_file4,
949
- 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,
950
1101
  S: this,
951
1102
  C: (f, a) => f(...a)
952
1103
  });
@@ -959,7 +1110,7 @@ var Teleport = class {
959
1110
  });
960
1111
  }
961
1112
  this._muxer.statsUpdated.on((stats) => {
962
- log4.trace("dxos.mesh.teleport.stats", {
1113
+ log5.trace("dxos.mesh.teleport.stats", {
963
1114
  localPeerId,
964
1115
  remotePeerId,
965
1116
  bytesSent: stats.bytesSent,
@@ -968,8 +1119,8 @@ var Teleport = class {
968
1119
  bytesReceivedRate: stats.bytesReceivedRate,
969
1120
  channels: stats.channels
970
1121
  }, {
971
- F: __dxlog_file4,
972
- L: 113,
1122
+ F: __dxlog_file5,
1123
+ L: 109,
973
1124
  S: this,
974
1125
  C: (f, a) => f(...a)
975
1126
  });
@@ -1005,9 +1156,9 @@ var Teleport = class {
1005
1156
  try {
1006
1157
  await extension.onAbort(err);
1007
1158
  } catch (err2) {
1008
- log4.catch(err2, void 0, {
1009
- F: __dxlog_file4,
1010
- L: 166,
1159
+ log5.catch(err2, void 0, {
1160
+ F: __dxlog_file5,
1161
+ L: 162,
1011
1162
  S: this,
1012
1163
  C: (f, a) => f(...a)
1013
1164
  });
@@ -1028,9 +1179,9 @@ var Teleport = class {
1028
1179
  try {
1029
1180
  await extension.onClose(err);
1030
1181
  } catch (err2) {
1031
- log4.catch(err2, void 0, {
1032
- F: __dxlog_file4,
1033
- L: 190,
1182
+ log5.catch(err2, void 0, {
1183
+ F: __dxlog_file5,
1184
+ L: 186,
1034
1185
  S: this,
1035
1186
  C: (f, a) => f(...a)
1036
1187
  });
@@ -1042,11 +1193,11 @@ var Teleport = class {
1042
1193
  if (!this._open) {
1043
1194
  throw new Error("Not open");
1044
1195
  }
1045
- log4("addExtension", {
1196
+ log5("addExtension", {
1046
1197
  name
1047
1198
  }, {
1048
- F: __dxlog_file4,
1049
- L: 202,
1199
+ F: __dxlog_file5,
1200
+ L: 198,
1050
1201
  S: this,
1051
1202
  C: (f, a) => f(...a)
1052
1203
  });
@@ -1055,7 +1206,7 @@ var Teleport = class {
1055
1206
  try {
1056
1207
  await this._control.registerExtension(name);
1057
1208
  } catch (err) {
1058
- if (err instanceof RpcClosedError) {
1209
+ if (err instanceof RpcClosedError2) {
1059
1210
  return;
1060
1211
  }
1061
1212
  throw err;
@@ -1069,8 +1220,8 @@ var Teleport = class {
1069
1220
  }
1070
1221
  _setExtension(extensionName, extension) {
1071
1222
  invariant4(!extensionName.includes("/"), "Invalid extension name", {
1072
- F: __dxlog_file4,
1073
- L: 226,
1223
+ F: __dxlog_file5,
1224
+ L: 222,
1074
1225
  S: this,
1075
1226
  A: [
1076
1227
  "!extensionName.includes('/')",
@@ -1078,8 +1229,8 @@ var Teleport = class {
1078
1229
  ]
1079
1230
  });
1080
1231
  invariant4(!this._extensions.has(extensionName), "Extension already exists", {
1081
- F: __dxlog_file4,
1082
- L: 227,
1232
+ F: __dxlog_file5,
1233
+ L: 223,
1083
1234
  S: this,
1084
1235
  A: [
1085
1236
  "!this._extensions.has(extensionName)",
@@ -1089,11 +1240,11 @@ var Teleport = class {
1089
1240
  this._extensions.set(extensionName, extension);
1090
1241
  }
1091
1242
  async _openExtension(extensionName) {
1092
- log4("open extension", {
1243
+ log5("open extension", {
1093
1244
  extensionName
1094
1245
  }, {
1095
- F: __dxlog_file4,
1096
- L: 232,
1246
+ F: __dxlog_file5,
1247
+ L: 228,
1097
1248
  S: this,
1098
1249
  C: (f, a) => f(...a)
1099
1250
  });
@@ -1104,8 +1255,8 @@ var Teleport = class {
1104
1255
  remotePeerId: this.remotePeerId,
1105
1256
  createPort: async (channelName, opts) => {
1106
1257
  invariant4(!channelName.includes("/"), "Invalid channel name", {
1107
- F: __dxlog_file4,
1108
- L: 240,
1258
+ F: __dxlog_file5,
1259
+ L: 236,
1109
1260
  S: this,
1110
1261
  A: [
1111
1262
  "!channelName.includes('/')",
@@ -1116,8 +1267,8 @@ var Teleport = class {
1116
1267
  },
1117
1268
  createStream: async (channelName, opts) => {
1118
1269
  invariant4(!channelName.includes("/"), "Invalid channel name", {
1119
- F: __dxlog_file4,
1120
- L: 244,
1270
+ F: __dxlog_file5,
1271
+ L: 240,
1121
1272
  S: this,
1122
1273
  A: [
1123
1274
  "!channelName.includes('/')",
@@ -1133,11 +1284,11 @@ var Teleport = class {
1133
1284
  }
1134
1285
  };
1135
1286
  await extension.onOpen(context);
1136
- log4("extension opened", {
1287
+ log5("extension opened", {
1137
1288
  extensionName
1138
1289
  }, {
1139
- F: __dxlog_file4,
1140
- L: 255,
1290
+ F: __dxlog_file5,
1291
+ L: 251,
1141
1292
  S: this,
1142
1293
  C: (f, a) => f(...a)
1143
1294
  });
@@ -1149,64 +1300,9 @@ _ts_decorate([
1149
1300
  _ts_decorate([
1150
1301
  synchronized
1151
1302
  ], 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
- };
1207
1303
 
1208
1304
  // 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";
1305
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/teleport/src/testing/test-builder.ts";
1210
1306
  var TestBuilder = class {
1211
1307
  constructor() {
1212
1308
  this._peers = /* @__PURE__ */ new Set();
@@ -1226,7 +1322,7 @@ var TestBuilder = class {
1226
1322
  }
1227
1323
  async connect(peer1, peer2) {
1228
1324
  invariant5(peer1 !== peer2, void 0, {
1229
- F: __dxlog_file5,
1325
+ F: __dxlog_file6,
1230
1326
  L: 37,
1231
1327
  S: this,
1232
1328
  A: [
@@ -1235,7 +1331,7 @@ var TestBuilder = class {
1235
1331
  ]
1236
1332
  });
1237
1333
  invariant5(this._peers.has(peer1), void 0, {
1238
- F: __dxlog_file5,
1334
+ F: __dxlog_file6,
1239
1335
  L: 38,
1240
1336
  S: this,
1241
1337
  A: [
@@ -1244,7 +1340,7 @@ var TestBuilder = class {
1244
1340
  ]
1245
1341
  });
1246
1342
  invariant5(this._peers.has(peer1), void 0, {
1247
- F: __dxlog_file5,
1343
+ F: __dxlog_file6,
1248
1344
  L: 39,
1249
1345
  S: this,
1250
1346
  A: [
@@ -1272,7 +1368,7 @@ var TestBuilder = class {
1272
1368
  }
1273
1369
  async disconnect(peer1, peer2) {
1274
1370
  invariant5(peer1 !== peer2, void 0, {
1275
- F: __dxlog_file5,
1371
+ F: __dxlog_file6,
1276
1372
  L: 51,
1277
1373
  S: this,
1278
1374
  A: [
@@ -1281,7 +1377,7 @@ var TestBuilder = class {
1281
1377
  ]
1282
1378
  });
1283
1379
  invariant5(this._peers.has(peer1), void 0, {
1284
- F: __dxlog_file5,
1380
+ F: __dxlog_file6,
1285
1381
  L: 52,
1286
1382
  S: this,
1287
1383
  A: [
@@ -1290,7 +1386,7 @@ var TestBuilder = class {
1290
1386
  ]
1291
1387
  });
1292
1388
  invariant5(this._peers.has(peer1), void 0, {
1293
- F: __dxlog_file5,
1389
+ F: __dxlog_file6,
1294
1390
  L: 53,
1295
1391
  S: this,
1296
1392
  A: [
@@ -1301,7 +1397,7 @@ var TestBuilder = class {
1301
1397
  const connection1 = Array.from(peer1.connections).find((connection) => connection.remotePeerId.equals(peer2.peerId));
1302
1398
  const connection2 = Array.from(peer2.connections).find((connection) => connection.remotePeerId.equals(peer1.peerId));
1303
1399
  invariant5(connection1, void 0, {
1304
- F: __dxlog_file5,
1400
+ F: __dxlog_file6,
1305
1401
  L: 62,
1306
1402
  S: this,
1307
1403
  A: [
@@ -1310,7 +1406,7 @@ var TestBuilder = class {
1310
1406
  ]
1311
1407
  });
1312
1408
  invariant5(connection2, void 0, {
1313
- F: __dxlog_file5,
1409
+ F: __dxlog_file6,
1314
1410
  L: 63,
1315
1411
  S: this,
1316
1412
  A: [
@@ -1340,7 +1436,7 @@ var TestPeer = class {
1340
1436
  }
1341
1437
  async openConnection(connection) {
1342
1438
  invariant5(this.connections.has(connection), void 0, {
1343
- F: __dxlog_file5,
1439
+ F: __dxlog_file6,
1344
1440
  L: 84,
1345
1441
  S: this,
1346
1442
  A: [
@@ -1353,7 +1449,7 @@ var TestPeer = class {
1353
1449
  }
1354
1450
  async closeConnection(connection) {
1355
1451
  invariant5(this.connections.has(connection), void 0, {
1356
- F: __dxlog_file5,
1452
+ F: __dxlog_file6,
1357
1453
  L: 90,
1358
1454
  S: this,
1359
1455
  A: [
@@ -1374,8 +1470,8 @@ var TestPeer = class {
1374
1470
  var pipeStreams = (stream1, stream2) => {
1375
1471
  pipeline(stream1, stream2, (err) => {
1376
1472
  if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
1377
- log5.catch(err, void 0, {
1378
- F: __dxlog_file5,
1473
+ log6.catch(err, void 0, {
1474
+ F: __dxlog_file6,
1379
1475
  L: 106,
1380
1476
  S: void 0,
1381
1477
  C: (f, a) => f(...a)
@@ -1384,8 +1480,8 @@ var pipeStreams = (stream1, stream2) => {
1384
1480
  });
1385
1481
  pipeline(stream2, stream1, (err) => {
1386
1482
  if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
1387
- log5.catch(err, void 0, {
1388
- F: __dxlog_file5,
1483
+ log6.catch(err, void 0, {
1484
+ F: __dxlog_file6,
1389
1485
  L: 111,
1390
1486
  S: void 0,
1391
1487
  C: (f, a) => f(...a)
@@ -1409,10 +1505,10 @@ var TestConnection = class {
1409
1505
  // packages/core/mesh/teleport/src/testing/test-extension.ts
1410
1506
  import { asyncTimeout as asyncTimeout2, Trigger as Trigger2 } from "@dxos/async";
1411
1507
  import { invariant as invariant6 } from "@dxos/invariant";
1412
- import { log as log6 } from "@dxos/log";
1508
+ import { log as log7 } from "@dxos/log";
1413
1509
  import { schema as schema3 } from "@dxos/protocols";
1414
1510
  import { createProtoRpcPeer as createProtoRpcPeer2 } from "@dxos/rpc";
1415
- 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";
1416
1512
  var TestExtension = class {
1417
1513
  constructor(callbacks = {}) {
1418
1514
  this.callbacks = callbacks;
@@ -1424,11 +1520,11 @@ var TestExtension = class {
1424
1520
  return this.extensionContext?.remotePeerId;
1425
1521
  }
1426
1522
  async onOpen(context) {
1427
- log6("onOpen", {
1523
+ log7("onOpen", {
1428
1524
  localPeerId: context.localPeerId,
1429
1525
  remotePeerId: context.remotePeerId
1430
1526
  }, {
1431
- F: __dxlog_file6,
1527
+ F: __dxlog_file7,
1432
1528
  L: 34,
1433
1529
  S: this,
1434
1530
  C: (f, a) => f(...a)
@@ -1462,10 +1558,10 @@ var TestExtension = class {
1462
1558
  this.open.wake();
1463
1559
  }
1464
1560
  async onClose(err) {
1465
- log6("onClose", {
1561
+ log7("onClose", {
1466
1562
  err
1467
1563
  }, {
1468
- F: __dxlog_file6,
1564
+ F: __dxlog_file7,
1469
1565
  L: 68,
1470
1566
  S: this,
1471
1567
  C: (f, a) => f(...a)
@@ -1475,10 +1571,10 @@ var TestExtension = class {
1475
1571
  await this._rpc?.close();
1476
1572
  }
1477
1573
  async onAbort(err) {
1478
- log6("onAbort", {
1574
+ log7("onAbort", {
1479
1575
  err
1480
1576
  }, {
1481
- F: __dxlog_file6,
1577
+ F: __dxlog_file7,
1482
1578
  L: 75,
1483
1579
  S: this,
1484
1580
  C: (f, a) => f(...a)
@@ -1495,7 +1591,7 @@ var TestExtension = class {
1495
1591
  data: message
1496
1592
  }), 1500);
1497
1593
  invariant6(res.data === message, void 0, {
1498
- F: __dxlog_file6,
1594
+ F: __dxlog_file7,
1499
1595
  L: 84,
1500
1596
  S: this,
1501
1597
  A: [
@@ -1516,10 +1612,10 @@ var TestExtension = class {
1516
1612
  import { randomBytes } from "@dxos/node-std/crypto";
1517
1613
  import { Trigger as Trigger3 } from "@dxos/async";
1518
1614
  import { invariant as invariant7 } from "@dxos/invariant";
1519
- import { log as log7 } from "@dxos/log";
1615
+ import { log as log8 } from "@dxos/log";
1520
1616
  import { schema as schema4 } from "@dxos/protocols";
1521
1617
  import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
1522
- 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";
1523
1619
  var TestExtensionWithStreams = class {
1524
1620
  constructor(callbacks = {}) {
1525
1621
  this.callbacks = callbacks;
@@ -1533,7 +1629,7 @@ var TestExtensionWithStreams = class {
1533
1629
  }
1534
1630
  async _openStream(streamTag, interval = 5, chunkSize = 2048) {
1535
1631
  invariant7(!this._streams.has(streamTag), `Stream already exists: ${streamTag}`, {
1536
- F: __dxlog_file7,
1632
+ F: __dxlog_file8,
1537
1633
  L: 39,
1538
1634
  S: this,
1539
1635
  A: [
@@ -1581,7 +1677,7 @@ var TestExtensionWithStreams = class {
1581
1677
  });
1582
1678
  streamEntry.reportingTimer = setInterval(() => {
1583
1679
  const { bytesSent, bytesReceived, sendErrors, receiveErrors } = streamEntry;
1584
- log7.trace("dxos.test.stream-stats", {
1680
+ log8.trace("dxos.test.stream-stats", {
1585
1681
  streamTag,
1586
1682
  bytesSent,
1587
1683
  bytesReceived,
@@ -1590,7 +1686,7 @@ var TestExtensionWithStreams = class {
1590
1686
  from: this.extensionContext?.localPeerId,
1591
1687
  to: this.extensionContext?.remotePeerId
1592
1688
  }, {
1593
- F: __dxlog_file7,
1689
+ F: __dxlog_file8,
1594
1690
  L: 93,
1595
1691
  S: this,
1596
1692
  C: (f, a) => f(...a)
@@ -1599,7 +1695,7 @@ var TestExtensionWithStreams = class {
1599
1695
  }
1600
1696
  _closeStream(streamTag) {
1601
1697
  invariant7(this._streams.has(streamTag), `Stream does not exist: ${streamTag}`, {
1602
- F: __dxlog_file7,
1698
+ F: __dxlog_file8,
1603
1699
  L: 106,
1604
1700
  S: this,
1605
1701
  A: [
@@ -1622,11 +1718,11 @@ var TestExtensionWithStreams = class {
1622
1718
  };
1623
1719
  }
1624
1720
  async onOpen(context) {
1625
- log7("onOpen", {
1721
+ log8("onOpen", {
1626
1722
  localPeerId: context.localPeerId,
1627
1723
  remotePeerId: context.remotePeerId
1628
1724
  }, {
1629
- F: __dxlog_file7,
1725
+ F: __dxlog_file8,
1630
1726
  L: 128,
1631
1727
  S: this,
1632
1728
  C: (f, a) => f(...a)
@@ -1672,10 +1768,10 @@ var TestExtensionWithStreams = class {
1672
1768
  this.open.wake();
1673
1769
  }
1674
1770
  async onClose(err) {
1675
- log7("onClose", {
1771
+ log8("onClose", {
1676
1772
  err
1677
1773
  }, {
1678
- F: __dxlog_file7,
1774
+ F: __dxlog_file8,
1679
1775
  L: 179,
1680
1776
  S: this,
1681
1777
  C: (f, a) => f(...a)
@@ -1683,10 +1779,10 @@ var TestExtensionWithStreams = class {
1683
1779
  await this.callbacks.onClose?.();
1684
1780
  this.closed.wake();
1685
1781
  for (const [streamTag, stream] of Object.entries(this._streams)) {
1686
- log7("closing stream", {
1782
+ log8("closing stream", {
1687
1783
  streamTag
1688
1784
  }, {
1689
- F: __dxlog_file7,
1785
+ F: __dxlog_file8,
1690
1786
  L: 183,
1691
1787
  S: this,
1692
1788
  C: (f, a) => f(...a)
@@ -1697,10 +1793,10 @@ var TestExtensionWithStreams = class {
1697
1793
  await this._rpc?.close();
1698
1794
  }
1699
1795
  async onAbort(err) {
1700
- log7("onAbort", {
1796
+ log8("onAbort", {
1701
1797
  err
1702
1798
  }, {
1703
- F: __dxlog_file7,
1799
+ F: __dxlog_file8,
1704
1800
  L: 191,
1705
1801
  S: this,
1706
1802
  C: (f, a) => f(...a)
@@ -1722,7 +1818,7 @@ var TestExtensionWithStreams = class {
1722
1818
  streamLoadChunkSize
1723
1819
  });
1724
1820
  invariant7(data === streamTag, void 0, {
1725
- F: __dxlog_file7,
1821
+ F: __dxlog_file8,
1726
1822
  L: 207,
1727
1823
  S: this,
1728
1824
  A: [
@@ -1741,7 +1837,7 @@ var TestExtensionWithStreams = class {
1741
1837
  data: streamTag
1742
1838
  });
1743
1839
  invariant7(data === streamTag, void 0, {
1744
- F: __dxlog_file7,
1840
+ F: __dxlog_file8,
1745
1841
  L: 220,
1746
1842
  S: this,
1747
1843
  A: [
@@ -1784,4 +1880,4 @@ export {
1784
1880
  TestExtension,
1785
1881
  TestExtensionWithStreams
1786
1882
  };
1787
- //# sourceMappingURL=chunk-VXXLKKBF.mjs.map
1883
+ //# sourceMappingURL=chunk-C7IP5EHF.mjs.map