@dxos/network-manager 0.4.10-main.f68a1ca → 0.4.10-main.f937af6
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-2QQJJZJQ.mjs → chunk-SOVZDG44.mjs} +473 -423
- package/dist/lib/browser/chunk-SOVZDG44.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-IWG3IC7H.cjs → chunk-BMZFS4HT.cjs} +489 -438
- package/dist/lib/node/chunk-BMZFS4HT.cjs.map +7 -0
- package/dist/lib/node/index.cjs +27 -27
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +18 -18
- package/dist/types/src/swarm/connection.d.ts.map +1 -1
- package/dist/types/src/swarm/peer.d.ts.map +1 -1
- package/dist/types/src/transport/libdatachannel-transport.d.ts +20 -19
- package/dist/types/src/transport/libdatachannel-transport.d.ts.map +1 -1
- package/dist/types/src/transport/memory-transport.d.ts +17 -10
- package/dist/types/src/transport/memory-transport.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport-proxy.d.ts +7 -9
- package/dist/types/src/transport/simplepeer-transport-proxy.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport-service.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport.d.ts +9 -11
- package/dist/types/src/transport/simplepeer-transport.d.ts.map +1 -1
- package/dist/types/src/transport/tcp-transport.browser.d.ts +7 -2
- package/dist/types/src/transport/tcp-transport.browser.d.ts.map +1 -1
- package/dist/types/src/transport/tcp-transport.d.ts +6 -4
- package/dist/types/src/transport/tcp-transport.d.ts.map +1 -1
- package/dist/types/src/transport/transport.d.ts +18 -12
- package/dist/types/src/transport/transport.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/swarm/connection.ts +7 -5
- package/src/swarm/peer.ts +3 -4
- package/src/transport/libdatachannel-transport.test.ts +14 -9
- package/src/transport/libdatachannel-transport.ts +226 -204
- package/src/transport/memory-transport.test.ts +10 -7
- package/src/transport/memory-transport.ts +49 -42
- package/src/transport/simplepeer-transport-proxy-test.ts +13 -8
- package/src/transport/simplepeer-transport-proxy.ts +57 -50
- package/src/transport/simplepeer-transport-service.ts +5 -2
- package/src/transport/simplepeer-transport.test.ts +9 -5
- package/src/transport/simplepeer-transport.ts +25 -25
- package/src/transport/tcp-transport.browser.ts +10 -5
- package/src/transport/tcp-transport.ts +31 -22
- package/src/transport/transport.ts +25 -14
- package/dist/lib/browser/chunk-2QQJJZJQ.mjs.map +0 -7
- package/dist/lib/node/chunk-IWG3IC7H.cjs.map +0 -7
|
@@ -167,6 +167,7 @@ var Connection = class {
|
|
|
167
167
|
sendSignal: async (signal) => this._sendSignal(signal),
|
|
168
168
|
sessionId: this.sessionId
|
|
169
169
|
});
|
|
170
|
+
await this._transport.open();
|
|
170
171
|
this._transport.connected.once(async () => {
|
|
171
172
|
this._changeState("CONNECTED");
|
|
172
173
|
await this.connectedTimeoutContext.dispose();
|
|
@@ -177,7 +178,7 @@ var Connection = class {
|
|
|
177
178
|
this._transport = void 0;
|
|
178
179
|
log("abort triggered by transport close", void 0, {
|
|
179
180
|
F: __dxlog_file,
|
|
180
|
-
L:
|
|
181
|
+
L: 218,
|
|
181
182
|
S: this,
|
|
182
183
|
C: (f, a) => f(...a)
|
|
183
184
|
});
|
|
@@ -188,7 +189,7 @@ var Connection = class {
|
|
|
188
189
|
err
|
|
189
190
|
}, {
|
|
190
191
|
F: __dxlog_file,
|
|
191
|
-
L:
|
|
192
|
+
L: 223,
|
|
192
193
|
S: this,
|
|
193
194
|
C: (f, a) => f(...a)
|
|
194
195
|
});
|
|
@@ -198,7 +199,7 @@ var Connection = class {
|
|
|
198
199
|
if (err instanceof ConnectionResetError) {
|
|
199
200
|
log.info("aborting due to transport ConnectionResetError", void 0, {
|
|
200
201
|
F: __dxlog_file,
|
|
201
|
-
L:
|
|
202
|
+
L: 230,
|
|
202
203
|
S: this,
|
|
203
204
|
C: (f, a) => f(...a)
|
|
204
205
|
});
|
|
@@ -206,7 +207,7 @@ var Connection = class {
|
|
|
206
207
|
} else if (err instanceof ConnectivityError) {
|
|
207
208
|
log.info("aborting due to transport ConnectivityError", void 0, {
|
|
208
209
|
F: __dxlog_file,
|
|
209
|
-
L:
|
|
210
|
+
L: 233,
|
|
210
211
|
S: this,
|
|
211
212
|
C: (f, a) => f(...a)
|
|
212
213
|
});
|
|
@@ -216,7 +217,7 @@ var Connection = class {
|
|
|
216
217
|
err
|
|
217
218
|
}, {
|
|
218
219
|
F: __dxlog_file,
|
|
219
|
-
L:
|
|
220
|
+
L: 236,
|
|
220
221
|
S: this,
|
|
221
222
|
C: (f, a) => f(...a)
|
|
222
223
|
});
|
|
@@ -227,14 +228,14 @@ var Connection = class {
|
|
|
227
228
|
}
|
|
228
229
|
});
|
|
229
230
|
for (const signal of this._incomingSignalBuffer) {
|
|
230
|
-
void this._transport.
|
|
231
|
+
void this._transport.onSignal(signal);
|
|
231
232
|
}
|
|
232
233
|
this._incomingSignalBuffer = [];
|
|
233
234
|
log.trace("dxos.mesh.connection.open-connection", trace.end({
|
|
234
235
|
id: this._instanceId
|
|
235
236
|
}), {
|
|
236
237
|
F: __dxlog_file,
|
|
237
|
-
L:
|
|
238
|
+
L: 252,
|
|
238
239
|
S: this,
|
|
239
240
|
C: (f, a) => f(...a)
|
|
240
241
|
});
|
|
@@ -244,14 +245,14 @@ var Connection = class {
|
|
|
244
245
|
err
|
|
245
246
|
}, {
|
|
246
247
|
F: __dxlog_file,
|
|
247
|
-
L:
|
|
248
|
+
L: 259,
|
|
248
249
|
S: this,
|
|
249
250
|
C: (f, a) => f(...a)
|
|
250
251
|
});
|
|
251
252
|
if (this._state === "CLOSED" || this._state === "ABORTED") {
|
|
252
253
|
log(`abort ignored: already ${this._state}`, this.closeReason, {
|
|
253
254
|
F: __dxlog_file,
|
|
254
|
-
L:
|
|
255
|
+
L: 261,
|
|
255
256
|
S: this,
|
|
256
257
|
C: (f, a) => f(...a)
|
|
257
258
|
});
|
|
@@ -266,7 +267,7 @@ var Connection = class {
|
|
|
266
267
|
try {
|
|
267
268
|
log("aborting protocol... ", void 0, {
|
|
268
269
|
F: __dxlog_file,
|
|
269
|
-
L:
|
|
270
|
+
L: 275,
|
|
270
271
|
S: this,
|
|
271
272
|
C: (f, a) => f(...a)
|
|
272
273
|
});
|
|
@@ -274,17 +275,17 @@ var Connection = class {
|
|
|
274
275
|
} catch (err2) {
|
|
275
276
|
log.catch(err2, void 0, {
|
|
276
277
|
F: __dxlog_file,
|
|
277
|
-
L:
|
|
278
|
+
L: 278,
|
|
278
279
|
S: this,
|
|
279
280
|
C: (f, a) => f(...a)
|
|
280
281
|
});
|
|
281
282
|
}
|
|
282
283
|
try {
|
|
283
|
-
await this._transport?.
|
|
284
|
+
await this._transport?.close();
|
|
284
285
|
} catch (err2) {
|
|
285
286
|
log.catch(err2, void 0, {
|
|
286
287
|
F: __dxlog_file,
|
|
287
|
-
L:
|
|
288
|
+
L: 285,
|
|
288
289
|
S: this,
|
|
289
290
|
C: (f, a) => f(...a)
|
|
290
291
|
});
|
|
@@ -294,7 +295,7 @@ var Connection = class {
|
|
|
294
295
|
} catch (err2) {
|
|
295
296
|
log.catch(err2, void 0, {
|
|
296
297
|
F: __dxlog_file,
|
|
297
|
-
L:
|
|
298
|
+
L: 291,
|
|
298
299
|
S: this,
|
|
299
300
|
C: (f, a) => f(...a)
|
|
300
301
|
});
|
|
@@ -318,7 +319,7 @@ var Connection = class {
|
|
|
318
319
|
peerId: this.ownId
|
|
319
320
|
}, {
|
|
320
321
|
F: __dxlog_file,
|
|
321
|
-
L:
|
|
322
|
+
L: 316,
|
|
322
323
|
S: this,
|
|
323
324
|
C: (f, a) => f(...a)
|
|
324
325
|
});
|
|
@@ -328,17 +329,17 @@ var Connection = class {
|
|
|
328
329
|
} catch (err2) {
|
|
329
330
|
log.catch(err2, void 0, {
|
|
330
331
|
F: __dxlog_file,
|
|
331
|
-
L:
|
|
332
|
+
L: 323,
|
|
332
333
|
S: this,
|
|
333
334
|
C: (f, a) => f(...a)
|
|
334
335
|
});
|
|
335
336
|
}
|
|
336
337
|
try {
|
|
337
|
-
await this._transport?.
|
|
338
|
+
await this._transport?.close();
|
|
338
339
|
} catch (err2) {
|
|
339
340
|
log.catch(err2, void 0, {
|
|
340
341
|
F: __dxlog_file,
|
|
341
|
-
L:
|
|
342
|
+
L: 330,
|
|
342
343
|
S: this,
|
|
343
344
|
C: (f, a) => f(...a)
|
|
344
345
|
});
|
|
@@ -346,7 +347,7 @@ var Connection = class {
|
|
|
346
347
|
} else {
|
|
347
348
|
log.info(`graceful close requested when we were in ${lastState} state? aborting`, void 0, {
|
|
348
349
|
F: __dxlog_file,
|
|
349
|
-
L:
|
|
350
|
+
L: 333,
|
|
350
351
|
S: this,
|
|
351
352
|
C: (f, a) => f(...a)
|
|
352
353
|
});
|
|
@@ -355,17 +356,17 @@ var Connection = class {
|
|
|
355
356
|
} catch (err2) {
|
|
356
357
|
log.catch(err2, void 0, {
|
|
357
358
|
F: __dxlog_file,
|
|
358
|
-
L:
|
|
359
|
+
L: 337,
|
|
359
360
|
S: this,
|
|
360
361
|
C: (f, a) => f(...a)
|
|
361
362
|
});
|
|
362
363
|
}
|
|
363
364
|
try {
|
|
364
|
-
await this._transport?.
|
|
365
|
+
await this._transport?.close();
|
|
365
366
|
} catch (err2) {
|
|
366
367
|
log.catch(err2, void 0, {
|
|
367
368
|
F: __dxlog_file,
|
|
368
|
-
L:
|
|
369
|
+
L: 342,
|
|
369
370
|
S: this,
|
|
370
371
|
C: (f, a) => f(...a)
|
|
371
372
|
});
|
|
@@ -375,7 +376,7 @@ var Connection = class {
|
|
|
375
376
|
peerId: this.ownId
|
|
376
377
|
}, {
|
|
377
378
|
F: __dxlog_file,
|
|
378
|
-
L:
|
|
379
|
+
L: 346,
|
|
379
380
|
S: this,
|
|
380
381
|
C: (f, a) => f(...a)
|
|
381
382
|
});
|
|
@@ -418,7 +419,7 @@ var Connection = class {
|
|
|
418
419
|
err
|
|
419
420
|
}, {
|
|
420
421
|
F: __dxlog_file,
|
|
421
|
-
L:
|
|
422
|
+
L: 384,
|
|
422
423
|
S: this,
|
|
423
424
|
C: (f, a) => f(...a)
|
|
424
425
|
});
|
|
@@ -431,7 +432,7 @@ var Connection = class {
|
|
|
431
432
|
async signal(msg) {
|
|
432
433
|
invariant(msg.sessionId, void 0, {
|
|
433
434
|
F: __dxlog_file,
|
|
434
|
-
L:
|
|
435
|
+
L: 393,
|
|
435
436
|
S: this,
|
|
436
437
|
A: [
|
|
437
438
|
"msg.sessionId",
|
|
@@ -441,7 +442,7 @@ var Connection = class {
|
|
|
441
442
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
442
443
|
log("dropping signal for incorrect session id", void 0, {
|
|
443
444
|
F: __dxlog_file,
|
|
444
|
-
L:
|
|
445
|
+
L: 395,
|
|
445
446
|
S: this,
|
|
446
447
|
C: (f, a) => f(...a)
|
|
447
448
|
});
|
|
@@ -449,7 +450,7 @@ var Connection = class {
|
|
|
449
450
|
}
|
|
450
451
|
invariant(msg.data.signal || msg.data.signalBatch, void 0, {
|
|
451
452
|
F: __dxlog_file,
|
|
452
|
-
L:
|
|
453
|
+
L: 398,
|
|
453
454
|
S: this,
|
|
454
455
|
A: [
|
|
455
456
|
"msg.data.signal || msg.data.signalBatch",
|
|
@@ -458,7 +459,7 @@ var Connection = class {
|
|
|
458
459
|
});
|
|
459
460
|
invariant(msg.author?.equals(this.remoteId), void 0, {
|
|
460
461
|
F: __dxlog_file,
|
|
461
|
-
L:
|
|
462
|
+
L: 399,
|
|
462
463
|
S: this,
|
|
463
464
|
A: [
|
|
464
465
|
"msg.author?.equals(this.remoteId)",
|
|
@@ -467,7 +468,7 @@ var Connection = class {
|
|
|
467
468
|
});
|
|
468
469
|
invariant(msg.recipient?.equals(this.ownId), void 0, {
|
|
469
470
|
F: __dxlog_file,
|
|
470
|
-
L:
|
|
471
|
+
L: 400,
|
|
471
472
|
S: this,
|
|
472
473
|
A: [
|
|
473
474
|
"msg.recipient?.equals(this.ownId)",
|
|
@@ -491,7 +492,7 @@ var Connection = class {
|
|
|
491
492
|
msg: msg.data
|
|
492
493
|
}, {
|
|
493
494
|
F: __dxlog_file,
|
|
494
|
-
L:
|
|
495
|
+
L: 409,
|
|
495
496
|
S: this,
|
|
496
497
|
C: (f, a) => f(...a)
|
|
497
498
|
});
|
|
@@ -499,7 +500,7 @@ var Connection = class {
|
|
|
499
500
|
} else {
|
|
500
501
|
invariant(this._transport, "Connection not ready to accept signals.", {
|
|
501
502
|
F: __dxlog_file,
|
|
502
|
-
L:
|
|
503
|
+
L: 412,
|
|
503
504
|
S: this,
|
|
504
505
|
A: [
|
|
505
506
|
"this._transport",
|
|
@@ -512,11 +513,11 @@ var Connection = class {
|
|
|
512
513
|
msg: msg.data
|
|
513
514
|
}, {
|
|
514
515
|
F: __dxlog_file,
|
|
515
|
-
L:
|
|
516
|
+
L: 413,
|
|
516
517
|
S: this,
|
|
517
518
|
C: (f, a) => f(...a)
|
|
518
519
|
});
|
|
519
|
-
await this._transport.
|
|
520
|
+
await this._transport.onSignal(signal);
|
|
520
521
|
}
|
|
521
522
|
}
|
|
522
523
|
}
|
|
@@ -530,13 +531,13 @@ var Connection = class {
|
|
|
530
531
|
peerId: this.ownId
|
|
531
532
|
}, {
|
|
532
533
|
F: __dxlog_file,
|
|
533
|
-
L:
|
|
534
|
+
L: 424,
|
|
534
535
|
S: this,
|
|
535
536
|
C: (f, a) => f(...a)
|
|
536
537
|
});
|
|
537
538
|
invariant(state !== this._state, "Already in this state.", {
|
|
538
539
|
F: __dxlog_file,
|
|
539
|
-
L:
|
|
540
|
+
L: 425,
|
|
540
541
|
S: this,
|
|
541
542
|
A: [
|
|
542
543
|
"state !== this._state",
|
|
@@ -841,7 +842,6 @@ var ConnectionDisplacedError = class extends SystemError {
|
|
|
841
842
|
};
|
|
842
843
|
var CONNECTION_COUNTS_STABLE_AFTER = 5e3;
|
|
843
844
|
var Peer = class {
|
|
844
|
-
// TODO(burdon): Convert to map?
|
|
845
845
|
constructor(id, topic, localPeerId, _signalMessaging, _protocolProvider, _transportFactory, _connectionLimiter, _callbacks) {
|
|
846
846
|
this.id = id;
|
|
847
847
|
this.topic = topic;
|
|
@@ -870,7 +870,7 @@ var Peer = class {
|
|
|
870
870
|
].includes(this.connection.state)) {
|
|
871
871
|
log3.info(`received offer when connection already in ${this.connection.state} state`, void 0, {
|
|
872
872
|
F: __dxlog_file3,
|
|
873
|
-
L:
|
|
873
|
+
L: 114,
|
|
874
874
|
S: this,
|
|
875
875
|
C: (f, a) => f(...a)
|
|
876
876
|
});
|
|
@@ -887,7 +887,7 @@ var Peer = class {
|
|
|
887
887
|
sessionId: this.connection?.sessionId
|
|
888
888
|
}, {
|
|
889
889
|
F: __dxlog_file3,
|
|
890
|
-
L:
|
|
890
|
+
L: 123,
|
|
891
891
|
S: this,
|
|
892
892
|
C: (f, a) => f(...a)
|
|
893
893
|
});
|
|
@@ -904,7 +904,7 @@ var Peer = class {
|
|
|
904
904
|
if (!this.connection) {
|
|
905
905
|
invariant3(message.sessionId, void 0, {
|
|
906
906
|
F: __dxlog_file3,
|
|
907
|
-
L:
|
|
907
|
+
L: 143,
|
|
908
908
|
S: this,
|
|
909
909
|
A: [
|
|
910
910
|
"message.sessionId",
|
|
@@ -925,7 +925,7 @@ var Peer = class {
|
|
|
925
925
|
err
|
|
926
926
|
}, {
|
|
927
927
|
F: __dxlog_file3,
|
|
928
|
-
L:
|
|
928
|
+
L: 153,
|
|
929
929
|
S: this,
|
|
930
930
|
C: (f, a) => f(...a)
|
|
931
931
|
});
|
|
@@ -947,7 +947,7 @@ var Peer = class {
|
|
|
947
947
|
async initiateConnection() {
|
|
948
948
|
invariant3(!this.initiating, "Initiation in progress.", {
|
|
949
949
|
F: __dxlog_file3,
|
|
950
|
-
L:
|
|
950
|
+
L: 170,
|
|
951
951
|
S: this,
|
|
952
952
|
A: [
|
|
953
953
|
"!this.initiating",
|
|
@@ -956,7 +956,7 @@ var Peer = class {
|
|
|
956
956
|
});
|
|
957
957
|
invariant3(!this.connection, "Already connected.", {
|
|
958
958
|
F: __dxlog_file3,
|
|
959
|
-
L:
|
|
959
|
+
L: 171,
|
|
960
960
|
S: this,
|
|
961
961
|
A: [
|
|
962
962
|
"!this.connection",
|
|
@@ -971,7 +971,7 @@ var Peer = class {
|
|
|
971
971
|
sessionId
|
|
972
972
|
}, {
|
|
973
973
|
F: __dxlog_file3,
|
|
974
|
-
L:
|
|
974
|
+
L: 173,
|
|
975
975
|
S: this,
|
|
976
976
|
C: (f, a) => f(...a)
|
|
977
977
|
});
|
|
@@ -997,14 +997,14 @@ var Peer = class {
|
|
|
997
997
|
remoteId: this.id
|
|
998
998
|
}, {
|
|
999
999
|
F: __dxlog_file3,
|
|
1000
|
-
L:
|
|
1000
|
+
L: 190,
|
|
1001
1001
|
S: this,
|
|
1002
1002
|
C: (f, a) => f(...a)
|
|
1003
1003
|
});
|
|
1004
1004
|
if (connection.state !== ConnectionState.INITIAL) {
|
|
1005
1005
|
log3("ignoring response", void 0, {
|
|
1006
1006
|
F: __dxlog_file3,
|
|
1007
|
-
L:
|
|
1007
|
+
L: 192,
|
|
1008
1008
|
S: this,
|
|
1009
1009
|
C: (f, a) => f(...a)
|
|
1010
1010
|
});
|
|
@@ -1018,7 +1018,7 @@ var Peer = class {
|
|
|
1018
1018
|
remoteId: this.id
|
|
1019
1019
|
}, {
|
|
1020
1020
|
F: __dxlog_file3,
|
|
1021
|
-
L:
|
|
1021
|
+
L: 196,
|
|
1022
1022
|
S: this,
|
|
1023
1023
|
C: (f, a) => f(...a)
|
|
1024
1024
|
});
|
|
@@ -1040,7 +1040,7 @@ var Peer = class {
|
|
|
1040
1040
|
remoteId: this.id
|
|
1041
1041
|
}, {
|
|
1042
1042
|
F: __dxlog_file3,
|
|
1043
|
-
L:
|
|
1043
|
+
L: 209,
|
|
1044
1044
|
S: this,
|
|
1045
1045
|
C: (f, a) => f(...a)
|
|
1046
1046
|
});
|
|
@@ -1052,7 +1052,7 @@ var Peer = class {
|
|
|
1052
1052
|
try {
|
|
1053
1053
|
log3("opening connection as initiator", void 0, {
|
|
1054
1054
|
F: __dxlog_file3,
|
|
1055
|
-
L:
|
|
1055
|
+
L: 222,
|
|
1056
1056
|
S: this,
|
|
1057
1057
|
C: (f, a) => f(...a)
|
|
1058
1058
|
});
|
|
@@ -1066,7 +1066,7 @@ var Peer = class {
|
|
|
1066
1066
|
remoteId: this.id
|
|
1067
1067
|
}, {
|
|
1068
1068
|
F: __dxlog_file3,
|
|
1069
|
-
L:
|
|
1069
|
+
L: 226,
|
|
1070
1070
|
S: this,
|
|
1071
1071
|
C: (f, a) => f(...a)
|
|
1072
1072
|
});
|
|
@@ -1074,7 +1074,7 @@ var Peer = class {
|
|
|
1074
1074
|
err
|
|
1075
1075
|
}, {
|
|
1076
1076
|
F: __dxlog_file3,
|
|
1077
|
-
L:
|
|
1077
|
+
L: 233,
|
|
1078
1078
|
S: this,
|
|
1079
1079
|
C: (f, a) => f(...a)
|
|
1080
1080
|
});
|
|
@@ -1097,13 +1097,13 @@ var Peer = class {
|
|
|
1097
1097
|
sessionId
|
|
1098
1098
|
}, {
|
|
1099
1099
|
F: __dxlog_file3,
|
|
1100
|
-
L:
|
|
1100
|
+
L: 247,
|
|
1101
1101
|
S: this,
|
|
1102
1102
|
C: (f, a) => f(...a)
|
|
1103
1103
|
});
|
|
1104
1104
|
invariant3(!this.connection, "Already connected.", {
|
|
1105
1105
|
F: __dxlog_file3,
|
|
1106
|
-
L:
|
|
1106
|
+
L: 254,
|
|
1107
1107
|
S: this,
|
|
1108
1108
|
A: [
|
|
1109
1109
|
"!this.connection",
|
|
@@ -1139,7 +1139,7 @@ var Peer = class {
|
|
|
1139
1139
|
initiator
|
|
1140
1140
|
}, {
|
|
1141
1141
|
F: __dxlog_file3,
|
|
1142
|
-
L:
|
|
1142
|
+
L: 273,
|
|
1143
1143
|
S: this,
|
|
1144
1144
|
C: (f, a) => f(...a)
|
|
1145
1145
|
});
|
|
@@ -1152,14 +1152,14 @@ var Peer = class {
|
|
|
1152
1152
|
initiator
|
|
1153
1153
|
}, {
|
|
1154
1154
|
F: __dxlog_file3,
|
|
1155
|
-
L:
|
|
1155
|
+
L: 282,
|
|
1156
1156
|
S: this,
|
|
1157
1157
|
C: (f, a) => f(...a)
|
|
1158
1158
|
});
|
|
1159
1159
|
this._connectionLimiter.doneConnecting(sessionId);
|
|
1160
1160
|
invariant3(this.connection === connection, "Connection mismatch (race condition).", {
|
|
1161
1161
|
F: __dxlog_file3,
|
|
1162
|
-
L:
|
|
1162
|
+
L: 287,
|
|
1163
1163
|
S: this,
|
|
1164
1164
|
A: [
|
|
1165
1165
|
"this.connection === connection",
|
|
@@ -1174,7 +1174,7 @@ var Peer = class {
|
|
|
1174
1174
|
initiator
|
|
1175
1175
|
}, {
|
|
1176
1176
|
F: __dxlog_file3,
|
|
1177
|
-
L:
|
|
1177
|
+
L: 289,
|
|
1178
1178
|
S: this,
|
|
1179
1179
|
C: (f, a) => f(...a)
|
|
1180
1180
|
});
|
|
@@ -1209,7 +1209,7 @@ var Peer = class {
|
|
|
1209
1209
|
err
|
|
1210
1210
|
}, {
|
|
1211
1211
|
F: __dxlog_file3,
|
|
1212
|
-
L:
|
|
1212
|
+
L: 329,
|
|
1213
1213
|
S: this,
|
|
1214
1214
|
C: (f, a) => f(...a)
|
|
1215
1215
|
});
|
|
@@ -1222,7 +1222,7 @@ var Peer = class {
|
|
|
1222
1222
|
err
|
|
1223
1223
|
}, {
|
|
1224
1224
|
F: __dxlog_file3,
|
|
1225
|
-
L:
|
|
1225
|
+
L: 336,
|
|
1226
1226
|
S: this,
|
|
1227
1227
|
C: (f, a) => f(...a)
|
|
1228
1228
|
});
|
|
@@ -1241,7 +1241,7 @@ var Peer = class {
|
|
|
1241
1241
|
sessionId: connection.sessionId
|
|
1242
1242
|
}, {
|
|
1243
1243
|
F: __dxlog_file3,
|
|
1244
|
-
L:
|
|
1244
|
+
L: 361,
|
|
1245
1245
|
S: this,
|
|
1246
1246
|
C: (f, a) => f(...a)
|
|
1247
1247
|
});
|
|
@@ -1251,7 +1251,7 @@ var Peer = class {
|
|
|
1251
1251
|
sessionId: connection.sessionId
|
|
1252
1252
|
}, {
|
|
1253
1253
|
F: __dxlog_file3,
|
|
1254
|
-
L:
|
|
1254
|
+
L: 367,
|
|
1255
1255
|
S: this,
|
|
1256
1256
|
C: (f, a) => f(...a)
|
|
1257
1257
|
});
|
|
@@ -1262,7 +1262,7 @@ var Peer = class {
|
|
|
1262
1262
|
message
|
|
1263
1263
|
}, {
|
|
1264
1264
|
F: __dxlog_file3,
|
|
1265
|
-
L:
|
|
1265
|
+
L: 372,
|
|
1266
1266
|
S: this,
|
|
1267
1267
|
C: (f, a) => f(...a)
|
|
1268
1268
|
});
|
|
@@ -1277,7 +1277,7 @@ var Peer = class {
|
|
|
1277
1277
|
topic: this.topic
|
|
1278
1278
|
}, {
|
|
1279
1279
|
F: __dxlog_file3,
|
|
1280
|
-
L:
|
|
1280
|
+
L: 382,
|
|
1281
1281
|
S: this,
|
|
1282
1282
|
C: (f, a) => f(...a)
|
|
1283
1283
|
});
|
|
@@ -2619,32 +2619,26 @@ var createStreamDelay = (delay) => {
|
|
|
2619
2619
|
});
|
|
2620
2620
|
};
|
|
2621
2621
|
var MemoryTransportFactory = {
|
|
2622
|
-
createTransport: (
|
|
2622
|
+
createTransport: (options) => new MemoryTransport(options)
|
|
2623
2623
|
};
|
|
2624
2624
|
var MemoryTransport = class _MemoryTransport {
|
|
2625
2625
|
static {
|
|
2626
2626
|
// TODO(burdon): Remove static properties (inject context into constructor).
|
|
2627
2627
|
this._connections = new ComplexMap7(PublicKey9.hash);
|
|
2628
2628
|
}
|
|
2629
|
-
constructor(
|
|
2630
|
-
this.
|
|
2631
|
-
this.closed = new Event7();
|
|
2632
|
-
this.connected = new Event7();
|
|
2633
|
-
this.errors = new ErrorStream3();
|
|
2629
|
+
constructor(_options) {
|
|
2630
|
+
this._options = _options;
|
|
2634
2631
|
this._instanceId = PublicKey9.random();
|
|
2635
2632
|
this._remote = new Trigger();
|
|
2636
2633
|
this._outgoingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY);
|
|
2637
2634
|
this._incomingDelay = createStreamDelay(MEMORY_TRANSPORT_DELAY);
|
|
2638
|
-
this.
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
S: this,
|
|
2643
|
-
C: (f, a) => f(...a)
|
|
2644
|
-
});
|
|
2635
|
+
this._closed = false;
|
|
2636
|
+
this.closed = new Event7();
|
|
2637
|
+
this.connected = new Event7();
|
|
2638
|
+
this.errors = new ErrorStream3();
|
|
2645
2639
|
invariant10(!_MemoryTransport._connections.has(this._instanceId), "Duplicate memory connection", {
|
|
2646
2640
|
F: __dxlog_file11,
|
|
2647
|
-
L:
|
|
2641
|
+
L: 64,
|
|
2648
2642
|
S: this,
|
|
2649
2643
|
A: [
|
|
2650
2644
|
"!MemoryTransport._connections.has(this._instanceId)",
|
|
@@ -2652,41 +2646,52 @@ var MemoryTransport = class _MemoryTransport {
|
|
|
2652
2646
|
]
|
|
2653
2647
|
});
|
|
2654
2648
|
_MemoryTransport._connections.set(this._instanceId, this);
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2649
|
+
}
|
|
2650
|
+
get isOpen() {
|
|
2651
|
+
return !this._closed;
|
|
2652
|
+
}
|
|
2653
|
+
async open() {
|
|
2654
|
+
log10("opening...", void 0, {
|
|
2655
|
+
F: __dxlog_file11,
|
|
2656
|
+
L: 74,
|
|
2657
|
+
S: this,
|
|
2658
|
+
C: (f, a) => f(...a)
|
|
2659
|
+
});
|
|
2660
|
+
if (this._options.initiator) {
|
|
2661
|
+
log10("sending signal", void 0, {
|
|
2662
|
+
F: __dxlog_file11,
|
|
2663
|
+
L: 78,
|
|
2664
|
+
S: this,
|
|
2665
|
+
C: (f, a) => f(...a)
|
|
2666
|
+
});
|
|
2667
|
+
try {
|
|
2668
|
+
await this._options.sendSignal({
|
|
2664
2669
|
payload: {
|
|
2665
2670
|
transportId: this._instanceId.toHex()
|
|
2666
2671
|
}
|
|
2667
|
-
}).catch((err) => {
|
|
2668
|
-
if (!this._destroyed) {
|
|
2669
|
-
this.errors.raise(err);
|
|
2670
|
-
}
|
|
2671
2672
|
});
|
|
2672
|
-
})
|
|
2673
|
+
} catch (err) {
|
|
2674
|
+
if (!this._closed) {
|
|
2675
|
+
this.errors.raise(toError(err));
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2673
2678
|
} else {
|
|
2674
2679
|
this._remote.wait({
|
|
2675
|
-
timeout: this.
|
|
2680
|
+
timeout: this._options.timeout ?? 1e3
|
|
2676
2681
|
}).then((remoteId) => {
|
|
2677
|
-
if (this.
|
|
2682
|
+
if (this._closed) {
|
|
2678
2683
|
return;
|
|
2679
2684
|
}
|
|
2680
2685
|
this._remoteInstanceId = remoteId;
|
|
2681
2686
|
this._remoteConnection = _MemoryTransport._connections.get(this._remoteInstanceId);
|
|
2682
2687
|
if (!this._remoteConnection) {
|
|
2683
|
-
this.
|
|
2688
|
+
this._closed = true;
|
|
2684
2689
|
this.closed.emit();
|
|
2685
2690
|
return;
|
|
2686
2691
|
}
|
|
2687
2692
|
invariant10(!this._remoteConnection._remoteConnection, `Remote already connected: ${this._remoteInstanceId}`, {
|
|
2688
2693
|
F: __dxlog_file11,
|
|
2689
|
-
L:
|
|
2694
|
+
L: 104,
|
|
2690
2695
|
S: this,
|
|
2691
2696
|
A: [
|
|
2692
2697
|
"!this._remoteConnection._remoteConnection",
|
|
@@ -2697,68 +2702,56 @@ var MemoryTransport = class _MemoryTransport {
|
|
|
2697
2702
|
this._remoteConnection._remoteInstanceId = this._instanceId;
|
|
2698
2703
|
log10("connected", void 0, {
|
|
2699
2704
|
F: __dxlog_file11,
|
|
2700
|
-
L:
|
|
2705
|
+
L: 108,
|
|
2701
2706
|
S: this,
|
|
2702
2707
|
C: (f, a) => f(...a)
|
|
2703
2708
|
});
|
|
2704
|
-
this.
|
|
2709
|
+
this._options.stream.pipe(this._outgoingDelay).pipe(this._remoteConnection._options.stream).pipe(this._incomingDelay).pipe(this._options.stream);
|
|
2705
2710
|
this.connected.emit();
|
|
2706
2711
|
this._remoteConnection.connected.emit();
|
|
2707
2712
|
}).catch((err) => {
|
|
2708
|
-
if (this.
|
|
2713
|
+
if (this._closed) {
|
|
2709
2714
|
return;
|
|
2710
2715
|
}
|
|
2711
2716
|
this.errors.raise(err);
|
|
2712
2717
|
});
|
|
2713
2718
|
}
|
|
2714
2719
|
}
|
|
2715
|
-
async
|
|
2716
|
-
log10("closing", void 0, {
|
|
2720
|
+
async close() {
|
|
2721
|
+
log10("closing...", void 0, {
|
|
2717
2722
|
F: __dxlog_file11,
|
|
2718
|
-
L:
|
|
2723
|
+
L: 129,
|
|
2719
2724
|
S: this,
|
|
2720
2725
|
C: (f, a) => f(...a)
|
|
2721
2726
|
});
|
|
2722
|
-
this.
|
|
2727
|
+
this._closed = true;
|
|
2723
2728
|
_MemoryTransport._connections.delete(this._instanceId);
|
|
2724
2729
|
if (this._remoteConnection) {
|
|
2725
|
-
|
|
2726
|
-
F: __dxlog_file11,
|
|
2727
|
-
L: 129,
|
|
2728
|
-
S: this,
|
|
2729
|
-
C: (f, a) => f(...a)
|
|
2730
|
-
});
|
|
2731
|
-
this._remoteConnection._destroyed = true;
|
|
2730
|
+
this._remoteConnection._closed = true;
|
|
2732
2731
|
_MemoryTransport._connections.delete(this._remoteInstanceId);
|
|
2733
|
-
this.
|
|
2734
|
-
this._incomingDelay.unpipe(this._remoteConnection.
|
|
2735
|
-
this._remoteConnection.
|
|
2736
|
-
this._outgoingDelay.unpipe(this.
|
|
2737
|
-
this.
|
|
2732
|
+
this._options.stream.unpipe(this._incomingDelay);
|
|
2733
|
+
this._incomingDelay.unpipe(this._remoteConnection._options.stream);
|
|
2734
|
+
this._remoteConnection._options.stream.unpipe(this._outgoingDelay);
|
|
2735
|
+
this._outgoingDelay.unpipe(this._options.stream);
|
|
2736
|
+
this._options.stream.unpipe(this._outgoingDelay);
|
|
2738
2737
|
this._remoteConnection.closed.emit();
|
|
2739
2738
|
this._remoteConnection._remoteConnection = void 0;
|
|
2740
2739
|
this._remoteConnection = void 0;
|
|
2741
|
-
log10("closed", void 0, {
|
|
2742
|
-
F: __dxlog_file11,
|
|
2743
|
-
L: 150,
|
|
2744
|
-
S: this,
|
|
2745
|
-
C: (f, a) => f(...a)
|
|
2746
|
-
});
|
|
2747
2740
|
}
|
|
2748
2741
|
this.closed.emit();
|
|
2749
2742
|
log10("closed", void 0, {
|
|
2750
2743
|
F: __dxlog_file11,
|
|
2751
|
-
L:
|
|
2744
|
+
L: 157,
|
|
2752
2745
|
S: this,
|
|
2753
2746
|
C: (f, a) => f(...a)
|
|
2754
2747
|
});
|
|
2755
2748
|
}
|
|
2756
|
-
|
|
2749
|
+
async onSignal({ payload }) {
|
|
2757
2750
|
log10("received signal", {
|
|
2758
2751
|
payload
|
|
2759
2752
|
}, {
|
|
2760
2753
|
F: __dxlog_file11,
|
|
2761
|
-
L:
|
|
2754
|
+
L: 161,
|
|
2762
2755
|
S: this,
|
|
2763
2756
|
C: (f, a) => f(...a)
|
|
2764
2757
|
});
|
|
@@ -2789,13 +2782,14 @@ _ts_decorate4([
|
|
|
2789
2782
|
_ts_decorate4([
|
|
2790
2783
|
logInfo3
|
|
2791
2784
|
], MemoryTransport.prototype, "_remoteInstanceId", void 0);
|
|
2785
|
+
var toError = (err) => err instanceof Error ? err : new Error(String(err));
|
|
2792
2786
|
|
|
2793
2787
|
// packages/core/mesh/network-manager/src/transport/transport.ts
|
|
2794
2788
|
var TransportKind;
|
|
2795
2789
|
(function(TransportKind2) {
|
|
2796
2790
|
TransportKind2["SIMPLE_PEER"] = "SIMPLE_PEER";
|
|
2797
|
-
TransportKind2["LIBDATACHANNEL"] = "LIBDATACHANNEL";
|
|
2798
2791
|
TransportKind2["SIMPLE_PEER_PROXY"] = "SIMPLE_PEER_PROXY";
|
|
2792
|
+
TransportKind2["LIBDATACHANNEL"] = "LIBDATACHANNEL";
|
|
2799
2793
|
TransportKind2["MEMORY"] = "MEMORY";
|
|
2800
2794
|
TransportKind2["TCP"] = "TCP";
|
|
2801
2795
|
})(TransportKind || (TransportKind = {}));
|
|
@@ -2818,12 +2812,21 @@ try {
|
|
|
2818
2812
|
|
|
2819
2813
|
// packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts
|
|
2820
2814
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts";
|
|
2815
|
+
var createSimplePeerTransportFactory = (webrtcConfig) => ({
|
|
2816
|
+
createTransport: (options) => new SimplePeerTransport({
|
|
2817
|
+
...options,
|
|
2818
|
+
webrtcConfig
|
|
2819
|
+
})
|
|
2820
|
+
});
|
|
2821
2821
|
var SimplePeerTransport = class {
|
|
2822
|
+
get isOpen() {
|
|
2823
|
+
return this._piped && !this._closed;
|
|
2824
|
+
}
|
|
2822
2825
|
/**
|
|
2823
2826
|
* @params opts.config formatted as per https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection
|
|
2824
2827
|
*/
|
|
2825
|
-
constructor(
|
|
2826
|
-
this.
|
|
2828
|
+
constructor(_params) {
|
|
2829
|
+
this._params = _params;
|
|
2827
2830
|
this._closed = false;
|
|
2828
2831
|
this._piped = false;
|
|
2829
2832
|
this.closed = new Event8();
|
|
@@ -2834,30 +2837,30 @@ var SimplePeerTransport = class {
|
|
|
2834
2837
|
id: this._instanceId
|
|
2835
2838
|
}), {
|
|
2836
2839
|
F: __dxlog_file12,
|
|
2837
|
-
L:
|
|
2840
|
+
L: 50,
|
|
2838
2841
|
S: this,
|
|
2839
2842
|
C: (f, a) => f(...a)
|
|
2840
2843
|
});
|
|
2841
|
-
log11("created connection",
|
|
2844
|
+
log11("created connection", _params, {
|
|
2842
2845
|
F: __dxlog_file12,
|
|
2843
|
-
L:
|
|
2846
|
+
L: 51,
|
|
2844
2847
|
S: this,
|
|
2845
2848
|
C: (f, a) => f(...a)
|
|
2846
2849
|
});
|
|
2847
2850
|
this._peer = new SimplePeerConstructor({
|
|
2848
2851
|
channelName: "dxos.mesh.transport",
|
|
2849
|
-
initiator: this.
|
|
2852
|
+
initiator: this._params.initiator,
|
|
2850
2853
|
wrtc: SimplePeerConstructor.WEBRTC_SUPPORT ? void 0 : wrtc ?? raise2(new Error("wrtc not available")),
|
|
2851
|
-
config: this.
|
|
2854
|
+
config: this._params.webrtcConfig
|
|
2852
2855
|
});
|
|
2853
2856
|
this._peer.on("signal", async (data) => {
|
|
2854
2857
|
log11("signal", data, {
|
|
2855
2858
|
F: __dxlog_file12,
|
|
2856
|
-
L:
|
|
2859
|
+
L: 60,
|
|
2857
2860
|
S: this,
|
|
2858
2861
|
C: (f, a) => f(...a)
|
|
2859
2862
|
});
|
|
2860
|
-
await this.
|
|
2863
|
+
await this._params.sendSignal({
|
|
2861
2864
|
payload: {
|
|
2862
2865
|
data
|
|
2863
2866
|
}
|
|
@@ -2866,22 +2869,22 @@ var SimplePeerTransport = class {
|
|
|
2866
2869
|
this._peer.on("connect", () => {
|
|
2867
2870
|
log11("connected", void 0, {
|
|
2868
2871
|
F: __dxlog_file12,
|
|
2869
|
-
L:
|
|
2872
|
+
L: 65,
|
|
2870
2873
|
S: this,
|
|
2871
2874
|
C: (f, a) => f(...a)
|
|
2872
2875
|
});
|
|
2873
|
-
this.
|
|
2876
|
+
this._params.stream.pipe(this._peer).pipe(this._params.stream);
|
|
2874
2877
|
this._piped = true;
|
|
2875
2878
|
this.connected.emit();
|
|
2876
2879
|
});
|
|
2877
2880
|
this._peer.on("close", async () => {
|
|
2878
2881
|
log11("closed", void 0, {
|
|
2879
2882
|
F: __dxlog_file12,
|
|
2880
|
-
L:
|
|
2883
|
+
L: 72,
|
|
2881
2884
|
S: this,
|
|
2882
2885
|
C: (f, a) => f(...a)
|
|
2883
2886
|
});
|
|
2884
|
-
await this.
|
|
2887
|
+
await this.close();
|
|
2885
2888
|
});
|
|
2886
2889
|
this._peer.on("error", async (err) => {
|
|
2887
2890
|
if (typeof RTCError !== "undefined" && err instanceof RTCError) {
|
|
@@ -2892,7 +2895,7 @@ var SimplePeerTransport = class {
|
|
|
2892
2895
|
err
|
|
2893
2896
|
}, {
|
|
2894
2897
|
F: __dxlog_file12,
|
|
2895
|
-
L:
|
|
2898
|
+
L: 83,
|
|
2896
2899
|
S: this,
|
|
2897
2900
|
C: (f, a) => f(...a)
|
|
2898
2901
|
});
|
|
@@ -2901,7 +2904,7 @@ var SimplePeerTransport = class {
|
|
|
2901
2904
|
} else if ("code" in err) {
|
|
2902
2905
|
log11.info("simple-peer error", err, {
|
|
2903
2906
|
F: __dxlog_file12,
|
|
2904
|
-
L:
|
|
2907
|
+
L: 88,
|
|
2905
2908
|
S: this,
|
|
2906
2909
|
C: (f, a) => f(...a)
|
|
2907
2910
|
});
|
|
@@ -2931,7 +2934,7 @@ var SimplePeerTransport = class {
|
|
|
2931
2934
|
} else {
|
|
2932
2935
|
log11.info("unknown peer connection error", err, {
|
|
2933
2936
|
F: __dxlog_file12,
|
|
2934
|
-
L:
|
|
2937
|
+
L: 114,
|
|
2935
2938
|
S: this,
|
|
2936
2939
|
C: (f, a) => f(...a)
|
|
2937
2940
|
});
|
|
@@ -2941,11 +2944,11 @@ var SimplePeerTransport = class {
|
|
|
2941
2944
|
if (typeof this._peer?._pc?.getStats === "function") {
|
|
2942
2945
|
this._peer._pc.getStats().then((stats) => {
|
|
2943
2946
|
log11.info("report after webrtc error", {
|
|
2944
|
-
config: this.
|
|
2947
|
+
config: this._params.webrtcConfig,
|
|
2945
2948
|
stats: Object.fromEntries(stats.entries())
|
|
2946
2949
|
}, {
|
|
2947
2950
|
F: __dxlog_file12,
|
|
2948
|
-
L:
|
|
2951
|
+
L: 122,
|
|
2949
2952
|
S: this,
|
|
2950
2953
|
C: (f, a) => f(...a)
|
|
2951
2954
|
});
|
|
@@ -2954,18 +2957,18 @@ var SimplePeerTransport = class {
|
|
|
2954
2957
|
} catch (err2) {
|
|
2955
2958
|
log11.catch(err2, void 0, {
|
|
2956
2959
|
F: __dxlog_file12,
|
|
2957
|
-
L:
|
|
2960
|
+
L: 129,
|
|
2958
2961
|
S: this,
|
|
2959
2962
|
C: (f, a) => f(...a)
|
|
2960
2963
|
});
|
|
2961
2964
|
}
|
|
2962
|
-
await this.
|
|
2965
|
+
await this.close();
|
|
2963
2966
|
});
|
|
2964
2967
|
log11.trace("dxos.mesh.webrtc-transport.constructor", trace4.end({
|
|
2965
2968
|
id: this._instanceId
|
|
2966
2969
|
}), {
|
|
2967
2970
|
F: __dxlog_file12,
|
|
2968
|
-
L:
|
|
2971
|
+
L: 135,
|
|
2969
2972
|
S: this,
|
|
2970
2973
|
C: (f, a) => f(...a)
|
|
2971
2974
|
});
|
|
@@ -3023,10 +3026,12 @@ var SimplePeerTransport = class {
|
|
|
3023
3026
|
}
|
|
3024
3027
|
return `${rc.ip}:${rc.port}/${rc.protocol} ${rc.candidateType}`;
|
|
3025
3028
|
}
|
|
3026
|
-
async
|
|
3029
|
+
async open() {
|
|
3030
|
+
}
|
|
3031
|
+
async close() {
|
|
3027
3032
|
log11("closing...", void 0, {
|
|
3028
3033
|
F: __dxlog_file12,
|
|
3029
|
-
L:
|
|
3034
|
+
L: 200,
|
|
3030
3035
|
S: this,
|
|
3031
3036
|
C: (f, a) => f(...a)
|
|
3032
3037
|
});
|
|
@@ -3039,12 +3044,12 @@ var SimplePeerTransport = class {
|
|
|
3039
3044
|
this.closed.emit();
|
|
3040
3045
|
log11("closed", void 0, {
|
|
3041
3046
|
F: __dxlog_file12,
|
|
3042
|
-
L:
|
|
3047
|
+
L: 208,
|
|
3043
3048
|
S: this,
|
|
3044
3049
|
C: (f, a) => f(...a)
|
|
3045
3050
|
});
|
|
3046
3051
|
}
|
|
3047
|
-
|
|
3052
|
+
async onSignal(signal) {
|
|
3048
3053
|
if (this._closed) {
|
|
3049
3054
|
return;
|
|
3050
3055
|
}
|
|
@@ -3053,16 +3058,10 @@ var SimplePeerTransport = class {
|
|
|
3053
3058
|
}
|
|
3054
3059
|
_disconnectStreams() {
|
|
3055
3060
|
if (this._piped) {
|
|
3056
|
-
this.
|
|
3061
|
+
this._params.stream.unpipe?.(this._peer)?.unpipe?.(this._params.stream);
|
|
3057
3062
|
}
|
|
3058
3063
|
}
|
|
3059
3064
|
};
|
|
3060
|
-
var createSimplePeerTransportFactory = (webrtcConfig) => ({
|
|
3061
|
-
createTransport: (params) => new SimplePeerTransport({
|
|
3062
|
-
...params,
|
|
3063
|
-
webrtcConfig
|
|
3064
|
-
})
|
|
3065
|
-
});
|
|
3066
3065
|
|
|
3067
3066
|
// packages/core/mesh/network-manager/src/transport/simplepeer-transport-service.ts
|
|
3068
3067
|
import { Duplex } from "@dxos/node-std/stream";
|
|
@@ -3111,6 +3110,7 @@ var SimplePeerTransportService = class {
|
|
|
3111
3110
|
});
|
|
3112
3111
|
}
|
|
3113
3112
|
});
|
|
3113
|
+
void transport.open();
|
|
3114
3114
|
next({
|
|
3115
3115
|
connection: {
|
|
3116
3116
|
state: ConnectionState3.CONNECTING
|
|
@@ -3154,19 +3154,19 @@ var SimplePeerTransportService = class {
|
|
|
3154
3154
|
async sendSignal({ proxyId, signal }) {
|
|
3155
3155
|
invariant12(this.transports.has(proxyId), void 0, {
|
|
3156
3156
|
F: __dxlog_file13,
|
|
3157
|
-
L:
|
|
3157
|
+
L: 119,
|
|
3158
3158
|
S: this,
|
|
3159
3159
|
A: [
|
|
3160
3160
|
"this.transports.has(proxyId)",
|
|
3161
3161
|
""
|
|
3162
3162
|
]
|
|
3163
3163
|
});
|
|
3164
|
-
await this.transports.get(proxyId).transport.
|
|
3164
|
+
await this.transports.get(proxyId).transport.onSignal(signal);
|
|
3165
3165
|
}
|
|
3166
3166
|
async getDetails({ proxyId }) {
|
|
3167
3167
|
invariant12(this.transports.has(proxyId), void 0, {
|
|
3168
3168
|
F: __dxlog_file13,
|
|
3169
|
-
L:
|
|
3169
|
+
L: 124,
|
|
3170
3170
|
S: this,
|
|
3171
3171
|
A: [
|
|
3172
3172
|
"this.transports.has(proxyId)",
|
|
@@ -3180,7 +3180,7 @@ var SimplePeerTransportService = class {
|
|
|
3180
3180
|
async getStats({ proxyId }) {
|
|
3181
3181
|
invariant12(this.transports.has(proxyId), void 0, {
|
|
3182
3182
|
F: __dxlog_file13,
|
|
3183
|
-
L:
|
|
3183
|
+
L: 129,
|
|
3184
3184
|
S: this,
|
|
3185
3185
|
A: [
|
|
3186
3186
|
"this.transports.has(proxyId)",
|
|
@@ -3195,14 +3195,14 @@ var SimplePeerTransportService = class {
|
|
|
3195
3195
|
if (this.transports.get(proxyId)?.state !== "OPEN") {
|
|
3196
3196
|
log12.debug("transport is closed", void 0, {
|
|
3197
3197
|
F: __dxlog_file13,
|
|
3198
|
-
L:
|
|
3198
|
+
L: 135,
|
|
3199
3199
|
S: this,
|
|
3200
3200
|
C: (f, a) => f(...a)
|
|
3201
3201
|
});
|
|
3202
3202
|
}
|
|
3203
3203
|
invariant12(this.transports.has(proxyId), void 0, {
|
|
3204
3204
|
F: __dxlog_file13,
|
|
3205
|
-
L:
|
|
3205
|
+
L: 137,
|
|
3206
3206
|
S: this,
|
|
3207
3207
|
A: [
|
|
3208
3208
|
"this.transports.has(proxyId)",
|
|
@@ -3218,14 +3218,14 @@ var SimplePeerTransportService = class {
|
|
|
3218
3218
|
}
|
|
3219
3219
|
}
|
|
3220
3220
|
async close({ proxyId }) {
|
|
3221
|
-
await this.transports.get(proxyId)?.transport.
|
|
3221
|
+
await this.transports.get(proxyId)?.transport.close();
|
|
3222
3222
|
await this.transports.get(proxyId)?.stream.end();
|
|
3223
3223
|
if (this.transports.get(proxyId)) {
|
|
3224
3224
|
this.transports.get(proxyId).state = "CLOSED";
|
|
3225
3225
|
}
|
|
3226
3226
|
log12("Closed.", void 0, {
|
|
3227
3227
|
F: __dxlog_file13,
|
|
3228
|
-
L:
|
|
3228
|
+
L: 153,
|
|
3229
3229
|
S: this,
|
|
3230
3230
|
C: (f, a) => f(...a)
|
|
3231
3231
|
});
|
|
@@ -3244,11 +3244,12 @@ import { ConnectionResetError as ConnectionResetError3, TimeoutError as TimeoutE
|
|
|
3244
3244
|
import { ConnectionState as ConnectionState4 } from "@dxos/protocols/proto/dxos/mesh/bridge";
|
|
3245
3245
|
import { arrayToBuffer } from "@dxos/util";
|
|
3246
3246
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport-proxy.ts";
|
|
3247
|
+
var RPC_TIMEOUT = 1e4;
|
|
3247
3248
|
var RESP_MIN_THRESHOLD = 500;
|
|
3248
3249
|
var TIMEOUT_THRESHOLD = 10;
|
|
3249
3250
|
var SimplePeerTransportProxy = class {
|
|
3250
|
-
constructor(
|
|
3251
|
-
this.
|
|
3251
|
+
constructor(_options) {
|
|
3252
|
+
this._options = _options;
|
|
3252
3253
|
this._proxyId = PublicKey12.random();
|
|
3253
3254
|
this._ctx = new Context6();
|
|
3254
3255
|
this._timeoutCount = 0;
|
|
@@ -3256,15 +3257,22 @@ var SimplePeerTransportProxy = class {
|
|
|
3256
3257
|
this.connected = new Event9();
|
|
3257
3258
|
this.errors = new ErrorStream5();
|
|
3258
3259
|
this._closed = false;
|
|
3259
|
-
|
|
3260
|
+
}
|
|
3261
|
+
get isOpen() {
|
|
3262
|
+
return !this._closed;
|
|
3263
|
+
}
|
|
3264
|
+
async open() {
|
|
3265
|
+
this._serviceStream = this._options.bridgeService.open({
|
|
3260
3266
|
proxyId: this._proxyId,
|
|
3261
|
-
initiator: this.
|
|
3267
|
+
initiator: this._options.initiator
|
|
3268
|
+
}, {
|
|
3269
|
+
timeout: RPC_TIMEOUT
|
|
3262
3270
|
});
|
|
3263
3271
|
this._serviceStream.waitUntilReady().then(() => {
|
|
3264
3272
|
this._serviceStream.subscribe(async (event) => {
|
|
3265
3273
|
log13("SimplePeerTransportProxy: event", event, {
|
|
3266
3274
|
F: __dxlog_file14,
|
|
3267
|
-
L:
|
|
3275
|
+
L: 66,
|
|
3268
3276
|
S: this,
|
|
3269
3277
|
C: (f, a) => f(...a)
|
|
3270
3278
|
});
|
|
@@ -3279,16 +3287,16 @@ var SimplePeerTransportProxy = class {
|
|
|
3279
3287
|
const proxyStream = new Writable({
|
|
3280
3288
|
write: (chunk, _, callback) => {
|
|
3281
3289
|
const then = performance.now();
|
|
3282
|
-
this.
|
|
3290
|
+
this._options.bridgeService.sendData({
|
|
3283
3291
|
proxyId: this._proxyId,
|
|
3284
3292
|
payload: chunk
|
|
3285
3293
|
}, {
|
|
3286
|
-
timeout:
|
|
3294
|
+
timeout: RPC_TIMEOUT
|
|
3287
3295
|
}).then(() => {
|
|
3288
3296
|
if (performance.now() - then > RESP_MIN_THRESHOLD) {
|
|
3289
3297
|
log13("slow response, delaying callback", void 0, {
|
|
3290
3298
|
F: __dxlog_file14,
|
|
3291
|
-
L:
|
|
3299
|
+
L: 90,
|
|
3292
3300
|
S: this,
|
|
3293
3301
|
C: (f, a) => f(...a)
|
|
3294
3302
|
});
|
|
@@ -3300,11 +3308,11 @@ var SimplePeerTransportProxy = class {
|
|
|
3300
3308
|
}, (err) => {
|
|
3301
3309
|
if (err instanceof TimeoutError3 || err.constructor.name === "TimeoutError") {
|
|
3302
3310
|
if (this._timeoutCount++ > TIMEOUT_THRESHOLD) {
|
|
3303
|
-
throw new TimeoutError3(`too many
|
|
3311
|
+
throw new TimeoutError3(`too many timeouts (${this._timeoutCount} > ${TIMEOUT_THRESHOLD}`);
|
|
3304
3312
|
} else {
|
|
3305
3313
|
log13("timeout error, but still invoking callback", void 0, {
|
|
3306
3314
|
F: __dxlog_file14,
|
|
3307
|
-
L:
|
|
3315
|
+
L: 102,
|
|
3308
3316
|
S: this,
|
|
3309
3317
|
C: (f, a) => f(...a)
|
|
3310
3318
|
});
|
|
@@ -3313,7 +3321,7 @@ var SimplePeerTransportProxy = class {
|
|
|
3313
3321
|
} else {
|
|
3314
3322
|
log13.catch(err, void 0, {
|
|
3315
3323
|
F: __dxlog_file14,
|
|
3316
|
-
L:
|
|
3324
|
+
L: 106,
|
|
3317
3325
|
S: this,
|
|
3318
3326
|
C: (f, a) => f(...a)
|
|
3319
3327
|
});
|
|
@@ -3326,19 +3334,50 @@ var SimplePeerTransportProxy = class {
|
|
|
3326
3334
|
err
|
|
3327
3335
|
}, {
|
|
3328
3336
|
F: __dxlog_file14,
|
|
3329
|
-
L:
|
|
3337
|
+
L: 114,
|
|
3330
3338
|
S: this,
|
|
3331
3339
|
C: (f, a) => f(...a)
|
|
3332
3340
|
});
|
|
3333
3341
|
});
|
|
3334
|
-
this.
|
|
3342
|
+
this._options.stream.pipe(proxyStream);
|
|
3335
3343
|
}, (error) => log13.catch(error, void 0, {
|
|
3336
3344
|
F: __dxlog_file14,
|
|
3337
|
-
L:
|
|
3345
|
+
L: 119,
|
|
3338
3346
|
S: this,
|
|
3339
3347
|
C: (f, a) => f(...a)
|
|
3340
3348
|
}));
|
|
3341
3349
|
}
|
|
3350
|
+
async close() {
|
|
3351
|
+
await this._ctx.dispose();
|
|
3352
|
+
if (this._closed) {
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
await this._serviceStream.close();
|
|
3356
|
+
try {
|
|
3357
|
+
await this._options.bridgeService.close({
|
|
3358
|
+
proxyId: this._proxyId
|
|
3359
|
+
}, {
|
|
3360
|
+
timeout: RPC_TIMEOUT
|
|
3361
|
+
});
|
|
3362
|
+
} catch (err) {
|
|
3363
|
+
log13.catch(err, void 0, {
|
|
3364
|
+
F: __dxlog_file14,
|
|
3365
|
+
L: 134,
|
|
3366
|
+
S: this,
|
|
3367
|
+
C: (f, a) => f(...a)
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
this.closed.emit();
|
|
3371
|
+
this._closed = true;
|
|
3372
|
+
}
|
|
3373
|
+
async onSignal(signal) {
|
|
3374
|
+
this._options.bridgeService.sendSignal({
|
|
3375
|
+
proxyId: this._proxyId,
|
|
3376
|
+
signal
|
|
3377
|
+
}, {
|
|
3378
|
+
timeout: RPC_TIMEOUT
|
|
3379
|
+
}).catch((err) => this.errors.raise(decodeError(err)));
|
|
3380
|
+
}
|
|
3342
3381
|
async _handleConnection(connectionEvent) {
|
|
3343
3382
|
if (connectionEvent.error) {
|
|
3344
3383
|
this.errors.raise(decodeError(connectionEvent.error));
|
|
@@ -3349,55 +3388,31 @@ var SimplePeerTransportProxy = class {
|
|
|
3349
3388
|
break;
|
|
3350
3389
|
}
|
|
3351
3390
|
case ConnectionState4.CLOSED: {
|
|
3352
|
-
await this.
|
|
3391
|
+
await this.close();
|
|
3353
3392
|
break;
|
|
3354
3393
|
}
|
|
3355
3394
|
}
|
|
3356
3395
|
}
|
|
3357
3396
|
_handleData(dataEvent) {
|
|
3358
|
-
this.
|
|
3397
|
+
this._options.stream.write(arrayToBuffer(dataEvent.payload));
|
|
3359
3398
|
}
|
|
3360
3399
|
async _handleSignal(signalEvent) {
|
|
3361
|
-
await this.
|
|
3362
|
-
}
|
|
3363
|
-
signal(signal) {
|
|
3364
|
-
this._params.bridgeService.sendSignal({
|
|
3365
|
-
proxyId: this._proxyId,
|
|
3366
|
-
signal
|
|
3367
|
-
}).catch((err) => this.errors.raise(decodeError(err)));
|
|
3400
|
+
await this._options.sendSignal(signalEvent.payload);
|
|
3368
3401
|
}
|
|
3369
3402
|
async getDetails() {
|
|
3370
|
-
return (await this.
|
|
3403
|
+
return (await this._options.bridgeService.getDetails({
|
|
3371
3404
|
proxyId: this._proxyId
|
|
3405
|
+
}, {
|
|
3406
|
+
timeout: RPC_TIMEOUT
|
|
3372
3407
|
})).details;
|
|
3373
3408
|
}
|
|
3374
3409
|
async getStats() {
|
|
3375
|
-
return (await this.
|
|
3410
|
+
return (await this._options.bridgeService.getStats({
|
|
3376
3411
|
proxyId: this._proxyId
|
|
3412
|
+
}, {
|
|
3413
|
+
timeout: RPC_TIMEOUT
|
|
3377
3414
|
})).stats;
|
|
3378
3415
|
}
|
|
3379
|
-
// TODO(burdon): Move open from constructor.
|
|
3380
|
-
async destroy() {
|
|
3381
|
-
await this._ctx.dispose();
|
|
3382
|
-
if (this._closed) {
|
|
3383
|
-
return;
|
|
3384
|
-
}
|
|
3385
|
-
await this._serviceStream.close();
|
|
3386
|
-
try {
|
|
3387
|
-
await this._params.bridgeService.close({
|
|
3388
|
-
proxyId: this._proxyId
|
|
3389
|
-
});
|
|
3390
|
-
} catch (err) {
|
|
3391
|
-
log13.catch(err, void 0, {
|
|
3392
|
-
F: __dxlog_file14,
|
|
3393
|
-
L: 171,
|
|
3394
|
-
S: this,
|
|
3395
|
-
C: (f, a) => f(...a)
|
|
3396
|
-
});
|
|
3397
|
-
}
|
|
3398
|
-
this.closed.emit();
|
|
3399
|
-
this._closed = true;
|
|
3400
|
-
}
|
|
3401
3416
|
/**
|
|
3402
3417
|
* Called when underlying proxy service becomes unavailable.
|
|
3403
3418
|
*/
|
|
@@ -3426,7 +3441,7 @@ var SimplePeerTransportProxyFactory = class {
|
|
|
3426
3441
|
createTransport(options) {
|
|
3427
3442
|
invariant13(this._bridgeService, "SimplePeerTransportProxyFactory is not ready to open connections", {
|
|
3428
3443
|
F: __dxlog_file14,
|
|
3429
|
-
L:
|
|
3444
|
+
L: 218,
|
|
3430
3445
|
S: this,
|
|
3431
3446
|
A: [
|
|
3432
3447
|
"this._bridgeService",
|
|
@@ -3463,6 +3478,7 @@ var decodeError = (err) => {
|
|
|
3463
3478
|
import { Duplex as Duplex2 } from "stream";
|
|
3464
3479
|
import { Event as Event10, Trigger as Trigger2, synchronized as synchronized4 } from "@dxos/async";
|
|
3465
3480
|
import { ErrorStream as ErrorStream6 } from "@dxos/debug";
|
|
3481
|
+
import { invariant as invariant14 } from "@dxos/invariant";
|
|
3466
3482
|
import { log as log14 } from "@dxos/log";
|
|
3467
3483
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
3468
3484
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3478,163 +3494,203 @@ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-man
|
|
|
3478
3494
|
var DATACHANNEL_LABEL = "dxos.mesh.transport";
|
|
3479
3495
|
var MAX_BUFFERED_AMOUNT = 64 * 1024;
|
|
3480
3496
|
var MAX_MESSAGE_SIZE = 64 * 1024;
|
|
3497
|
+
var createLibDataChannelTransportFactory = (webrtcConfig) => ({
|
|
3498
|
+
createTransport: (options) => new LibDataChannelTransport({
|
|
3499
|
+
...options,
|
|
3500
|
+
webrtcConfig
|
|
3501
|
+
})
|
|
3502
|
+
});
|
|
3481
3503
|
var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
3482
3504
|
static {
|
|
3483
3505
|
this._instanceCount = 0;
|
|
3484
3506
|
}
|
|
3485
|
-
constructor(
|
|
3486
|
-
this.
|
|
3507
|
+
constructor(_options) {
|
|
3508
|
+
this._options = _options;
|
|
3487
3509
|
this._closed = false;
|
|
3488
|
-
this.closed = new Event10();
|
|
3489
3510
|
this._connected = false;
|
|
3511
|
+
this._writeCallback = null;
|
|
3512
|
+
this._readyForCandidates = new Trigger2();
|
|
3513
|
+
this.closed = new Event10();
|
|
3490
3514
|
this.connected = new Event10();
|
|
3491
3515
|
this.errors = new ErrorStream6();
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
this._peer
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3516
|
+
}
|
|
3517
|
+
get isOpen() {
|
|
3518
|
+
return !!this._peer && !this._closed;
|
|
3519
|
+
}
|
|
3520
|
+
async open() {
|
|
3521
|
+
if (this._closed) {
|
|
3522
|
+
this.errors.raise(new Error("connection already closed"));
|
|
3523
|
+
}
|
|
3524
|
+
const { RTCPeerConnection } = (await importESM("node-datachannel/polyfill")).default;
|
|
3525
|
+
if (this._options.webrtcConfig) {
|
|
3526
|
+
this._options.webrtcConfig.iceServers = this._options.webrtcConfig.iceServers ?? [];
|
|
3527
|
+
} else {
|
|
3528
|
+
this._options.webrtcConfig = {
|
|
3529
|
+
iceServers: []
|
|
3530
|
+
};
|
|
3531
|
+
}
|
|
3532
|
+
this._peer = new RTCPeerConnection(this._options.webrtcConfig);
|
|
3533
|
+
this._peer.onicecandidateerror = (event) => {
|
|
3534
|
+
log14.error("peer.onicecandidateerror", {
|
|
3535
|
+
event
|
|
3536
|
+
}, {
|
|
3537
|
+
F: __dxlog_file15,
|
|
3538
|
+
L: 77,
|
|
3539
|
+
S: this,
|
|
3540
|
+
C: (f, a) => f(...a)
|
|
3541
|
+
});
|
|
3542
|
+
};
|
|
3543
|
+
this._peer.onconnectionstatechange = (event) => {
|
|
3544
|
+
log14.debug("peer.onconnectionstatechange", {
|
|
3545
|
+
event,
|
|
3546
|
+
peerConnectionState: this._peer?.connectionState,
|
|
3547
|
+
transportConnectionState: this._connected
|
|
3548
|
+
}, {
|
|
3549
|
+
F: __dxlog_file15,
|
|
3550
|
+
L: 81,
|
|
3551
|
+
S: this,
|
|
3552
|
+
C: (f, a) => f(...a)
|
|
3553
|
+
});
|
|
3554
|
+
};
|
|
3555
|
+
this._peer.onicecandidate = async (event) => {
|
|
3556
|
+
log14.debug("peer.onicecandidate", {
|
|
3557
|
+
event
|
|
3558
|
+
}, {
|
|
3559
|
+
F: __dxlog_file15,
|
|
3560
|
+
L: 91,
|
|
3561
|
+
S: this,
|
|
3562
|
+
C: (f, a) => f(...a)
|
|
3563
|
+
});
|
|
3564
|
+
if (event.candidate) {
|
|
3565
|
+
try {
|
|
3566
|
+
await this._options.sendSignal({
|
|
3567
|
+
payload: {
|
|
3568
|
+
data: {
|
|
3569
|
+
type: "candidate",
|
|
3570
|
+
candidate: {
|
|
3571
|
+
candidate: event.candidate.candidate,
|
|
3572
|
+
// These fields never seem to be not null, but connecting to Chrome doesn't work if they are.
|
|
3573
|
+
sdpMLineIndex: event.candidate.sdpMLineIndex ?? 0,
|
|
3574
|
+
sdpMid: event.candidate.sdpMid ?? 0
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
} catch (err) {
|
|
3580
|
+
log14.info("signaling error", {
|
|
3581
|
+
err
|
|
3582
|
+
}, {
|
|
3583
|
+
F: __dxlog_file15,
|
|
3584
|
+
L: 108,
|
|
3585
|
+
S: this,
|
|
3586
|
+
C: (f, a) => f(...a)
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3505
3589
|
}
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3590
|
+
};
|
|
3591
|
+
if (this._options.initiator) {
|
|
3592
|
+
invariant14(this._peer, "not open", {
|
|
3593
|
+
F: __dxlog_file15,
|
|
3594
|
+
L: 114,
|
|
3595
|
+
S: this,
|
|
3596
|
+
A: [
|
|
3597
|
+
"this._peer",
|
|
3598
|
+
"'not open'"
|
|
3599
|
+
]
|
|
3600
|
+
});
|
|
3601
|
+
this._peer.createOffer().then(async (offer) => {
|
|
3602
|
+
if (this._closed) {
|
|
3603
|
+
return;
|
|
3604
|
+
}
|
|
3605
|
+
if (this._peer?.connectionState !== "connecting") {
|
|
3606
|
+
log14.error("peer not connecting", {
|
|
3607
|
+
peer: this._peer
|
|
3608
|
+
}, {
|
|
3609
|
+
F: __dxlog_file15,
|
|
3610
|
+
L: 125,
|
|
3611
|
+
S: this,
|
|
3612
|
+
C: (f, a) => f(...a)
|
|
3613
|
+
});
|
|
3614
|
+
this.errors.raise(new Error("invalid state: peer is initiator, but other peer not in state connecting"));
|
|
3615
|
+
}
|
|
3616
|
+
log14.debug("creating offer", {
|
|
3617
|
+
peer: this._peer,
|
|
3618
|
+
offer
|
|
3511
3619
|
}, {
|
|
3512
3620
|
F: __dxlog_file15,
|
|
3513
|
-
L:
|
|
3621
|
+
L: 129,
|
|
3514
3622
|
S: this,
|
|
3515
3623
|
C: (f, a) => f(...a)
|
|
3516
3624
|
});
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
L: 67,
|
|
3526
|
-
S: this,
|
|
3527
|
-
C: (f, a) => f(...a)
|
|
3625
|
+
await this._peer.setLocalDescription(offer);
|
|
3626
|
+
await this._options.sendSignal({
|
|
3627
|
+
payload: {
|
|
3628
|
+
data: {
|
|
3629
|
+
type: offer.type,
|
|
3630
|
+
sdp: offer.sdp
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3528
3633
|
});
|
|
3634
|
+
}).catch((err) => {
|
|
3635
|
+
this.errors.raise(err);
|
|
3636
|
+
});
|
|
3637
|
+
this._handleChannel(this._peer.createDataChannel(DATACHANNEL_LABEL));
|
|
3638
|
+
log14.debug("created data channel", void 0, {
|
|
3639
|
+
F: __dxlog_file15,
|
|
3640
|
+
L: 139,
|
|
3641
|
+
S: this,
|
|
3642
|
+
C: (f, a) => f(...a)
|
|
3643
|
+
});
|
|
3644
|
+
this._peer.ondatachannel = () => {
|
|
3645
|
+
this.errors.raise(new Error("unexpected ondatachannel event for initiator"));
|
|
3529
3646
|
};
|
|
3530
|
-
|
|
3531
|
-
|
|
3647
|
+
} else {
|
|
3648
|
+
this._peer.ondatachannel = (event) => {
|
|
3649
|
+
log14.debug("peer.ondatachannel (non-initiator)", {
|
|
3532
3650
|
event
|
|
3533
3651
|
}, {
|
|
3534
3652
|
F: __dxlog_file15,
|
|
3535
|
-
L:
|
|
3653
|
+
L: 145,
|
|
3536
3654
|
S: this,
|
|
3537
3655
|
C: (f, a) => f(...a)
|
|
3538
3656
|
});
|
|
3539
|
-
if (event.
|
|
3540
|
-
|
|
3541
|
-
await params.sendSignal({
|
|
3542
|
-
payload: {
|
|
3543
|
-
data: {
|
|
3544
|
-
type: "candidate",
|
|
3545
|
-
candidate: {
|
|
3546
|
-
candidate: event.candidate.candidate,
|
|
3547
|
-
// these fields never seem to be not null, but connecting to Chrome doesn't work if they are
|
|
3548
|
-
sdpMLineIndex: event.candidate.sdpMLineIndex ?? 0,
|
|
3549
|
-
sdpMid: event.candidate.sdpMid ?? 0
|
|
3550
|
-
}
|
|
3551
|
-
}
|
|
3552
|
-
}
|
|
3553
|
-
});
|
|
3554
|
-
} catch (err) {
|
|
3555
|
-
log14.info("signaling errror", {
|
|
3556
|
-
err
|
|
3557
|
-
}, {
|
|
3558
|
-
F: __dxlog_file15,
|
|
3559
|
-
L: 93,
|
|
3560
|
-
S: this,
|
|
3561
|
-
C: (f, a) => f(...a)
|
|
3562
|
-
});
|
|
3563
|
-
}
|
|
3657
|
+
if (event.channel.label !== DATACHANNEL_LABEL) {
|
|
3658
|
+
this.errors.raise(new Error(`unexpected channel label ${event.channel.label}`));
|
|
3564
3659
|
}
|
|
3660
|
+
this._handleChannel(event.channel);
|
|
3565
3661
|
};
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
}, {
|
|
3575
|
-
F: __dxlog_file15,
|
|
3576
|
-
L: 106,
|
|
3577
|
-
S: this,
|
|
3578
|
-
C: (f, a) => f(...a)
|
|
3579
|
-
});
|
|
3580
|
-
this.errors.raise(new Error("invalid state: peer is initiator, but other peer not in state connecting"));
|
|
3581
|
-
}
|
|
3582
|
-
log14.debug(`im the initiator, creating offer, peer is in state ${peer.connectionState}`, {
|
|
3583
|
-
offer
|
|
3584
|
-
}, {
|
|
3585
|
-
F: __dxlog_file15,
|
|
3586
|
-
L: 109,
|
|
3587
|
-
S: this,
|
|
3588
|
-
C: (f, a) => f(...a)
|
|
3589
|
-
});
|
|
3590
|
-
await peer.setLocalDescription(offer);
|
|
3591
|
-
await params.sendSignal({
|
|
3592
|
-
payload: {
|
|
3593
|
-
data: {
|
|
3594
|
-
type: offer.type,
|
|
3595
|
-
sdp: offer.sdp
|
|
3596
|
-
}
|
|
3597
|
-
}
|
|
3598
|
-
});
|
|
3599
|
-
return offer;
|
|
3600
|
-
}).catch((err) => {
|
|
3601
|
-
this.errors.raise(err);
|
|
3602
|
-
});
|
|
3603
|
-
this.handleChannel(peer.createDataChannel(DATACHANNEL_LABEL));
|
|
3604
|
-
log14.debug("created data channel", void 0, {
|
|
3605
|
-
F: __dxlog_file15,
|
|
3606
|
-
L: 118,
|
|
3607
|
-
S: this,
|
|
3608
|
-
C: (f, a) => f(...a)
|
|
3609
|
-
});
|
|
3610
|
-
peer.ondatachannel = (event) => {
|
|
3611
|
-
this.errors.raise(new Error("got ondatachannel when i am the initiator?"));
|
|
3612
|
-
};
|
|
3613
|
-
} else {
|
|
3614
|
-
peer.ondatachannel = (event) => {
|
|
3615
|
-
log14.debug("peer.ondatachannel (non-initiator)", {
|
|
3616
|
-
event
|
|
3617
|
-
}, {
|
|
3618
|
-
F: __dxlog_file15,
|
|
3619
|
-
L: 124,
|
|
3620
|
-
S: this,
|
|
3621
|
-
C: (f, a) => f(...a)
|
|
3622
|
-
});
|
|
3623
|
-
if (event.channel.label !== DATACHANNEL_LABEL) {
|
|
3624
|
-
this.errors.raise(new Error(`unexpected channel label ${event.channel.label}`));
|
|
3625
|
-
}
|
|
3626
|
-
this.handleChannel(event.channel);
|
|
3627
|
-
};
|
|
3628
|
-
}
|
|
3629
|
-
return peer;
|
|
3630
|
-
})();
|
|
3662
|
+
}
|
|
3663
|
+
_LibDataChannelTransport._instanceCount++;
|
|
3664
|
+
}
|
|
3665
|
+
async close() {
|
|
3666
|
+
await this._close();
|
|
3667
|
+
if (--_LibDataChannelTransport._instanceCount === 0) {
|
|
3668
|
+
(await importESM("node-datachannel")).cleanup();
|
|
3669
|
+
}
|
|
3631
3670
|
}
|
|
3632
|
-
|
|
3671
|
+
async _close() {
|
|
3672
|
+
if (this._closed) {
|
|
3673
|
+
return;
|
|
3674
|
+
}
|
|
3675
|
+
await this._disconnectStreams();
|
|
3676
|
+
try {
|
|
3677
|
+
this._peer?.close();
|
|
3678
|
+
} catch (err) {
|
|
3679
|
+
this.errors.raise(err);
|
|
3680
|
+
}
|
|
3681
|
+
this._peer = void 0;
|
|
3682
|
+
this._closed = true;
|
|
3683
|
+
this.closed.emit();
|
|
3684
|
+
}
|
|
3685
|
+
/**
|
|
3686
|
+
* Handle data channel events.
|
|
3687
|
+
*/
|
|
3688
|
+
_handleChannel(dataChannel) {
|
|
3633
3689
|
this._channel = dataChannel;
|
|
3634
3690
|
this._channel.onopen = () => {
|
|
3635
|
-
log14.debug("
|
|
3691
|
+
log14.debug("channel.onopen", void 0, {
|
|
3636
3692
|
F: __dxlog_file15,
|
|
3637
|
-
L:
|
|
3693
|
+
L: 190,
|
|
3638
3694
|
S: this,
|
|
3639
3695
|
C: (f, a) => f(...a)
|
|
3640
3696
|
});
|
|
@@ -3653,9 +3709,9 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3653
3709
|
}
|
|
3654
3710
|
if (this._channel.bufferedAmount > MAX_BUFFERED_AMOUNT) {
|
|
3655
3711
|
if (this._writeCallback !== null) {
|
|
3656
|
-
log14.error("consumer trying to write before we
|
|
3712
|
+
log14.error("consumer trying to write before we are ready for more data", void 0, {
|
|
3657
3713
|
F: __dxlog_file15,
|
|
3658
|
-
L:
|
|
3714
|
+
L: 207,
|
|
3659
3715
|
S: this,
|
|
3660
3716
|
C: (f, a) => f(...a)
|
|
3661
3717
|
});
|
|
@@ -3666,26 +3722,31 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3666
3722
|
}
|
|
3667
3723
|
}
|
|
3668
3724
|
});
|
|
3669
|
-
duplex.pipe(this.
|
|
3725
|
+
duplex.pipe(this._options.stream).pipe(duplex);
|
|
3670
3726
|
this._stream = duplex;
|
|
3671
3727
|
this._connected = true;
|
|
3672
3728
|
this.connected.emit();
|
|
3673
3729
|
};
|
|
3674
|
-
this._channel.onerror = async (err) => {
|
|
3675
|
-
this.errors.raise(new Error("channel error: " + err.toString()));
|
|
3676
|
-
await this._close();
|
|
3677
|
-
};
|
|
3678
3730
|
this._channel.onclose = async (err) => {
|
|
3679
|
-
log14.info("channel
|
|
3731
|
+
log14.info("channel.onclose", {
|
|
3680
3732
|
err
|
|
3681
3733
|
}, {
|
|
3682
3734
|
F: __dxlog_file15,
|
|
3683
|
-
L:
|
|
3735
|
+
L: 223,
|
|
3684
3736
|
S: this,
|
|
3685
3737
|
C: (f, a) => f(...a)
|
|
3686
3738
|
});
|
|
3687
3739
|
await this._close();
|
|
3688
3740
|
};
|
|
3741
|
+
this._channel.onerror = async (err) => {
|
|
3742
|
+
this.errors.raise(new Error("channel error: " + err.toString()));
|
|
3743
|
+
await this._close();
|
|
3744
|
+
};
|
|
3745
|
+
this._channel.onbufferedamountlow = () => {
|
|
3746
|
+
const cb = this._writeCallback;
|
|
3747
|
+
this._writeCallback = null;
|
|
3748
|
+
cb?.();
|
|
3749
|
+
};
|
|
3689
3750
|
this._channel.onmessage = (event) => {
|
|
3690
3751
|
let data = event.data;
|
|
3691
3752
|
if (data instanceof ArrayBuffer) {
|
|
@@ -3693,37 +3754,27 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3693
3754
|
}
|
|
3694
3755
|
this._stream.push(data);
|
|
3695
3756
|
};
|
|
3696
|
-
this._channel.onbufferedamountlow = () => {
|
|
3697
|
-
const cb = this._writeCallback;
|
|
3698
|
-
this._writeCallback = null;
|
|
3699
|
-
cb?.();
|
|
3700
|
-
};
|
|
3701
3757
|
}
|
|
3702
|
-
async
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3758
|
+
async onSignal(signal) {
|
|
3759
|
+
invariant14(this._peer, "not open", {
|
|
3760
|
+
F: __dxlog_file15,
|
|
3761
|
+
L: 249,
|
|
3762
|
+
S: this,
|
|
3763
|
+
A: [
|
|
3764
|
+
"this._peer",
|
|
3765
|
+
"'not open'"
|
|
3766
|
+
]
|
|
3767
|
+
});
|
|
3708
3768
|
try {
|
|
3709
|
-
peer.close();
|
|
3710
|
-
} catch (err) {
|
|
3711
|
-
this.errors.raise(err);
|
|
3712
|
-
}
|
|
3713
|
-
this._closed = true;
|
|
3714
|
-
this.closed.emit();
|
|
3715
|
-
}
|
|
3716
|
-
signal(signal) {
|
|
3717
|
-
this._peer.then(async (peer) => {
|
|
3718
3769
|
const data = signal.payload.data;
|
|
3719
3770
|
switch (data.type) {
|
|
3720
3771
|
case "offer": {
|
|
3721
|
-
if (
|
|
3772
|
+
if (this._peer.connectionState !== "new") {
|
|
3722
3773
|
log14.error("received offer but peer not in state new", {
|
|
3723
|
-
peer
|
|
3774
|
+
peer: this._peer
|
|
3724
3775
|
}, {
|
|
3725
3776
|
F: __dxlog_file15,
|
|
3726
|
-
L:
|
|
3777
|
+
L: 256,
|
|
3727
3778
|
S: this,
|
|
3728
3779
|
C: (f, a) => f(...a)
|
|
3729
3780
|
});
|
|
@@ -3731,13 +3782,13 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3731
3782
|
break;
|
|
3732
3783
|
}
|
|
3733
3784
|
try {
|
|
3734
|
-
await
|
|
3785
|
+
await this._peer.setRemoteDescription({
|
|
3735
3786
|
type: data.type,
|
|
3736
3787
|
sdp: data.sdp
|
|
3737
3788
|
});
|
|
3738
|
-
const answer = await
|
|
3739
|
-
await
|
|
3740
|
-
await this.
|
|
3789
|
+
const answer = await this._peer.createAnswer();
|
|
3790
|
+
await this._peer.setLocalDescription(answer);
|
|
3791
|
+
await this._options.sendSignal({
|
|
3741
3792
|
payload: {
|
|
3742
3793
|
data: {
|
|
3743
3794
|
type: answer.type,
|
|
@@ -3747,11 +3798,11 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3747
3798
|
});
|
|
3748
3799
|
this._readyForCandidates.wake();
|
|
3749
3800
|
} catch (err) {
|
|
3750
|
-
log14.error("
|
|
3801
|
+
log14.error("cannot handle offer from signalling server", {
|
|
3751
3802
|
err
|
|
3752
3803
|
}, {
|
|
3753
3804
|
F: __dxlog_file15,
|
|
3754
|
-
L:
|
|
3805
|
+
L: 268,
|
|
3755
3806
|
S: this,
|
|
3756
3807
|
C: (f, a) => f(...a)
|
|
3757
3808
|
});
|
|
@@ -3761,17 +3812,17 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3761
3812
|
}
|
|
3762
3813
|
case "answer":
|
|
3763
3814
|
try {
|
|
3764
|
-
await
|
|
3815
|
+
await this._peer.setRemoteDescription({
|
|
3765
3816
|
type: data.type,
|
|
3766
3817
|
sdp: data.sdp
|
|
3767
3818
|
});
|
|
3768
3819
|
this._readyForCandidates.wake();
|
|
3769
3820
|
} catch (err) {
|
|
3770
|
-
log14.error("
|
|
3821
|
+
log14.error("cannot handle answer from signalling server", {
|
|
3771
3822
|
err
|
|
3772
3823
|
}, {
|
|
3773
3824
|
F: __dxlog_file15,
|
|
3774
|
-
L:
|
|
3825
|
+
L: 279,
|
|
3775
3826
|
S: this,
|
|
3776
3827
|
C: (f, a) => f(...a)
|
|
3777
3828
|
});
|
|
@@ -3780,7 +3831,7 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3780
3831
|
break;
|
|
3781
3832
|
case "candidate":
|
|
3782
3833
|
await this._readyForCandidates.wait();
|
|
3783
|
-
await
|
|
3834
|
+
await this._peer.addIceCandidate({
|
|
3784
3835
|
candidate: data.candidate.candidate
|
|
3785
3836
|
});
|
|
3786
3837
|
break;
|
|
@@ -3790,20 +3841,20 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3790
3841
|
signal
|
|
3791
3842
|
}, {
|
|
3792
3843
|
F: __dxlog_file15,
|
|
3793
|
-
L:
|
|
3844
|
+
L: 290,
|
|
3794
3845
|
S: this,
|
|
3795
3846
|
C: (f, a) => f(...a)
|
|
3796
3847
|
});
|
|
3797
3848
|
this.errors.raise(new Error(`unhandled signal type ${data.type}`));
|
|
3798
3849
|
}
|
|
3799
|
-
}
|
|
3850
|
+
} catch (err) {
|
|
3800
3851
|
log14.catch(err, void 0, {
|
|
3801
3852
|
F: __dxlog_file15,
|
|
3802
|
-
L:
|
|
3853
|
+
L: 294,
|
|
3803
3854
|
S: this,
|
|
3804
3855
|
C: (f, a) => f(...a)
|
|
3805
3856
|
});
|
|
3806
|
-
}
|
|
3857
|
+
}
|
|
3807
3858
|
}
|
|
3808
3859
|
async getDetails() {
|
|
3809
3860
|
const stats = await this._getStats();
|
|
@@ -3816,26 +3867,6 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3816
3867
|
}
|
|
3817
3868
|
return `${rc.ip}:${rc.port} ${rc.candidateType}`;
|
|
3818
3869
|
}
|
|
3819
|
-
async _getStats() {
|
|
3820
|
-
return this._peer.then(async (peer) => {
|
|
3821
|
-
const stats = await peer.getStats();
|
|
3822
|
-
const statsEntries = Array.from(stats.entries());
|
|
3823
|
-
const transport = statsEntries.filter((s) => s[1].type === "transport")[0][1];
|
|
3824
|
-
const candidatePair = statsEntries.filter((s) => s[0] === transport.selectedCandidatePairId);
|
|
3825
|
-
let selectedCandidatePair;
|
|
3826
|
-
let remoteCandidate;
|
|
3827
|
-
if (candidatePair.length > 0) {
|
|
3828
|
-
selectedCandidatePair = candidatePair[0][1];
|
|
3829
|
-
remoteCandidate = statsEntries.filter((s) => s[0] === selectedCandidatePair.remoteCandidateId)[0][1];
|
|
3830
|
-
}
|
|
3831
|
-
return {
|
|
3832
|
-
transport,
|
|
3833
|
-
selectedCandidatePair,
|
|
3834
|
-
remoteCandidate,
|
|
3835
|
-
raw: Object.fromEntries(stats)
|
|
3836
|
-
};
|
|
3837
|
-
});
|
|
3838
|
-
}
|
|
3839
3870
|
async getStats() {
|
|
3840
3871
|
const stats = await this._getStats();
|
|
3841
3872
|
if (!stats) {
|
|
@@ -3855,25 +3886,40 @@ var LibDataChannelTransport = class _LibDataChannelTransport {
|
|
|
3855
3886
|
rawStats: stats.raw
|
|
3856
3887
|
};
|
|
3857
3888
|
}
|
|
3858
|
-
async
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3889
|
+
async _getStats() {
|
|
3890
|
+
invariant14(this._peer, "not open", {
|
|
3891
|
+
F: __dxlog_file15,
|
|
3892
|
+
L: 334,
|
|
3893
|
+
S: this,
|
|
3894
|
+
A: [
|
|
3895
|
+
"this._peer",
|
|
3896
|
+
"'not open'"
|
|
3897
|
+
]
|
|
3898
|
+
});
|
|
3899
|
+
const stats = await this._peer.getStats();
|
|
3900
|
+
const statsEntries = Array.from(stats.entries());
|
|
3901
|
+
const transport = statsEntries.filter((s) => s[1].type === "transport")[0][1];
|
|
3902
|
+
const candidatePair = statsEntries.filter((s) => s[0] === transport.selectedCandidatePairId);
|
|
3903
|
+
let selectedCandidatePair;
|
|
3904
|
+
let remoteCandidate;
|
|
3905
|
+
if (candidatePair.length > 0) {
|
|
3906
|
+
selectedCandidatePair = candidatePair[0][1];
|
|
3907
|
+
remoteCandidate = statsEntries.filter((s) => s[0] === selectedCandidatePair.remoteCandidateId)[0][1];
|
|
3862
3908
|
}
|
|
3909
|
+
return {
|
|
3910
|
+
transport,
|
|
3911
|
+
selectedCandidatePair,
|
|
3912
|
+
remoteCandidate,
|
|
3913
|
+
raw: Object.fromEntries(stats)
|
|
3914
|
+
};
|
|
3863
3915
|
}
|
|
3864
3916
|
async _disconnectStreams() {
|
|
3865
|
-
this.
|
|
3917
|
+
this._options.stream.unpipe?.(this._stream)?.unpipe?.(this._options.stream);
|
|
3866
3918
|
}
|
|
3867
3919
|
};
|
|
3868
3920
|
_ts_decorate5([
|
|
3869
3921
|
synchronized4
|
|
3870
3922
|
], LibDataChannelTransport.prototype, "_close", null);
|
|
3871
|
-
var createLibDataChannelTransportFactory = (webrtcConfig) => ({
|
|
3872
|
-
createTransport: (params) => new LibDataChannelTransport({
|
|
3873
|
-
...params,
|
|
3874
|
-
webrtcConfig
|
|
3875
|
-
})
|
|
3876
|
-
});
|
|
3877
3923
|
var importESM = Function("path", "return import(path)");
|
|
3878
3924
|
|
|
3879
3925
|
// packages/core/mesh/network-manager/src/transport/tcp-transport.browser.ts
|
|
@@ -3888,10 +3934,14 @@ var TcpTransport = class {
|
|
|
3888
3934
|
this.connected = new Event11();
|
|
3889
3935
|
this.errors = new ErrorStream7();
|
|
3890
3936
|
}
|
|
3891
|
-
|
|
3892
|
-
|
|
3937
|
+
get isOpen() {
|
|
3938
|
+
return true;
|
|
3939
|
+
}
|
|
3940
|
+
async open() {
|
|
3893
3941
|
}
|
|
3894
|
-
|
|
3942
|
+
async close() {
|
|
3943
|
+
}
|
|
3944
|
+
async onSignal() {
|
|
3895
3945
|
throw new Error("Method not implemented.");
|
|
3896
3946
|
}
|
|
3897
3947
|
async getStats() {
|
|
@@ -3941,15 +3991,15 @@ export {
|
|
|
3941
3991
|
MemoryTransportFactory,
|
|
3942
3992
|
MemoryTransport,
|
|
3943
3993
|
TransportKind,
|
|
3944
|
-
SimplePeerTransport,
|
|
3945
3994
|
createSimplePeerTransportFactory,
|
|
3995
|
+
SimplePeerTransport,
|
|
3946
3996
|
SimplePeerTransportService,
|
|
3947
3997
|
SimplePeerTransportProxy,
|
|
3948
3998
|
SimplePeerTransportProxyFactory,
|
|
3949
|
-
LibDataChannelTransport,
|
|
3950
3999
|
createLibDataChannelTransportFactory,
|
|
4000
|
+
LibDataChannelTransport,
|
|
3951
4001
|
TcpTransportFactory,
|
|
3952
4002
|
TcpTransport,
|
|
3953
4003
|
createTeleportProtocolFactory
|
|
3954
4004
|
};
|
|
3955
|
-
//# sourceMappingURL=chunk-
|
|
4005
|
+
//# sourceMappingURL=chunk-SOVZDG44.mjs.map
|