@dxos/network-manager 0.1.53-main.e7b89d1 → 0.1.53-main.f5aedb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-6CP5XM3F.mjs → chunk-N5RZB7V4.mjs} +509 -497
- package/dist/lib/browser/chunk-N5RZB7V4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +11 -10
- package/dist/lib/browser/testing/index.mjs.map +1 -1
- package/dist/lib/node/index.cjs +507 -495
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +463 -450
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/transport/memory-transport.d.ts.map +1 -1
- package/package.json +19 -18
- package/src/network-manager.ts +5 -5
- package/src/signal/swarm-messenger.ts +7 -7
- package/src/swarm/connection.ts +9 -9
- package/src/swarm/peer.ts +6 -6
- package/src/swarm/swarm.ts +8 -8
- package/src/topology/fully-connected-topology.ts +3 -3
- package/src/topology/mmst-topology.ts +5 -5
- package/src/topology/star-topology.ts +4 -4
- package/src/transport/memory-transport.ts +3 -6
- package/src/transport/webrtc-transport-proxy.ts +2 -2
- package/src/transport/webrtc-transport-service.ts +3 -3
- package/src/transport/webrtc-transport.ts +2 -2
- package/dist/lib/browser/chunk-6CP5XM3F.mjs.map +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "@dxos/node-std/globals"
|
|
1
|
+
import "@dxos/node-std/globals";
|
|
2
2
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
3
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
4
|
}) : x)(function(x) {
|
|
@@ -8,7 +8,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
// packages/core/mesh/network-manager/src/swarm/connection.ts
|
|
11
|
-
import
|
|
11
|
+
import invariant from "tiny-invariant";
|
|
12
12
|
import { DeferredTask, Event, sleep, synchronized } from "@dxos/async";
|
|
13
13
|
import { Context, cancelWithContext } from "@dxos/context";
|
|
14
14
|
import { ErrorStream } from "@dxos/debug";
|
|
@@ -16,7 +16,7 @@ import { CancelledError } from "@dxos/errors";
|
|
|
16
16
|
import { PublicKey } from "@dxos/keys";
|
|
17
17
|
import { log } from "@dxos/log";
|
|
18
18
|
import { trace } from "@dxos/protocols";
|
|
19
|
-
|
|
19
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
20
20
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
21
21
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
22
22
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -25,7 +25,8 @@ var __decorate = function(decorators, target, key, desc) {
|
|
|
25
25
|
if (d = decorators[i])
|
|
26
26
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
27
27
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection.ts";
|
|
29
30
|
var STARTING_SIGNALLING_DELAY = 10;
|
|
30
31
|
var MAX_SIGNALLING_DELAY = 300;
|
|
31
32
|
var ConnectionState;
|
|
@@ -98,29 +99,29 @@ var Connection = class {
|
|
|
98
99
|
*/
|
|
99
100
|
// TODO(burdon): Make async?
|
|
100
101
|
openConnection() {
|
|
101
|
-
|
|
102
|
+
invariant(this._state === ConnectionState.INITIAL, "Invalid state.");
|
|
102
103
|
log.trace("dxos.mesh.connection.open-connection", trace.begin({
|
|
103
104
|
id: this._instanceId
|
|
104
105
|
}), {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
F: __dxlog_file,
|
|
107
|
+
L: 115,
|
|
108
|
+
S: this,
|
|
109
|
+
C: (f, a) => f(...a)
|
|
109
110
|
});
|
|
110
111
|
this._changeState(ConnectionState.CONNECTING);
|
|
111
112
|
this._protocol.initialize().catch((err) => {
|
|
112
113
|
this.errors.raise(err);
|
|
113
114
|
});
|
|
114
115
|
this._protocol.stream.on("close", () => {
|
|
115
|
-
log("protocol stream closed",
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
log("protocol stream closed", void 0, {
|
|
117
|
+
F: __dxlog_file,
|
|
118
|
+
L: 126,
|
|
119
|
+
S: this,
|
|
120
|
+
C: (f, a) => f(...a)
|
|
120
121
|
});
|
|
121
122
|
this.close().catch((err) => this.errors.raise(err));
|
|
122
123
|
});
|
|
123
|
-
|
|
124
|
+
invariant(!this._transport);
|
|
124
125
|
this._transport = this._transportFactory.createTransport({
|
|
125
126
|
initiator: this.initiator,
|
|
126
127
|
stream: this._protocol.stream,
|
|
@@ -145,10 +146,10 @@ var Connection = class {
|
|
|
145
146
|
log.trace("dxos.mesh.connection.open-connection", trace.end({
|
|
146
147
|
id: this._instanceId
|
|
147
148
|
}), {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
F: __dxlog_file,
|
|
150
|
+
L: 159,
|
|
151
|
+
S: this,
|
|
152
|
+
C: (f, a) => f(...a)
|
|
152
153
|
});
|
|
153
154
|
}
|
|
154
155
|
async close() {
|
|
@@ -161,38 +162,38 @@ var Connection = class {
|
|
|
161
162
|
log("closing...", {
|
|
162
163
|
peerId: this.ownId
|
|
163
164
|
}, {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
F: __dxlog_file,
|
|
166
|
+
L: 171,
|
|
167
|
+
S: this,
|
|
168
|
+
C: (f, a) => f(...a)
|
|
168
169
|
});
|
|
169
170
|
try {
|
|
170
171
|
await this._protocol.destroy();
|
|
171
172
|
} catch (err) {
|
|
172
|
-
log.catch(err,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
log.catch(err, void 0, {
|
|
174
|
+
F: __dxlog_file,
|
|
175
|
+
L: 177,
|
|
176
|
+
S: this,
|
|
177
|
+
C: (f, a) => f(...a)
|
|
177
178
|
});
|
|
178
179
|
}
|
|
179
180
|
try {
|
|
180
181
|
await ((_a = this._transport) == null ? void 0 : _a.destroy());
|
|
181
|
-
} catch (
|
|
182
|
-
log.catch(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
} catch (err) {
|
|
183
|
+
log.catch(err, void 0, {
|
|
184
|
+
F: __dxlog_file,
|
|
185
|
+
L: 184,
|
|
186
|
+
S: this,
|
|
187
|
+
C: (f, a) => f(...a)
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
190
|
log("closed", {
|
|
190
191
|
peerId: this.ownId
|
|
191
192
|
}, {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
F: __dxlog_file,
|
|
194
|
+
L: 187,
|
|
195
|
+
S: this,
|
|
196
|
+
C: (f, a) => f(...a)
|
|
196
197
|
});
|
|
197
198
|
this._changeState(ConnectionState.CLOSED);
|
|
198
199
|
}
|
|
@@ -229,10 +230,10 @@ var Connection = class {
|
|
|
229
230
|
log.warn("Signal failed", {
|
|
230
231
|
err
|
|
231
232
|
}, {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
F: __dxlog_file,
|
|
234
|
+
L: 221,
|
|
235
|
+
S: this,
|
|
236
|
+
C: (f, a) => f(...a)
|
|
236
237
|
});
|
|
237
238
|
await this.close();
|
|
238
239
|
}
|
|
@@ -242,19 +243,19 @@ var Connection = class {
|
|
|
242
243
|
*/
|
|
243
244
|
async signal(msg) {
|
|
244
245
|
var _a, _b, _c;
|
|
245
|
-
|
|
246
|
+
invariant(msg.sessionId);
|
|
246
247
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
247
|
-
log("dropping signal for incorrect session id",
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
log("dropping signal for incorrect session id", void 0, {
|
|
249
|
+
F: __dxlog_file,
|
|
250
|
+
L: 232,
|
|
251
|
+
S: this,
|
|
252
|
+
C: (f, a) => f(...a)
|
|
252
253
|
});
|
|
253
254
|
return;
|
|
254
255
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
invariant(msg.data.signal || msg.data.signalBatch);
|
|
257
|
+
invariant((_a = msg.author) == null ? void 0 : _a.equals(this.remoteId));
|
|
258
|
+
invariant((_b = msg.recipient) == null ? void 0 : _b.equals(this.ownId));
|
|
258
259
|
const signals = msg.data.signalBatch ? (_c = msg.data.signalBatch.signals) != null ? _c : [] : [
|
|
259
260
|
msg.data.signal
|
|
260
261
|
];
|
|
@@ -268,23 +269,23 @@ var Connection = class {
|
|
|
268
269
|
remoteId: this.remoteId,
|
|
269
270
|
msg: msg.data
|
|
270
271
|
}, {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
F: __dxlog_file,
|
|
273
|
+
L: 246,
|
|
274
|
+
S: this,
|
|
275
|
+
C: (f, a) => f(...a)
|
|
275
276
|
});
|
|
276
277
|
this._incomingSignalBuffer.push(signal);
|
|
277
278
|
} else {
|
|
278
|
-
|
|
279
|
+
invariant(this._transport, "Connection not ready to accept signals.");
|
|
279
280
|
log("received signal", {
|
|
280
281
|
peerId: this.ownId,
|
|
281
282
|
remoteId: this.remoteId,
|
|
282
283
|
msg: msg.data
|
|
283
284
|
}, {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
F: __dxlog_file,
|
|
286
|
+
L: 250,
|
|
287
|
+
S: this,
|
|
288
|
+
C: (f, a) => f(...a)
|
|
288
289
|
});
|
|
289
290
|
await this._transport.signal(signal);
|
|
290
291
|
}
|
|
@@ -296,27 +297,28 @@ var Connection = class {
|
|
|
296
297
|
too: state,
|
|
297
298
|
peerId: this.ownId
|
|
298
299
|
}, {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
F: __dxlog_file,
|
|
301
|
+
L: 257,
|
|
302
|
+
S: this,
|
|
303
|
+
C: (f, a) => f(...a)
|
|
303
304
|
});
|
|
304
|
-
|
|
305
|
+
invariant(state !== this._state, "Already in this state.");
|
|
305
306
|
this._state = state;
|
|
306
307
|
this.stateChanged.emit(state);
|
|
307
308
|
}
|
|
308
309
|
};
|
|
309
|
-
|
|
310
|
+
_ts_decorate([
|
|
310
311
|
synchronized
|
|
311
312
|
], Connection.prototype, "close", null);
|
|
312
313
|
|
|
313
314
|
// packages/core/mesh/network-manager/src/signal/swarm-messenger.ts
|
|
314
|
-
import
|
|
315
|
+
import invariant2 from "tiny-invariant";
|
|
315
316
|
import { Context as Context2 } from "@dxos/context";
|
|
316
317
|
import { PublicKey as PublicKey2 } from "@dxos/keys";
|
|
317
318
|
import { log as log2 } from "@dxos/log";
|
|
318
319
|
import { schema } from "@dxos/protocols";
|
|
319
320
|
import { ComplexMap } from "@dxos/util";
|
|
321
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/signal/swarm-messenger.ts";
|
|
320
322
|
var SwarmMessenger = class {
|
|
321
323
|
constructor({ sendMessage, onSignal, onOffer, topic }) {
|
|
322
324
|
this._ctx = new Context2();
|
|
@@ -340,10 +342,10 @@ var SwarmMessenger = class {
|
|
|
340
342
|
to: recipient,
|
|
341
343
|
msg: message
|
|
342
344
|
}, {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
F: __dxlog_file2,
|
|
346
|
+
L: 68,
|
|
347
|
+
S: this,
|
|
348
|
+
C: (f, a) => f(...a)
|
|
347
349
|
});
|
|
348
350
|
if ((_a = message.data) == null ? void 0 : _a.offer) {
|
|
349
351
|
await this._handleOffer({
|
|
@@ -369,16 +371,16 @@ var SwarmMessenger = class {
|
|
|
369
371
|
log2.warn("unknown message", {
|
|
370
372
|
message
|
|
371
373
|
}, {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
F: __dxlog_file2,
|
|
375
|
+
L: 79,
|
|
376
|
+
S: this,
|
|
377
|
+
C: (f, a) => f(...a)
|
|
376
378
|
});
|
|
377
379
|
}
|
|
378
380
|
}
|
|
379
381
|
async signal(message) {
|
|
380
382
|
var _a, _b;
|
|
381
|
-
|
|
383
|
+
invariant2(((_a = message.data) == null ? void 0 : _a.signal) || ((_b = message.data) == null ? void 0 : _b.signalBatch), "Invalid message");
|
|
382
384
|
await this._sendReliableMessage({
|
|
383
385
|
author: message.author,
|
|
384
386
|
recipient: message.recipient,
|
|
@@ -413,10 +415,10 @@ var SwarmMessenger = class {
|
|
|
413
415
|
to: recipient,
|
|
414
416
|
msg: networkMessage
|
|
415
417
|
}, {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
F: __dxlog_file2,
|
|
419
|
+
L: 122,
|
|
420
|
+
S: this,
|
|
421
|
+
C: (f, a) => f(...a)
|
|
420
422
|
});
|
|
421
423
|
await this._sendMessage({
|
|
422
424
|
author,
|
|
@@ -429,24 +431,24 @@ var SwarmMessenger = class {
|
|
|
429
431
|
}
|
|
430
432
|
async _resolveAnswers(message) {
|
|
431
433
|
var _a, _b, _c;
|
|
432
|
-
|
|
434
|
+
invariant2((_b = (_a = message.data) == null ? void 0 : _a.answer) == null ? void 0 : _b.offerMessageId, "No offerMessageId");
|
|
433
435
|
const offerRecord = this._offerRecords.get(message.data.answer.offerMessageId);
|
|
434
436
|
if (offerRecord) {
|
|
435
437
|
this._offerRecords.delete(message.data.answer.offerMessageId);
|
|
436
|
-
|
|
438
|
+
invariant2((_c = message.data) == null ? void 0 : _c.answer, "No answer");
|
|
437
439
|
log2("resolving", {
|
|
438
440
|
answer: message.data.answer
|
|
439
441
|
}, {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
F: __dxlog_file2,
|
|
443
|
+
L: 139,
|
|
444
|
+
S: this,
|
|
445
|
+
C: (f, a) => f(...a)
|
|
444
446
|
});
|
|
445
447
|
offerRecord.resolve(message.data.answer);
|
|
446
448
|
}
|
|
447
449
|
}
|
|
448
450
|
async _handleOffer({ author, recipient, message }) {
|
|
449
|
-
|
|
451
|
+
invariant2(message.data.offer, "No offer");
|
|
450
452
|
const offerMessage = {
|
|
451
453
|
author,
|
|
452
454
|
recipient,
|
|
@@ -473,16 +475,16 @@ var SwarmMessenger = class {
|
|
|
473
475
|
log2.warn("error sending answer", {
|
|
474
476
|
err
|
|
475
477
|
}, {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
F: __dxlog_file2,
|
|
479
|
+
L: 173,
|
|
480
|
+
S: this,
|
|
481
|
+
C: (f, a) => f(...a)
|
|
480
482
|
});
|
|
481
483
|
}
|
|
482
484
|
}
|
|
483
485
|
async _handleSignal({ author, recipient, message }) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
+
invariant2(message.messageId);
|
|
487
|
+
invariant2(message.data.signal || message.data.signalBatch, "Invalid message");
|
|
486
488
|
const signalMessage = {
|
|
487
489
|
author,
|
|
488
490
|
recipient,
|
|
@@ -497,7 +499,7 @@ var SwarmMessenger = class {
|
|
|
497
499
|
};
|
|
498
500
|
|
|
499
501
|
// packages/core/mesh/network-manager/src/swarm/swarm.ts
|
|
500
|
-
import
|
|
502
|
+
import invariant4 from "tiny-invariant";
|
|
501
503
|
import { Event as Event2, scheduleTask as scheduleTask2, sleep as sleep2, synchronized as synchronized3 } from "@dxos/async";
|
|
502
504
|
import { Context as Context4 } from "@dxos/context";
|
|
503
505
|
import { ErrorStream as ErrorStream2 } from "@dxos/debug";
|
|
@@ -507,12 +509,12 @@ import { trace as trace2 } from "@dxos/protocols";
|
|
|
507
509
|
import { ComplexMap as ComplexMap2, isNotNullOrUndefined } from "@dxos/util";
|
|
508
510
|
|
|
509
511
|
// packages/core/mesh/network-manager/src/swarm/peer.ts
|
|
510
|
-
import
|
|
512
|
+
import invariant3 from "tiny-invariant";
|
|
511
513
|
import { scheduleTask, synchronized as synchronized2 } from "@dxos/async";
|
|
512
514
|
import { Context as Context3 } from "@dxos/context";
|
|
513
515
|
import { PublicKey as PublicKey3 } from "@dxos/keys";
|
|
514
516
|
import { log as log3 } from "@dxos/log";
|
|
515
|
-
|
|
517
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
516
518
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
517
519
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
518
520
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -521,7 +523,8 @@ var __decorate2 = function(decorators, target, key, desc) {
|
|
|
521
523
|
if (d = decorators[i])
|
|
522
524
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
523
525
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
524
|
-
}
|
|
526
|
+
}
|
|
527
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/peer.ts";
|
|
525
528
|
var CONNECTION_COUNTS_STABLE_AFTER = 5e3;
|
|
526
529
|
var Peer = class {
|
|
527
530
|
constructor(id, topic, localPeerId, _signalMessaging, _protocolProvider, _transportFactory, _callbacks) {
|
|
@@ -550,10 +553,10 @@ var Peer = class {
|
|
|
550
553
|
topic: this.topic,
|
|
551
554
|
peerId: this.localPeerId
|
|
552
555
|
}, {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
556
|
+
F: __dxlog_file3,
|
|
557
|
+
L: 105,
|
|
558
|
+
S: this,
|
|
559
|
+
C: (f, a) => f(...a)
|
|
557
560
|
});
|
|
558
561
|
if (this.connection) {
|
|
559
562
|
await this.closeConnection();
|
|
@@ -566,7 +569,7 @@ var Peer = class {
|
|
|
566
569
|
}
|
|
567
570
|
if (await this._callbacks.onOffer(remoteId)) {
|
|
568
571
|
if (!this.connection) {
|
|
569
|
-
|
|
572
|
+
invariant3(message.sessionId);
|
|
570
573
|
const connection = this._createConnection(false, message.sessionId);
|
|
571
574
|
try {
|
|
572
575
|
connection.openConnection();
|
|
@@ -577,10 +580,10 @@ var Peer = class {
|
|
|
577
580
|
remoteId: this.id,
|
|
578
581
|
err
|
|
579
582
|
}, {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
583
|
+
F: __dxlog_file3,
|
|
584
|
+
L: 129,
|
|
585
|
+
S: this,
|
|
586
|
+
C: (f, a) => f(...a)
|
|
584
587
|
});
|
|
585
588
|
await this.closeConnection();
|
|
586
589
|
}
|
|
@@ -597,8 +600,8 @@ var Peer = class {
|
|
|
597
600
|
* Initiate a connection to the remote peer.
|
|
598
601
|
*/
|
|
599
602
|
async initiateConnection() {
|
|
600
|
-
|
|
601
|
-
|
|
603
|
+
invariant3(!this.initiating, "Initiation in progress.");
|
|
604
|
+
invariant3(!this.connection, "Already connected.");
|
|
602
605
|
const sessionId = PublicKey3.random();
|
|
603
606
|
log3("initiating...", {
|
|
604
607
|
id: this.id,
|
|
@@ -606,10 +609,10 @@ var Peer = class {
|
|
|
606
609
|
peerId: this.id,
|
|
607
610
|
sessionId
|
|
608
611
|
}, {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
612
|
+
F: __dxlog_file3,
|
|
613
|
+
L: 147,
|
|
614
|
+
S: this,
|
|
615
|
+
C: (f, a) => f(...a)
|
|
613
616
|
});
|
|
614
617
|
const connection = this._createConnection(true, sessionId);
|
|
615
618
|
this.initiating = true;
|
|
@@ -629,17 +632,17 @@ var Peer = class {
|
|
|
629
632
|
ownId: this.localPeerId,
|
|
630
633
|
remoteId: this.id
|
|
631
634
|
}, {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
635
|
+
F: __dxlog_file3,
|
|
636
|
+
L: 159,
|
|
637
|
+
S: this,
|
|
638
|
+
C: (f, a) => f(...a)
|
|
636
639
|
});
|
|
637
640
|
if (connection.state !== ConnectionState.INITIAL) {
|
|
638
|
-
log3("ignoring response",
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
log3("ignoring response", void 0, {
|
|
642
|
+
F: __dxlog_file3,
|
|
643
|
+
L: 161,
|
|
644
|
+
S: this,
|
|
645
|
+
C: (f, a) => f(...a)
|
|
643
646
|
});
|
|
644
647
|
return;
|
|
645
648
|
}
|
|
@@ -656,10 +659,10 @@ var Peer = class {
|
|
|
656
659
|
peerId: this.localPeerId,
|
|
657
660
|
remoteId: this.id
|
|
658
661
|
}, {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
662
|
+
F: __dxlog_file3,
|
|
663
|
+
L: 172,
|
|
664
|
+
S: this,
|
|
665
|
+
C: (f, a) => f(...a)
|
|
663
666
|
});
|
|
664
667
|
await this.closeConnection();
|
|
665
668
|
throw err;
|
|
@@ -680,12 +683,12 @@ var Peer = class {
|
|
|
680
683
|
initiator,
|
|
681
684
|
sessionId
|
|
682
685
|
}, {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
686
|
+
F: __dxlog_file3,
|
|
687
|
+
L: 186,
|
|
688
|
+
S: this,
|
|
689
|
+
C: (f, a) => f(...a)
|
|
687
690
|
});
|
|
688
|
-
|
|
691
|
+
invariant3(!this.connection, "Already connected.");
|
|
689
692
|
const connection = new Connection(
|
|
690
693
|
this.topic,
|
|
691
694
|
this.localPeerId,
|
|
@@ -720,12 +723,12 @@ var Peer = class {
|
|
|
720
723
|
remoteId: this.id,
|
|
721
724
|
initiator
|
|
722
725
|
}, {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
726
|
+
F: __dxlog_file3,
|
|
727
|
+
L: 221,
|
|
728
|
+
S: this,
|
|
729
|
+
C: (f, a) => f(...a)
|
|
727
730
|
});
|
|
728
|
-
|
|
731
|
+
invariant3(this.connection === connection, "Connection mismatch (race condition).");
|
|
729
732
|
if (this._lastConnectionTime && this._lastConnectionTime + CONNECTION_COUNTS_STABLE_AFTER < Date.now()) {
|
|
730
733
|
this._availableAfter = 0;
|
|
731
734
|
} else {
|
|
@@ -750,10 +753,10 @@ var Peer = class {
|
|
|
750
753
|
initiator,
|
|
751
754
|
err
|
|
752
755
|
}, {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
756
|
+
F: __dxlog_file3,
|
|
757
|
+
L: 249,
|
|
758
|
+
S: this,
|
|
759
|
+
C: (f, a) => f(...a)
|
|
757
760
|
});
|
|
758
761
|
void this.closeConnection();
|
|
759
762
|
});
|
|
@@ -769,20 +772,20 @@ var Peer = class {
|
|
|
769
772
|
peerId: this.id,
|
|
770
773
|
sessionId: connection.sessionId
|
|
771
774
|
}, {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
775
|
+
F: __dxlog_file3,
|
|
776
|
+
L: 265,
|
|
777
|
+
S: this,
|
|
778
|
+
C: (f, a) => f(...a)
|
|
776
779
|
});
|
|
777
780
|
await connection.close();
|
|
778
781
|
log3("closed", {
|
|
779
782
|
peerId: this.id,
|
|
780
783
|
sessionId: connection.sessionId
|
|
781
784
|
}, {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
785
|
+
F: __dxlog_file3,
|
|
786
|
+
L: 271,
|
|
787
|
+
S: this,
|
|
788
|
+
C: (f, a) => f(...a)
|
|
786
789
|
});
|
|
787
790
|
}
|
|
788
791
|
async onSignal(message) {
|
|
@@ -790,10 +793,10 @@ var Peer = class {
|
|
|
790
793
|
log3("dropping signal message for non-existent connection", {
|
|
791
794
|
message
|
|
792
795
|
}, {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
796
|
+
F: __dxlog_file3,
|
|
797
|
+
L: 276,
|
|
798
|
+
S: this,
|
|
799
|
+
C: (f, a) => f(...a)
|
|
797
800
|
});
|
|
798
801
|
return;
|
|
799
802
|
}
|
|
@@ -806,15 +809,15 @@ var Peer = class {
|
|
|
806
809
|
peerId: this.id,
|
|
807
810
|
topic: this.topic
|
|
808
811
|
}, {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
812
|
+
F: __dxlog_file3,
|
|
813
|
+
L: 285,
|
|
814
|
+
S: this,
|
|
815
|
+
C: (f, a) => f(...a)
|
|
813
816
|
});
|
|
814
817
|
await ((_a = this == null ? void 0 : this.connection) == null ? void 0 : _a.close());
|
|
815
818
|
}
|
|
816
819
|
};
|
|
817
|
-
|
|
820
|
+
_ts_decorate2([
|
|
818
821
|
synchronized2
|
|
819
822
|
], Peer.prototype, "destroy", null);
|
|
820
823
|
var increaseInterval = (interval) => {
|
|
@@ -831,7 +834,7 @@ var increaseInterval = (interval) => {
|
|
|
831
834
|
};
|
|
832
835
|
|
|
833
836
|
// packages/core/mesh/network-manager/src/swarm/swarm.ts
|
|
834
|
-
|
|
837
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
835
838
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
836
839
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
837
840
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -840,7 +843,8 @@ var __decorate3 = function(decorators, target, key, desc) {
|
|
|
840
843
|
if (d = decorators[i])
|
|
841
844
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
842
845
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
843
|
-
}
|
|
846
|
+
}
|
|
847
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm.ts";
|
|
844
848
|
var INITIATION_DELAY = 100;
|
|
845
849
|
var getClassName = (obj) => Object.getPrototypeOf(obj).constructor.name;
|
|
846
850
|
var Swarm = class {
|
|
@@ -857,11 +861,11 @@ var Swarm = class {
|
|
|
857
861
|
this._peers = new ComplexMap2(PublicKey4.hash);
|
|
858
862
|
this._ctx = new Context4();
|
|
859
863
|
this._listeningHandle = void 0;
|
|
864
|
+
this._instanceId = PublicKey4.random().toHex();
|
|
860
865
|
this.connectionAdded = new Event2();
|
|
861
866
|
this.disconnected = new Event2();
|
|
862
867
|
this.connected = new Event2();
|
|
863
868
|
this.errors = new ErrorStream2();
|
|
864
|
-
this._instanceId = PublicKey4.random().toHex();
|
|
865
869
|
log4.trace("dxos.mesh.swarm.constructor", trace2.begin({
|
|
866
870
|
id: this._instanceId,
|
|
867
871
|
data: {
|
|
@@ -869,18 +873,18 @@ var Swarm = class {
|
|
|
869
873
|
peerId: this._ownPeerId.toHex()
|
|
870
874
|
}
|
|
871
875
|
}), {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
+
F: __dxlog_file4,
|
|
877
|
+
L: 86,
|
|
878
|
+
S: this,
|
|
879
|
+
C: (f, a) => f(...a)
|
|
876
880
|
});
|
|
877
881
|
log4("creating swarm", {
|
|
878
882
|
peerId: _ownPeerId
|
|
879
883
|
}, {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
+
F: __dxlog_file4,
|
|
885
|
+
L: 90,
|
|
886
|
+
S: this,
|
|
887
|
+
C: (f, a) => f(...a)
|
|
884
888
|
});
|
|
885
889
|
_topology.init(this._getSwarmController());
|
|
886
890
|
this._swarmMessenger = new SwarmMessenger({
|
|
@@ -892,10 +896,10 @@ var Swarm = class {
|
|
|
892
896
|
log4.trace("dxos.mesh.swarm.constructor", trace2.end({
|
|
893
897
|
id: this._instanceId
|
|
894
898
|
}), {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
+
F: __dxlog_file4,
|
|
900
|
+
L: 99,
|
|
901
|
+
S: this,
|
|
902
|
+
C: (f, a) => f(...a)
|
|
899
903
|
});
|
|
900
904
|
}
|
|
901
905
|
get connections() {
|
|
@@ -914,7 +918,7 @@ var Swarm = class {
|
|
|
914
918
|
return this._topic;
|
|
915
919
|
}
|
|
916
920
|
async open() {
|
|
917
|
-
|
|
921
|
+
invariant4(!this._listeningHandle);
|
|
918
922
|
this._listeningHandle = await this._messenger.listen({
|
|
919
923
|
peerId: this._ownPeerId,
|
|
920
924
|
payloadType: "dxos.mesh.swarm.SwarmMessage",
|
|
@@ -922,36 +926,36 @@ var Swarm = class {
|
|
|
922
926
|
await this._swarmMessenger.receiveMessage(message).catch((err) => log4.warn("Error while receiving message", {
|
|
923
927
|
err
|
|
924
928
|
}, {
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
+
F: __dxlog_file4,
|
|
930
|
+
L: 133,
|
|
931
|
+
S: this,
|
|
932
|
+
C: (f, a) => f(...a)
|
|
929
933
|
}));
|
|
930
934
|
}
|
|
931
935
|
});
|
|
932
936
|
}
|
|
933
937
|
async destroy() {
|
|
934
938
|
var _a;
|
|
935
|
-
log4("destroying...",
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
939
|
+
log4("destroying...", void 0, {
|
|
940
|
+
F: __dxlog_file4,
|
|
941
|
+
L: 139,
|
|
942
|
+
S: this,
|
|
943
|
+
C: (f, a) => f(...a)
|
|
940
944
|
});
|
|
941
945
|
await ((_a = this._listeningHandle) == null ? void 0 : _a.unsubscribe());
|
|
942
946
|
this._listeningHandle = void 0;
|
|
943
947
|
await this._ctx.dispose();
|
|
944
948
|
await this._topology.destroy();
|
|
945
949
|
await Promise.all(Array.from(this._peers.keys()).map((key) => this._destroyPeer(key)));
|
|
946
|
-
log4("destroyed",
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
950
|
+
log4("destroyed", void 0, {
|
|
951
|
+
F: __dxlog_file4,
|
|
952
|
+
L: 146,
|
|
953
|
+
S: this,
|
|
954
|
+
C: (f, a) => f(...a)
|
|
951
955
|
});
|
|
952
956
|
}
|
|
953
957
|
async setTopology(topology) {
|
|
954
|
-
|
|
958
|
+
invariant4(!this._ctx.disposed, "Swarm is offline");
|
|
955
959
|
if (topology === this._topology) {
|
|
956
960
|
return;
|
|
957
961
|
}
|
|
@@ -959,10 +963,10 @@ var Swarm = class {
|
|
|
959
963
|
previous: getClassName(this._topology),
|
|
960
964
|
topology: getClassName(topology)
|
|
961
965
|
}, {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
+
F: __dxlog_file4,
|
|
967
|
+
L: 154,
|
|
968
|
+
S: this,
|
|
969
|
+
C: (f, a) => f(...a)
|
|
966
970
|
});
|
|
967
971
|
await this._topology.destroy();
|
|
968
972
|
this._topology = topology;
|
|
@@ -974,17 +978,17 @@ var Swarm = class {
|
|
|
974
978
|
log4("swarm event", {
|
|
975
979
|
swarmEvent
|
|
976
980
|
}, {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
+
F: __dxlog_file4,
|
|
982
|
+
L: 167,
|
|
983
|
+
S: this,
|
|
984
|
+
C: (f, a) => f(...a)
|
|
981
985
|
});
|
|
982
986
|
if (this._ctx.disposed) {
|
|
983
|
-
log4("swarm event ignored for disposed swarm",
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
987
|
+
log4("swarm event ignored for disposed swarm", void 0, {
|
|
988
|
+
F: __dxlog_file4,
|
|
989
|
+
L: 170,
|
|
990
|
+
S: this,
|
|
991
|
+
C: (f, a) => f(...a)
|
|
988
992
|
});
|
|
989
993
|
return;
|
|
990
994
|
}
|
|
@@ -993,25 +997,25 @@ var Swarm = class {
|
|
|
993
997
|
log4("new peer", {
|
|
994
998
|
peerId
|
|
995
999
|
}, {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
+
F: __dxlog_file4,
|
|
1001
|
+
L: 176,
|
|
1002
|
+
S: this,
|
|
1003
|
+
C: (f, a) => f(...a)
|
|
1000
1004
|
});
|
|
1001
1005
|
if (!peerId.equals(this._ownPeerId)) {
|
|
1002
1006
|
const peer = this._getOrCreatePeer(peerId);
|
|
1003
1007
|
peer.advertizing = true;
|
|
1004
1008
|
}
|
|
1005
1009
|
} else if (swarmEvent.peerLeft) {
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1008
|
-
|
|
1009
|
-
if (((_a =
|
|
1010
|
-
void this._destroyPeer(
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1010
|
+
const peer = this._peers.get(PublicKey4.from(swarmEvent.peerLeft.peer));
|
|
1011
|
+
if (peer) {
|
|
1012
|
+
peer.advertizing = false;
|
|
1013
|
+
if (((_a = peer.connection) == null ? void 0 : _a.state) !== ConnectionState.CONNECTED) {
|
|
1014
|
+
void this._destroyPeer(peer.id).catch((err) => log4.catch(err, void 0, {
|
|
1015
|
+
F: __dxlog_file4,
|
|
1016
|
+
L: 187,
|
|
1017
|
+
S: this,
|
|
1018
|
+
C: (f, a) => f(...a)
|
|
1015
1019
|
}));
|
|
1016
1020
|
}
|
|
1017
1021
|
}
|
|
@@ -1023,31 +1027,31 @@ var Swarm = class {
|
|
|
1023
1027
|
log4("offer", {
|
|
1024
1028
|
message
|
|
1025
1029
|
}, {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
+
F: __dxlog_file4,
|
|
1031
|
+
L: 197,
|
|
1032
|
+
S: this,
|
|
1033
|
+
C: (f, a) => f(...a)
|
|
1030
1034
|
});
|
|
1031
1035
|
if (this._ctx.disposed) {
|
|
1032
|
-
log4("ignored for disposed swarm",
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1036
|
+
log4("ignored for disposed swarm", void 0, {
|
|
1037
|
+
F: __dxlog_file4,
|
|
1038
|
+
L: 199,
|
|
1039
|
+
S: this,
|
|
1040
|
+
C: (f, a) => f(...a)
|
|
1037
1041
|
});
|
|
1038
1042
|
return {
|
|
1039
1043
|
accept: false
|
|
1040
1044
|
};
|
|
1041
1045
|
}
|
|
1042
|
-
|
|
1046
|
+
invariant4(message.author);
|
|
1043
1047
|
if (!((_a = message.recipient) == null ? void 0 : _a.equals(this._ownPeerId))) {
|
|
1044
1048
|
log4("rejecting offer with incorrect peerId", {
|
|
1045
1049
|
message
|
|
1046
1050
|
}, {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
+
F: __dxlog_file4,
|
|
1052
|
+
L: 206,
|
|
1053
|
+
S: this,
|
|
1054
|
+
C: (f, a) => f(...a)
|
|
1051
1055
|
});
|
|
1052
1056
|
return {
|
|
1053
1057
|
accept: false
|
|
@@ -1057,10 +1061,10 @@ var Swarm = class {
|
|
|
1057
1061
|
log4("rejecting offer with incorrect topic", {
|
|
1058
1062
|
message
|
|
1059
1063
|
}, {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
+
F: __dxlog_file4,
|
|
1065
|
+
L: 210,
|
|
1066
|
+
S: this,
|
|
1067
|
+
C: (f, a) => f(...a)
|
|
1064
1068
|
});
|
|
1065
1069
|
return {
|
|
1066
1070
|
accept: false
|
|
@@ -1076,23 +1080,23 @@ var Swarm = class {
|
|
|
1076
1080
|
log4("signal", {
|
|
1077
1081
|
message
|
|
1078
1082
|
}, {
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
+
F: __dxlog_file4,
|
|
1084
|
+
L: 222,
|
|
1085
|
+
S: this,
|
|
1086
|
+
C: (f, a) => f(...a)
|
|
1083
1087
|
});
|
|
1084
1088
|
if (this._ctx.disposed) {
|
|
1085
|
-
log4.info("ignored for offline swarm",
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1089
|
+
log4.info("ignored for offline swarm", void 0, {
|
|
1090
|
+
F: __dxlog_file4,
|
|
1091
|
+
L: 224,
|
|
1092
|
+
S: this,
|
|
1093
|
+
C: (f, a) => f(...a)
|
|
1090
1094
|
});
|
|
1091
1095
|
return;
|
|
1092
1096
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1097
|
+
invariant4((_a = message.recipient) == null ? void 0 : _a.equals(this._ownPeerId), `Invalid signal peer id expected=${this.ownPeerId}, actual=${message.recipient}`);
|
|
1098
|
+
invariant4((_b = message.topic) == null ? void 0 : _b.equals(this._topic));
|
|
1099
|
+
invariant4(message.author);
|
|
1096
1100
|
const peer = this._getOrCreatePeer(message.author);
|
|
1097
1101
|
await peer.onSignal(message);
|
|
1098
1102
|
}
|
|
@@ -1144,7 +1148,7 @@ var Swarm = class {
|
|
|
1144
1148
|
return peer;
|
|
1145
1149
|
}
|
|
1146
1150
|
async _destroyPeer(peerId) {
|
|
1147
|
-
|
|
1151
|
+
invariant4(this._peers.has(peerId));
|
|
1148
1152
|
await this._peers.get(peerId).destroy();
|
|
1149
1153
|
this._peers.delete(peerId);
|
|
1150
1154
|
}
|
|
@@ -1164,10 +1168,10 @@ var Swarm = class {
|
|
|
1164
1168
|
await this._initiateConnection(peer);
|
|
1165
1169
|
} catch (err) {
|
|
1166
1170
|
log4("initiation error", err, {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
+
F: __dxlog_file4,
|
|
1172
|
+
L: 327,
|
|
1173
|
+
S: this,
|
|
1174
|
+
C: (f, a) => f(...a)
|
|
1171
1175
|
});
|
|
1172
1176
|
}
|
|
1173
1177
|
});
|
|
@@ -1192,10 +1196,10 @@ var Swarm = class {
|
|
|
1192
1196
|
log4("initiation delay", {
|
|
1193
1197
|
remoteId
|
|
1194
1198
|
}, {
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
+
F: __dxlog_file4,
|
|
1200
|
+
L: 354,
|
|
1201
|
+
S: this,
|
|
1202
|
+
C: (f, a) => f(...a)
|
|
1199
1203
|
});
|
|
1200
1204
|
await sleep2(INITIATION_DELAY);
|
|
1201
1205
|
}
|
|
@@ -1209,20 +1213,20 @@ var Swarm = class {
|
|
|
1209
1213
|
log4("initiating connection...", {
|
|
1210
1214
|
remoteId
|
|
1211
1215
|
}, {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
+
F: __dxlog_file4,
|
|
1217
|
+
L: 368,
|
|
1218
|
+
S: this,
|
|
1219
|
+
C: (f, a) => f(...a)
|
|
1216
1220
|
});
|
|
1217
1221
|
await peer.initiateConnection();
|
|
1218
1222
|
this._topology.update();
|
|
1219
1223
|
log4("initiated", {
|
|
1220
1224
|
remoteId
|
|
1221
1225
|
}, {
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
+
F: __dxlog_file4,
|
|
1227
|
+
L: 371,
|
|
1228
|
+
S: this,
|
|
1229
|
+
C: (f, a) => f(...a)
|
|
1226
1230
|
});
|
|
1227
1231
|
}
|
|
1228
1232
|
async _closeConnection(peerId) {
|
|
@@ -1233,28 +1237,28 @@ var Swarm = class {
|
|
|
1233
1237
|
await peer.closeConnection();
|
|
1234
1238
|
}
|
|
1235
1239
|
};
|
|
1236
|
-
|
|
1240
|
+
_ts_decorate3([
|
|
1237
1241
|
logInfo
|
|
1238
1242
|
], Swarm.prototype, "_instanceId", void 0);
|
|
1239
|
-
|
|
1243
|
+
_ts_decorate3([
|
|
1240
1244
|
logInfo
|
|
1241
1245
|
], Swarm.prototype, "ownPeerId", null);
|
|
1242
|
-
|
|
1246
|
+
_ts_decorate3([
|
|
1243
1247
|
logInfo
|
|
1244
1248
|
], Swarm.prototype, "topic", null);
|
|
1245
|
-
|
|
1249
|
+
_ts_decorate3([
|
|
1246
1250
|
synchronized3
|
|
1247
1251
|
], Swarm.prototype, "onSwarmEvent", null);
|
|
1248
|
-
|
|
1252
|
+
_ts_decorate3([
|
|
1249
1253
|
synchronized3
|
|
1250
1254
|
], Swarm.prototype, "onOffer", null);
|
|
1251
|
-
|
|
1255
|
+
_ts_decorate3([
|
|
1252
1256
|
synchronized3
|
|
1253
1257
|
], Swarm.prototype, "onSignal", null);
|
|
1254
|
-
|
|
1258
|
+
_ts_decorate3([
|
|
1255
1259
|
synchronized3
|
|
1256
1260
|
], Swarm.prototype, "goOffline", null);
|
|
1257
|
-
|
|
1261
|
+
_ts_decorate3([
|
|
1258
1262
|
synchronized3
|
|
1259
1263
|
], Swarm.prototype, "goOnline", null);
|
|
1260
1264
|
|
|
@@ -1263,6 +1267,7 @@ import { Event as Event3, EventSubscriptions } from "@dxos/async";
|
|
|
1263
1267
|
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
1264
1268
|
import { log as log5 } from "@dxos/log";
|
|
1265
1269
|
import { ComplexMap as ComplexMap3 } from "@dxos/util";
|
|
1270
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/swarm-mapper.ts";
|
|
1266
1271
|
var SwarmMapper = class {
|
|
1267
1272
|
get peers() {
|
|
1268
1273
|
return Array.from(this._peers.values());
|
|
@@ -1289,11 +1294,11 @@ var SwarmMapper = class {
|
|
|
1289
1294
|
this._update();
|
|
1290
1295
|
}
|
|
1291
1296
|
_update() {
|
|
1292
|
-
log5("updating swarm",
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
+
log5("updating swarm", void 0, {
|
|
1298
|
+
F: __dxlog_file5,
|
|
1299
|
+
L: 75,
|
|
1300
|
+
S: this,
|
|
1301
|
+
C: (f, a) => f(...a)
|
|
1297
1302
|
});
|
|
1298
1303
|
this._peers.clear();
|
|
1299
1304
|
this._peers.set(this._swarm.ownPeerId, {
|
|
@@ -1314,10 +1319,10 @@ var SwarmMapper = class {
|
|
|
1314
1319
|
directConnections: this._swarm.connections.length,
|
|
1315
1320
|
totalPeersInSwarm: this._peers.size
|
|
1316
1321
|
}, {
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1322
|
+
F: __dxlog_file5,
|
|
1323
|
+
L: 116,
|
|
1324
|
+
S: this,
|
|
1325
|
+
C: (f, a) => f(...a)
|
|
1321
1326
|
});
|
|
1322
1327
|
this.mapUpdated.emit(Array.from(this._peers.values()));
|
|
1323
1328
|
}
|
|
@@ -1399,7 +1404,7 @@ var ConnectionLog = class {
|
|
|
1399
1404
|
};
|
|
1400
1405
|
|
|
1401
1406
|
// packages/core/mesh/network-manager/src/network-manager.ts
|
|
1402
|
-
import
|
|
1407
|
+
import invariant5 from "tiny-invariant";
|
|
1403
1408
|
import { Event as Event5 } from "@dxos/async";
|
|
1404
1409
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
1405
1410
|
import { log as log6 } from "@dxos/log";
|
|
@@ -1407,8 +1412,9 @@ import { Messenger } from "@dxos/messaging";
|
|
|
1407
1412
|
import { trace as trace3 } from "@dxos/protocols";
|
|
1408
1413
|
import { ConnectionState as ConnectionState2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1409
1414
|
import { ComplexMap as ComplexMap5 } from "@dxos/util";
|
|
1415
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/network-manager.ts";
|
|
1410
1416
|
var NetworkManager = class {
|
|
1411
|
-
constructor({ transportFactory, signalManager, log:
|
|
1417
|
+
constructor({ transportFactory, signalManager, log: log1 }) {
|
|
1412
1418
|
this._swarms = new ComplexMap5(PublicKey7.hash);
|
|
1413
1419
|
this._mappers = new ComplexMap5(PublicKey7.hash);
|
|
1414
1420
|
this._connectionState = ConnectionState2.ONLINE;
|
|
@@ -1428,7 +1434,7 @@ var NetworkManager = class {
|
|
|
1428
1434
|
join: (opts) => this._signalManager.join(opts),
|
|
1429
1435
|
leave: (opts) => this._signalManager.leave(opts)
|
|
1430
1436
|
};
|
|
1431
|
-
if (
|
|
1437
|
+
if (log1) {
|
|
1432
1438
|
this._connectionLog = new ConnectionLog();
|
|
1433
1439
|
}
|
|
1434
1440
|
}
|
|
@@ -1453,30 +1459,30 @@ var NetworkManager = class {
|
|
|
1453
1459
|
log6.trace("dxos.mesh.network-manager.open", trace3.begin({
|
|
1454
1460
|
id: this._instanceId
|
|
1455
1461
|
}), {
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1462
|
+
F: __dxlog_file6,
|
|
1463
|
+
L: 127,
|
|
1464
|
+
S: this,
|
|
1465
|
+
C: (f, a) => f(...a)
|
|
1460
1466
|
});
|
|
1461
1467
|
await this._messenger.open();
|
|
1462
1468
|
await this._signalManager.open();
|
|
1463
1469
|
log6.trace("dxos.mesh.network-manager.open", trace3.end({
|
|
1464
1470
|
id: this._instanceId
|
|
1465
1471
|
}), {
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1472
|
+
F: __dxlog_file6,
|
|
1473
|
+
L: 130,
|
|
1474
|
+
S: this,
|
|
1475
|
+
C: (f, a) => f(...a)
|
|
1470
1476
|
});
|
|
1471
1477
|
}
|
|
1472
1478
|
async close() {
|
|
1473
1479
|
for (const topic of this._swarms.keys()) {
|
|
1474
1480
|
await this.leaveSwarm(topic).catch((err) => {
|
|
1475
|
-
log6(err,
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1481
|
+
log6(err, void 0, {
|
|
1482
|
+
F: __dxlog_file6,
|
|
1483
|
+
L: 136,
|
|
1484
|
+
S: this,
|
|
1485
|
+
C: (f, a) => f(...a)
|
|
1480
1486
|
});
|
|
1481
1487
|
});
|
|
1482
1488
|
}
|
|
@@ -1488,10 +1494,10 @@ var NetworkManager = class {
|
|
|
1488
1494
|
*/
|
|
1489
1495
|
async joinSwarm({ topic, peerId, topology, protocolProvider: protocol, label }) {
|
|
1490
1496
|
var _a;
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1497
|
+
invariant5(PublicKey7.isPublicKey(topic));
|
|
1498
|
+
invariant5(PublicKey7.isPublicKey(peerId));
|
|
1499
|
+
invariant5(topology);
|
|
1500
|
+
invariant5(typeof protocol === "function");
|
|
1495
1501
|
if (this._swarms.has(topic)) {
|
|
1496
1502
|
throw new Error(`Already connected to swarm: ${PublicKey7.from(topic)}`);
|
|
1497
1503
|
}
|
|
@@ -1500,20 +1506,20 @@ var NetworkManager = class {
|
|
|
1500
1506
|
peerId,
|
|
1501
1507
|
topology: topology.toString()
|
|
1502
1508
|
}, {
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1509
|
+
F: __dxlog_file6,
|
|
1510
|
+
L: 162,
|
|
1511
|
+
S: this,
|
|
1512
|
+
C: (f, a) => f(...a)
|
|
1507
1513
|
});
|
|
1508
1514
|
const swarm = new Swarm(topic, peerId, topology, protocol, this._messenger, this._transportFactory, label);
|
|
1509
1515
|
swarm.errors.handle((error) => {
|
|
1510
1516
|
log6("swarm error", {
|
|
1511
1517
|
error
|
|
1512
1518
|
}, {
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1519
|
+
F: __dxlog_file6,
|
|
1520
|
+
L: 165,
|
|
1521
|
+
S: this,
|
|
1522
|
+
C: (f, a) => f(...a)
|
|
1517
1523
|
});
|
|
1518
1524
|
});
|
|
1519
1525
|
this._swarms.set(topic, swarm);
|
|
@@ -1522,11 +1528,11 @@ var NetworkManager = class {
|
|
|
1522
1528
|
this._signalConnection.join({
|
|
1523
1529
|
topic,
|
|
1524
1530
|
peerId
|
|
1525
|
-
}).catch((error) => log6.catch(error,
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1531
|
+
}).catch((error) => log6.catch(error, void 0, {
|
|
1532
|
+
F: __dxlog_file6,
|
|
1533
|
+
L: 174,
|
|
1534
|
+
S: this,
|
|
1535
|
+
C: (f, a) => f(...a)
|
|
1530
1536
|
}));
|
|
1531
1537
|
this.topicsUpdated.emit();
|
|
1532
1538
|
(_a = this._connectionLog) == null ? void 0 : _a.joinedSwarm(swarm);
|
|
@@ -1534,10 +1540,10 @@ var NetworkManager = class {
|
|
|
1534
1540
|
topic: PublicKey7.from(topic),
|
|
1535
1541
|
count: this._swarms.size
|
|
1536
1542
|
}, {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1543
|
+
F: __dxlog_file6,
|
|
1544
|
+
L: 178,
|
|
1545
|
+
S: this,
|
|
1546
|
+
C: (f, a) => f(...a)
|
|
1541
1547
|
});
|
|
1542
1548
|
return {
|
|
1543
1549
|
close: () => this.leaveSwarm(topic)
|
|
@@ -1554,10 +1560,10 @@ var NetworkManager = class {
|
|
|
1554
1560
|
log6("leaving", {
|
|
1555
1561
|
topic: PublicKey7.from(topic)
|
|
1556
1562
|
}, {
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1563
|
+
F: __dxlog_file6,
|
|
1564
|
+
L: 194,
|
|
1565
|
+
S: this,
|
|
1566
|
+
C: (f, a) => f(...a)
|
|
1561
1567
|
});
|
|
1562
1568
|
const swarm = this._swarms.get(topic);
|
|
1563
1569
|
await this._signalConnection.leave({
|
|
@@ -1575,10 +1581,10 @@ var NetworkManager = class {
|
|
|
1575
1581
|
topic: PublicKey7.from(topic),
|
|
1576
1582
|
count: this._swarms.size
|
|
1577
1583
|
}, {
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1584
|
+
F: __dxlog_file6,
|
|
1585
|
+
L: 208,
|
|
1586
|
+
S: this,
|
|
1587
|
+
C: (f, a) => f(...a)
|
|
1582
1588
|
});
|
|
1583
1589
|
}
|
|
1584
1590
|
async setConnectionState(state) {
|
|
@@ -1610,17 +1616,17 @@ var NetworkManager = class {
|
|
|
1610
1616
|
};
|
|
1611
1617
|
|
|
1612
1618
|
// packages/core/mesh/network-manager/src/topology/fully-connected-topology.ts
|
|
1613
|
-
import
|
|
1619
|
+
import invariant6 from "tiny-invariant";
|
|
1614
1620
|
var FullyConnectedTopology = class {
|
|
1615
1621
|
toString() {
|
|
1616
1622
|
return "FullyConnectedTopology";
|
|
1617
1623
|
}
|
|
1618
1624
|
init(controller) {
|
|
1619
|
-
|
|
1625
|
+
invariant6(!this._controller, "Already initialized");
|
|
1620
1626
|
this._controller = controller;
|
|
1621
1627
|
}
|
|
1622
1628
|
update() {
|
|
1623
|
-
|
|
1629
|
+
invariant6(this._controller, "Not initialized");
|
|
1624
1630
|
const { candidates: discovered } = this._controller.getState();
|
|
1625
1631
|
for (const peer of discovered) {
|
|
1626
1632
|
this._controller.connect(peer);
|
|
@@ -1634,9 +1640,10 @@ var FullyConnectedTopology = class {
|
|
|
1634
1640
|
};
|
|
1635
1641
|
|
|
1636
1642
|
// packages/core/mesh/network-manager/src/topology/mmst-topology.ts
|
|
1637
|
-
import
|
|
1643
|
+
import invariant7 from "tiny-invariant";
|
|
1638
1644
|
import distance from "xor-distance";
|
|
1639
1645
|
import { log as log7 } from "@dxos/log";
|
|
1646
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/topology/mmst-topology.ts";
|
|
1640
1647
|
var MMSTTopology = class {
|
|
1641
1648
|
constructor({ originateConnections = 2, maxPeers = 4, sampleSize = 10 } = {}) {
|
|
1642
1649
|
this._sampleCollected = false;
|
|
@@ -1645,62 +1652,62 @@ var MMSTTopology = class {
|
|
|
1645
1652
|
this._sampleSize = sampleSize;
|
|
1646
1653
|
}
|
|
1647
1654
|
init(controller) {
|
|
1648
|
-
|
|
1655
|
+
invariant7(!this._controller, "Already initialized");
|
|
1649
1656
|
this._controller = controller;
|
|
1650
1657
|
}
|
|
1651
1658
|
update() {
|
|
1652
|
-
|
|
1659
|
+
invariant7(this._controller, "Not initialized");
|
|
1653
1660
|
const { connected, candidates } = this._controller.getState();
|
|
1654
1661
|
if (this._sampleCollected || connected.length > this._maxPeers || candidates.length > 0) {
|
|
1655
|
-
log7("Running the algorithm.",
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1662
|
+
log7("Running the algorithm.", void 0, {
|
|
1663
|
+
F: __dxlog_file7,
|
|
1664
|
+
L: 55,
|
|
1665
|
+
S: this,
|
|
1666
|
+
C: (f, a) => f(...a)
|
|
1660
1667
|
});
|
|
1661
1668
|
this._sampleCollected = true;
|
|
1662
1669
|
this._runAlgorithm();
|
|
1663
1670
|
}
|
|
1664
1671
|
}
|
|
1665
1672
|
async onOffer(peer) {
|
|
1666
|
-
|
|
1673
|
+
invariant7(this._controller, "Not initialized");
|
|
1667
1674
|
const { connected } = this._controller.getState();
|
|
1668
1675
|
const accept = connected.length < this._maxPeers;
|
|
1669
|
-
log7(`Offer ${peer} accept=${accept}`,
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1676
|
+
log7(`Offer ${peer} accept=${accept}`, void 0, {
|
|
1677
|
+
F: __dxlog_file7,
|
|
1678
|
+
L: 65,
|
|
1679
|
+
S: this,
|
|
1680
|
+
C: (f, a) => f(...a)
|
|
1674
1681
|
});
|
|
1675
1682
|
return accept;
|
|
1676
1683
|
}
|
|
1677
1684
|
async destroy() {
|
|
1678
1685
|
}
|
|
1679
1686
|
_runAlgorithm() {
|
|
1680
|
-
|
|
1687
|
+
invariant7(this._controller, "Not initialized");
|
|
1681
1688
|
const { connected, candidates, ownPeerId } = this._controller.getState();
|
|
1682
1689
|
if (connected.length > this._maxPeers) {
|
|
1683
1690
|
const sorted = sortByXorDistance(connected, ownPeerId).reverse().slice(0, this._maxPeers - connected.length);
|
|
1684
1691
|
for (const peer of sorted) {
|
|
1685
|
-
log7(`Disconnect ${peer}.`,
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1692
|
+
log7(`Disconnect ${peer}.`, void 0, {
|
|
1693
|
+
F: __dxlog_file7,
|
|
1694
|
+
L: 83,
|
|
1695
|
+
S: this,
|
|
1696
|
+
C: (f, a) => f(...a)
|
|
1690
1697
|
});
|
|
1691
1698
|
this._controller.disconnect(peer);
|
|
1692
1699
|
}
|
|
1693
1700
|
} else if (connected.length < this._originateConnections) {
|
|
1694
1701
|
const sample = candidates.sort(() => Math.random() - 0.5).slice(0, this._sampleSize);
|
|
1695
|
-
const
|
|
1696
|
-
for (const
|
|
1697
|
-
log7(`Connect ${
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
+
const sorted = sortByXorDistance(sample, ownPeerId).slice(0, this._originateConnections - connected.length);
|
|
1703
|
+
for (const peer of sorted) {
|
|
1704
|
+
log7(`Connect ${peer}.`, void 0, {
|
|
1705
|
+
F: __dxlog_file7,
|
|
1706
|
+
L: 91,
|
|
1707
|
+
S: this,
|
|
1708
|
+
C: (f, a) => f(...a)
|
|
1702
1709
|
});
|
|
1703
|
-
this._controller.connect(
|
|
1710
|
+
this._controller.connect(peer);
|
|
1704
1711
|
}
|
|
1705
1712
|
}
|
|
1706
1713
|
}
|
|
@@ -1711,8 +1718,9 @@ var MMSTTopology = class {
|
|
|
1711
1718
|
var sortByXorDistance = (keys, reference) => keys.sort((a, b) => distance.gt(distance(a.asBuffer(), reference.asBuffer()), distance(b.asBuffer(), reference.asBuffer())));
|
|
1712
1719
|
|
|
1713
1720
|
// packages/core/mesh/network-manager/src/topology/star-topology.ts
|
|
1714
|
-
import
|
|
1721
|
+
import invariant8 from "tiny-invariant";
|
|
1715
1722
|
import { log as log8 } from "@dxos/log";
|
|
1723
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/topology/star-topology.ts";
|
|
1716
1724
|
var StarTopology = class {
|
|
1717
1725
|
// prettier-ignore
|
|
1718
1726
|
constructor(_centralPeer) {
|
|
@@ -1722,59 +1730,59 @@ var StarTopology = class {
|
|
|
1722
1730
|
return `StarTopology(${this._centralPeer.truncate()})`;
|
|
1723
1731
|
}
|
|
1724
1732
|
init(controller) {
|
|
1725
|
-
|
|
1733
|
+
invariant8(!this._controller, "Already initialized.");
|
|
1726
1734
|
this._controller = controller;
|
|
1727
1735
|
}
|
|
1728
1736
|
update() {
|
|
1729
|
-
|
|
1737
|
+
invariant8(this._controller, "Not initialized.");
|
|
1730
1738
|
const { candidates, connected, ownPeerId } = this._controller.getState();
|
|
1731
1739
|
if (!ownPeerId.equals(this._centralPeer)) {
|
|
1732
|
-
log8("leaf peer dropping all connections apart from central peer.",
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1740
|
+
log8("leaf peer dropping all connections apart from central peer.", void 0, {
|
|
1741
|
+
F: __dxlog_file8,
|
|
1742
|
+
L: 33,
|
|
1743
|
+
S: this,
|
|
1744
|
+
C: (f, a) => f(...a)
|
|
1737
1745
|
});
|
|
1738
1746
|
for (const peer of connected) {
|
|
1739
1747
|
if (!peer.equals(this._centralPeer)) {
|
|
1740
1748
|
log8("dropping connection", {
|
|
1741
1749
|
peer
|
|
1742
1750
|
}, {
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1751
|
+
F: __dxlog_file8,
|
|
1752
|
+
L: 38,
|
|
1753
|
+
S: this,
|
|
1754
|
+
C: (f, a) => f(...a)
|
|
1747
1755
|
});
|
|
1748
1756
|
this._controller.disconnect(peer);
|
|
1749
1757
|
}
|
|
1750
1758
|
}
|
|
1751
1759
|
}
|
|
1752
|
-
for (const
|
|
1753
|
-
if (
|
|
1760
|
+
for (const peer of candidates) {
|
|
1761
|
+
if (peer.equals(this._centralPeer) || ownPeerId.equals(this._centralPeer)) {
|
|
1754
1762
|
log8("connecting to peer", {
|
|
1755
|
-
peer
|
|
1763
|
+
peer
|
|
1756
1764
|
}, {
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1765
|
+
F: __dxlog_file8,
|
|
1766
|
+
L: 47,
|
|
1767
|
+
S: this,
|
|
1768
|
+
C: (f, a) => f(...a)
|
|
1761
1769
|
});
|
|
1762
|
-
this._controller.connect(
|
|
1770
|
+
this._controller.connect(peer);
|
|
1763
1771
|
}
|
|
1764
1772
|
}
|
|
1765
1773
|
}
|
|
1766
1774
|
async onOffer(peer) {
|
|
1767
|
-
|
|
1775
|
+
invariant8(this._controller, "Not initialized.");
|
|
1768
1776
|
const { ownPeerId } = this._controller.getState();
|
|
1769
1777
|
log8("offer", {
|
|
1770
1778
|
peer,
|
|
1771
1779
|
isCentral: peer.equals(this._centralPeer),
|
|
1772
1780
|
isSelfCentral: ownPeerId.equals(this._centralPeer)
|
|
1773
1781
|
}, {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1782
|
+
F: __dxlog_file8,
|
|
1783
|
+
L: 56,
|
|
1784
|
+
S: this,
|
|
1785
|
+
C: (f, a) => f(...a)
|
|
1778
1786
|
});
|
|
1779
1787
|
return ownPeerId.equals(this._centralPeer) || peer.equals(this._centralPeer);
|
|
1780
1788
|
}
|
|
@@ -1783,14 +1791,14 @@ var StarTopology = class {
|
|
|
1783
1791
|
};
|
|
1784
1792
|
|
|
1785
1793
|
// packages/core/mesh/network-manager/src/transport/memory-transport.ts
|
|
1786
|
-
import assert9 from "@dxos/node-std/assert";
|
|
1787
1794
|
import { Transform } from "@dxos/node-std/stream";
|
|
1795
|
+
import invariant9 from "tiny-invariant";
|
|
1788
1796
|
import { Event as Event6, Trigger } from "@dxos/async";
|
|
1789
1797
|
import { ErrorStream as ErrorStream3 } from "@dxos/debug";
|
|
1790
1798
|
import { PublicKey as PublicKey8 } from "@dxos/keys";
|
|
1791
1799
|
import { log as log9, logInfo as logInfo2 } from "@dxos/log";
|
|
1792
1800
|
import { ComplexMap as ComplexMap6 } from "@dxos/util";
|
|
1793
|
-
|
|
1801
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
1794
1802
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1795
1803
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1796
1804
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1799,7 +1807,8 @@ var __decorate4 = function(decorators, target, key, desc) {
|
|
|
1799
1807
|
if (d = decorators[i])
|
|
1800
1808
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1801
1809
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1802
|
-
}
|
|
1810
|
+
}
|
|
1811
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/memory-transport.ts";
|
|
1803
1812
|
var MEMORY_TRANSPORT_DELAY = 1;
|
|
1804
1813
|
var createStreamDelay = (delay) => {
|
|
1805
1814
|
return new Transform({
|
|
@@ -1819,26 +1828,26 @@ var _MemoryTransport = class {
|
|
|
1819
1828
|
this.closed = new Event6();
|
|
1820
1829
|
this.connected = new Event6();
|
|
1821
1830
|
this.errors = new ErrorStream3();
|
|
1831
|
+
this._instanceId = PublicKey8.random();
|
|
1822
1832
|
this._remote = new Trigger();
|
|
1823
1833
|
this._outgoingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY);
|
|
1824
1834
|
this._incomingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY);
|
|
1825
1835
|
this._destroyed = false;
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
callSite: (f, a) => f(...a)
|
|
1836
|
+
log9("creating", void 0, {
|
|
1837
|
+
F: __dxlog_file9,
|
|
1838
|
+
L: 64,
|
|
1839
|
+
S: this,
|
|
1840
|
+
C: (f, a) => f(...a)
|
|
1832
1841
|
});
|
|
1833
|
-
|
|
1842
|
+
invariant9(!_MemoryTransport._connections.has(this._instanceId), "Duplicate memory connection");
|
|
1834
1843
|
_MemoryTransport._connections.set(this._instanceId, this);
|
|
1835
1844
|
if (this.options.initiator) {
|
|
1836
1845
|
setTimeout(async () => {
|
|
1837
|
-
log9("sending signal",
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1846
|
+
log9("sending signal", void 0, {
|
|
1847
|
+
F: __dxlog_file9,
|
|
1848
|
+
L: 73,
|
|
1849
|
+
S: this,
|
|
1850
|
+
C: (f, a) => f(...a)
|
|
1842
1851
|
});
|
|
1843
1852
|
void this.options.sendSignal({
|
|
1844
1853
|
payload: {
|
|
@@ -1864,14 +1873,14 @@ var _MemoryTransport = class {
|
|
|
1864
1873
|
this.closed.emit();
|
|
1865
1874
|
return;
|
|
1866
1875
|
}
|
|
1867
|
-
|
|
1876
|
+
invariant9(!this._remoteConnection._remoteConnection, `Remote already connected: ${this._remoteInstanceId}`);
|
|
1868
1877
|
this._remoteConnection._remoteConnection = this;
|
|
1869
1878
|
this._remoteConnection._remoteInstanceId = this._instanceId;
|
|
1870
|
-
log9("connected",
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1879
|
+
log9("connected", void 0, {
|
|
1880
|
+
F: __dxlog_file9,
|
|
1881
|
+
L: 103,
|
|
1882
|
+
S: this,
|
|
1883
|
+
C: (f, a) => f(...a)
|
|
1875
1884
|
});
|
|
1876
1885
|
this.options.stream.pipe(this._outgoingDelay).pipe(this._remoteConnection.options.stream).pipe(this._incomingDelay).pipe(this.options.stream);
|
|
1877
1886
|
this.connected.emit();
|
|
@@ -1885,20 +1894,20 @@ var _MemoryTransport = class {
|
|
|
1885
1894
|
}
|
|
1886
1895
|
}
|
|
1887
1896
|
async destroy() {
|
|
1888
|
-
log9("closing",
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1897
|
+
log9("closing", void 0, {
|
|
1898
|
+
F: __dxlog_file9,
|
|
1899
|
+
L: 124,
|
|
1900
|
+
S: this,
|
|
1901
|
+
C: (f, a) => f(...a)
|
|
1893
1902
|
});
|
|
1894
1903
|
this._destroyed = true;
|
|
1895
1904
|
_MemoryTransport._connections.delete(this._instanceId);
|
|
1896
1905
|
if (this._remoteConnection) {
|
|
1897
|
-
log9("closing",
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1906
|
+
log9("closing", void 0, {
|
|
1907
|
+
F: __dxlog_file9,
|
|
1908
|
+
L: 129,
|
|
1909
|
+
S: this,
|
|
1910
|
+
C: (f, a) => f(...a)
|
|
1902
1911
|
});
|
|
1903
1912
|
this._remoteConnection._destroyed = true;
|
|
1904
1913
|
_MemoryTransport._connections.delete(this._remoteInstanceId);
|
|
@@ -1907,29 +1916,29 @@ var _MemoryTransport = class {
|
|
|
1907
1916
|
this._remoteConnection.closed.emit();
|
|
1908
1917
|
this._remoteConnection._remoteConnection = void 0;
|
|
1909
1918
|
this._remoteConnection = void 0;
|
|
1910
|
-
log9("closed",
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1919
|
+
log9("closed", void 0, {
|
|
1920
|
+
F: __dxlog_file9,
|
|
1921
|
+
L: 147,
|
|
1922
|
+
S: this,
|
|
1923
|
+
C: (f, a) => f(...a)
|
|
1915
1924
|
});
|
|
1916
1925
|
}
|
|
1917
1926
|
this.closed.emit();
|
|
1918
|
-
log9("closed",
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1927
|
+
log9("closed", void 0, {
|
|
1928
|
+
F: __dxlog_file9,
|
|
1929
|
+
L: 151,
|
|
1930
|
+
S: this,
|
|
1931
|
+
C: (f, a) => f(...a)
|
|
1923
1932
|
});
|
|
1924
1933
|
}
|
|
1925
1934
|
signal({ payload }) {
|
|
1926
1935
|
log9("received signal", {
|
|
1927
1936
|
payload
|
|
1928
1937
|
}, {
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1938
|
+
F: __dxlog_file9,
|
|
1939
|
+
L: 155,
|
|
1940
|
+
S: this,
|
|
1941
|
+
C: (f, a) => f(...a)
|
|
1933
1942
|
});
|
|
1934
1943
|
if (!(payload == null ? void 0 : payload.transportId)) {
|
|
1935
1944
|
return;
|
|
@@ -1944,16 +1953,16 @@ var _MemoryTransport = class {
|
|
|
1944
1953
|
var MemoryTransport = _MemoryTransport;
|
|
1945
1954
|
// TODO(burdon): Remove static properties (inject context into constructor).
|
|
1946
1955
|
MemoryTransport._connections = new ComplexMap6(PublicKey8.hash);
|
|
1947
|
-
|
|
1956
|
+
_ts_decorate4([
|
|
1948
1957
|
logInfo2
|
|
1949
1958
|
], MemoryTransport.prototype, "_instanceId", void 0);
|
|
1950
|
-
|
|
1959
|
+
_ts_decorate4([
|
|
1951
1960
|
logInfo2
|
|
1952
1961
|
], MemoryTransport.prototype, "_remoteInstanceId", void 0);
|
|
1953
1962
|
|
|
1954
1963
|
// packages/core/mesh/network-manager/src/transport/webrtc-transport.ts
|
|
1955
|
-
import assert10 from "@dxos/node-std/assert";
|
|
1956
1964
|
import SimplePeerConstructor from "simple-peer";
|
|
1965
|
+
import invariant10 from "tiny-invariant";
|
|
1957
1966
|
import { Event as Event7 } from "@dxos/async";
|
|
1958
1967
|
import { ErrorStream as ErrorStream4, raise as raise2 } from "@dxos/debug";
|
|
1959
1968
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
@@ -1968,6 +1977,7 @@ try {
|
|
|
1968
1977
|
}
|
|
1969
1978
|
|
|
1970
1979
|
// packages/core/mesh/network-manager/src/transport/webrtc-transport.ts
|
|
1980
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/webrtc-transport.ts";
|
|
1971
1981
|
var WebRTCTransport = class {
|
|
1972
1982
|
constructor(params) {
|
|
1973
1983
|
var _a;
|
|
@@ -1980,16 +1990,16 @@ var WebRTCTransport = class {
|
|
|
1980
1990
|
log10.trace("dxos.mesh.webrtc-transport.constructor", trace4.begin({
|
|
1981
1991
|
id: this._instanceId
|
|
1982
1992
|
}), {
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1993
|
+
F: __dxlog_file10,
|
|
1994
|
+
L: 39,
|
|
1995
|
+
S: this,
|
|
1996
|
+
C: (f, a) => f(...a)
|
|
1987
1997
|
});
|
|
1988
1998
|
log10("created connection", params, {
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1999
|
+
F: __dxlog_file10,
|
|
2000
|
+
L: 40,
|
|
2001
|
+
S: this,
|
|
2002
|
+
C: (f, a) => f(...a)
|
|
1993
2003
|
});
|
|
1994
2004
|
this._peer = new SimplePeerConstructor({
|
|
1995
2005
|
initiator: this.params.initiator,
|
|
@@ -1998,10 +2008,10 @@ var WebRTCTransport = class {
|
|
|
1998
2008
|
});
|
|
1999
2009
|
this._peer.on("signal", async (data) => {
|
|
2000
2010
|
log10("signal", data, {
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2011
|
+
F: __dxlog_file10,
|
|
2012
|
+
L: 48,
|
|
2013
|
+
S: this,
|
|
2014
|
+
C: (f, a) => f(...a)
|
|
2005
2015
|
});
|
|
2006
2016
|
await this.params.sendSignal({
|
|
2007
2017
|
payload: {
|
|
@@ -2010,21 +2020,21 @@ var WebRTCTransport = class {
|
|
|
2010
2020
|
});
|
|
2011
2021
|
});
|
|
2012
2022
|
this._peer.on("connect", () => {
|
|
2013
|
-
log10("connected",
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2023
|
+
log10("connected", void 0, {
|
|
2024
|
+
F: __dxlog_file10,
|
|
2025
|
+
L: 53,
|
|
2026
|
+
S: this,
|
|
2027
|
+
C: (f, a) => f(...a)
|
|
2018
2028
|
});
|
|
2019
2029
|
this.params.stream.pipe(this._peer).pipe(this.params.stream);
|
|
2020
2030
|
this.connected.emit();
|
|
2021
2031
|
});
|
|
2022
2032
|
this._peer.on("close", async () => {
|
|
2023
|
-
log10("closed",
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2033
|
+
log10("closed", void 0, {
|
|
2034
|
+
F: __dxlog_file10,
|
|
2035
|
+
L: 59,
|
|
2036
|
+
S: this,
|
|
2037
|
+
C: (f, a) => f(...a)
|
|
2028
2038
|
});
|
|
2029
2039
|
await this._disconnectStreams();
|
|
2030
2040
|
this.closed.emit();
|
|
@@ -2039,10 +2049,10 @@ var WebRTCTransport = class {
|
|
|
2039
2049
|
config: this.params.webrtcConfig,
|
|
2040
2050
|
stats
|
|
2041
2051
|
}, {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2052
|
+
F: __dxlog_file10,
|
|
2053
|
+
L: 71,
|
|
2054
|
+
S: this,
|
|
2055
|
+
C: (f, a) => f(...a)
|
|
2046
2056
|
});
|
|
2047
2057
|
});
|
|
2048
2058
|
}
|
|
@@ -2053,35 +2063,35 @@ var WebRTCTransport = class {
|
|
|
2053
2063
|
log10.trace("dxos.mesh.webrtc-transport.constructor", trace4.end({
|
|
2054
2064
|
id: this._instanceId
|
|
2055
2065
|
}), {
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2066
|
+
F: __dxlog_file10,
|
|
2067
|
+
L: 81,
|
|
2068
|
+
S: this,
|
|
2069
|
+
C: (f, a) => f(...a)
|
|
2060
2070
|
});
|
|
2061
2071
|
}
|
|
2062
2072
|
async destroy() {
|
|
2063
|
-
log10("closing...",
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2073
|
+
log10("closing...", void 0, {
|
|
2074
|
+
F: __dxlog_file10,
|
|
2075
|
+
L: 85,
|
|
2076
|
+
S: this,
|
|
2077
|
+
C: (f, a) => f(...a)
|
|
2068
2078
|
});
|
|
2069
2079
|
this._closed = true;
|
|
2070
2080
|
await this._disconnectStreams();
|
|
2071
2081
|
this._peer.destroy();
|
|
2072
2082
|
this.closed.emit();
|
|
2073
|
-
log10("closed",
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2083
|
+
log10("closed", void 0, {
|
|
2084
|
+
F: __dxlog_file10,
|
|
2085
|
+
L: 90,
|
|
2086
|
+
S: this,
|
|
2087
|
+
C: (f, a) => f(...a)
|
|
2078
2088
|
});
|
|
2079
2089
|
}
|
|
2080
2090
|
signal(signal) {
|
|
2081
2091
|
if (this._closed) {
|
|
2082
2092
|
return;
|
|
2083
2093
|
}
|
|
2084
|
-
|
|
2094
|
+
invariant10(signal.payload.data, "Signal message must contain signal data.");
|
|
2085
2095
|
this._peer.signal(signal.payload.data);
|
|
2086
2096
|
}
|
|
2087
2097
|
async _disconnectStreams() {
|
|
@@ -2097,13 +2107,14 @@ var createWebRTCTransportFactory = (webrtcConfig) => ({
|
|
|
2097
2107
|
});
|
|
2098
2108
|
|
|
2099
2109
|
// packages/core/mesh/network-manager/src/transport/webrtc-transport-service.ts
|
|
2100
|
-
import assert11 from "@dxos/node-std/assert";
|
|
2101
2110
|
import { Duplex } from "@dxos/node-std/stream";
|
|
2111
|
+
import invariant11 from "tiny-invariant";
|
|
2102
2112
|
import { Stream } from "@dxos/codec-protobuf";
|
|
2103
2113
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
2104
2114
|
import { log as log11 } from "@dxos/log";
|
|
2105
2115
|
import { ConnectionState as ConnectionState3 } from "@dxos/protocols/proto/dxos/mesh/bridge";
|
|
2106
2116
|
import { ComplexMap as ComplexMap7 } from "@dxos/util";
|
|
2117
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/webrtc-transport-service.ts";
|
|
2107
2118
|
var WebRTCTransportService = class {
|
|
2108
2119
|
// prettier-ignore
|
|
2109
2120
|
constructor(_webrtcConfig) {
|
|
@@ -2174,11 +2185,11 @@ var WebRTCTransportService = class {
|
|
|
2174
2185
|
return rpcStream;
|
|
2175
2186
|
}
|
|
2176
2187
|
async sendSignal({ proxyId, signal }) {
|
|
2177
|
-
|
|
2188
|
+
invariant11(this.transports.has(proxyId));
|
|
2178
2189
|
await this.transports.get(proxyId).transport.signal(signal);
|
|
2179
2190
|
}
|
|
2180
2191
|
async sendData({ proxyId, payload }) {
|
|
2181
|
-
|
|
2192
|
+
invariant11(this.transports.has(proxyId));
|
|
2182
2193
|
await this.transports.get(proxyId).stream.push(payload);
|
|
2183
2194
|
}
|
|
2184
2195
|
async close({ proxyId }) {
|
|
@@ -2186,17 +2197,17 @@ var WebRTCTransportService = class {
|
|
|
2186
2197
|
await ((_a = this.transports.get(proxyId)) == null ? void 0 : _a.transport.destroy());
|
|
2187
2198
|
await ((_b = this.transports.get(proxyId)) == null ? void 0 : _b.stream.end());
|
|
2188
2199
|
this.transports.delete(proxyId);
|
|
2189
|
-
log11("Closed.",
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2200
|
+
log11("Closed.", void 0, {
|
|
2201
|
+
F: __dxlog_file11,
|
|
2202
|
+
L: 109,
|
|
2203
|
+
S: this,
|
|
2204
|
+
C: (f, a) => f(...a)
|
|
2194
2205
|
});
|
|
2195
2206
|
}
|
|
2196
2207
|
};
|
|
2197
2208
|
|
|
2198
2209
|
// packages/core/mesh/network-manager/src/transport/webrtc-transport-proxy.ts
|
|
2199
|
-
import
|
|
2210
|
+
import invariant12 from "tiny-invariant";
|
|
2200
2211
|
import { Event as Event8 } from "@dxos/async";
|
|
2201
2212
|
import { Context as Context5 } from "@dxos/context";
|
|
2202
2213
|
import { ErrorStream as ErrorStream5 } from "@dxos/debug";
|
|
@@ -2204,6 +2215,7 @@ import { PublicKey as PublicKey11 } from "@dxos/keys";
|
|
|
2204
2215
|
import { log as log12 } from "@dxos/log";
|
|
2205
2216
|
import { ConnectionState as ConnectionState4 } from "@dxos/protocols/proto/dxos/mesh/bridge";
|
|
2206
2217
|
import { arrayToBuffer } from "@dxos/util";
|
|
2218
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/webrtc-transport-proxy.ts";
|
|
2207
2219
|
var WebRTCTransportProxy = class {
|
|
2208
2220
|
// prettier-ignore
|
|
2209
2221
|
constructor(_params) {
|
|
@@ -2221,10 +2233,10 @@ var WebRTCTransportProxy = class {
|
|
|
2221
2233
|
this._serviceStream.waitUntilReady().then(() => {
|
|
2222
2234
|
this._serviceStream.subscribe(async (event) => {
|
|
2223
2235
|
log12("WebRTCTransportProxy: event", event, {
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2236
|
+
F: __dxlog_file12,
|
|
2237
|
+
L: 50,
|
|
2238
|
+
S: this,
|
|
2239
|
+
C: (f, a) => f(...a)
|
|
2228
2240
|
});
|
|
2229
2241
|
if (event.connection) {
|
|
2230
2242
|
await this._handleConnection(event.connection);
|
|
@@ -2241,11 +2253,11 @@ var WebRTCTransportProxy = class {
|
|
|
2241
2253
|
payload: data
|
|
2242
2254
|
});
|
|
2243
2255
|
} catch (err) {
|
|
2244
|
-
log12.catch(err,
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2256
|
+
log12.catch(err, void 0, {
|
|
2257
|
+
F: __dxlog_file12,
|
|
2258
|
+
L: 67,
|
|
2259
|
+
S: this,
|
|
2260
|
+
C: (f, a) => f(...a)
|
|
2249
2261
|
});
|
|
2250
2262
|
}
|
|
2251
2263
|
};
|
|
@@ -2253,11 +2265,11 @@ var WebRTCTransportProxy = class {
|
|
|
2253
2265
|
this._ctx.onDispose(() => {
|
|
2254
2266
|
this._params.stream.off("data", dataListener);
|
|
2255
2267
|
});
|
|
2256
|
-
}, (error) => log12.catch(error,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2268
|
+
}, (error) => log12.catch(error, void 0, {
|
|
2269
|
+
F: __dxlog_file12,
|
|
2270
|
+
L: 73,
|
|
2271
|
+
S: this,
|
|
2272
|
+
C: (f, a) => f(...a)
|
|
2261
2273
|
}));
|
|
2262
2274
|
}
|
|
2263
2275
|
async _handleConnection(connectionEvent) {
|
|
@@ -2299,11 +2311,11 @@ var WebRTCTransportProxy = class {
|
|
|
2299
2311
|
proxyId: this._proxyId
|
|
2300
2312
|
});
|
|
2301
2313
|
} catch (err) {
|
|
2302
|
-
log12.catch(err,
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2314
|
+
log12.catch(err, void 0, {
|
|
2315
|
+
F: __dxlog_file12,
|
|
2316
|
+
L: 124,
|
|
2317
|
+
S: this,
|
|
2318
|
+
C: (f, a) => f(...a)
|
|
2307
2319
|
});
|
|
2308
2320
|
}
|
|
2309
2321
|
this.closed.emit();
|
|
@@ -2335,7 +2347,7 @@ var WebRTCTransportProxyFactory = class {
|
|
|
2335
2347
|
return this;
|
|
2336
2348
|
}
|
|
2337
2349
|
createTransport(options) {
|
|
2338
|
-
|
|
2350
|
+
invariant12(this._bridgeService, "WebRTCTransportProxyFactory is not ready to open connections");
|
|
2339
2351
|
const transport = new WebRTCTransportProxy({
|
|
2340
2352
|
...options,
|
|
2341
2353
|
bridgeService: this._bridgeService
|
|
@@ -2385,4 +2397,4 @@ export {
|
|
|
2385
2397
|
WebRTCTransportProxyFactory,
|
|
2386
2398
|
createTeleportProtocolFactory
|
|
2387
2399
|
};
|
|
2388
|
-
//# sourceMappingURL=chunk-
|
|
2400
|
+
//# sourceMappingURL=chunk-N5RZB7V4.mjs.map
|