@dxos/client-services 0.1.56-main.a25bb93 → 0.1.56-main.ad054df
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-MAHWP5I6.mjs → chunk-U5CCSPX6.mjs} +215 -140
- package/dist/lib/browser/chunk-U5CCSPX6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -12
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +2 -2
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +210 -133
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +197 -122
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +3 -2
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +2 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +3 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -33
- package/src/packlets/devices/devices-service.test.ts +2 -1
- package/src/packlets/identity/identity-manager.test.ts +4 -3
- package/src/packlets/identity/identity-manager.ts +9 -5
- package/src/packlets/identity/identity-service.test.ts +2 -1
- package/src/packlets/identity/identity.test.ts +7 -6
- package/src/packlets/identity/identity.ts +8 -3
- package/src/packlets/invitations/device-invitation-protocol.test.ts +2 -1
- package/src/packlets/network/network-service.test.ts +2 -1
- package/src/packlets/services/client-rpc-server.ts +4 -4
- package/src/packlets/services/service-context.ts +11 -6
- package/src/packlets/services/service-host.test.ts +6 -5
- package/src/packlets/services/service-host.ts +15 -3
- package/src/packlets/services/service-registry.test.ts +2 -1
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/spaces-service.test.ts +2 -1
- package/src/packlets/testing/test-builder.ts +1 -1
- package/src/packlets/vault/iframe-host-runtime.ts +2 -1
- package/src/packlets/vault/worker-runtime.ts +2 -1
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-MAHWP5I6.mjs.map +0 -7
|
@@ -70,7 +70,7 @@ var import_protocols = require("@dxos/protocols");
|
|
|
70
70
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
71
71
|
|
|
72
72
|
// packages/sdk/client-services/src/version.ts
|
|
73
|
-
var DXOS_VERSION = "0.1.56-main.
|
|
73
|
+
var DXOS_VERSION = "0.1.56-main.ad054df";
|
|
74
74
|
|
|
75
75
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
76
76
|
var getPlatform = () => {
|
|
@@ -228,6 +228,7 @@ var getSpaceStats = async (space) => {
|
|
|
228
228
|
|
|
229
229
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
230
230
|
var import_async11 = require("@dxos/async");
|
|
231
|
+
var import_context8 = require("@dxos/context");
|
|
231
232
|
var import_credentials15 = require("@dxos/credentials");
|
|
232
233
|
var import_debug7 = require("@dxos/debug");
|
|
233
234
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
@@ -239,6 +240,7 @@ var import_log13 = require("@dxos/log");
|
|
|
239
240
|
var import_protocols9 = require("@dxos/protocols");
|
|
240
241
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
241
242
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
243
|
+
var import_tracing3 = require("@dxos/tracing");
|
|
242
244
|
|
|
243
245
|
// packages/sdk/client-services/src/packlets/identity/authenticator.ts
|
|
244
246
|
var import_async = require("@dxos/async");
|
|
@@ -365,8 +367,19 @@ var import_feed_store = require("@dxos/feed-store");
|
|
|
365
367
|
var import_invariant2 = require("@dxos/invariant");
|
|
366
368
|
var import_log3 = require("@dxos/log");
|
|
367
369
|
var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
370
|
+
var import_tracing = require("@dxos/tracing");
|
|
371
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
372
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
373
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
374
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
375
|
+
else
|
|
376
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
377
|
+
if (d = decorators[i])
|
|
378
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
379
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
380
|
+
}
|
|
368
381
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
369
|
-
var Identity = class {
|
|
382
|
+
var Identity = class Identity2 {
|
|
370
383
|
constructor({ space, signer, identityKey, deviceKey }) {
|
|
371
384
|
this.stateUpdate = new import_async2.Event();
|
|
372
385
|
this.space = space;
|
|
@@ -392,12 +405,12 @@ var Identity = class {
|
|
|
392
405
|
get authorizedDeviceKeys() {
|
|
393
406
|
return this._deviceStateMachine.authorizedDeviceKeys;
|
|
394
407
|
}
|
|
395
|
-
async open() {
|
|
408
|
+
async open(ctx) {
|
|
396
409
|
await this.space.spaceState.addCredentialProcessor(this._deviceStateMachine);
|
|
397
410
|
await this.space.spaceState.addCredentialProcessor(this._profileStateMachine);
|
|
398
|
-
await this.space.open();
|
|
411
|
+
await this.space.open(ctx);
|
|
399
412
|
}
|
|
400
|
-
async close() {
|
|
413
|
+
async close(ctx) {
|
|
401
414
|
await this.authVerifier.close();
|
|
402
415
|
await this.space.spaceState.removeCredentialProcessor(this._profileStateMachine);
|
|
403
416
|
await this.space.spaceState.removeCredentialProcessor(this._deviceStateMachine);
|
|
@@ -442,7 +455,7 @@ var Identity = class {
|
|
|
442
455
|
getIdentityCredentialSigner() {
|
|
443
456
|
(0, import_invariant2.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
444
457
|
F: __dxlog_file3,
|
|
445
|
-
L:
|
|
458
|
+
L: 139,
|
|
446
459
|
S: this,
|
|
447
460
|
A: [
|
|
448
461
|
"this._deviceStateMachine.deviceCredentialChain",
|
|
@@ -466,7 +479,7 @@ var Identity = class {
|
|
|
466
479
|
dataFeedKey
|
|
467
480
|
}, {
|
|
468
481
|
F: __dxlog_file3,
|
|
469
|
-
L:
|
|
482
|
+
L: 155,
|
|
470
483
|
S: this,
|
|
471
484
|
C: (f, a) => f(...a)
|
|
472
485
|
});
|
|
@@ -507,18 +520,39 @@ var Identity = class {
|
|
|
507
520
|
})));
|
|
508
521
|
}
|
|
509
522
|
};
|
|
523
|
+
_ts_decorate([
|
|
524
|
+
import_tracing.trace.span()
|
|
525
|
+
], Identity.prototype, "open", null);
|
|
526
|
+
_ts_decorate([
|
|
527
|
+
import_tracing.trace.span()
|
|
528
|
+
], Identity.prototype, "close", null);
|
|
529
|
+
Identity = _ts_decorate([
|
|
530
|
+
import_tracing.trace.resource()
|
|
531
|
+
], Identity);
|
|
510
532
|
|
|
511
533
|
// packages/sdk/client-services/src/packlets/identity/identity-manager.ts
|
|
512
534
|
var import_async3 = require("@dxos/async");
|
|
535
|
+
var import_context2 = require("@dxos/context");
|
|
513
536
|
var import_credentials6 = require("@dxos/credentials");
|
|
514
537
|
var import_invariant3 = require("@dxos/invariant");
|
|
515
538
|
var import_keys2 = require("@dxos/keys");
|
|
516
539
|
var import_log4 = require("@dxos/log");
|
|
517
540
|
var import_protocols3 = require("@dxos/protocols");
|
|
518
541
|
var import_credentials7 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
542
|
+
var import_tracing2 = require("@dxos/tracing");
|
|
519
543
|
var import_util = require("@dxos/util");
|
|
544
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
545
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
546
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
547
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
548
|
+
else
|
|
549
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
550
|
+
if (d = decorators[i])
|
|
551
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
552
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
553
|
+
}
|
|
520
554
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
521
|
-
var IdentityManager = class {
|
|
555
|
+
var IdentityManager = class IdentityManager2 {
|
|
522
556
|
// TODO(burdon): IdentityManagerParams.
|
|
523
557
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
524
558
|
constructor(_metadataStore, _keyring, _feedStore, _spaceManager) {
|
|
@@ -531,14 +565,14 @@ var IdentityManager = class {
|
|
|
531
565
|
get identity() {
|
|
532
566
|
return this._identity;
|
|
533
567
|
}
|
|
534
|
-
async open() {
|
|
568
|
+
async open(ctx) {
|
|
535
569
|
var _a;
|
|
536
570
|
const traceId = import_keys2.PublicKey.random().toHex();
|
|
537
571
|
import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.begin({
|
|
538
572
|
id: traceId
|
|
539
573
|
}), {
|
|
540
574
|
F: __dxlog_file4,
|
|
541
|
-
L:
|
|
575
|
+
L: 73,
|
|
542
576
|
S: this,
|
|
543
577
|
C: (f, a) => f(...a)
|
|
544
578
|
});
|
|
@@ -548,20 +582,20 @@ var IdentityManager = class {
|
|
|
548
582
|
identityRecord
|
|
549
583
|
}, {
|
|
550
584
|
F: __dxlog_file4,
|
|
551
|
-
L:
|
|
585
|
+
L: 77,
|
|
552
586
|
S: this,
|
|
553
587
|
C: (f, a) => f(...a)
|
|
554
588
|
});
|
|
555
589
|
if (identityRecord) {
|
|
556
590
|
this._identity = await this._constructIdentity(identityRecord);
|
|
557
|
-
await this._identity.open();
|
|
591
|
+
await this._identity.open(ctx);
|
|
558
592
|
await this._identity.ready();
|
|
559
593
|
import_log4.log.trace("dxos.halo.identity", {
|
|
560
594
|
identityKey: identityRecord.identityKey,
|
|
561
595
|
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
562
596
|
}, {
|
|
563
597
|
F: __dxlog_file4,
|
|
564
|
-
L:
|
|
598
|
+
L: 82,
|
|
565
599
|
S: this,
|
|
566
600
|
C: (f, a) => f(...a)
|
|
567
601
|
});
|
|
@@ -571,20 +605,20 @@ var IdentityManager = class {
|
|
|
571
605
|
id: traceId
|
|
572
606
|
}), {
|
|
573
607
|
F: __dxlog_file4,
|
|
574
|
-
L:
|
|
608
|
+
L: 88,
|
|
575
609
|
S: this,
|
|
576
610
|
C: (f, a) => f(...a)
|
|
577
611
|
});
|
|
578
612
|
}
|
|
579
613
|
async close() {
|
|
580
614
|
var _a;
|
|
581
|
-
await ((_a = this._identity) == null ? void 0 : _a.close());
|
|
615
|
+
await ((_a = this._identity) == null ? void 0 : _a.close(new import_context2.Context()));
|
|
582
616
|
}
|
|
583
617
|
async createIdentity({ displayName } = {}) {
|
|
584
618
|
var _a;
|
|
585
619
|
(0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
|
|
586
620
|
F: __dxlog_file4,
|
|
587
|
-
L:
|
|
621
|
+
L: 96,
|
|
588
622
|
S: this,
|
|
589
623
|
A: [
|
|
590
624
|
"!this._identity",
|
|
@@ -593,7 +627,7 @@ var IdentityManager = class {
|
|
|
593
627
|
});
|
|
594
628
|
(0, import_log4.log)("creating identity...", void 0, {
|
|
595
629
|
F: __dxlog_file4,
|
|
596
|
-
L:
|
|
630
|
+
L: 97,
|
|
597
631
|
S: this,
|
|
598
632
|
C: (f, a) => f(...a)
|
|
599
633
|
});
|
|
@@ -609,12 +643,12 @@ var IdentityManager = class {
|
|
|
609
643
|
}
|
|
610
644
|
};
|
|
611
645
|
const identity = await this._constructIdentity(identityRecord);
|
|
612
|
-
await identity.open();
|
|
646
|
+
await identity.open(new import_context2.Context());
|
|
613
647
|
{
|
|
614
648
|
const generator = new import_credentials6.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
615
649
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
616
650
|
F: __dxlog_file4,
|
|
617
|
-
L:
|
|
651
|
+
L: 116,
|
|
618
652
|
S: this,
|
|
619
653
|
A: [
|
|
620
654
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -623,7 +657,7 @@ var IdentityManager = class {
|
|
|
623
657
|
});
|
|
624
658
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
625
659
|
F: __dxlog_file4,
|
|
626
|
-
L:
|
|
660
|
+
L: 117,
|
|
627
661
|
S: this,
|
|
628
662
|
A: [
|
|
629
663
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -658,7 +692,7 @@ var IdentityManager = class {
|
|
|
658
692
|
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
659
693
|
}, {
|
|
660
694
|
F: __dxlog_file4,
|
|
661
|
-
L:
|
|
695
|
+
L: 152,
|
|
662
696
|
S: this,
|
|
663
697
|
C: (f, a) => f(...a)
|
|
664
698
|
});
|
|
@@ -668,7 +702,7 @@ var IdentityManager = class {
|
|
|
668
702
|
deviceKey: identity.deviceKey
|
|
669
703
|
}, {
|
|
670
704
|
F: __dxlog_file4,
|
|
671
|
-
L:
|
|
705
|
+
L: 158,
|
|
672
706
|
S: this,
|
|
673
707
|
C: (f, a) => f(...a)
|
|
674
708
|
});
|
|
@@ -683,13 +717,13 @@ var IdentityManager = class {
|
|
|
683
717
|
params
|
|
684
718
|
}, {
|
|
685
719
|
F: __dxlog_file4,
|
|
686
|
-
L:
|
|
720
|
+
L: 166,
|
|
687
721
|
S: this,
|
|
688
722
|
C: (f, a) => f(...a)
|
|
689
723
|
});
|
|
690
724
|
(0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
|
|
691
725
|
F: __dxlog_file4,
|
|
692
|
-
L:
|
|
726
|
+
L: 167,
|
|
693
727
|
S: this,
|
|
694
728
|
A: [
|
|
695
729
|
"!this._identity",
|
|
@@ -708,7 +742,7 @@ var IdentityManager = class {
|
|
|
708
742
|
}
|
|
709
743
|
};
|
|
710
744
|
const identity = await this._constructIdentity(identityRecord);
|
|
711
|
-
await identity.open();
|
|
745
|
+
await identity.open(new import_context2.Context());
|
|
712
746
|
this._identity = identity;
|
|
713
747
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
714
748
|
await this._identity.ready();
|
|
@@ -717,7 +751,7 @@ var IdentityManager = class {
|
|
|
717
751
|
displayName: (_a = this._identity.profileDocument) == null ? void 0 : _a.displayName
|
|
718
752
|
}, {
|
|
719
753
|
F: __dxlog_file4,
|
|
720
|
-
L:
|
|
754
|
+
L: 186,
|
|
721
755
|
S: this,
|
|
722
756
|
C: (f, a) => f(...a)
|
|
723
757
|
});
|
|
@@ -727,7 +761,7 @@ var IdentityManager = class {
|
|
|
727
761
|
deviceKey: identity.deviceKey
|
|
728
762
|
}, {
|
|
729
763
|
F: __dxlog_file4,
|
|
730
|
-
L:
|
|
764
|
+
L: 192,
|
|
731
765
|
S: this,
|
|
732
766
|
C: (f, a) => f(...a)
|
|
733
767
|
});
|
|
@@ -736,7 +770,7 @@ var IdentityManager = class {
|
|
|
736
770
|
async _constructIdentity(identityRecord) {
|
|
737
771
|
(0, import_invariant3.invariant)(!this._identity, void 0, {
|
|
738
772
|
F: __dxlog_file4,
|
|
739
|
-
L:
|
|
773
|
+
L: 197,
|
|
740
774
|
S: this,
|
|
741
775
|
A: [
|
|
742
776
|
"!this._identity",
|
|
@@ -747,13 +781,13 @@ var IdentityManager = class {
|
|
|
747
781
|
identityRecord
|
|
748
782
|
}, {
|
|
749
783
|
F: __dxlog_file4,
|
|
750
|
-
L:
|
|
784
|
+
L: 198,
|
|
751
785
|
S: this,
|
|
752
786
|
C: (f, a) => f(...a)
|
|
753
787
|
});
|
|
754
788
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
755
789
|
F: __dxlog_file4,
|
|
756
|
-
L:
|
|
790
|
+
L: 201,
|
|
757
791
|
S: this,
|
|
758
792
|
A: [
|
|
759
793
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -765,7 +799,7 @@ var IdentityManager = class {
|
|
|
765
799
|
});
|
|
766
800
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
767
801
|
F: __dxlog_file4,
|
|
768
|
-
L:
|
|
802
|
+
L: 205,
|
|
769
803
|
S: this,
|
|
770
804
|
A: [
|
|
771
805
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -797,7 +831,7 @@ var IdentityManager = class {
|
|
|
797
831
|
identityKey: identityRecord.identityKey
|
|
798
832
|
}, {
|
|
799
833
|
F: __dxlog_file4,
|
|
800
|
-
L:
|
|
834
|
+
L: 229,
|
|
801
835
|
S: this,
|
|
802
836
|
C: (f, a) => f(...a)
|
|
803
837
|
});
|
|
@@ -818,7 +852,7 @@ var IdentityManager = class {
|
|
|
818
852
|
onAuthFailure: () => {
|
|
819
853
|
import_log4.log.warn("auth failure", void 0, {
|
|
820
854
|
F: __dxlog_file4,
|
|
821
|
-
L:
|
|
855
|
+
L: 248,
|
|
822
856
|
S: this,
|
|
823
857
|
C: (f, a) => f(...a)
|
|
824
858
|
});
|
|
@@ -827,6 +861,12 @@ var IdentityManager = class {
|
|
|
827
861
|
});
|
|
828
862
|
}
|
|
829
863
|
};
|
|
864
|
+
_ts_decorate2([
|
|
865
|
+
import_tracing2.trace.span()
|
|
866
|
+
], IdentityManager.prototype, "open", null);
|
|
867
|
+
IdentityManager = _ts_decorate2([
|
|
868
|
+
import_tracing2.trace.resource()
|
|
869
|
+
], IdentityManager);
|
|
830
870
|
|
|
831
871
|
// packages/sdk/client-services/src/packlets/identity/identity-service.ts
|
|
832
872
|
var import_codec_protobuf3 = require("@dxos/codec-protobuf");
|
|
@@ -978,7 +1018,7 @@ var DeviceInvitationProtocol = class {
|
|
|
978
1018
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
979
1019
|
var import_async5 = require("@dxos/async");
|
|
980
1020
|
var import_client_protocol2 = require("@dxos/client-protocol");
|
|
981
|
-
var
|
|
1021
|
+
var import_context4 = require("@dxos/context");
|
|
982
1022
|
var import_credentials9 = require("@dxos/credentials");
|
|
983
1023
|
var import_errors2 = require("@dxos/errors");
|
|
984
1024
|
var import_invariant7 = require("@dxos/invariant");
|
|
@@ -991,7 +1031,7 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
|
|
|
991
1031
|
|
|
992
1032
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
993
1033
|
var import_async4 = require("@dxos/async");
|
|
994
|
-
var
|
|
1034
|
+
var import_context3 = require("@dxos/context");
|
|
995
1035
|
var import_errors = require("@dxos/errors");
|
|
996
1036
|
var import_invariant6 = require("@dxos/invariant");
|
|
997
1037
|
var import_keys3 = require("@dxos/keys");
|
|
@@ -1014,7 +1054,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1014
1054
|
}
|
|
1015
1055
|
});
|
|
1016
1056
|
this._callbacks = _callbacks;
|
|
1017
|
-
this._ctx = new
|
|
1057
|
+
this._ctx = new import_context3.Context();
|
|
1018
1058
|
this._remoteOptionsTrigger = new import_async4.Trigger();
|
|
1019
1059
|
this.invitation = void 0;
|
|
1020
1060
|
this.guestProfile = void 0;
|
|
@@ -1221,7 +1261,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1221
1261
|
await this.rpc.InvitationHostService.options({
|
|
1222
1262
|
role: import_invitations.Options.Role.HOST
|
|
1223
1263
|
});
|
|
1224
|
-
await (0,
|
|
1264
|
+
await (0, import_context3.cancelWithContext)(this._ctx, this._remoteOptionsTrigger.wait({
|
|
1225
1265
|
timeout: OPTIONS_TIMEOUT
|
|
1226
1266
|
}));
|
|
1227
1267
|
if (((_a = this._remoteOptions) == null ? void 0 : _a.role) !== import_invitations.Options.Role.GUEST) {
|
|
@@ -1250,7 +1290,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1250
1290
|
}
|
|
1251
1291
|
});
|
|
1252
1292
|
this._callbacks = _callbacks;
|
|
1253
|
-
this._ctx = new
|
|
1293
|
+
this._ctx = new import_context3.Context();
|
|
1254
1294
|
this._remoteOptionsTrigger = new import_async4.Trigger();
|
|
1255
1295
|
}
|
|
1256
1296
|
async getHandlers() {
|
|
@@ -1291,10 +1331,10 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1291
1331
|
S: this,
|
|
1292
1332
|
C: (f, a) => f(...a)
|
|
1293
1333
|
});
|
|
1294
|
-
await (0,
|
|
1334
|
+
await (0, import_context3.cancelWithContext)(this._ctx, this.rpc.InvitationHostService.options({
|
|
1295
1335
|
role: import_invitations.Options.Role.GUEST
|
|
1296
1336
|
}));
|
|
1297
|
-
await (0,
|
|
1337
|
+
await (0, import_context3.cancelWithContext)(this._ctx, this._remoteOptionsTrigger.wait({
|
|
1298
1338
|
timeout: OPTIONS_TIMEOUT
|
|
1299
1339
|
}));
|
|
1300
1340
|
(0, import_log5.log)("end options", void 0, {
|
|
@@ -1365,7 +1405,7 @@ var InvitationsHandler = class {
|
|
|
1365
1405
|
...protocol.getInvitationContext()
|
|
1366
1406
|
};
|
|
1367
1407
|
const stream = new import_async5.PushStream();
|
|
1368
|
-
const ctx = new
|
|
1408
|
+
const ctx = new import_context4.Context({
|
|
1369
1409
|
onError: (err) => {
|
|
1370
1410
|
void ctx.dispose();
|
|
1371
1411
|
stream.error(err);
|
|
@@ -1596,7 +1636,7 @@ var InvitationsHandler = class {
|
|
|
1596
1636
|
...newData
|
|
1597
1637
|
});
|
|
1598
1638
|
};
|
|
1599
|
-
const ctx = new
|
|
1639
|
+
const ctx = new import_context4.Context({
|
|
1600
1640
|
onError: (err) => {
|
|
1601
1641
|
if (err instanceof import_async5.TimeoutError) {
|
|
1602
1642
|
(0, import_log6.log)("timeout", {
|
|
@@ -2228,7 +2268,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2228
2268
|
|
|
2229
2269
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2230
2270
|
var import_async9 = require("@dxos/async");
|
|
2231
|
-
var
|
|
2271
|
+
var import_context7 = require("@dxos/context");
|
|
2232
2272
|
var import_credentials14 = require("@dxos/credentials");
|
|
2233
2273
|
var import_invariant11 = require("@dxos/invariant");
|
|
2234
2274
|
var import_keys7 = require("@dxos/keys");
|
|
@@ -2241,7 +2281,7 @@ var import_util4 = require("@dxos/util");
|
|
|
2241
2281
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2242
2282
|
var import_async8 = require("@dxos/async");
|
|
2243
2283
|
var import_client_protocol3 = require("@dxos/client-protocol");
|
|
2244
|
-
var
|
|
2284
|
+
var import_context6 = require("@dxos/context");
|
|
2245
2285
|
var import_debug4 = require("@dxos/debug");
|
|
2246
2286
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2247
2287
|
var import_errors3 = require("@dxos/errors");
|
|
@@ -2254,7 +2294,7 @@ var import_util3 = require("@dxos/util");
|
|
|
2254
2294
|
|
|
2255
2295
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2256
2296
|
var import_async7 = require("@dxos/async");
|
|
2257
|
-
var
|
|
2297
|
+
var import_context5 = require("@dxos/context");
|
|
2258
2298
|
var import_invariant10 = require("@dxos/invariant");
|
|
2259
2299
|
var import_keys5 = require("@dxos/keys");
|
|
2260
2300
|
var import_log9 = require("@dxos/log");
|
|
@@ -2268,7 +2308,7 @@ var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
|
2268
2308
|
var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
|
|
2269
2309
|
var NotarizationPlugin = class {
|
|
2270
2310
|
constructor() {
|
|
2271
|
-
this._ctx = new
|
|
2311
|
+
this._ctx = new import_context5.Context();
|
|
2272
2312
|
this._extensionOpened = new import_async7.Event();
|
|
2273
2313
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2274
2314
|
this._processedCredentials = new import_util2.ComplexSet(import_keys5.PublicKey.hash);
|
|
@@ -2393,7 +2433,7 @@ var NotarizationPlugin = class {
|
|
|
2393
2433
|
this._extensionOpened.on(ctx, () => notarizeTask.schedule());
|
|
2394
2434
|
try {
|
|
2395
2435
|
await Promise.race([
|
|
2396
|
-
(0,
|
|
2436
|
+
(0, import_context5.rejectOnDispose)(ctx),
|
|
2397
2437
|
allNotarized,
|
|
2398
2438
|
errors.wait()
|
|
2399
2439
|
]);
|
|
@@ -2523,7 +2563,7 @@ var NotarizationTeleportExtension = class extends import_teleport2.RpcExtension
|
|
|
2523
2563
|
};
|
|
2524
2564
|
|
|
2525
2565
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2526
|
-
function
|
|
2566
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
2527
2567
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2528
2568
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2529
2569
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2536,7 +2576,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
2536
2576
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
2537
2577
|
var DataSpace = class DataSpace2 {
|
|
2538
2578
|
constructor(params) {
|
|
2539
|
-
this._ctx = new
|
|
2579
|
+
this._ctx = new import_context6.Context();
|
|
2540
2580
|
this._notarizationPlugin = new NotarizationPlugin();
|
|
2541
2581
|
this._state = import_services7.SpaceState.CLOSED;
|
|
2542
2582
|
/**
|
|
@@ -2594,7 +2634,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2594
2634
|
async _open() {
|
|
2595
2635
|
await this._notarizationPlugin.open();
|
|
2596
2636
|
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
2597
|
-
await this._inner.open();
|
|
2637
|
+
await this._inner.open(new import_context6.Context());
|
|
2598
2638
|
this._state = import_services7.SpaceState.CONTROL_ONLY;
|
|
2599
2639
|
this.stateUpdate.emit();
|
|
2600
2640
|
this.metrics = {};
|
|
@@ -2608,7 +2648,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2608
2648
|
await ((_b = (_a = this._callbacks).beforeClose) == null ? void 0 : _b.call(_a));
|
|
2609
2649
|
this._state = import_services7.SpaceState.CLOSED;
|
|
2610
2650
|
await this._ctx.dispose();
|
|
2611
|
-
this._ctx = new
|
|
2651
|
+
this._ctx = new import_context6.Context();
|
|
2612
2652
|
await this.authVerifier.close();
|
|
2613
2653
|
await this._inner.close();
|
|
2614
2654
|
await this._inner.spaceState.removeCredentialProcessor(this._notarizationPlugin);
|
|
@@ -2681,7 +2721,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2681
2721
|
}
|
|
2682
2722
|
await this._inner.initializeDataPipeline();
|
|
2683
2723
|
this.metrics.dataPipelineOpen = new Date();
|
|
2684
|
-
await (0,
|
|
2724
|
+
await (0, import_context6.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
2685
2725
|
(0, import_log10.log)("waiting for data pipeline to reach target timeframe", void 0, {
|
|
2686
2726
|
F: __dxlog_file12,
|
|
2687
2727
|
L: 242,
|
|
@@ -2793,22 +2833,22 @@ var DataSpace = class DataSpace2 {
|
|
|
2793
2833
|
this.stateUpdate.emit();
|
|
2794
2834
|
}
|
|
2795
2835
|
};
|
|
2796
|
-
|
|
2836
|
+
_ts_decorate3([
|
|
2797
2837
|
import_async8.synchronized
|
|
2798
2838
|
], DataSpace.prototype, "open", null);
|
|
2799
|
-
|
|
2839
|
+
_ts_decorate3([
|
|
2800
2840
|
import_async8.synchronized
|
|
2801
2841
|
], DataSpace.prototype, "close", null);
|
|
2802
|
-
|
|
2842
|
+
_ts_decorate3([
|
|
2803
2843
|
(0, import_debug4.timed)(1e4)
|
|
2804
2844
|
], DataSpace.prototype, "_createWritableFeeds", null);
|
|
2805
|
-
|
|
2845
|
+
_ts_decorate3([
|
|
2806
2846
|
import_async8.synchronized
|
|
2807
2847
|
], DataSpace.prototype, "activate", null);
|
|
2808
|
-
|
|
2848
|
+
_ts_decorate3([
|
|
2809
2849
|
import_async8.synchronized
|
|
2810
2850
|
], DataSpace.prototype, "deactivate", null);
|
|
2811
|
-
DataSpace =
|
|
2851
|
+
DataSpace = _ts_decorate3([
|
|
2812
2852
|
(0, import_async8.trackLeaks)("open", "close")
|
|
2813
2853
|
], DataSpace);
|
|
2814
2854
|
|
|
@@ -2883,7 +2923,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
|
|
|
2883
2923
|
};
|
|
2884
2924
|
|
|
2885
2925
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2886
|
-
function
|
|
2926
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
2887
2927
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2888
2928
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2889
2929
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2902,7 +2942,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2902
2942
|
this._keyring = _keyring;
|
|
2903
2943
|
this._signingContext = _signingContext;
|
|
2904
2944
|
this._feedStore = _feedStore;
|
|
2905
|
-
this._ctx = new
|
|
2945
|
+
this._ctx = new import_context7.Context();
|
|
2906
2946
|
this.updated = new import_async9.Event();
|
|
2907
2947
|
this._spaces = new import_util4.ComplexMap(import_keys7.PublicKey.hash);
|
|
2908
2948
|
this._isOpen = false;
|
|
@@ -3081,7 +3121,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3081
3121
|
* TODO(dmaretskyi): Consider removing.
|
|
3082
3122
|
*/
|
|
3083
3123
|
async waitUntilSpaceReady(spaceKey) {
|
|
3084
|
-
await (0,
|
|
3124
|
+
await (0, import_context7.cancelWithContext)(this._ctx, this.updated.waitForCondition(() => {
|
|
3085
3125
|
const space = this._spaces.get(spaceKey);
|
|
3086
3126
|
return !!space && space.state === import_services8.SpaceState.READY;
|
|
3087
3127
|
}));
|
|
@@ -3198,19 +3238,19 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3198
3238
|
return dataSpace;
|
|
3199
3239
|
}
|
|
3200
3240
|
};
|
|
3201
|
-
|
|
3241
|
+
_ts_decorate4([
|
|
3202
3242
|
import_async9.synchronized
|
|
3203
3243
|
], DataSpaceManager.prototype, "open", null);
|
|
3204
|
-
|
|
3244
|
+
_ts_decorate4([
|
|
3205
3245
|
import_async9.synchronized
|
|
3206
3246
|
], DataSpaceManager.prototype, "close", null);
|
|
3207
|
-
|
|
3247
|
+
_ts_decorate4([
|
|
3208
3248
|
import_async9.synchronized
|
|
3209
3249
|
], DataSpaceManager.prototype, "createSpace", null);
|
|
3210
|
-
|
|
3250
|
+
_ts_decorate4([
|
|
3211
3251
|
import_async9.synchronized
|
|
3212
3252
|
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
3213
|
-
DataSpaceManager =
|
|
3253
|
+
DataSpaceManager = _ts_decorate4([
|
|
3214
3254
|
(0, import_async9.trackLeaks)("open", "close")
|
|
3215
3255
|
], DataSpaceManager);
|
|
3216
3256
|
|
|
@@ -3401,8 +3441,18 @@ var SpacesServiceImpl = class {
|
|
|
3401
3441
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
3402
3442
|
|
|
3403
3443
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3444
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
3445
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3446
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
3447
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
3448
|
+
else
|
|
3449
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
3450
|
+
if (d = decorators[i])
|
|
3451
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3452
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3453
|
+
}
|
|
3404
3454
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3405
|
-
var ServiceContext = class {
|
|
3455
|
+
var ServiceContext = class ServiceContext2 {
|
|
3406
3456
|
// prettier-ignore
|
|
3407
3457
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
3408
3458
|
this.storage = storage;
|
|
@@ -3441,11 +3491,11 @@ var ServiceContext = class {
|
|
|
3441
3491
|
return (_a = this.identityManager.identity) != null ? _a : (0, import_debug7.failUndefined)();
|
|
3442
3492
|
}, this._acceptIdentity.bind(this)));
|
|
3443
3493
|
}
|
|
3444
|
-
async open() {
|
|
3494
|
+
async open(ctx) {
|
|
3445
3495
|
await this._checkStorageVersion();
|
|
3446
3496
|
(0, import_log13.log)("opening...", void 0, {
|
|
3447
3497
|
F: __dxlog_file15,
|
|
3448
|
-
L:
|
|
3498
|
+
L: 131,
|
|
3449
3499
|
S: this,
|
|
3450
3500
|
C: (f, a) => f(...a)
|
|
3451
3501
|
});
|
|
@@ -3453,28 +3503,28 @@ var ServiceContext = class {
|
|
|
3453
3503
|
id: this._instanceId
|
|
3454
3504
|
}), {
|
|
3455
3505
|
F: __dxlog_file15,
|
|
3456
|
-
L:
|
|
3506
|
+
L: 132,
|
|
3457
3507
|
S: this,
|
|
3458
3508
|
C: (f, a) => f(...a)
|
|
3459
3509
|
});
|
|
3460
3510
|
await this.signalManager.open();
|
|
3461
3511
|
await this.networkManager.open();
|
|
3462
3512
|
await this.spaceManager.open();
|
|
3463
|
-
await this.identityManager.open();
|
|
3513
|
+
await this.identityManager.open(ctx);
|
|
3464
3514
|
if (this.identityManager.identity) {
|
|
3465
|
-
await this._initialize();
|
|
3515
|
+
await this._initialize(ctx);
|
|
3466
3516
|
}
|
|
3467
3517
|
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols9.trace.end({
|
|
3468
3518
|
id: this._instanceId
|
|
3469
3519
|
}), {
|
|
3470
3520
|
F: __dxlog_file15,
|
|
3471
|
-
L:
|
|
3521
|
+
L: 140,
|
|
3472
3522
|
S: this,
|
|
3473
3523
|
C: (f, a) => f(...a)
|
|
3474
3524
|
});
|
|
3475
3525
|
(0, import_log13.log)("opened", void 0, {
|
|
3476
3526
|
F: __dxlog_file15,
|
|
3477
|
-
L:
|
|
3527
|
+
L: 141,
|
|
3478
3528
|
S: this,
|
|
3479
3529
|
C: (f, a) => f(...a)
|
|
3480
3530
|
});
|
|
@@ -3483,7 +3533,7 @@ var ServiceContext = class {
|
|
|
3483
3533
|
var _a;
|
|
3484
3534
|
(0, import_log13.log)("closing...", void 0, {
|
|
3485
3535
|
F: __dxlog_file15,
|
|
3486
|
-
L:
|
|
3536
|
+
L: 145,
|
|
3487
3537
|
S: this,
|
|
3488
3538
|
C: (f, a) => f(...a)
|
|
3489
3539
|
});
|
|
@@ -3499,21 +3549,21 @@ var ServiceContext = class {
|
|
|
3499
3549
|
this.dataServiceSubscriptions.clear();
|
|
3500
3550
|
(0, import_log13.log)("closed", void 0, {
|
|
3501
3551
|
F: __dxlog_file15,
|
|
3502
|
-
L:
|
|
3552
|
+
L: 156,
|
|
3503
3553
|
S: this,
|
|
3504
3554
|
C: (f, a) => f(...a)
|
|
3505
3555
|
});
|
|
3506
3556
|
}
|
|
3507
3557
|
async createIdentity(params = {}) {
|
|
3508
3558
|
const identity = await this.identityManager.createIdentity(params);
|
|
3509
|
-
await this._initialize();
|
|
3559
|
+
await this._initialize(new import_context8.Context());
|
|
3510
3560
|
return identity;
|
|
3511
3561
|
}
|
|
3512
3562
|
getInvitationHandler(invitation) {
|
|
3513
3563
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
3514
3564
|
(0, import_invariant12.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
3515
3565
|
F: __dxlog_file15,
|
|
3516
|
-
L:
|
|
3566
|
+
L: 168,
|
|
3517
3567
|
S: this,
|
|
3518
3568
|
A: [
|
|
3519
3569
|
"factory",
|
|
@@ -3524,7 +3574,7 @@ var ServiceContext = class {
|
|
|
3524
3574
|
}
|
|
3525
3575
|
async _acceptIdentity(params) {
|
|
3526
3576
|
const identity = await this.identityManager.acceptIdentity(params);
|
|
3527
|
-
await this._initialize();
|
|
3577
|
+
await this._initialize(new import_context8.Context());
|
|
3528
3578
|
return identity;
|
|
3529
3579
|
}
|
|
3530
3580
|
async _checkStorageVersion() {
|
|
@@ -3534,11 +3584,11 @@ var ServiceContext = class {
|
|
|
3534
3584
|
}
|
|
3535
3585
|
}
|
|
3536
3586
|
// Called when identity is created.
|
|
3537
|
-
async _initialize() {
|
|
3587
|
+
async _initialize(ctx) {
|
|
3538
3588
|
var _a;
|
|
3539
3589
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
3540
3590
|
F: __dxlog_file15,
|
|
3541
|
-
L:
|
|
3591
|
+
L: 190,
|
|
3542
3592
|
S: this,
|
|
3543
3593
|
C: (f, a) => f(...a)
|
|
3544
3594
|
});
|
|
@@ -3561,7 +3611,7 @@ var ServiceContext = class {
|
|
|
3561
3611
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
3562
3612
|
(0, import_invariant12.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
3563
3613
|
F: __dxlog_file15,
|
|
3564
|
-
L:
|
|
3614
|
+
L: 213,
|
|
3565
3615
|
S: this,
|
|
3566
3616
|
A: [
|
|
3567
3617
|
"this.dataSpaceManager",
|
|
@@ -3585,7 +3635,7 @@ var ServiceContext = class {
|
|
|
3585
3635
|
details: assertion
|
|
3586
3636
|
}, {
|
|
3587
3637
|
F: __dxlog_file15,
|
|
3588
|
-
L:
|
|
3638
|
+
L: 229,
|
|
3589
3639
|
S: this,
|
|
3590
3640
|
C: (f, a) => f(...a)
|
|
3591
3641
|
});
|
|
@@ -3596,7 +3646,7 @@ var ServiceContext = class {
|
|
|
3596
3646
|
details: assertion
|
|
3597
3647
|
}, {
|
|
3598
3648
|
F: __dxlog_file15,
|
|
3599
|
-
L:
|
|
3649
|
+
L: 233,
|
|
3600
3650
|
S: this,
|
|
3601
3651
|
C: (f, a) => f(...a)
|
|
3602
3652
|
});
|
|
@@ -3607,7 +3657,7 @@ var ServiceContext = class {
|
|
|
3607
3657
|
details: assertion
|
|
3608
3658
|
}, {
|
|
3609
3659
|
F: __dxlog_file15,
|
|
3610
|
-
L:
|
|
3660
|
+
L: 238,
|
|
3611
3661
|
S: this,
|
|
3612
3662
|
C: (f, a) => f(...a)
|
|
3613
3663
|
});
|
|
@@ -3618,7 +3668,7 @@ var ServiceContext = class {
|
|
|
3618
3668
|
} catch (err) {
|
|
3619
3669
|
import_log13.log.catch(err, void 0, {
|
|
3620
3670
|
F: __dxlog_file15,
|
|
3621
|
-
L:
|
|
3671
|
+
L: 244,
|
|
3622
3672
|
S: this,
|
|
3623
3673
|
C: (f, a) => f(...a)
|
|
3624
3674
|
});
|
|
@@ -3628,10 +3678,20 @@ var ServiceContext = class {
|
|
|
3628
3678
|
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
3629
3679
|
}
|
|
3630
3680
|
};
|
|
3681
|
+
_ts_decorate5([
|
|
3682
|
+
import_tracing3.trace.span()
|
|
3683
|
+
], ServiceContext.prototype, "open", null);
|
|
3684
|
+
_ts_decorate5([
|
|
3685
|
+
import_tracing3.trace.span()
|
|
3686
|
+
], ServiceContext.prototype, "_initialize", null);
|
|
3687
|
+
ServiceContext = _ts_decorate5([
|
|
3688
|
+
import_tracing3.trace.resource()
|
|
3689
|
+
], ServiceContext);
|
|
3631
3690
|
|
|
3632
3691
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
3633
3692
|
var import_async17 = require("@dxos/async");
|
|
3634
3693
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
3694
|
+
var import_context10 = require("@dxos/context");
|
|
3635
3695
|
var import_document_model2 = require("@dxos/document-model");
|
|
3636
3696
|
var import_echo_pipeline4 = require("@dxos/echo-pipeline");
|
|
3637
3697
|
var import_invariant14 = require("@dxos/invariant");
|
|
@@ -3643,6 +3703,7 @@ var import_network_manager2 = require("@dxos/network-manager");
|
|
|
3643
3703
|
var import_protocols10 = require("@dxos/protocols");
|
|
3644
3704
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3645
3705
|
var import_text_model = require("@dxos/text-model");
|
|
3706
|
+
var import_tracing4 = require("@dxos/tracing");
|
|
3646
3707
|
|
|
3647
3708
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
3648
3709
|
var import_async12 = require("@dxos/async");
|
|
@@ -3798,7 +3859,7 @@ var subscribeToMetadata = ({ context }) => new import_codec_protobuf9.Stream(({
|
|
|
3798
3859
|
|
|
3799
3860
|
// packages/sdk/client-services/src/packlets/devtools/network.ts
|
|
3800
3861
|
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
3801
|
-
var
|
|
3862
|
+
var import_context9 = require("@dxos/context");
|
|
3802
3863
|
var import_keys10 = require("@dxos/keys");
|
|
3803
3864
|
var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf10.Stream(({ next, close }) => {
|
|
3804
3865
|
const update = () => {
|
|
@@ -3815,7 +3876,7 @@ var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf1
|
|
|
3815
3876
|
update();
|
|
3816
3877
|
});
|
|
3817
3878
|
var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf10.Stream(({ next }) => {
|
|
3818
|
-
const ctx = new
|
|
3879
|
+
const ctx = new import_context9.Context();
|
|
3819
3880
|
signalManager.onMessage.on(ctx, (message) => {
|
|
3820
3881
|
next({
|
|
3821
3882
|
message: {
|
|
@@ -4008,7 +4069,7 @@ var DevtoolsServiceImpl = class {
|
|
|
4008
4069
|
var import_invariant13 = require("@dxos/invariant");
|
|
4009
4070
|
var import_lock_file = require("@dxos/lock-file");
|
|
4010
4071
|
var import_log14 = require("@dxos/log");
|
|
4011
|
-
function
|
|
4072
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
4012
4073
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4013
4074
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4014
4075
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4060,7 +4121,7 @@ var Lock = class {
|
|
|
4060
4121
|
await import_lock_file.LockFile.release(this._fileHandle);
|
|
4061
4122
|
}
|
|
4062
4123
|
};
|
|
4063
|
-
|
|
4124
|
+
_ts_decorate6([
|
|
4064
4125
|
import_log14.logInfo
|
|
4065
4126
|
], Lock.prototype, "lockKey", null);
|
|
4066
4127
|
|
|
@@ -4348,7 +4409,7 @@ var ServiceRegistry = class {
|
|
|
4348
4409
|
};
|
|
4349
4410
|
|
|
4350
4411
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
4351
|
-
function
|
|
4412
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
4352
4413
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4353
4414
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4354
4415
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4362,7 +4423,7 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
4362
4423
|
var createDefaultModelFactory = () => {
|
|
4363
4424
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4364
4425
|
};
|
|
4365
|
-
var ClientServicesHost = class {
|
|
4426
|
+
var ClientServicesHost = class ClientServicesHost2 {
|
|
4366
4427
|
constructor({
|
|
4367
4428
|
config,
|
|
4368
4429
|
modelFactory = createDefaultModelFactory(),
|
|
@@ -4373,6 +4434,7 @@ var ClientServicesHost = class {
|
|
|
4373
4434
|
lockKey,
|
|
4374
4435
|
callbacks
|
|
4375
4436
|
} = {}) {
|
|
4437
|
+
this._tracingService = import_tracing4.TRACE_PROCESSOR.createTraceSender();
|
|
4376
4438
|
this._statusUpdate = new import_async17.Event();
|
|
4377
4439
|
this._opening = false;
|
|
4378
4440
|
this._open = false;
|
|
@@ -4391,7 +4453,7 @@ var ClientServicesHost = class {
|
|
|
4391
4453
|
lockKey,
|
|
4392
4454
|
onAcquire: () => {
|
|
4393
4455
|
if (!this._opening) {
|
|
4394
|
-
void this.open();
|
|
4456
|
+
void this.open(new import_context10.Context());
|
|
4395
4457
|
}
|
|
4396
4458
|
},
|
|
4397
4459
|
onRelease: () => this.close()
|
|
@@ -4418,7 +4480,8 @@ var ClientServicesHost = class {
|
|
|
4418
4480
|
});
|
|
4419
4481
|
this._loggingService = new LoggingServiceImpl();
|
|
4420
4482
|
this._serviceRegistry = new ServiceRegistry(import_client_protocol5.clientServiceBundle, {
|
|
4421
|
-
SystemService: this._systemService
|
|
4483
|
+
SystemService: this._systemService,
|
|
4484
|
+
TracingService: this._tracingService
|
|
4422
4485
|
});
|
|
4423
4486
|
}
|
|
4424
4487
|
get isOpen() {
|
|
@@ -4448,7 +4511,7 @@ var ClientServicesHost = class {
|
|
|
4448
4511
|
var _a, _b, _c;
|
|
4449
4512
|
(0, import_invariant14.invariant)(!this._open, "service host is open", {
|
|
4450
4513
|
F: __dxlog_file17,
|
|
4451
|
-
L:
|
|
4514
|
+
L: 181,
|
|
4452
4515
|
S: this,
|
|
4453
4516
|
A: [
|
|
4454
4517
|
"!this._open",
|
|
@@ -4457,14 +4520,14 @@ var ClientServicesHost = class {
|
|
|
4457
4520
|
});
|
|
4458
4521
|
import_log16.log.info("initializing...", void 0, {
|
|
4459
4522
|
F: __dxlog_file17,
|
|
4460
|
-
L:
|
|
4523
|
+
L: 182,
|
|
4461
4524
|
S: this,
|
|
4462
4525
|
C: (f, a) => f(...a)
|
|
4463
4526
|
});
|
|
4464
4527
|
if (config) {
|
|
4465
4528
|
(0, import_invariant14.invariant)(!this._config, "config already set", {
|
|
4466
4529
|
F: __dxlog_file17,
|
|
4467
|
-
L:
|
|
4530
|
+
L: 185,
|
|
4468
4531
|
S: this,
|
|
4469
4532
|
A: [
|
|
4470
4533
|
"!this._config",
|
|
@@ -4482,7 +4545,7 @@ var ClientServicesHost = class {
|
|
|
4482
4545
|
this._signalManager = signalManager;
|
|
4483
4546
|
(0, import_invariant14.invariant)(!this._networkManager, "network manager already set", {
|
|
4484
4547
|
F: __dxlog_file17,
|
|
4485
|
-
L:
|
|
4548
|
+
L: 201,
|
|
4486
4549
|
S: this,
|
|
4487
4550
|
A: [
|
|
4488
4551
|
"!this._networkManager",
|
|
@@ -4496,12 +4559,12 @@ var ClientServicesHost = class {
|
|
|
4496
4559
|
});
|
|
4497
4560
|
import_log16.log.info("initialized", void 0, {
|
|
4498
4561
|
F: __dxlog_file17,
|
|
4499
|
-
L:
|
|
4562
|
+
L: 208,
|
|
4500
4563
|
S: this,
|
|
4501
4564
|
C: (f, a) => f(...a)
|
|
4502
4565
|
});
|
|
4503
4566
|
}
|
|
4504
|
-
async open() {
|
|
4567
|
+
async open(ctx) {
|
|
4505
4568
|
var _a, _b, _c;
|
|
4506
4569
|
if (this._open) {
|
|
4507
4570
|
return;
|
|
@@ -4511,13 +4574,13 @@ var ClientServicesHost = class {
|
|
|
4511
4574
|
id: traceId
|
|
4512
4575
|
}), {
|
|
4513
4576
|
F: __dxlog_file17,
|
|
4514
|
-
L:
|
|
4577
|
+
L: 219,
|
|
4515
4578
|
S: this,
|
|
4516
4579
|
C: (f, a) => f(...a)
|
|
4517
4580
|
});
|
|
4518
4581
|
(0, import_invariant14.invariant)(this._config, "config not set", {
|
|
4519
4582
|
F: __dxlog_file17,
|
|
4520
|
-
L:
|
|
4583
|
+
L: 221,
|
|
4521
4584
|
S: this,
|
|
4522
4585
|
A: [
|
|
4523
4586
|
"this._config",
|
|
@@ -4526,7 +4589,7 @@ var ClientServicesHost = class {
|
|
|
4526
4589
|
});
|
|
4527
4590
|
(0, import_invariant14.invariant)(this._storage, "storage not set", {
|
|
4528
4591
|
F: __dxlog_file17,
|
|
4529
|
-
L:
|
|
4592
|
+
L: 222,
|
|
4530
4593
|
S: this,
|
|
4531
4594
|
A: [
|
|
4532
4595
|
"this._storage",
|
|
@@ -4535,7 +4598,7 @@ var ClientServicesHost = class {
|
|
|
4535
4598
|
});
|
|
4536
4599
|
(0, import_invariant14.invariant)(this._signalManager, "signal manager not set", {
|
|
4537
4600
|
F: __dxlog_file17,
|
|
4538
|
-
L:
|
|
4601
|
+
L: 223,
|
|
4539
4602
|
S: this,
|
|
4540
4603
|
A: [
|
|
4541
4604
|
"this._signalManager",
|
|
@@ -4544,7 +4607,7 @@ var ClientServicesHost = class {
|
|
|
4544
4607
|
});
|
|
4545
4608
|
(0, import_invariant14.invariant)(this._networkManager, "network manager not set", {
|
|
4546
4609
|
F: __dxlog_file17,
|
|
4547
|
-
L:
|
|
4610
|
+
L: 224,
|
|
4548
4611
|
S: this,
|
|
4549
4612
|
A: [
|
|
4550
4613
|
"this._networkManager",
|
|
@@ -4556,7 +4619,7 @@ var ClientServicesHost = class {
|
|
|
4556
4619
|
lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
|
|
4557
4620
|
}, {
|
|
4558
4621
|
F: __dxlog_file17,
|
|
4559
|
-
L:
|
|
4622
|
+
L: 227,
|
|
4560
4623
|
S: this,
|
|
4561
4624
|
C: (f, a) => f(...a)
|
|
4562
4625
|
});
|
|
@@ -4575,6 +4638,7 @@ var ClientServicesHost = class {
|
|
|
4575
4638
|
DataService: new import_echo_pipeline4.DataServiceImpl(this._serviceContext.dataServiceSubscriptions),
|
|
4576
4639
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
4577
4640
|
LoggingService: this._loggingService,
|
|
4641
|
+
TracingService: this._tracingService,
|
|
4578
4642
|
// TODO(burdon): Move to new protobuf definitions.
|
|
4579
4643
|
DevtoolsHost: new DevtoolsServiceImpl({
|
|
4580
4644
|
events: new DevtoolsHostEvents(),
|
|
@@ -4582,7 +4646,7 @@ var ClientServicesHost = class {
|
|
|
4582
4646
|
context: this._serviceContext
|
|
4583
4647
|
})
|
|
4584
4648
|
});
|
|
4585
|
-
await this._serviceContext.open();
|
|
4649
|
+
await this._serviceContext.open(ctx);
|
|
4586
4650
|
this._opening = false;
|
|
4587
4651
|
this._open = true;
|
|
4588
4652
|
this._statusUpdate.emit();
|
|
@@ -4591,7 +4655,7 @@ var ClientServicesHost = class {
|
|
|
4591
4655
|
deviceKey
|
|
4592
4656
|
}, {
|
|
4593
4657
|
F: __dxlog_file17,
|
|
4594
|
-
L:
|
|
4658
|
+
L: 280,
|
|
4595
4659
|
S: this,
|
|
4596
4660
|
C: (f, a) => f(...a)
|
|
4597
4661
|
});
|
|
@@ -4599,7 +4663,7 @@ var ClientServicesHost = class {
|
|
|
4599
4663
|
id: traceId
|
|
4600
4664
|
}), {
|
|
4601
4665
|
F: __dxlog_file17,
|
|
4602
|
-
L:
|
|
4666
|
+
L: 281,
|
|
4603
4667
|
S: this,
|
|
4604
4668
|
C: (f, a) => f(...a)
|
|
4605
4669
|
});
|
|
@@ -4614,7 +4678,7 @@ var ClientServicesHost = class {
|
|
|
4614
4678
|
deviceKey
|
|
4615
4679
|
}, {
|
|
4616
4680
|
F: __dxlog_file17,
|
|
4617
|
-
L:
|
|
4681
|
+
L: 292,
|
|
4618
4682
|
S: this,
|
|
4619
4683
|
C: (f, a) => f(...a)
|
|
4620
4684
|
});
|
|
@@ -4629,7 +4693,7 @@ var ClientServicesHost = class {
|
|
|
4629
4693
|
deviceKey
|
|
4630
4694
|
}, {
|
|
4631
4695
|
F: __dxlog_file17,
|
|
4632
|
-
L:
|
|
4696
|
+
L: 298,
|
|
4633
4697
|
S: this,
|
|
4634
4698
|
C: (f, a) => f(...a)
|
|
4635
4699
|
});
|
|
@@ -4641,13 +4705,13 @@ var ClientServicesHost = class {
|
|
|
4641
4705
|
id: traceId
|
|
4642
4706
|
}), {
|
|
4643
4707
|
F: __dxlog_file17,
|
|
4644
|
-
L:
|
|
4708
|
+
L: 303,
|
|
4645
4709
|
S: this,
|
|
4646
4710
|
C: (f, a) => f(...a)
|
|
4647
4711
|
});
|
|
4648
4712
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4649
4713
|
F: __dxlog_file17,
|
|
4650
|
-
L:
|
|
4714
|
+
L: 305,
|
|
4651
4715
|
S: this,
|
|
4652
4716
|
C: (f, a) => f(...a)
|
|
4653
4717
|
});
|
|
@@ -4655,7 +4719,7 @@ var ClientServicesHost = class {
|
|
|
4655
4719
|
await this._storage.reset();
|
|
4656
4720
|
(0, import_log16.log)("reset", void 0, {
|
|
4657
4721
|
F: __dxlog_file17,
|
|
4658
|
-
L:
|
|
4722
|
+
L: 308,
|
|
4659
4723
|
S: this,
|
|
4660
4724
|
C: (f, a) => f(...a)
|
|
4661
4725
|
});
|
|
@@ -4663,19 +4727,30 @@ var ClientServicesHost = class {
|
|
|
4663
4727
|
id: traceId
|
|
4664
4728
|
}), {
|
|
4665
4729
|
F: __dxlog_file17,
|
|
4666
|
-
L:
|
|
4730
|
+
L: 309,
|
|
4667
4731
|
S: this,
|
|
4668
4732
|
C: (f, a) => f(...a)
|
|
4669
4733
|
});
|
|
4670
4734
|
await ((_c = (_b = this._callbacks) == null ? void 0 : _b.onReset) == null ? void 0 : _c.call(_b));
|
|
4671
4735
|
}
|
|
4672
4736
|
};
|
|
4673
|
-
|
|
4674
|
-
|
|
4737
|
+
_ts_decorate7([
|
|
4738
|
+
import_tracing4.trace.info()
|
|
4739
|
+
], ClientServicesHost.prototype, "_opening", void 0);
|
|
4740
|
+
_ts_decorate7([
|
|
4741
|
+
import_tracing4.trace.info()
|
|
4742
|
+
], ClientServicesHost.prototype, "_open", void 0);
|
|
4743
|
+
_ts_decorate7([
|
|
4744
|
+
import_async17.synchronized,
|
|
4745
|
+
import_tracing4.trace.span()
|
|
4675
4746
|
], ClientServicesHost.prototype, "open", null);
|
|
4676
|
-
|
|
4677
|
-
import_async17.synchronized
|
|
4747
|
+
_ts_decorate7([
|
|
4748
|
+
import_async17.synchronized,
|
|
4749
|
+
import_tracing4.trace.span()
|
|
4678
4750
|
], ClientServicesHost.prototype, "close", null);
|
|
4751
|
+
ClientServicesHost = _ts_decorate7([
|
|
4752
|
+
import_tracing4.trace.resource()
|
|
4753
|
+
], ClientServicesHost);
|
|
4679
4754
|
|
|
4680
4755
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
4681
4756
|
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
|
|
@@ -4859,7 +4934,7 @@ var acceptInvitation = (guest, invitation) => {
|
|
|
4859
4934
|
};
|
|
4860
4935
|
|
|
4861
4936
|
// packages/sdk/client-services/src/packlets/testing/test-builder.ts
|
|
4862
|
-
var
|
|
4937
|
+
var import_context11 = require("@dxos/context");
|
|
4863
4938
|
var import_credentials16 = require("@dxos/credentials");
|
|
4864
4939
|
var import_debug8 = require("@dxos/debug");
|
|
4865
4940
|
var import_echo_pipeline5 = require("@dxos/echo-pipeline");
|
|
@@ -4894,7 +4969,7 @@ var createPeers = async (numPeers) => {
|
|
|
4894
4969
|
const peer = createServiceContext({
|
|
4895
4970
|
signalContext
|
|
4896
4971
|
});
|
|
4897
|
-
await peer.open();
|
|
4972
|
+
await peer.open(new import_context11.Context());
|
|
4898
4973
|
return peer;
|
|
4899
4974
|
}));
|
|
4900
4975
|
};
|
|
@@ -4909,7 +4984,7 @@ var syncItemsLocal = async (db1, db2) => {
|
|
|
4909
4984
|
var TestBuilder = class {
|
|
4910
4985
|
constructor() {
|
|
4911
4986
|
this.signalContext = new import_messaging2.MemorySignalManagerContext();
|
|
4912
|
-
this._ctx = new
|
|
4987
|
+
this._ctx = new import_context11.Context();
|
|
4913
4988
|
}
|
|
4914
4989
|
createPeer(peerOptions) {
|
|
4915
4990
|
const peer = new TestPeer(this.signalContext, peerOptions);
|