@dxos/client-services 0.3.2-main.de57e73 → 0.3.2-main.fa875a7
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-XEZCTVLQ.mjs → chunk-IM7YVH3R.mjs} +122 -112
- package/dist/lib/browser/chunk-IM7YVH3R.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs.map +2 -2
- package/dist/lib/node/index.cjs +158 -138
- 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 +155 -135
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/devices/devices-service.d.ts +4 -4
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/devtools.d.ts +4 -4
- package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/feeds.d.ts +3 -3
- package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/keys.d.ts +2 -2
- package/dist/types/src/packlets/devtools/keys.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/metadata.d.ts +2 -2
- package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/network.d.ts +3 -3
- package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
- package/dist/types/src/packlets/devtools/spaces.d.ts +2 -2
- package/dist/types/src/packlets/devtools/spaces.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts +5 -5
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +5 -5
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +4 -4
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +8 -8
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +4 -4
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +6 -6
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/browser.d.ts +1 -1
- package/dist/types/src/packlets/locks/browser.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/node.d.ts +1 -1
- package/dist/types/src/packlets/locks/node.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/resource-lock.d.ts +1 -1
- package/dist/types/src/packlets/locks/resource-lock.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts +3 -3
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts +5 -5
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/diagnostics.d.ts +8 -8
- package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +6 -6
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +5 -5
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-registry.d.ts +1 -1
- package/dist/types/src/packlets/services/service-registry.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +7 -7
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +9 -9
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/genesis.d.ts +3 -3
- package/dist/types/src/packlets/spaces/genesis.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +5 -5
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +7 -7
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts +5 -5
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/credential-utils.d.ts +2 -2
- package/dist/types/src/packlets/testing/credential-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +4 -4
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +4 -4
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts +4 -4
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +4 -4
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts +3 -3
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts +3 -3
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +37 -35
- package/src/packlets/devices/devices-service.test.ts +2 -2
- package/src/packlets/devices/devices-service.ts +11 -5
- package/src/packlets/devtools/devtools.ts +35 -35
- package/src/packlets/devtools/feeds.ts +6 -6
- package/src/packlets/devtools/keys.ts +2 -2
- package/src/packlets/devtools/metadata.ts +2 -2
- package/src/packlets/devtools/network.ts +8 -8
- package/src/packlets/devtools/spaces.ts +8 -5
- package/src/packlets/identity/authenticator.ts +5 -5
- package/src/packlets/identity/identity-manager.test.ts +13 -1
- package/src/packlets/identity/identity-manager.ts +18 -6
- package/src/packlets/identity/identity-service.test.ts +2 -2
- package/src/packlets/identity/identity-service.ts +8 -8
- package/src/packlets/identity/identity.test.ts +4 -4
- package/src/packlets/identity/identity.ts +16 -10
- package/src/packlets/invitations/device-invitation-protocol.test.ts +1 -1
- package/src/packlets/invitations/device-invitation-protocol.ts +8 -4
- package/src/packlets/invitations/invitation-extension.ts +6 -6
- package/src/packlets/invitations/invitation-protocol.ts +7 -3
- package/src/packlets/invitations/invitations-handler.ts +7 -2
- package/src/packlets/invitations/invitations-service.ts +5 -7
- package/src/packlets/invitations/space-invitation-protocol.test.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.ts +12 -8
- package/src/packlets/locks/browser.ts +1 -1
- package/src/packlets/locks/node.ts +2 -2
- package/src/packlets/locks/resource-lock.ts +1 -1
- package/src/packlets/logging/logging-service.ts +14 -8
- package/src/packlets/logging/logging.test.ts +1 -1
- package/src/packlets/network/network-service.test.ts +2 -2
- package/src/packlets/network/network-service.ts +7 -3
- package/src/packlets/services/client-rpc-server.ts +5 -5
- package/src/packlets/services/diagnostics.ts +13 -13
- package/src/packlets/services/service-context.test.ts +2 -2
- package/src/packlets/services/service-context.ts +9 -9
- package/src/packlets/services/service-host.test.ts +3 -3
- package/src/packlets/services/service-host.ts +9 -9
- package/src/packlets/services/service-registry.test.ts +2 -2
- package/src/packlets/services/service-registry.ts +1 -1
- package/src/packlets/spaces/data-space-manager.test.ts +4 -4
- package/src/packlets/spaces/data-space-manager.ts +8 -8
- package/src/packlets/spaces/data-space.ts +10 -10
- package/src/packlets/spaces/genesis.ts +3 -3
- package/src/packlets/spaces/notarization-plugin.test.ts +2 -2
- package/src/packlets/spaces/notarization-plugin.ts +5 -5
- package/src/packlets/spaces/spaces-service.test.ts +2 -2
- package/src/packlets/spaces/spaces-service.ts +17 -17
- package/src/packlets/system/system-service.test.ts +1 -1
- package/src/packlets/system/system-service.ts +9 -9
- package/src/packlets/testing/credential-utils.ts +2 -2
- package/src/packlets/testing/invitation-utils.ts +1 -1
- package/src/packlets/testing/test-builder.ts +4 -4
- package/src/packlets/vault/iframe-host-runtime.ts +6 -6
- package/src/packlets/vault/iframe-proxy-runtime.ts +10 -5
- package/src/packlets/vault/shell-runtime.ts +4 -4
- package/src/packlets/vault/worker-runtime.ts +3 -3
- package/src/packlets/vault/worker-session.ts +5 -5
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-XEZCTVLQ.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// packages/sdk/client-services/src/index.ts
|
|
@@ -519,9 +529,11 @@ var import_credentials2 = require("@dxos/credentials");
|
|
|
519
529
|
var import_debug = require("@dxos/debug");
|
|
520
530
|
var import_feed_store2 = require("@dxos/feed-store");
|
|
521
531
|
var import_invariant = require("@dxos/invariant");
|
|
532
|
+
var import_keys4 = require("@dxos/keys");
|
|
522
533
|
var import_log2 = require("@dxos/log");
|
|
523
534
|
var import_credentials3 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
524
535
|
var import_tracing = require("@dxos/tracing");
|
|
536
|
+
var import_util2 = require("@dxos/util");
|
|
525
537
|
function _ts_decorate(decorators, target, key, desc) {
|
|
526
538
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
527
539
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -540,6 +552,14 @@ var Identity = class Identity2 {
|
|
|
540
552
|
this._signer = signer;
|
|
541
553
|
this.identityKey = identityKey;
|
|
542
554
|
this.deviceKey = deviceKey;
|
|
555
|
+
import_log2.log.trace("dxos.halo.device", {
|
|
556
|
+
deviceKey
|
|
557
|
+
}, {
|
|
558
|
+
F: __dxlog_file2,
|
|
559
|
+
L: 64,
|
|
560
|
+
S: this,
|
|
561
|
+
C: (f, a) => f(...a)
|
|
562
|
+
});
|
|
543
563
|
this._deviceStateMachine = new import_credentials2.DeviceStateMachine({
|
|
544
564
|
identityKey: this.identityKey,
|
|
545
565
|
deviceKey: this.deviceKey,
|
|
@@ -550,7 +570,7 @@ var Identity = class Identity2 {
|
|
|
550
570
|
onUpdate: () => this.stateUpdate.emit()
|
|
551
571
|
});
|
|
552
572
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
553
|
-
trustedKeysProvider: () => this.authorizedDeviceKeys,
|
|
573
|
+
trustedKeysProvider: () => new import_util2.ComplexSet(import_keys4.PublicKey.hash, this.authorizedDeviceKeys.keys()),
|
|
554
574
|
update: this.stateUpdate,
|
|
555
575
|
authTimeout: import_client_protocol.AUTH_TIMEOUT
|
|
556
576
|
});
|
|
@@ -608,7 +628,7 @@ var Identity = class Identity2 {
|
|
|
608
628
|
getIdentityCredentialSigner() {
|
|
609
629
|
(0, import_invariant.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
610
630
|
F: __dxlog_file2,
|
|
611
|
-
L:
|
|
631
|
+
L: 145,
|
|
612
632
|
S: this,
|
|
613
633
|
A: [
|
|
614
634
|
"this._deviceStateMachine.deviceCredentialChain",
|
|
@@ -632,7 +652,7 @@ var Identity = class Identity2 {
|
|
|
632
652
|
dataFeedKey
|
|
633
653
|
}, {
|
|
634
654
|
F: __dxlog_file2,
|
|
635
|
-
L:
|
|
655
|
+
L: 161,
|
|
636
656
|
S: this,
|
|
637
657
|
C: (f, a) => f(...a)
|
|
638
658
|
});
|
|
@@ -684,17 +704,18 @@ Identity = _ts_decorate([
|
|
|
684
704
|
], Identity);
|
|
685
705
|
|
|
686
706
|
// packages/sdk/client-services/src/packlets/identity/identity-manager.ts
|
|
707
|
+
var import_platform = __toESM(require("platform"));
|
|
687
708
|
var import_async6 = require("@dxos/async");
|
|
688
709
|
var import_context3 = require("@dxos/context");
|
|
689
710
|
var import_credentials4 = require("@dxos/credentials");
|
|
690
711
|
var import_invariant2 = require("@dxos/invariant");
|
|
691
|
-
var
|
|
712
|
+
var import_keys5 = require("@dxos/keys");
|
|
692
713
|
var import_log3 = require("@dxos/log");
|
|
693
714
|
var import_protocols2 = require("@dxos/protocols");
|
|
694
715
|
var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
695
716
|
var import_timeframe = require("@dxos/timeframe");
|
|
696
717
|
var import_tracing2 = require("@dxos/tracing");
|
|
697
|
-
var
|
|
718
|
+
var import_util3 = require("@dxos/util");
|
|
698
719
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
699
720
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
700
721
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -720,12 +741,12 @@ var IdentityManager = class IdentityManager2 {
|
|
|
720
741
|
return this._identity;
|
|
721
742
|
}
|
|
722
743
|
async open(ctx) {
|
|
723
|
-
const traceId =
|
|
744
|
+
const traceId = import_keys5.PublicKey.random().toHex();
|
|
724
745
|
import_log3.log.trace("dxos.halo.identity-manager.open", import_protocols2.trace.begin({
|
|
725
746
|
id: traceId
|
|
726
747
|
}), {
|
|
727
748
|
F: __dxlog_file3,
|
|
728
|
-
L:
|
|
749
|
+
L: 75,
|
|
729
750
|
S: this,
|
|
730
751
|
C: (f, a) => f(...a)
|
|
731
752
|
});
|
|
@@ -734,7 +755,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
734
755
|
identityRecord
|
|
735
756
|
}, {
|
|
736
757
|
F: __dxlog_file3,
|
|
737
|
-
L:
|
|
758
|
+
L: 78,
|
|
738
759
|
S: this,
|
|
739
760
|
C: (f, a) => f(...a)
|
|
740
761
|
});
|
|
@@ -747,7 +768,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
747
768
|
displayName: this._identity.profileDocument?.displayName
|
|
748
769
|
}, {
|
|
749
770
|
F: __dxlog_file3,
|
|
750
|
-
L:
|
|
771
|
+
L: 83,
|
|
751
772
|
S: this,
|
|
752
773
|
C: (f, a) => f(...a)
|
|
753
774
|
});
|
|
@@ -757,7 +778,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
757
778
|
id: traceId
|
|
758
779
|
}), {
|
|
759
780
|
F: __dxlog_file3,
|
|
760
|
-
L:
|
|
781
|
+
L: 89,
|
|
761
782
|
S: this,
|
|
762
783
|
C: (f, a) => f(...a)
|
|
763
784
|
});
|
|
@@ -768,7 +789,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
768
789
|
async createIdentity({ displayName } = {}) {
|
|
769
790
|
(0, import_invariant2.invariant)(!this._identity, "Identity already exists.", {
|
|
770
791
|
F: __dxlog_file3,
|
|
771
|
-
L:
|
|
792
|
+
L: 97,
|
|
772
793
|
S: this,
|
|
773
794
|
A: [
|
|
774
795
|
"!this._identity",
|
|
@@ -777,7 +798,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
777
798
|
});
|
|
778
799
|
(0, import_log3.log)("creating identity...", void 0, {
|
|
779
800
|
F: __dxlog_file3,
|
|
780
|
-
L:
|
|
801
|
+
L: 98,
|
|
781
802
|
S: this,
|
|
782
803
|
C: (f, a) => f(...a)
|
|
783
804
|
});
|
|
@@ -798,7 +819,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
798
819
|
const generator = new import_credentials4.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
799
820
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
800
821
|
F: __dxlog_file3,
|
|
801
|
-
L:
|
|
822
|
+
L: 117,
|
|
802
823
|
S: this,
|
|
803
824
|
A: [
|
|
804
825
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -807,7 +828,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
807
828
|
});
|
|
808
829
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
809
830
|
F: __dxlog_file3,
|
|
810
|
-
L:
|
|
831
|
+
L: 118,
|
|
811
832
|
S: this,
|
|
812
833
|
A: [
|
|
813
834
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -826,6 +847,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
826
847
|
}));
|
|
827
848
|
}
|
|
828
849
|
credentials.push(await generator.createDeviceAuthorization(identityRecord.deviceKey));
|
|
850
|
+
credentials.push(await generator.createDeviceProfile({
|
|
851
|
+
platform: import_platform.default.name,
|
|
852
|
+
platformVersion: import_platform.default.version,
|
|
853
|
+
architecture: typeof import_platform.default.os?.architecture === "number" ? String(import_platform.default.os.architecture) : void 0,
|
|
854
|
+
os: import_platform.default.os?.family,
|
|
855
|
+
osVersion: import_platform.default.os?.version
|
|
856
|
+
}));
|
|
829
857
|
for (const credential of credentials) {
|
|
830
858
|
await identity.controlPipeline.writer.write({
|
|
831
859
|
credential: {
|
|
@@ -842,7 +870,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
842
870
|
displayName: this._identity.profileDocument?.displayName
|
|
843
871
|
}, {
|
|
844
872
|
F: __dxlog_file3,
|
|
845
|
-
L:
|
|
873
|
+
L: 163,
|
|
846
874
|
S: this,
|
|
847
875
|
C: (f, a) => f(...a)
|
|
848
876
|
});
|
|
@@ -852,7 +880,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
852
880
|
deviceKey: identity.deviceKey
|
|
853
881
|
}, {
|
|
854
882
|
F: __dxlog_file3,
|
|
855
|
-
L:
|
|
883
|
+
L: 169,
|
|
856
884
|
S: this,
|
|
857
885
|
C: (f, a) => f(...a)
|
|
858
886
|
});
|
|
@@ -866,13 +894,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
866
894
|
params
|
|
867
895
|
}, {
|
|
868
896
|
F: __dxlog_file3,
|
|
869
|
-
L:
|
|
897
|
+
L: 177,
|
|
870
898
|
S: this,
|
|
871
899
|
C: (f, a) => f(...a)
|
|
872
900
|
});
|
|
873
901
|
(0, import_invariant2.invariant)(!this._identity, "Identity already exists.", {
|
|
874
902
|
F: __dxlog_file3,
|
|
875
|
-
L:
|
|
903
|
+
L: 178,
|
|
876
904
|
S: this,
|
|
877
905
|
A: [
|
|
878
906
|
"!this._identity",
|
|
@@ -900,7 +928,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
900
928
|
displayName: this._identity.profileDocument?.displayName
|
|
901
929
|
}, {
|
|
902
930
|
F: __dxlog_file3,
|
|
903
|
-
L:
|
|
931
|
+
L: 197,
|
|
904
932
|
S: this,
|
|
905
933
|
C: (f, a) => f(...a)
|
|
906
934
|
});
|
|
@@ -910,7 +938,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
910
938
|
deviceKey: identity.deviceKey
|
|
911
939
|
}, {
|
|
912
940
|
F: __dxlog_file3,
|
|
913
|
-
L:
|
|
941
|
+
L: 203,
|
|
914
942
|
S: this,
|
|
915
943
|
C: (f, a) => f(...a)
|
|
916
944
|
});
|
|
@@ -922,7 +950,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
922
950
|
async updateProfile(profile) {
|
|
923
951
|
(0, import_invariant2.invariant)(this._identity, "Identity not initialized.", {
|
|
924
952
|
F: __dxlog_file3,
|
|
925
|
-
L:
|
|
953
|
+
L: 211,
|
|
926
954
|
S: this,
|
|
927
955
|
A: [
|
|
928
956
|
"this._identity",
|
|
@@ -953,7 +981,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
953
981
|
async _constructIdentity(identityRecord) {
|
|
954
982
|
(0, import_invariant2.invariant)(!this._identity, void 0, {
|
|
955
983
|
F: __dxlog_file3,
|
|
956
|
-
L:
|
|
984
|
+
L: 228,
|
|
957
985
|
S: this,
|
|
958
986
|
A: [
|
|
959
987
|
"!this._identity",
|
|
@@ -964,13 +992,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
964
992
|
identityRecord
|
|
965
993
|
}, {
|
|
966
994
|
F: __dxlog_file3,
|
|
967
|
-
L:
|
|
995
|
+
L: 229,
|
|
968
996
|
S: this,
|
|
969
997
|
C: (f, a) => f(...a)
|
|
970
998
|
});
|
|
971
999
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
972
1000
|
F: __dxlog_file3,
|
|
973
|
-
L:
|
|
1001
|
+
L: 232,
|
|
974
1002
|
S: this,
|
|
975
1003
|
A: [
|
|
976
1004
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -982,7 +1010,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
982
1010
|
});
|
|
983
1011
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
984
1012
|
F: __dxlog_file3,
|
|
985
|
-
L:
|
|
1013
|
+
L: 236,
|
|
986
1014
|
S: this,
|
|
987
1015
|
A: [
|
|
988
1016
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -998,7 +1026,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
998
1026
|
swarmIdentity: {
|
|
999
1027
|
peerKey: identityRecord.deviceKey,
|
|
1000
1028
|
credentialProvider: createAuthProvider((0, import_credentials4.createCredentialSignerWithKey)(this._keyring, identityRecord.deviceKey)),
|
|
1001
|
-
credentialAuthenticator: (0,
|
|
1029
|
+
credentialAuthenticator: (0, import_util3.deferFunction)(() => identity.authVerifier.verifier)
|
|
1002
1030
|
},
|
|
1003
1031
|
identityKey: identityRecord.identityKey
|
|
1004
1032
|
});
|
|
@@ -1014,7 +1042,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
1014
1042
|
identityKey: identityRecord.identityKey
|
|
1015
1043
|
}, {
|
|
1016
1044
|
F: __dxlog_file3,
|
|
1017
|
-
L:
|
|
1045
|
+
L: 260,
|
|
1018
1046
|
S: this,
|
|
1019
1047
|
C: (f, a) => f(...a)
|
|
1020
1048
|
});
|
|
@@ -1035,7 +1063,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
1035
1063
|
onAuthFailure: () => {
|
|
1036
1064
|
import_log3.log.warn("auth failure", void 0, {
|
|
1037
1065
|
F: __dxlog_file3,
|
|
1038
|
-
L:
|
|
1066
|
+
L: 279,
|
|
1039
1067
|
S: this,
|
|
1040
1068
|
C: (f, a) => f(...a)
|
|
1041
1069
|
});
|
|
@@ -1145,7 +1173,7 @@ var DeviceInvitationProtocol = class {
|
|
|
1145
1173
|
async admit(request) {
|
|
1146
1174
|
(0, import_invariant4.invariant)(request.device, void 0, {
|
|
1147
1175
|
F: __dxlog_file5,
|
|
1148
|
-
L:
|
|
1176
|
+
L: 35,
|
|
1149
1177
|
S: this,
|
|
1150
1178
|
A: [
|
|
1151
1179
|
"request.device",
|
|
@@ -1181,7 +1209,7 @@ var DeviceInvitationProtocol = class {
|
|
|
1181
1209
|
async accept(response, request) {
|
|
1182
1210
|
(0, import_invariant4.invariant)(response.device, void 0, {
|
|
1183
1211
|
F: __dxlog_file5,
|
|
1184
|
-
L:
|
|
1212
|
+
L: 68,
|
|
1185
1213
|
S: this,
|
|
1186
1214
|
A: [
|
|
1187
1215
|
"response.device",
|
|
@@ -1191,7 +1219,7 @@ var DeviceInvitationProtocol = class {
|
|
|
1191
1219
|
const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
|
|
1192
1220
|
(0, import_invariant4.invariant)(request.device, void 0, {
|
|
1193
1221
|
F: __dxlog_file5,
|
|
1194
|
-
L:
|
|
1222
|
+
L: 71,
|
|
1195
1223
|
S: this,
|
|
1196
1224
|
A: [
|
|
1197
1225
|
"request.device",
|
|
@@ -1220,7 +1248,7 @@ var import_client_protocol2 = require("@dxos/client-protocol");
|
|
|
1220
1248
|
var import_context5 = require("@dxos/context");
|
|
1221
1249
|
var import_credentials7 = require("@dxos/credentials");
|
|
1222
1250
|
var import_invariant6 = require("@dxos/invariant");
|
|
1223
|
-
var
|
|
1251
|
+
var import_keys7 = require("@dxos/keys");
|
|
1224
1252
|
var import_log5 = require("@dxos/log");
|
|
1225
1253
|
var import_network_manager = require("@dxos/network-manager");
|
|
1226
1254
|
var import_protocols4 = require("@dxos/protocols");
|
|
@@ -1231,7 +1259,7 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
|
|
|
1231
1259
|
var import_async7 = require("@dxos/async");
|
|
1232
1260
|
var import_context4 = require("@dxos/context");
|
|
1233
1261
|
var import_invariant5 = require("@dxos/invariant");
|
|
1234
|
-
var
|
|
1262
|
+
var import_keys6 = require("@dxos/keys");
|
|
1235
1263
|
var import_log4 = require("@dxos/log");
|
|
1236
1264
|
var import_protocols3 = require("@dxos/protocols");
|
|
1237
1265
|
var import_services2 = require("@dxos/protocols/proto/dxos/client/services");
|
|
@@ -1279,7 +1307,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1279
1307
|
},
|
|
1280
1308
|
introduce: async (request) => {
|
|
1281
1309
|
const { profile, invitationId } = request;
|
|
1282
|
-
const traceId =
|
|
1310
|
+
const traceId = import_keys6.PublicKey.random().toHex();
|
|
1283
1311
|
import_log4.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols3.trace.begin({
|
|
1284
1312
|
id: traceId
|
|
1285
1313
|
}), {
|
|
@@ -1331,7 +1359,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1331
1359
|
};
|
|
1332
1360
|
},
|
|
1333
1361
|
authenticate: async ({ authCode: code }) => {
|
|
1334
|
-
const traceId =
|
|
1362
|
+
const traceId = import_keys6.PublicKey.random().toHex();
|
|
1335
1363
|
import_log4.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols3.trace.begin({
|
|
1336
1364
|
id: traceId
|
|
1337
1365
|
}), {
|
|
@@ -1411,7 +1439,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1411
1439
|
};
|
|
1412
1440
|
},
|
|
1413
1441
|
admit: async (request) => {
|
|
1414
|
-
const traceId =
|
|
1442
|
+
const traceId = import_keys6.PublicKey.random().toHex();
|
|
1415
1443
|
import_log4.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols3.trace.begin({
|
|
1416
1444
|
id: traceId
|
|
1417
1445
|
}), {
|
|
@@ -1577,11 +1605,11 @@ var InvitationsHandler = class {
|
|
|
1577
1605
|
this._networkManager = _networkManager;
|
|
1578
1606
|
}
|
|
1579
1607
|
createInvitation(protocol, options) {
|
|
1580
|
-
const { invitationId =
|
|
1608
|
+
const { invitationId = import_keys7.PublicKey.random().toHex(), type = import_services3.Invitation.Type.INTERACTIVE, authMethod = import_services3.Invitation.AuthMethod.SHARED_SECRET, state = import_services3.Invitation.State.INIT, timeout = import_client_protocol2.INVITATION_TIMEOUT, swarmKey = import_keys7.PublicKey.random() } = options ?? {};
|
|
1581
1609
|
const authCode = options?.authCode ?? (authMethod === import_services3.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials7.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1582
1610
|
(0, import_invariant6.invariant)(protocol, void 0, {
|
|
1583
1611
|
F: __dxlog_file7,
|
|
1584
|
-
L:
|
|
1612
|
+
L: 80,
|
|
1585
1613
|
S: this,
|
|
1586
1614
|
A: [
|
|
1587
1615
|
"protocol",
|
|
@@ -1610,7 +1638,7 @@ var InvitationsHandler = class {
|
|
|
1610
1638
|
...protocol.toJSON()
|
|
1611
1639
|
}, {
|
|
1612
1640
|
F: __dxlog_file7,
|
|
1613
|
-
L:
|
|
1641
|
+
L: 102,
|
|
1614
1642
|
S: this,
|
|
1615
1643
|
C: (f, a) => f(...a)
|
|
1616
1644
|
});
|
|
@@ -1635,7 +1663,7 @@ var InvitationsHandler = class {
|
|
|
1635
1663
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1636
1664
|
(0, import_invariant6.invariant)(deviceKey, void 0, {
|
|
1637
1665
|
F: __dxlog_file7,
|
|
1638
|
-
L:
|
|
1666
|
+
L: 123,
|
|
1639
1667
|
S: this,
|
|
1640
1668
|
A: [
|
|
1641
1669
|
"deviceKey",
|
|
@@ -1652,13 +1680,13 @@ var InvitationsHandler = class {
|
|
|
1652
1680
|
},
|
|
1653
1681
|
onOpen: () => {
|
|
1654
1682
|
(0, import_async8.scheduleTask)(ctx, async () => {
|
|
1655
|
-
const traceId =
|
|
1683
|
+
const traceId = import_keys7.PublicKey.random().toHex();
|
|
1656
1684
|
try {
|
|
1657
1685
|
import_log5.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols4.trace.begin({
|
|
1658
1686
|
id: traceId
|
|
1659
1687
|
}), {
|
|
1660
1688
|
F: __dxlog_file7,
|
|
1661
|
-
L:
|
|
1689
|
+
L: 141,
|
|
1662
1690
|
S: this,
|
|
1663
1691
|
C: (f, a) => f(...a)
|
|
1664
1692
|
});
|
|
@@ -1666,7 +1694,7 @@ var InvitationsHandler = class {
|
|
|
1666
1694
|
...protocol.toJSON()
|
|
1667
1695
|
}, {
|
|
1668
1696
|
F: __dxlog_file7,
|
|
1669
|
-
L:
|
|
1697
|
+
L: 142,
|
|
1670
1698
|
S: this,
|
|
1671
1699
|
C: (f, a) => f(...a)
|
|
1672
1700
|
});
|
|
@@ -1682,7 +1710,7 @@ var InvitationsHandler = class {
|
|
|
1682
1710
|
...protocol.toJSON()
|
|
1683
1711
|
}, {
|
|
1684
1712
|
F: __dxlog_file7,
|
|
1685
|
-
L:
|
|
1713
|
+
L: 145,
|
|
1686
1714
|
S: this,
|
|
1687
1715
|
C: (f, a) => f(...a)
|
|
1688
1716
|
});
|
|
@@ -1694,7 +1722,7 @@ var InvitationsHandler = class {
|
|
|
1694
1722
|
id: traceId
|
|
1695
1723
|
}), {
|
|
1696
1724
|
F: __dxlog_file7,
|
|
1697
|
-
L:
|
|
1725
|
+
L: 147,
|
|
1698
1726
|
S: this,
|
|
1699
1727
|
C: (f, a) => f(...a)
|
|
1700
1728
|
});
|
|
@@ -1704,7 +1732,7 @@ var InvitationsHandler = class {
|
|
|
1704
1732
|
...protocol.toJSON()
|
|
1705
1733
|
}, {
|
|
1706
1734
|
F: __dxlog_file7,
|
|
1707
|
-
L:
|
|
1735
|
+
L: 150,
|
|
1708
1736
|
S: this,
|
|
1709
1737
|
C: (f, a) => f(...a)
|
|
1710
1738
|
});
|
|
@@ -1715,7 +1743,7 @@ var InvitationsHandler = class {
|
|
|
1715
1743
|
} else {
|
|
1716
1744
|
import_log5.log.error("failed", err, {
|
|
1717
1745
|
F: __dxlog_file7,
|
|
1718
|
-
L:
|
|
1746
|
+
L: 153,
|
|
1719
1747
|
S: this,
|
|
1720
1748
|
C: (f, a) => f(...a)
|
|
1721
1749
|
});
|
|
@@ -1726,7 +1754,7 @@ var InvitationsHandler = class {
|
|
|
1726
1754
|
error: err
|
|
1727
1755
|
}), {
|
|
1728
1756
|
F: __dxlog_file7,
|
|
1729
|
-
L:
|
|
1757
|
+
L: 156,
|
|
1730
1758
|
S: this,
|
|
1731
1759
|
C: (f, a) => f(...a)
|
|
1732
1760
|
});
|
|
@@ -1747,7 +1775,7 @@ var InvitationsHandler = class {
|
|
|
1747
1775
|
...protocol.toJSON()
|
|
1748
1776
|
}, {
|
|
1749
1777
|
F: __dxlog_file7,
|
|
1750
|
-
L:
|
|
1778
|
+
L: 171,
|
|
1751
1779
|
S: this,
|
|
1752
1780
|
C: (f, a) => f(...a)
|
|
1753
1781
|
});
|
|
@@ -1758,7 +1786,7 @@ var InvitationsHandler = class {
|
|
|
1758
1786
|
} else {
|
|
1759
1787
|
import_log5.log.error("failed", err, {
|
|
1760
1788
|
F: __dxlog_file7,
|
|
1761
|
-
L:
|
|
1789
|
+
L: 174,
|
|
1762
1790
|
S: this,
|
|
1763
1791
|
C: (f, a) => f(...a)
|
|
1764
1792
|
});
|
|
@@ -1803,7 +1831,7 @@ var InvitationsHandler = class {
|
|
|
1803
1831
|
const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
|
|
1804
1832
|
(0, import_invariant6.invariant)(protocol, void 0, {
|
|
1805
1833
|
F: __dxlog_file7,
|
|
1806
|
-
L:
|
|
1834
|
+
L: 215,
|
|
1807
1835
|
S: this,
|
|
1808
1836
|
A: [
|
|
1809
1837
|
"protocol",
|
|
@@ -1817,7 +1845,7 @@ var InvitationsHandler = class {
|
|
|
1817
1845
|
const setState = (newData) => {
|
|
1818
1846
|
(0, import_invariant6.invariant)(newData.state !== void 0, void 0, {
|
|
1819
1847
|
F: __dxlog_file7,
|
|
1820
|
-
L:
|
|
1848
|
+
L: 226,
|
|
1821
1849
|
S: this,
|
|
1822
1850
|
A: [
|
|
1823
1851
|
"newData.state !== undefined",
|
|
@@ -1837,7 +1865,7 @@ var InvitationsHandler = class {
|
|
|
1837
1865
|
...protocol.toJSON()
|
|
1838
1866
|
}, {
|
|
1839
1867
|
F: __dxlog_file7,
|
|
1840
|
-
L:
|
|
1868
|
+
L: 234,
|
|
1841
1869
|
S: this,
|
|
1842
1870
|
C: (f, a) => f(...a)
|
|
1843
1871
|
});
|
|
@@ -1847,7 +1875,7 @@ var InvitationsHandler = class {
|
|
|
1847
1875
|
} else {
|
|
1848
1876
|
import_log5.log.warn("auth failed", err, {
|
|
1849
1877
|
F: __dxlog_file7,
|
|
1850
|
-
L:
|
|
1878
|
+
L: 237,
|
|
1851
1879
|
S: this,
|
|
1852
1880
|
C: (f, a) => f(...a)
|
|
1853
1881
|
});
|
|
@@ -1861,7 +1889,7 @@ var InvitationsHandler = class {
|
|
|
1861
1889
|
...protocol.toJSON()
|
|
1862
1890
|
}, {
|
|
1863
1891
|
F: __dxlog_file7,
|
|
1864
|
-
L:
|
|
1892
|
+
L: 245,
|
|
1865
1893
|
S: this,
|
|
1866
1894
|
C: (f, a) => f(...a)
|
|
1867
1895
|
});
|
|
@@ -1876,7 +1904,7 @@ var InvitationsHandler = class {
|
|
|
1876
1904
|
currentState
|
|
1877
1905
|
}, {
|
|
1878
1906
|
F: __dxlog_file7,
|
|
1879
|
-
L:
|
|
1907
|
+
L: 255,
|
|
1880
1908
|
S: this,
|
|
1881
1909
|
C: (f, a) => f(...a)
|
|
1882
1910
|
});
|
|
@@ -1885,13 +1913,13 @@ var InvitationsHandler = class {
|
|
|
1885
1913
|
}
|
|
1886
1914
|
});
|
|
1887
1915
|
(0, import_async8.scheduleTask)(ctx, async () => {
|
|
1888
|
-
const traceId =
|
|
1916
|
+
const traceId = import_keys7.PublicKey.random().toHex();
|
|
1889
1917
|
try {
|
|
1890
1918
|
import_log5.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols4.trace.begin({
|
|
1891
1919
|
id: traceId
|
|
1892
1920
|
}), {
|
|
1893
1921
|
F: __dxlog_file7,
|
|
1894
|
-
L:
|
|
1922
|
+
L: 264,
|
|
1895
1923
|
S: this,
|
|
1896
1924
|
C: (f, a) => f(...a)
|
|
1897
1925
|
});
|
|
@@ -1903,7 +1931,7 @@ var InvitationsHandler = class {
|
|
|
1903
1931
|
...protocol.toJSON()
|
|
1904
1932
|
}, {
|
|
1905
1933
|
F: __dxlog_file7,
|
|
1906
|
-
L:
|
|
1934
|
+
L: 272,
|
|
1907
1935
|
S: this,
|
|
1908
1936
|
C: (f, a) => f(...a)
|
|
1909
1937
|
});
|
|
@@ -1914,7 +1942,7 @@ var InvitationsHandler = class {
|
|
|
1914
1942
|
...protocol.toJSON()
|
|
1915
1943
|
}, {
|
|
1916
1944
|
F: __dxlog_file7,
|
|
1917
|
-
L:
|
|
1945
|
+
L: 276,
|
|
1918
1946
|
S: this,
|
|
1919
1947
|
C: (f, a) => f(...a)
|
|
1920
1948
|
});
|
|
@@ -1924,7 +1952,7 @@ var InvitationsHandler = class {
|
|
|
1924
1952
|
response: introductionResponse
|
|
1925
1953
|
}, {
|
|
1926
1954
|
F: __dxlog_file7,
|
|
1927
|
-
L:
|
|
1955
|
+
L: 280,
|
|
1928
1956
|
S: this,
|
|
1929
1957
|
C: (f, a) => f(...a)
|
|
1930
1958
|
});
|
|
@@ -1936,7 +1964,7 @@ var InvitationsHandler = class {
|
|
|
1936
1964
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1937
1965
|
(0, import_log5.log)("guest waiting for authentication code...", void 0, {
|
|
1938
1966
|
F: __dxlog_file7,
|
|
1939
|
-
L:
|
|
1967
|
+
L: 289,
|
|
1940
1968
|
S: this,
|
|
1941
1969
|
C: (f, a) => f(...a)
|
|
1942
1970
|
});
|
|
@@ -1948,7 +1976,7 @@ var InvitationsHandler = class {
|
|
|
1948
1976
|
});
|
|
1949
1977
|
(0, import_log5.log)("sending authentication request", void 0, {
|
|
1950
1978
|
F: __dxlog_file7,
|
|
1951
|
-
L:
|
|
1979
|
+
L: 293,
|
|
1952
1980
|
S: this,
|
|
1953
1981
|
C: (f, a) => f(...a)
|
|
1954
1982
|
});
|
|
@@ -1969,7 +1997,7 @@ var InvitationsHandler = class {
|
|
|
1969
1997
|
attempt
|
|
1970
1998
|
}, {
|
|
1971
1999
|
F: __dxlog_file7,
|
|
1972
|
-
L:
|
|
2000
|
+
L: 304,
|
|
1973
2001
|
S: this,
|
|
1974
2002
|
C: (f, a) => f(...a)
|
|
1975
2003
|
});
|
|
@@ -1986,7 +2014,7 @@ var InvitationsHandler = class {
|
|
|
1986
2014
|
...protocol.toJSON()
|
|
1987
2015
|
}, {
|
|
1988
2016
|
F: __dxlog_file7,
|
|
1989
|
-
L:
|
|
2017
|
+
L: 315,
|
|
1990
2018
|
S: this,
|
|
1991
2019
|
C: (f, a) => f(...a)
|
|
1992
2020
|
});
|
|
@@ -1998,7 +2026,7 @@ var InvitationsHandler = class {
|
|
|
1998
2026
|
...protocol.toJSON()
|
|
1999
2027
|
}, {
|
|
2000
2028
|
F: __dxlog_file7,
|
|
2001
|
-
L:
|
|
2029
|
+
L: 326,
|
|
2002
2030
|
S: this,
|
|
2003
2031
|
C: (f, a) => f(...a)
|
|
2004
2032
|
});
|
|
@@ -2010,7 +2038,7 @@ var InvitationsHandler = class {
|
|
|
2010
2038
|
id: traceId
|
|
2011
2039
|
}), {
|
|
2012
2040
|
F: __dxlog_file7,
|
|
2013
|
-
L:
|
|
2041
|
+
L: 328,
|
|
2014
2042
|
S: this,
|
|
2015
2043
|
C: (f, a) => f(...a)
|
|
2016
2044
|
});
|
|
@@ -2020,7 +2048,7 @@ var InvitationsHandler = class {
|
|
|
2020
2048
|
...protocol.toJSON()
|
|
2021
2049
|
}, {
|
|
2022
2050
|
F: __dxlog_file7,
|
|
2023
|
-
L:
|
|
2051
|
+
L: 331,
|
|
2024
2052
|
S: this,
|
|
2025
2053
|
C: (f, a) => f(...a)
|
|
2026
2054
|
});
|
|
@@ -2030,7 +2058,7 @@ var InvitationsHandler = class {
|
|
|
2030
2058
|
} else {
|
|
2031
2059
|
(0, import_log5.log)("auth failed", err, {
|
|
2032
2060
|
F: __dxlog_file7,
|
|
2033
|
-
L:
|
|
2061
|
+
L: 334,
|
|
2034
2062
|
S: this,
|
|
2035
2063
|
C: (f, a) => f(...a)
|
|
2036
2064
|
});
|
|
@@ -2041,7 +2069,7 @@ var InvitationsHandler = class {
|
|
|
2041
2069
|
error: err
|
|
2042
2070
|
}), {
|
|
2043
2071
|
F: __dxlog_file7,
|
|
2044
|
-
L:
|
|
2072
|
+
L: 337,
|
|
2045
2073
|
S: this,
|
|
2046
2074
|
C: (f, a) => f(...a)
|
|
2047
2075
|
});
|
|
@@ -2059,7 +2087,7 @@ var InvitationsHandler = class {
|
|
|
2059
2087
|
...protocol.toJSON()
|
|
2060
2088
|
}, {
|
|
2061
2089
|
F: __dxlog_file7,
|
|
2062
|
-
L:
|
|
2090
|
+
L: 348,
|
|
2063
2091
|
S: this,
|
|
2064
2092
|
C: (f, a) => f(...a)
|
|
2065
2093
|
});
|
|
@@ -2069,7 +2097,7 @@ var InvitationsHandler = class {
|
|
|
2069
2097
|
} else {
|
|
2070
2098
|
(0, import_log5.log)("auth failed", err, {
|
|
2071
2099
|
F: __dxlog_file7,
|
|
2072
|
-
L:
|
|
2100
|
+
L: 351,
|
|
2073
2101
|
S: this,
|
|
2074
2102
|
C: (f, a) => f(...a)
|
|
2075
2103
|
});
|
|
@@ -2082,7 +2110,7 @@ var InvitationsHandler = class {
|
|
|
2082
2110
|
(0, import_async8.scheduleTask)(ctx, async () => {
|
|
2083
2111
|
(0, import_invariant6.invariant)(invitation.swarmKey, void 0, {
|
|
2084
2112
|
F: __dxlog_file7,
|
|
2085
|
-
L:
|
|
2113
|
+
L: 361,
|
|
2086
2114
|
S: this,
|
|
2087
2115
|
A: [
|
|
2088
2116
|
"invitation.swarmKey",
|
|
@@ -2092,7 +2120,7 @@ var InvitationsHandler = class {
|
|
|
2092
2120
|
const topic = invitation.swarmKey;
|
|
2093
2121
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
2094
2122
|
topic,
|
|
2095
|
-
peerId:
|
|
2123
|
+
peerId: import_keys7.PublicKey.random(),
|
|
2096
2124
|
protocolProvider: (0, import_network_manager.createTeleportProtocolFactory)(async (teleport) => {
|
|
2097
2125
|
teleport.addExtension("dxos.halo.invitations", createExtension());
|
|
2098
2126
|
}),
|
|
@@ -2249,15 +2277,6 @@ var InvitationsServiceImpl = class {
|
|
|
2249
2277
|
await accepted.cancel();
|
|
2250
2278
|
this._acceptInvitations.delete(invitationId);
|
|
2251
2279
|
this._removedAccepted.emit(accepted.get());
|
|
2252
|
-
} else {
|
|
2253
|
-
import_log6.log.warn("invalid invitation", {
|
|
2254
|
-
invitationId
|
|
2255
|
-
}, {
|
|
2256
|
-
F: __dxlog_file8,
|
|
2257
|
-
L: 132,
|
|
2258
|
-
S: this,
|
|
2259
|
-
C: (f, a) => f(...a)
|
|
2260
|
-
});
|
|
2261
2280
|
}
|
|
2262
2281
|
}
|
|
2263
2282
|
queryInvitations() {
|
|
@@ -2341,7 +2360,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2341
2360
|
async admit(request, guestProfile) {
|
|
2342
2361
|
(0, import_invariant8.invariant)(this._spaceKey, void 0, {
|
|
2343
2362
|
F: __dxlog_file9,
|
|
2344
|
-
L:
|
|
2363
|
+
L: 46,
|
|
2345
2364
|
S: this,
|
|
2346
2365
|
A: [
|
|
2347
2366
|
"this._spaceKey",
|
|
@@ -2351,7 +2370,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2351
2370
|
const space = await this._spaceManager.spaces.get(this._spaceKey);
|
|
2352
2371
|
(0, import_invariant8.invariant)(space, void 0, {
|
|
2353
2372
|
F: __dxlog_file9,
|
|
2354
|
-
L:
|
|
2373
|
+
L: 48,
|
|
2355
2374
|
S: this,
|
|
2356
2375
|
A: [
|
|
2357
2376
|
"space",
|
|
@@ -2360,7 +2379,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2360
2379
|
});
|
|
2361
2380
|
(0, import_invariant8.invariant)(request.space, void 0, {
|
|
2362
2381
|
F: __dxlog_file9,
|
|
2363
|
-
L:
|
|
2382
|
+
L: 50,
|
|
2364
2383
|
S: this,
|
|
2365
2384
|
A: [
|
|
2366
2385
|
"request.space",
|
|
@@ -2373,14 +2392,14 @@ var SpaceInvitationProtocol = class {
|
|
|
2373
2392
|
guest: deviceKey
|
|
2374
2393
|
}, {
|
|
2375
2394
|
F: __dxlog_file9,
|
|
2376
|
-
L:
|
|
2395
|
+
L: 53,
|
|
2377
2396
|
S: this,
|
|
2378
2397
|
C: (f, a) => f(...a)
|
|
2379
2398
|
});
|
|
2380
2399
|
const credentials = await (0, import_credentials8.createAdmissionCredentials)(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, guestProfile);
|
|
2381
2400
|
(0, import_invariant8.invariant)(credentials[0].credential, void 0, {
|
|
2382
2401
|
F: __dxlog_file9,
|
|
2383
|
-
L:
|
|
2402
|
+
L: 64,
|
|
2384
2403
|
S: this,
|
|
2385
2404
|
A: [
|
|
2386
2405
|
"credentials[0].credential",
|
|
@@ -2390,7 +2409,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2390
2409
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2391
2410
|
(0, import_invariant8.invariant)((0, import_credentials8.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2392
2411
|
F: __dxlog_file9,
|
|
2393
|
-
L:
|
|
2412
|
+
L: 66,
|
|
2394
2413
|
S: this,
|
|
2395
2414
|
A: [
|
|
2396
2415
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2426,7 +2445,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2426
2445
|
async accept(response) {
|
|
2427
2446
|
(0, import_invariant8.invariant)(response.space, void 0, {
|
|
2428
2447
|
F: __dxlog_file9,
|
|
2429
|
-
L:
|
|
2448
|
+
L: 101,
|
|
2430
2449
|
S: this,
|
|
2431
2450
|
A: [
|
|
2432
2451
|
"response.space",
|
|
@@ -2437,7 +2456,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2437
2456
|
const assertion = (0, import_credentials8.getCredentialAssertion)(credential);
|
|
2438
2457
|
(0, import_invariant8.invariant)(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
2439
2458
|
F: __dxlog_file9,
|
|
2440
|
-
L:
|
|
2459
|
+
L: 104,
|
|
2441
2460
|
S: this,
|
|
2442
2461
|
A: [
|
|
2443
2462
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2446,7 +2465,7 @@ var SpaceInvitationProtocol = class {
|
|
|
2446
2465
|
});
|
|
2447
2466
|
(0, import_invariant8.invariant)(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
|
|
2448
2467
|
F: __dxlog_file9,
|
|
2449
|
-
L:
|
|
2468
|
+
L: 105,
|
|
2450
2469
|
S: this,
|
|
2451
2470
|
A: [
|
|
2452
2471
|
"credential.subject.id.equals(this._signingContext.identityKey)",
|
|
@@ -2545,10 +2564,10 @@ var getPlatform = () => {
|
|
|
2545
2564
|
};
|
|
2546
2565
|
}
|
|
2547
2566
|
} else {
|
|
2548
|
-
const { platform, version, arch } = process;
|
|
2567
|
+
const { platform: platform2, version, arch } = process;
|
|
2549
2568
|
return {
|
|
2550
2569
|
type: "node",
|
|
2551
|
-
platform: `${
|
|
2570
|
+
platform: `${platform2} ${version} ${arch}`,
|
|
2552
2571
|
runtime: process.version,
|
|
2553
2572
|
uptime: Math.floor(process.uptime()),
|
|
2554
2573
|
memory: process.memoryUsage()
|
|
@@ -2557,7 +2576,7 @@ var getPlatform = () => {
|
|
|
2557
2576
|
};
|
|
2558
2577
|
|
|
2559
2578
|
// packages/sdk/client-services/src/version.ts
|
|
2560
|
-
var DXOS_VERSION = "0.3.2-main.
|
|
2579
|
+
var DXOS_VERSION = "0.3.2-main.fa875a7";
|
|
2561
2580
|
|
|
2562
2581
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
2563
2582
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -2686,25 +2705,25 @@ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
|
2686
2705
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
2687
2706
|
var import_invariant13 = require("@dxos/invariant");
|
|
2688
2707
|
var import_keyring = require("@dxos/keyring");
|
|
2689
|
-
var
|
|
2708
|
+
var import_keys11 = require("@dxos/keys");
|
|
2690
2709
|
var import_log13 = require("@dxos/log");
|
|
2691
2710
|
var import_protocols10 = require("@dxos/protocols");
|
|
2692
2711
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2693
2712
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
2694
2713
|
var import_tracing4 = require("@dxos/tracing");
|
|
2695
|
-
var
|
|
2714
|
+
var import_util7 = require("@dxos/util");
|
|
2696
2715
|
|
|
2697
2716
|
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2698
2717
|
var import_async12 = require("@dxos/async");
|
|
2699
2718
|
var import_context8 = require("@dxos/context");
|
|
2700
2719
|
var import_credentials13 = require("@dxos/credentials");
|
|
2701
2720
|
var import_invariant11 = require("@dxos/invariant");
|
|
2702
|
-
var
|
|
2721
|
+
var import_keys10 = require("@dxos/keys");
|
|
2703
2722
|
var import_log11 = require("@dxos/log");
|
|
2704
2723
|
var import_protocols8 = require("@dxos/protocols");
|
|
2705
2724
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2706
2725
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2707
|
-
var
|
|
2726
|
+
var import_util6 = require("@dxos/util");
|
|
2708
2727
|
|
|
2709
2728
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2710
2729
|
var import_async11 = require("@dxos/async");
|
|
@@ -2712,24 +2731,24 @@ var import_client_protocol3 = require("@dxos/client-protocol");
|
|
|
2712
2731
|
var import_context7 = require("@dxos/context");
|
|
2713
2732
|
var import_debug4 = require("@dxos/debug");
|
|
2714
2733
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2715
|
-
var
|
|
2734
|
+
var import_keys9 = require("@dxos/keys");
|
|
2716
2735
|
var import_log10 = require("@dxos/log");
|
|
2717
2736
|
var import_protocols7 = require("@dxos/protocols");
|
|
2718
2737
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2719
2738
|
var import_credentials10 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2720
2739
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
2721
2740
|
var import_tracing3 = require("@dxos/tracing");
|
|
2722
|
-
var
|
|
2741
|
+
var import_util5 = require("@dxos/util");
|
|
2723
2742
|
|
|
2724
2743
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2725
2744
|
var import_async10 = require("@dxos/async");
|
|
2726
2745
|
var import_context6 = require("@dxos/context");
|
|
2727
2746
|
var import_invariant10 = require("@dxos/invariant");
|
|
2728
|
-
var
|
|
2747
|
+
var import_keys8 = require("@dxos/keys");
|
|
2729
2748
|
var import_log9 = require("@dxos/log");
|
|
2730
2749
|
var import_protocols6 = require("@dxos/protocols");
|
|
2731
2750
|
var import_teleport2 = require("@dxos/teleport");
|
|
2732
|
-
var
|
|
2751
|
+
var import_util4 = require("@dxos/util");
|
|
2733
2752
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2734
2753
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2735
2754
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
@@ -2740,8 +2759,8 @@ var NotarizationPlugin = class {
|
|
|
2740
2759
|
this._ctx = new import_context6.Context();
|
|
2741
2760
|
this._extensionOpened = new import_async10.Event();
|
|
2742
2761
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2743
|
-
this._processedCredentials = new
|
|
2744
|
-
this._processCredentialsTriggers = new
|
|
2762
|
+
this._processedCredentials = new import_util4.ComplexSet(import_keys8.PublicKey.hash);
|
|
2763
|
+
this._processCredentialsTriggers = new import_util4.ComplexMap(import_keys8.PublicKey.hash);
|
|
2745
2764
|
}
|
|
2746
2765
|
get hasWriter() {
|
|
2747
2766
|
return !!this._writer;
|
|
@@ -2903,7 +2922,7 @@ var NotarizationPlugin = class {
|
|
|
2903
2922
|
if (this._processedCredentials.has(id)) {
|
|
2904
2923
|
return;
|
|
2905
2924
|
}
|
|
2906
|
-
await (0,
|
|
2925
|
+
await (0, import_util4.entry)(this._processCredentialsTriggers, id).orInsert(new import_async10.Trigger()).value.wait();
|
|
2907
2926
|
}
|
|
2908
2927
|
/**
|
|
2909
2928
|
* Requests from other peers to notarize credentials.
|
|
@@ -3023,7 +3042,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3023
3042
|
this._signingContext = params.signingContext;
|
|
3024
3043
|
this._callbacks = params.callbacks ?? {};
|
|
3025
3044
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
3026
|
-
trustedKeysProvider: () => new
|
|
3045
|
+
trustedKeysProvider: () => new import_util5.ComplexSet(import_keys9.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
3027
3046
|
update: this._inner.stateUpdate,
|
|
3028
3047
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
3029
3048
|
});
|
|
@@ -3442,9 +3461,9 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3442
3461
|
this._feedStore = _feedStore;
|
|
3443
3462
|
this._ctx = new import_context8.Context();
|
|
3444
3463
|
this.updated = new import_async12.Event();
|
|
3445
|
-
this._spaces = new
|
|
3464
|
+
this._spaces = new import_util6.ComplexMap(import_keys10.PublicKey.hash);
|
|
3446
3465
|
this._isOpen = false;
|
|
3447
|
-
this._instanceId =
|
|
3466
|
+
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
3448
3467
|
}
|
|
3449
3468
|
// TODO(burdon): Remove.
|
|
3450
3469
|
get spaces() {
|
|
@@ -3473,7 +3492,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3473
3492
|
S: this,
|
|
3474
3493
|
C: (f, a) => f(...a)
|
|
3475
3494
|
});
|
|
3476
|
-
await (0,
|
|
3495
|
+
await (0, import_util6.forEachAsync)(this._metadataStore.spaces, async (spaceMetadata) => {
|
|
3477
3496
|
try {
|
|
3478
3497
|
(0, import_log11.log)("load space", {
|
|
3479
3498
|
spaceMetadata
|
|
@@ -3655,7 +3674,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3655
3674
|
swarmIdentity: {
|
|
3656
3675
|
peerKey: this._signingContext.deviceKey,
|
|
3657
3676
|
credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
|
|
3658
|
-
credentialAuthenticator: (0,
|
|
3677
|
+
credentialAuthenticator: (0, import_util6.deferFunction)(() => dataSpace.authVerifier.verifier)
|
|
3659
3678
|
},
|
|
3660
3679
|
onNetworkConnection: (session) => {
|
|
3661
3680
|
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
@@ -3995,7 +4014,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3995
4014
|
this.initialized = new import_async14.Trigger();
|
|
3996
4015
|
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
3997
4016
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3998
|
-
this._instanceId =
|
|
4017
|
+
this._instanceId = import_keys11.PublicKey.random().toHex();
|
|
3999
4018
|
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
4000
4019
|
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
4001
4020
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
@@ -4216,7 +4235,7 @@ _ts_decorate5([
|
|
|
4216
4235
|
import_tracing4.trace.span()
|
|
4217
4236
|
], ServiceContext.prototype, "_initialize", null);
|
|
4218
4237
|
ServiceContext = _ts_decorate5([
|
|
4219
|
-
(0,
|
|
4238
|
+
(0, import_util7.safeInstanceof)("dxos.client-services.ServiceContext"),
|
|
4220
4239
|
import_tracing4.trace.resource()
|
|
4221
4240
|
], ServiceContext);
|
|
4222
4241
|
|
|
@@ -4228,7 +4247,7 @@ var import_document_model2 = require("@dxos/document-model");
|
|
|
4228
4247
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
4229
4248
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
4230
4249
|
var import_invariant15 = require("@dxos/invariant");
|
|
4231
|
-
var
|
|
4250
|
+
var import_keys12 = require("@dxos/keys");
|
|
4232
4251
|
var import_log16 = require("@dxos/log");
|
|
4233
4252
|
var import_messaging = require("@dxos/messaging");
|
|
4234
4253
|
var import_model_factory = require("@dxos/model-factory");
|
|
@@ -4271,7 +4290,7 @@ var DevicesServiceImpl = class {
|
|
|
4271
4290
|
constructor(_identityManager) {
|
|
4272
4291
|
this._identityManager = _identityManager;
|
|
4273
4292
|
}
|
|
4274
|
-
updateDevice(
|
|
4293
|
+
async updateDevice(profile) {
|
|
4275
4294
|
throw new Error("Method not implemented.");
|
|
4276
4295
|
}
|
|
4277
4296
|
queryDevices() {
|
|
@@ -4284,9 +4303,10 @@ var DevicesServiceImpl = class {
|
|
|
4284
4303
|
});
|
|
4285
4304
|
} else {
|
|
4286
4305
|
next({
|
|
4287
|
-
devices: Array.from(deviceKeys.
|
|
4306
|
+
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
|
|
4288
4307
|
deviceKey: key,
|
|
4289
|
-
kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services11.DeviceKind.CURRENT : import_services11.DeviceKind.TRUSTED
|
|
4308
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services11.DeviceKind.CURRENT : import_services11.DeviceKind.TRUSTED,
|
|
4309
|
+
profile
|
|
4290
4310
|
}))
|
|
4291
4311
|
});
|
|
4292
4312
|
}
|
|
@@ -4370,7 +4390,7 @@ var import_async16 = require("@dxos/async");
|
|
|
4370
4390
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
4371
4391
|
var import_log15 = require("@dxos/log");
|
|
4372
4392
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4373
|
-
var
|
|
4393
|
+
var import_util8 = require("@dxos/util");
|
|
4374
4394
|
var LoggingServiceImpl = class {
|
|
4375
4395
|
constructor() {
|
|
4376
4396
|
this._logs = new import_async16.Event();
|
|
@@ -4388,15 +4408,15 @@ var LoggingServiceImpl = class {
|
|
|
4388
4408
|
}
|
|
4389
4409
|
async controlMetrics({ reset, record }) {
|
|
4390
4410
|
if (reset) {
|
|
4391
|
-
|
|
4411
|
+
import_util8.tracer.clear();
|
|
4392
4412
|
}
|
|
4393
4413
|
if (record === true) {
|
|
4394
|
-
|
|
4414
|
+
import_util8.tracer.start();
|
|
4395
4415
|
} else if (record === false) {
|
|
4396
|
-
|
|
4416
|
+
import_util8.tracer.stop();
|
|
4397
4417
|
}
|
|
4398
4418
|
return {
|
|
4399
|
-
recording:
|
|
4419
|
+
recording: import_util8.tracer.recording
|
|
4400
4420
|
};
|
|
4401
4421
|
}
|
|
4402
4422
|
/**
|
|
@@ -4404,10 +4424,10 @@ var LoggingServiceImpl = class {
|
|
|
4404
4424
|
*/
|
|
4405
4425
|
queryMetrics({ interval = 5e3 }) {
|
|
4406
4426
|
const getNumericalValues = (key) => {
|
|
4407
|
-
const events =
|
|
4427
|
+
const events = import_util8.tracer.get(key) ?? [];
|
|
4408
4428
|
return {
|
|
4409
4429
|
key,
|
|
4410
|
-
stats: (0,
|
|
4430
|
+
stats: (0, import_util8.numericalValues)(events, "duration")
|
|
4411
4431
|
};
|
|
4412
4432
|
};
|
|
4413
4433
|
return new import_codec_protobuf13.Stream(({ next }) => {
|
|
@@ -4445,7 +4465,7 @@ var LoggingServiceImpl = class {
|
|
|
4445
4465
|
}
|
|
4446
4466
|
const record = {
|
|
4447
4467
|
...entry2,
|
|
4448
|
-
context: (0,
|
|
4468
|
+
context: (0, import_util8.jsonify)((0, import_log15.getContextFromEntry)(entry2)),
|
|
4449
4469
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4450
4470
|
meta: {
|
|
4451
4471
|
// TODO(dmaretskyi): Fix proto.
|
|
@@ -4519,10 +4539,10 @@ var import_client_protocol4 = require("@dxos/client-protocol");
|
|
|
4519
4539
|
var import_protocols11 = require("@dxos/protocols");
|
|
4520
4540
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
4521
4541
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
4522
|
-
var
|
|
4542
|
+
var import_util9 = require("@dxos/util");
|
|
4523
4543
|
var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
4524
4544
|
var createStorageObjects = (config) => {
|
|
4525
|
-
const { persistent = false, keyStore, dataStore, dataRoot = (0,
|
|
4545
|
+
const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util9.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
|
|
4526
4546
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4527
4547
|
throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4528
4548
|
}
|
|
@@ -4566,7 +4586,7 @@ var toStorageType = (type) => {
|
|
|
4566
4586
|
// packages/sdk/client-services/src/packlets/system/system-service.ts
|
|
4567
4587
|
var import_codec_protobuf15 = require("@dxos/codec-protobuf");
|
|
4568
4588
|
var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4569
|
-
var
|
|
4589
|
+
var import_util10 = require("@dxos/util");
|
|
4570
4590
|
var SystemServiceImpl = class {
|
|
4571
4591
|
constructor({ config, statusUpdate, getDiagnostics, onUpdateStatus, getCurrentStatus, onReset }) {
|
|
4572
4592
|
this._config = config;
|
|
@@ -4586,7 +4606,7 @@ var SystemServiceImpl = class {
|
|
|
4586
4606
|
const diagnostics = await this._getDiagnostics();
|
|
4587
4607
|
return {
|
|
4588
4608
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4589
|
-
diagnostics: JSON.parse(JSON.stringify(diagnostics, (0,
|
|
4609
|
+
diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util10.jsonKeyReplacer)({
|
|
4590
4610
|
truncate: keys === import_services13.GetDiagnosticsRequest.KEY_OPTION.TRUNCATE,
|
|
4591
4611
|
humanize: keys === import_services13.GetDiagnosticsRequest.KEY_OPTION.HUMANIZE
|
|
4592
4612
|
})))
|
|
@@ -4787,7 +4807,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4787
4807
|
if (this._open) {
|
|
4788
4808
|
return;
|
|
4789
4809
|
}
|
|
4790
|
-
const traceId =
|
|
4810
|
+
const traceId = import_keys12.PublicKey.random().toHex();
|
|
4791
4811
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4792
4812
|
id: traceId
|
|
4793
4813
|
}), {
|
|
@@ -4927,7 +4947,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4927
4947
|
});
|
|
4928
4948
|
}
|
|
4929
4949
|
async reset() {
|
|
4930
|
-
const traceId =
|
|
4950
|
+
const traceId = import_keys12.PublicKey.random().toHex();
|
|
4931
4951
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4932
4952
|
id: traceId
|
|
4933
4953
|
}), {
|
|
@@ -5005,7 +5025,7 @@ var import_context11 = require("@dxos/context");
|
|
|
5005
5025
|
var import_log17 = require("@dxos/log");
|
|
5006
5026
|
var import_messaging2 = require("@dxos/messaging");
|
|
5007
5027
|
var import_network_manager3 = require("@dxos/network-manager");
|
|
5008
|
-
var
|
|
5028
|
+
var import_util11 = require("@dxos/util");
|
|
5009
5029
|
|
|
5010
5030
|
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
5011
5031
|
var import_async18 = require("@dxos/async");
|
|
@@ -5113,7 +5133,7 @@ var IFrameHostRuntime = class {
|
|
|
5113
5133
|
C: (f, a) => f(...a)
|
|
5114
5134
|
});
|
|
5115
5135
|
try {
|
|
5116
|
-
this._config = await (0,
|
|
5136
|
+
this._config = await (0, import_util11.getAsyncValue)(this._configProvider);
|
|
5117
5137
|
this._transportFactory = (0, import_network_manager3.createSimplePeerTransportFactory)({
|
|
5118
5138
|
iceServers: this._config.get("runtime.services.ice")
|
|
5119
5139
|
});
|
|
@@ -5200,7 +5220,7 @@ var import_log18 = require("@dxos/log");
|
|
|
5200
5220
|
var import_network_manager4 = require("@dxos/network-manager");
|
|
5201
5221
|
var import_protocols13 = require("@dxos/protocols");
|
|
5202
5222
|
var import_rpc3 = require("@dxos/rpc");
|
|
5203
|
-
var
|
|
5223
|
+
var import_util12 = require("@dxos/util");
|
|
5204
5224
|
var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts";
|
|
5205
5225
|
var IFrameProxyRuntime = class {
|
|
5206
5226
|
constructor({ config, systemPort, shellPort }) {
|
|
@@ -5217,7 +5237,7 @@ var IFrameProxyRuntime = class {
|
|
|
5217
5237
|
return this._shellRuntime;
|
|
5218
5238
|
}
|
|
5219
5239
|
async open(origin) {
|
|
5220
|
-
this._config = await (0,
|
|
5240
|
+
this._config = await (0, import_util12.getAsyncValue)(this._configProvider);
|
|
5221
5241
|
this._transportService = new import_network_manager4.SimplePeerTransportService({
|
|
5222
5242
|
iceServers: this._config.get("runtime.services.ice")
|
|
5223
5243
|
});
|
|
@@ -5250,7 +5270,7 @@ var IFrameProxyRuntime = class {
|
|
|
5250
5270
|
} catch (err) {
|
|
5251
5271
|
import_log18.log.catch(err, void 0, {
|
|
5252
5272
|
F: __dxlog_file20,
|
|
5253
|
-
L:
|
|
5273
|
+
L: 90,
|
|
5254
5274
|
S: this,
|
|
5255
5275
|
C: (f, a) => f(...a)
|
|
5256
5276
|
});
|
|
@@ -5282,7 +5302,7 @@ var import_client_protocol9 = require("@dxos/client-protocol");
|
|
|
5282
5302
|
var import_invariant17 = require("@dxos/invariant");
|
|
5283
5303
|
var import_log19 = require("@dxos/log");
|
|
5284
5304
|
var import_rpc4 = require("@dxos/rpc");
|
|
5285
|
-
var
|
|
5305
|
+
var import_util13 = require("@dxos/util");
|
|
5286
5306
|
function _ts_decorate9(decorators, target, key, desc) {
|
|
5287
5307
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5288
5308
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -5297,7 +5317,7 @@ var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
5297
5317
|
var WorkerSession = class {
|
|
5298
5318
|
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
5299
5319
|
this._startTrigger = new import_async21.Trigger();
|
|
5300
|
-
this.onClose = new
|
|
5320
|
+
this.onClose = new import_util13.Callback();
|
|
5301
5321
|
(0, import_invariant17.invariant)(serviceHost, void 0, {
|
|
5302
5322
|
F: __dxlog_file21,
|
|
5303
5323
|
L: 49,
|