@annals/agent-mesh 0.18.2 → 0.18.4
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/index.js +60 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -367,19 +367,22 @@ var FileSender = class {
|
|
|
367
367
|
});
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.peer.
|
|
380
|
-
|
|
381
|
-
|
|
370
|
+
try {
|
|
371
|
+
if (signal.signal_type === "offer" || signal.signal_type === "answer") {
|
|
372
|
+
this.peer.setRemoteDescription(signal.payload, signal.signal_type);
|
|
373
|
+
for (const c of this.pendingCandidates) {
|
|
374
|
+
this.peer.addRemoteCandidate(c.candidate, c.mid);
|
|
375
|
+
}
|
|
376
|
+
this.pendingCandidates = [];
|
|
377
|
+
} else if (signal.signal_type === "candidate") {
|
|
378
|
+
const { candidate, mid } = JSON.parse(signal.payload);
|
|
379
|
+
if (this.peer.remoteDescription()) {
|
|
380
|
+
this.peer.addRemoteCandidate(candidate, mid);
|
|
381
|
+
} else {
|
|
382
|
+
this.pendingCandidates.push({ candidate, mid });
|
|
383
|
+
}
|
|
382
384
|
}
|
|
385
|
+
} catch {
|
|
383
386
|
}
|
|
384
387
|
}
|
|
385
388
|
async sendZip(dc) {
|
|
@@ -469,19 +472,22 @@ var FileReceiver = class {
|
|
|
469
472
|
}
|
|
470
473
|
async handleSignal(signal) {
|
|
471
474
|
if (!this.peer || this.closed) return;
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
this.peer.
|
|
482
|
-
|
|
483
|
-
|
|
475
|
+
try {
|
|
476
|
+
if (signal.signal_type === "answer" || signal.signal_type === "offer") {
|
|
477
|
+
this.peer.setRemoteDescription(signal.payload, signal.signal_type);
|
|
478
|
+
for (const c of this.pendingCandidates) {
|
|
479
|
+
this.peer.addRemoteCandidate(c.candidate, c.mid);
|
|
480
|
+
}
|
|
481
|
+
this.pendingCandidates = [];
|
|
482
|
+
} else if (signal.signal_type === "candidate") {
|
|
483
|
+
const { candidate, mid } = JSON.parse(signal.payload);
|
|
484
|
+
if (this.peer.remoteDescription()) {
|
|
485
|
+
this.peer.addRemoteCandidate(candidate, mid);
|
|
486
|
+
} else {
|
|
487
|
+
this.pendingCandidates.push({ candidate, mid });
|
|
488
|
+
}
|
|
484
489
|
}
|
|
490
|
+
} catch {
|
|
485
491
|
}
|
|
486
492
|
}
|
|
487
493
|
waitForCompletion(timeoutMs = CONNECT_TIMEOUT_MS) {
|
|
@@ -583,19 +589,22 @@ var FileUploadReceiver = class {
|
|
|
583
589
|
});
|
|
584
590
|
});
|
|
585
591
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
this.peer.
|
|
596
|
-
|
|
597
|
-
|
|
592
|
+
try {
|
|
593
|
+
if (signal.signal_type === "offer" || signal.signal_type === "answer") {
|
|
594
|
+
this.peer.setRemoteDescription(signal.payload, signal.signal_type);
|
|
595
|
+
for (const c of this.pendingCandidates) {
|
|
596
|
+
this.peer.addRemoteCandidate(c.candidate, c.mid);
|
|
597
|
+
}
|
|
598
|
+
this.pendingCandidates = [];
|
|
599
|
+
} else if (signal.signal_type === "candidate") {
|
|
600
|
+
const { candidate, mid } = JSON.parse(signal.payload);
|
|
601
|
+
if (this.peer.remoteDescription()) {
|
|
602
|
+
this.peer.addRemoteCandidate(candidate, mid);
|
|
603
|
+
} else {
|
|
604
|
+
this.pendingCandidates.push({ candidate, mid });
|
|
605
|
+
}
|
|
598
606
|
}
|
|
607
|
+
} catch {
|
|
599
608
|
}
|
|
600
609
|
}
|
|
601
610
|
waitForCompletion(timeoutMs = 3e4) {
|
|
@@ -684,19 +693,22 @@ var FileUploadSender = class {
|
|
|
684
693
|
}
|
|
685
694
|
async handleSignal(signal) {
|
|
686
695
|
if (!this.peer || this.closed) return;
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
this.peer.
|
|
697
|
-
|
|
698
|
-
|
|
696
|
+
try {
|
|
697
|
+
if (signal.signal_type === "answer" || signal.signal_type === "offer") {
|
|
698
|
+
this.peer.setRemoteDescription(signal.payload, signal.signal_type);
|
|
699
|
+
for (const c of this.pendingCandidates) {
|
|
700
|
+
this.peer.addRemoteCandidate(c.candidate, c.mid);
|
|
701
|
+
}
|
|
702
|
+
this.pendingCandidates = [];
|
|
703
|
+
} else if (signal.signal_type === "candidate") {
|
|
704
|
+
const { candidate, mid } = JSON.parse(signal.payload);
|
|
705
|
+
if (this.peer.remoteDescription()) {
|
|
706
|
+
this.peer.addRemoteCandidate(candidate, mid);
|
|
707
|
+
} else {
|
|
708
|
+
this.pendingCandidates.push({ candidate, mid });
|
|
709
|
+
}
|
|
699
710
|
}
|
|
711
|
+
} catch {
|
|
700
712
|
}
|
|
701
713
|
}
|
|
702
714
|
waitForCompletion(timeoutMs = 3e4) {
|