@dxos/client-services 0.4.7-main.0aeacda → 0.4.7-main.6b81200
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-N4RGR7MX.mjs → chunk-CWD6SLTL.mjs} +133 -202
- package/dist/lib/browser/chunk-CWD6SLTL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-IG3MUK6Q.cjs → chunk-TG6QYWRX.cjs} +125 -194
- package/dist/lib/node/chunk-TG6QYWRX.cjs.map +7 -0
- package/dist/lib/node/index.cjs +37 -37
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/devices/devices-service.d.ts +1 -1
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -8
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +1 -5
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -5
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +2 -4
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -7
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/devices/devices-service.test.ts +4 -8
- package/src/packlets/devices/devices-service.ts +11 -47
- package/src/packlets/identity/identity-manager.ts +5 -47
- package/src/packlets/identity/identity.ts +1 -9
- package/src/packlets/services/service-context.ts +3 -17
- package/src/packlets/services/service-host.ts +1 -6
- package/src/packlets/spaces/data-space-manager.ts +3 -18
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-N4RGR7MX.mjs.map +0 -7
- package/dist/lib/node/chunk-IG3MUK6Q.cjs.map +0 -7
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_TG6QYWRX_exports = {};
|
|
30
|
+
__export(chunk_TG6QYWRX_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -60,7 +60,7 @@ __export(chunk_IG3MUK6Q_exports, {
|
|
|
60
60
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
61
61
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
62
62
|
});
|
|
63
|
-
module.exports = __toCommonJS(
|
|
63
|
+
module.exports = __toCommonJS(chunk_TG6QYWRX_exports);
|
|
64
64
|
var import_async = require("@dxos/async");
|
|
65
65
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
66
66
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -100,7 +100,6 @@ var import_log3 = require("@dxos/log");
|
|
|
100
100
|
var import_protocols2 = require("@dxos/protocols");
|
|
101
101
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
102
102
|
var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
103
|
-
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
104
103
|
var import_timeframe = require("@dxos/timeframe");
|
|
105
104
|
var import_tracing2 = require("@dxos/tracing");
|
|
106
105
|
var import_util3 = require("@dxos/util");
|
|
@@ -187,7 +186,7 @@ var import_keys9 = require("@dxos/keys");
|
|
|
187
186
|
var import_log11 = require("@dxos/log");
|
|
188
187
|
var import_protocols10 = require("@dxos/protocols");
|
|
189
188
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
190
|
-
var
|
|
189
|
+
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
191
190
|
var import_util6 = require("@dxos/util");
|
|
192
191
|
var import_credentials13 = require("@dxos/credentials");
|
|
193
192
|
var import_debug4 = require("@dxos/debug");
|
|
@@ -243,7 +242,6 @@ var import_util9 = require("@dxos/util");
|
|
|
243
242
|
var import_websocket_rpc = require("@dxos/websocket-rpc");
|
|
244
243
|
var import_async16 = require("@dxos/async");
|
|
245
244
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
246
|
-
var import_invariant17 = require("@dxos/invariant");
|
|
247
245
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
248
246
|
var import_async17 = require("@dxos/async");
|
|
249
247
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
@@ -684,18 +682,17 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
684
682
|
}
|
|
685
683
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
686
684
|
var Identity = class {
|
|
687
|
-
constructor({ space, signer, identityKey, deviceKey
|
|
685
|
+
constructor({ space, signer, identityKey, deviceKey }) {
|
|
688
686
|
this.stateUpdate = new import_async5.Event();
|
|
689
687
|
this.space = space;
|
|
690
688
|
this._signer = signer;
|
|
691
|
-
this._presence = presence;
|
|
692
689
|
this.identityKey = identityKey;
|
|
693
690
|
this.deviceKey = deviceKey;
|
|
694
691
|
import_log2.log.trace("dxos.halo.device", {
|
|
695
692
|
deviceKey
|
|
696
693
|
}, {
|
|
697
694
|
F: __dxlog_file2,
|
|
698
|
-
L:
|
|
695
|
+
L: 63,
|
|
699
696
|
S: this,
|
|
700
697
|
C: (f, a) => f(...a)
|
|
701
698
|
});
|
|
@@ -753,9 +750,6 @@ var Identity = class {
|
|
|
753
750
|
get deviceCredentialChain() {
|
|
754
751
|
return this._deviceStateMachine.deviceCredentialChain;
|
|
755
752
|
}
|
|
756
|
-
get presence() {
|
|
757
|
-
return this._presence;
|
|
758
|
-
}
|
|
759
753
|
/**
|
|
760
754
|
* Issues credentials as identity.
|
|
761
755
|
* Requires identity to be ready.
|
|
@@ -763,7 +757,7 @@ var Identity = class {
|
|
|
763
757
|
getIdentityCredentialSigner() {
|
|
764
758
|
(0, import_invariant.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
|
|
765
759
|
F: __dxlog_file2,
|
|
766
|
-
L:
|
|
760
|
+
L: 136,
|
|
767
761
|
S: this,
|
|
768
762
|
A: [
|
|
769
763
|
"this._deviceStateMachine.deviceCredentialChain",
|
|
@@ -787,7 +781,7 @@ var Identity = class {
|
|
|
787
781
|
dataFeedKey
|
|
788
782
|
}, {
|
|
789
783
|
F: __dxlog_file2,
|
|
790
|
-
L:
|
|
784
|
+
L: 152,
|
|
791
785
|
S: this,
|
|
792
786
|
C: (f, a) => f(...a)
|
|
793
787
|
});
|
|
@@ -848,20 +842,15 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
848
842
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
849
843
|
}
|
|
850
844
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
851
|
-
var DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 1e4;
|
|
852
|
-
var DEVICE_PRESENCE_OFFLINE_TIMEOUT = 2e4;
|
|
853
845
|
var IdentityManager = class {
|
|
854
846
|
// TODO(burdon): IdentityManagerParams.
|
|
855
847
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
856
|
-
constructor(_metadataStore, _keyring, _feedStore, _spaceManager
|
|
848
|
+
constructor(_metadataStore, _keyring, _feedStore, _spaceManager) {
|
|
857
849
|
this._metadataStore = _metadataStore;
|
|
858
850
|
this._keyring = _keyring;
|
|
859
851
|
this._feedStore = _feedStore;
|
|
860
852
|
this._spaceManager = _spaceManager;
|
|
861
853
|
this.stateUpdate = new import_async6.Event();
|
|
862
|
-
const { devicePresenceAnnounceInterval = DEVICE_PRESENCE_ANNOUNCE_INTERVAL, devicePresenceOfflineTimeout = DEVICE_PRESENCE_OFFLINE_TIMEOUT } = params ?? {};
|
|
863
|
-
this._devicePresenceAnnounceInterval = devicePresenceAnnounceInterval;
|
|
864
|
-
this._devicePresenceOfflineTimeout = devicePresenceOfflineTimeout;
|
|
865
854
|
}
|
|
866
855
|
get identity() {
|
|
867
856
|
return this._identity;
|
|
@@ -872,7 +861,7 @@ var IdentityManager = class {
|
|
|
872
861
|
id: traceId
|
|
873
862
|
}), {
|
|
874
863
|
F: __dxlog_file3,
|
|
875
|
-
L:
|
|
864
|
+
L: 84,
|
|
876
865
|
S: this,
|
|
877
866
|
C: (f, a) => f(...a)
|
|
878
867
|
});
|
|
@@ -881,7 +870,7 @@ var IdentityManager = class {
|
|
|
881
870
|
identityRecord
|
|
882
871
|
}, {
|
|
883
872
|
F: __dxlog_file3,
|
|
884
|
-
L:
|
|
873
|
+
L: 87,
|
|
885
874
|
S: this,
|
|
886
875
|
C: (f, a) => f(...a)
|
|
887
876
|
});
|
|
@@ -894,7 +883,7 @@ var IdentityManager = class {
|
|
|
894
883
|
displayName: this._identity.profileDocument?.displayName
|
|
895
884
|
}, {
|
|
896
885
|
F: __dxlog_file3,
|
|
897
|
-
L:
|
|
886
|
+
L: 92,
|
|
898
887
|
S: this,
|
|
899
888
|
C: (f, a) => f(...a)
|
|
900
889
|
});
|
|
@@ -904,7 +893,7 @@ var IdentityManager = class {
|
|
|
904
893
|
id: traceId
|
|
905
894
|
}), {
|
|
906
895
|
F: __dxlog_file3,
|
|
907
|
-
L:
|
|
896
|
+
L: 99,
|
|
908
897
|
S: this,
|
|
909
898
|
C: (f, a) => f(...a)
|
|
910
899
|
});
|
|
@@ -915,7 +904,7 @@ var IdentityManager = class {
|
|
|
915
904
|
async createIdentity({ displayName, deviceProfile } = {}) {
|
|
916
905
|
(0, import_invariant2.invariant)(!this._identity, "Identity already exists.", {
|
|
917
906
|
F: __dxlog_file3,
|
|
918
|
-
L:
|
|
907
|
+
L: 108,
|
|
919
908
|
S: this,
|
|
920
909
|
A: [
|
|
921
910
|
"!this._identity",
|
|
@@ -924,7 +913,7 @@ var IdentityManager = class {
|
|
|
924
913
|
});
|
|
925
914
|
(0, import_log3.log)("creating identity...", void 0, {
|
|
926
915
|
F: __dxlog_file3,
|
|
927
|
-
L:
|
|
916
|
+
L: 109,
|
|
928
917
|
S: this,
|
|
929
918
|
C: (f, a) => f(...a)
|
|
930
919
|
});
|
|
@@ -945,7 +934,7 @@ var IdentityManager = class {
|
|
|
945
934
|
const generator = new import_credentials4.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
|
|
946
935
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
|
|
947
936
|
F: __dxlog_file3,
|
|
948
|
-
L:
|
|
937
|
+
L: 128,
|
|
949
938
|
S: this,
|
|
950
939
|
A: [
|
|
951
940
|
"identityRecord.haloSpace.genesisFeedKey",
|
|
@@ -954,7 +943,7 @@ var IdentityManager = class {
|
|
|
954
943
|
});
|
|
955
944
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
|
|
956
945
|
F: __dxlog_file3,
|
|
957
|
-
L:
|
|
946
|
+
L: 129,
|
|
958
947
|
S: this,
|
|
959
948
|
A: [
|
|
960
949
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -993,7 +982,7 @@ var IdentityManager = class {
|
|
|
993
982
|
displayName: this._identity.profileDocument?.displayName
|
|
994
983
|
}, {
|
|
995
984
|
F: __dxlog_file3,
|
|
996
|
-
L:
|
|
985
|
+
L: 171,
|
|
997
986
|
S: this,
|
|
998
987
|
C: (f, a) => f(...a)
|
|
999
988
|
});
|
|
@@ -1004,7 +993,7 @@ var IdentityManager = class {
|
|
|
1004
993
|
profile: identity.profileDocument
|
|
1005
994
|
}, {
|
|
1006
995
|
F: __dxlog_file3,
|
|
1007
|
-
L:
|
|
996
|
+
L: 177,
|
|
1008
997
|
S: this,
|
|
1009
998
|
C: (f, a) => f(...a)
|
|
1010
999
|
});
|
|
@@ -1041,13 +1030,13 @@ var IdentityManager = class {
|
|
|
1041
1030
|
params
|
|
1042
1031
|
}, {
|
|
1043
1032
|
F: __dxlog_file3,
|
|
1044
|
-
L:
|
|
1033
|
+
L: 215,
|
|
1045
1034
|
S: this,
|
|
1046
1035
|
C: (f, a) => f(...a)
|
|
1047
1036
|
});
|
|
1048
1037
|
(0, import_invariant2.invariant)(!this._identity, "Identity already exists.", {
|
|
1049
1038
|
F: __dxlog_file3,
|
|
1050
|
-
L:
|
|
1039
|
+
L: 216,
|
|
1051
1040
|
S: this,
|
|
1052
1041
|
A: [
|
|
1053
1042
|
"!this._identity",
|
|
@@ -1075,7 +1064,7 @@ var IdentityManager = class {
|
|
|
1075
1064
|
displayName: this._identity.profileDocument?.displayName
|
|
1076
1065
|
}, {
|
|
1077
1066
|
F: __dxlog_file3,
|
|
1078
|
-
L:
|
|
1067
|
+
L: 235,
|
|
1079
1068
|
S: this,
|
|
1080
1069
|
C: (f, a) => f(...a)
|
|
1081
1070
|
});
|
|
@@ -1089,7 +1078,7 @@ var IdentityManager = class {
|
|
|
1089
1078
|
deviceKey: identity.deviceKey
|
|
1090
1079
|
}, {
|
|
1091
1080
|
F: __dxlog_file3,
|
|
1092
|
-
L:
|
|
1081
|
+
L: 245,
|
|
1093
1082
|
S: this,
|
|
1094
1083
|
C: (f, a) => f(...a)
|
|
1095
1084
|
});
|
|
@@ -1101,7 +1090,7 @@ var IdentityManager = class {
|
|
|
1101
1090
|
async updateProfile(profile) {
|
|
1102
1091
|
(0, import_invariant2.invariant)(this._identity, "Identity not initialized.", {
|
|
1103
1092
|
F: __dxlog_file3,
|
|
1104
|
-
L:
|
|
1093
|
+
L: 253,
|
|
1105
1094
|
S: this,
|
|
1106
1095
|
A: [
|
|
1107
1096
|
"this._identity",
|
|
@@ -1132,7 +1121,7 @@ var IdentityManager = class {
|
|
|
1132
1121
|
async updateDeviceProfile(profile) {
|
|
1133
1122
|
(0, import_invariant2.invariant)(this._identity, "Identity not initialized.", {
|
|
1134
1123
|
F: __dxlog_file3,
|
|
1135
|
-
L:
|
|
1124
|
+
L: 270,
|
|
1136
1125
|
S: this,
|
|
1137
1126
|
A: [
|
|
1138
1127
|
"this._identity",
|
|
@@ -1161,14 +1150,13 @@ var IdentityManager = class {
|
|
|
1161
1150
|
return {
|
|
1162
1151
|
deviceKey: this._identity.deviceKey,
|
|
1163
1152
|
kind: import_services.DeviceKind.CURRENT,
|
|
1164
|
-
presence: import_services.Device.PresenceState.ONLINE,
|
|
1165
1153
|
profile
|
|
1166
1154
|
};
|
|
1167
1155
|
}
|
|
1168
1156
|
async _constructIdentity(identityRecord) {
|
|
1169
1157
|
(0, import_invariant2.invariant)(!this._identity, void 0, {
|
|
1170
1158
|
F: __dxlog_file3,
|
|
1171
|
-
L:
|
|
1159
|
+
L: 291,
|
|
1172
1160
|
S: this,
|
|
1173
1161
|
A: [
|
|
1174
1162
|
"!this._identity",
|
|
@@ -1179,22 +1167,13 @@ var IdentityManager = class {
|
|
|
1179
1167
|
identityRecord
|
|
1180
1168
|
}, {
|
|
1181
1169
|
F: __dxlog_file3,
|
|
1182
|
-
L:
|
|
1170
|
+
L: 292,
|
|
1183
1171
|
S: this,
|
|
1184
1172
|
C: (f, a) => f(...a)
|
|
1185
1173
|
});
|
|
1186
|
-
const gossip = new import_teleport_extension_gossip.Gossip({
|
|
1187
|
-
localPeerId: identityRecord.deviceKey
|
|
1188
|
-
});
|
|
1189
|
-
const presence = new import_teleport_extension_gossip.Presence({
|
|
1190
|
-
announceInterval: this._devicePresenceAnnounceInterval,
|
|
1191
|
-
offlineTimeout: this._devicePresenceOfflineTimeout,
|
|
1192
|
-
identityKey: identityRecord.deviceKey,
|
|
1193
|
-
gossip
|
|
1194
|
-
});
|
|
1195
1174
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
1196
1175
|
F: __dxlog_file3,
|
|
1197
|
-
L:
|
|
1176
|
+
L: 295,
|
|
1198
1177
|
S: this,
|
|
1199
1178
|
A: [
|
|
1200
1179
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -1206,7 +1185,7 @@ var IdentityManager = class {
|
|
|
1206
1185
|
});
|
|
1207
1186
|
(0, import_invariant2.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
1208
1187
|
F: __dxlog_file3,
|
|
1209
|
-
L:
|
|
1188
|
+
L: 299,
|
|
1210
1189
|
S: this,
|
|
1211
1190
|
A: [
|
|
1212
1191
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -1224,14 +1203,12 @@ var IdentityManager = class {
|
|
|
1224
1203
|
credentialProvider: createAuthProvider((0, import_credentials4.createCredentialSignerWithKey)(this._keyring, identityRecord.deviceKey)),
|
|
1225
1204
|
credentialAuthenticator: (0, import_util3.deferFunction)(() => identity.authVerifier.verifier)
|
|
1226
1205
|
},
|
|
1227
|
-
gossip,
|
|
1228
1206
|
identityKey: identityRecord.identityKey
|
|
1229
1207
|
});
|
|
1230
1208
|
await space.setControlFeed(controlFeed);
|
|
1231
1209
|
space.setDataFeed(dataFeed);
|
|
1232
1210
|
const identity = new Identity({
|
|
1233
1211
|
space,
|
|
1234
|
-
presence,
|
|
1235
1212
|
signer: this._keyring,
|
|
1236
1213
|
identityKey: identityRecord.identityKey,
|
|
1237
1214
|
deviceKey: identityRecord.deviceKey
|
|
@@ -1240,7 +1217,7 @@ var IdentityManager = class {
|
|
|
1240
1217
|
identityKey: identityRecord.identityKey
|
|
1241
1218
|
}, {
|
|
1242
1219
|
F: __dxlog_file3,
|
|
1243
|
-
L:
|
|
1220
|
+
L: 323,
|
|
1244
1221
|
S: this,
|
|
1245
1222
|
C: (f, a) => f(...a)
|
|
1246
1223
|
});
|
|
@@ -1250,22 +1227,19 @@ var IdentityManager = class {
|
|
|
1250
1227
|
identity.stateUpdate.on(() => this.stateUpdate.emit());
|
|
1251
1228
|
return identity;
|
|
1252
1229
|
}
|
|
1253
|
-
async _constructSpace({ spaceRecord, swarmIdentity, identityKey
|
|
1230
|
+
async _constructSpace({ spaceRecord, swarmIdentity, identityKey }) {
|
|
1254
1231
|
return this._spaceManager.constructSpace({
|
|
1255
1232
|
metadata: {
|
|
1256
1233
|
key: spaceRecord.key,
|
|
1257
1234
|
genesisFeedKey: spaceRecord.genesisFeedKey
|
|
1258
1235
|
},
|
|
1259
1236
|
swarmIdentity,
|
|
1260
|
-
onAuthorizedConnection: (
|
|
1261
|
-
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
1262
|
-
remotePeerId: session.remotePeerId
|
|
1263
|
-
}));
|
|
1237
|
+
onAuthorizedConnection: () => {
|
|
1264
1238
|
},
|
|
1265
1239
|
onAuthFailure: () => {
|
|
1266
1240
|
import_log3.log.warn("auth failure", void 0, {
|
|
1267
1241
|
F: __dxlog_file3,
|
|
1268
|
-
L:
|
|
1242
|
+
L: 343,
|
|
1269
1243
|
S: this,
|
|
1270
1244
|
C: (f, a) => f(...a)
|
|
1271
1245
|
});
|
|
@@ -2782,7 +2756,7 @@ var getPlatform = () => {
|
|
|
2782
2756
|
};
|
|
2783
2757
|
}
|
|
2784
2758
|
};
|
|
2785
|
-
var DXOS_VERSION = "0.4.7-main.
|
|
2759
|
+
var DXOS_VERSION = "0.4.7-main.6b81200";
|
|
2786
2760
|
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
2787
2761
|
var DEFAULT_TIMEOUT = 1e3;
|
|
2788
2762
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
@@ -3741,7 +3715,7 @@ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
3741
3715
|
var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
|
|
3742
3716
|
var PRESENCE_OFFLINE_TIMEOUT = 2e4;
|
|
3743
3717
|
var DataSpaceManager = class {
|
|
3744
|
-
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore, _automergeHost
|
|
3718
|
+
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore, _automergeHost) {
|
|
3745
3719
|
this._spaceManager = _spaceManager;
|
|
3746
3720
|
this._metadataStore = _metadataStore;
|
|
3747
3721
|
this._dataServiceSubscriptions = _dataServiceSubscriptions;
|
|
@@ -3754,9 +3728,6 @@ var DataSpaceManager = class {
|
|
|
3754
3728
|
this._spaces = new import_util6.ComplexMap(import_keys9.PublicKey.hash);
|
|
3755
3729
|
this._isOpen = false;
|
|
3756
3730
|
this._instanceId = import_keys9.PublicKey.random().toHex();
|
|
3757
|
-
const { spaceMemberPresenceAnnounceInterval = PRESENCE_ANNOUNCE_INTERVAL, spaceMemberPresenceOfflineTimeout = PRESENCE_OFFLINE_TIMEOUT } = params ?? {};
|
|
3758
|
-
this._spaceMemberPresenceAnnounceInterval = spaceMemberPresenceAnnounceInterval;
|
|
3759
|
-
this._spaceMemberPresenceOfflineTimeout = spaceMemberPresenceOfflineTimeout;
|
|
3760
3731
|
}
|
|
3761
3732
|
// TODO(burdon): Remove.
|
|
3762
3733
|
get spaces() {
|
|
@@ -3765,7 +3736,7 @@ var DataSpaceManager = class {
|
|
|
3765
3736
|
async open() {
|
|
3766
3737
|
(0, import_log11.log)("open", void 0, {
|
|
3767
3738
|
F: __dxlog_file13,
|
|
3768
|
-
L:
|
|
3739
|
+
L: 90,
|
|
3769
3740
|
S: this,
|
|
3770
3741
|
C: (f, a) => f(...a)
|
|
3771
3742
|
});
|
|
@@ -3773,7 +3744,7 @@ var DataSpaceManager = class {
|
|
|
3773
3744
|
id: this._instanceId
|
|
3774
3745
|
}), {
|
|
3775
3746
|
F: __dxlog_file13,
|
|
3776
|
-
L:
|
|
3747
|
+
L: 91,
|
|
3777
3748
|
S: this,
|
|
3778
3749
|
C: (f, a) => f(...a)
|
|
3779
3750
|
});
|
|
@@ -3781,7 +3752,7 @@ var DataSpaceManager = class {
|
|
|
3781
3752
|
spaces: this._metadataStore.spaces.length
|
|
3782
3753
|
}, {
|
|
3783
3754
|
F: __dxlog_file13,
|
|
3784
|
-
L:
|
|
3755
|
+
L: 92,
|
|
3785
3756
|
S: this,
|
|
3786
3757
|
C: (f, a) => f(...a)
|
|
3787
3758
|
});
|
|
@@ -3791,7 +3762,7 @@ var DataSpaceManager = class {
|
|
|
3791
3762
|
spaceMetadata
|
|
3792
3763
|
}, {
|
|
3793
3764
|
F: __dxlog_file13,
|
|
3794
|
-
L:
|
|
3765
|
+
L: 96,
|
|
3795
3766
|
S: this,
|
|
3796
3767
|
C: (f, a) => f(...a)
|
|
3797
3768
|
});
|
|
@@ -3802,7 +3773,7 @@ var DataSpaceManager = class {
|
|
|
3802
3773
|
err
|
|
3803
3774
|
}, {
|
|
3804
3775
|
F: __dxlog_file13,
|
|
3805
|
-
L:
|
|
3776
|
+
L: 99,
|
|
3806
3777
|
S: this,
|
|
3807
3778
|
C: (f, a) => f(...a)
|
|
3808
3779
|
});
|
|
@@ -3819,7 +3790,7 @@ var DataSpaceManager = class {
|
|
|
3819
3790
|
id: this._instanceId
|
|
3820
3791
|
}), {
|
|
3821
3792
|
F: __dxlog_file13,
|
|
3822
|
-
L:
|
|
3793
|
+
L: 112,
|
|
3823
3794
|
S: this,
|
|
3824
3795
|
C: (f, a) => f(...a)
|
|
3825
3796
|
});
|
|
@@ -3827,7 +3798,7 @@ var DataSpaceManager = class {
|
|
|
3827
3798
|
async close() {
|
|
3828
3799
|
(0, import_log11.log)("close", void 0, {
|
|
3829
3800
|
F: __dxlog_file13,
|
|
3830
|
-
L:
|
|
3801
|
+
L: 117,
|
|
3831
3802
|
S: this,
|
|
3832
3803
|
C: (f, a) => f(...a)
|
|
3833
3804
|
});
|
|
@@ -3843,7 +3814,7 @@ var DataSpaceManager = class {
|
|
|
3843
3814
|
async createSpace() {
|
|
3844
3815
|
(0, import_invariant12.invariant)(this._isOpen, "Not open.", {
|
|
3845
3816
|
F: __dxlog_file13,
|
|
3846
|
-
L:
|
|
3817
|
+
L: 130,
|
|
3847
3818
|
S: this,
|
|
3848
3819
|
A: [
|
|
3849
3820
|
"this._isOpen",
|
|
@@ -3864,7 +3835,7 @@ var DataSpaceManager = class {
|
|
|
3864
3835
|
spaceKey
|
|
3865
3836
|
}, {
|
|
3866
3837
|
F: __dxlog_file13,
|
|
3867
|
-
L:
|
|
3838
|
+
L: 142,
|
|
3868
3839
|
S: this,
|
|
3869
3840
|
C: (f, a) => f(...a)
|
|
3870
3841
|
});
|
|
@@ -3880,7 +3851,7 @@ var DataSpaceManager = class {
|
|
|
3880
3851
|
const memberCredential = credentials[1];
|
|
3881
3852
|
(0, import_invariant12.invariant)((0, import_credentials12.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
3882
3853
|
F: __dxlog_file13,
|
|
3883
|
-
L:
|
|
3854
|
+
L: 155,
|
|
3884
3855
|
S: this,
|
|
3885
3856
|
A: [
|
|
3886
3857
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -3898,13 +3869,13 @@ var DataSpaceManager = class {
|
|
|
3898
3869
|
opts
|
|
3899
3870
|
}, {
|
|
3900
3871
|
F: __dxlog_file13,
|
|
3901
|
-
L:
|
|
3872
|
+
L: 167,
|
|
3902
3873
|
S: this,
|
|
3903
3874
|
C: (f, a) => f(...a)
|
|
3904
3875
|
});
|
|
3905
3876
|
(0, import_invariant12.invariant)(this._isOpen, "Not open.", {
|
|
3906
3877
|
F: __dxlog_file13,
|
|
3907
|
-
L:
|
|
3878
|
+
L: 168,
|
|
3908
3879
|
S: this,
|
|
3909
3880
|
A: [
|
|
3910
3881
|
"this._isOpen",
|
|
@@ -3913,7 +3884,7 @@ var DataSpaceManager = class {
|
|
|
3913
3884
|
});
|
|
3914
3885
|
(0, import_invariant12.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
3915
3886
|
F: __dxlog_file13,
|
|
3916
|
-
L:
|
|
3887
|
+
L: 169,
|
|
3917
3888
|
S: this,
|
|
3918
3889
|
A: [
|
|
3919
3890
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -3948,16 +3919,16 @@ var DataSpaceManager = class {
|
|
|
3948
3919
|
metadata
|
|
3949
3920
|
}, {
|
|
3950
3921
|
F: __dxlog_file13,
|
|
3951
|
-
L:
|
|
3922
|
+
L: 202,
|
|
3952
3923
|
S: this,
|
|
3953
3924
|
C: (f, a) => f(...a)
|
|
3954
3925
|
});
|
|
3955
|
-
const gossip = new
|
|
3926
|
+
const gossip = new import_teleport_extension_gossip.Gossip({
|
|
3956
3927
|
localPeerId: this._signingContext.deviceKey
|
|
3957
3928
|
});
|
|
3958
|
-
const presence = new
|
|
3959
|
-
announceInterval:
|
|
3960
|
-
offlineTimeout:
|
|
3929
|
+
const presence = new import_teleport_extension_gossip.Presence({
|
|
3930
|
+
announceInterval: PRESENCE_ANNOUNCE_INTERVAL,
|
|
3931
|
+
offlineTimeout: PRESENCE_OFFLINE_TIMEOUT,
|
|
3961
3932
|
identityKey: this._signingContext.identityKey,
|
|
3962
3933
|
gossip
|
|
3963
3934
|
});
|
|
@@ -3986,7 +3957,7 @@ var DataSpaceManager = class {
|
|
|
3986
3957
|
onAuthFailure: () => {
|
|
3987
3958
|
import_log11.log.warn("auth failure", void 0, {
|
|
3988
3959
|
F: __dxlog_file13,
|
|
3989
|
-
L:
|
|
3960
|
+
L: 239,
|
|
3990
3961
|
S: this,
|
|
3991
3962
|
C: (f, a) => f(...a)
|
|
3992
3963
|
});
|
|
@@ -4010,7 +3981,7 @@ var DataSpaceManager = class {
|
|
|
4010
3981
|
space: space.key
|
|
4011
3982
|
}, {
|
|
4012
3983
|
F: __dxlog_file13,
|
|
4013
|
-
L:
|
|
3984
|
+
L: 257,
|
|
4014
3985
|
S: this,
|
|
4015
3986
|
C: (f, a) => f(...a)
|
|
4016
3987
|
});
|
|
@@ -4022,7 +3993,7 @@ var DataSpaceManager = class {
|
|
|
4022
3993
|
open: this._isOpen
|
|
4023
3994
|
}, {
|
|
4024
3995
|
F: __dxlog_file13,
|
|
4025
|
-
L:
|
|
3996
|
+
L: 264,
|
|
4026
3997
|
S: this,
|
|
4027
3998
|
C: (f, a) => f(...a)
|
|
4028
3999
|
});
|
|
@@ -4035,7 +4006,7 @@ var DataSpaceManager = class {
|
|
|
4035
4006
|
space: space.key
|
|
4036
4007
|
}, {
|
|
4037
4008
|
F: __dxlog_file13,
|
|
4038
|
-
L:
|
|
4009
|
+
L: 270,
|
|
4039
4010
|
S: this,
|
|
4040
4011
|
C: (f, a) => f(...a)
|
|
4041
4012
|
});
|
|
@@ -4297,12 +4268,11 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4297
4268
|
}
|
|
4298
4269
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
4299
4270
|
var ServiceContext = class {
|
|
4300
|
-
constructor(storage, networkManager, signalManager, modelFactory
|
|
4271
|
+
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
4301
4272
|
this.storage = storage;
|
|
4302
4273
|
this.networkManager = networkManager;
|
|
4303
4274
|
this.signalManager = signalManager;
|
|
4304
4275
|
this.modelFactory = modelFactory;
|
|
4305
|
-
this._runtimeParams = _runtimeParams;
|
|
4306
4276
|
this.initialized = new import_async14.Trigger();
|
|
4307
4277
|
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
4308
4278
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
@@ -4329,7 +4299,7 @@ var ServiceContext = class {
|
|
|
4329
4299
|
modelFactory: this.modelFactory,
|
|
4330
4300
|
snapshotStore: this.snapshotStore
|
|
4331
4301
|
});
|
|
4332
|
-
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager
|
|
4302
|
+
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
|
|
4333
4303
|
this.automergeHost = new import_echo_pipeline2.AutomergeHost(storage.createDirectory("automerge"));
|
|
4334
4304
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
4335
4305
|
this._handlerFactories.set(import_services12.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? (0, import_debug6.failUndefined)(), this._acceptIdentity.bind(this)));
|
|
@@ -4338,7 +4308,7 @@ var ServiceContext = class {
|
|
|
4338
4308
|
await this._checkStorageVersion();
|
|
4339
4309
|
(0, import_log13.log)("opening...", void 0, {
|
|
4340
4310
|
F: __dxlog_file15,
|
|
4341
|
-
L:
|
|
4311
|
+
L: 133,
|
|
4342
4312
|
S: this,
|
|
4343
4313
|
C: (f, a) => f(...a)
|
|
4344
4314
|
});
|
|
@@ -4346,7 +4316,7 @@ var ServiceContext = class {
|
|
|
4346
4316
|
id: this._instanceId
|
|
4347
4317
|
}), {
|
|
4348
4318
|
F: __dxlog_file15,
|
|
4349
|
-
L:
|
|
4319
|
+
L: 134,
|
|
4350
4320
|
S: this,
|
|
4351
4321
|
C: (f, a) => f(...a)
|
|
4352
4322
|
});
|
|
@@ -4362,13 +4332,13 @@ var ServiceContext = class {
|
|
|
4362
4332
|
id: this._instanceId
|
|
4363
4333
|
}), {
|
|
4364
4334
|
F: __dxlog_file15,
|
|
4365
|
-
L:
|
|
4335
|
+
L: 144,
|
|
4366
4336
|
S: this,
|
|
4367
4337
|
C: (f, a) => f(...a)
|
|
4368
4338
|
});
|
|
4369
4339
|
(0, import_log13.log)("opened", void 0, {
|
|
4370
4340
|
F: __dxlog_file15,
|
|
4371
|
-
L:
|
|
4341
|
+
L: 145,
|
|
4372
4342
|
S: this,
|
|
4373
4343
|
C: (f, a) => f(...a)
|
|
4374
4344
|
});
|
|
@@ -4376,7 +4346,7 @@ var ServiceContext = class {
|
|
|
4376
4346
|
async close() {
|
|
4377
4347
|
(0, import_log13.log)("closing...", void 0, {
|
|
4378
4348
|
F: __dxlog_file15,
|
|
4379
|
-
L:
|
|
4349
|
+
L: 149,
|
|
4380
4350
|
S: this,
|
|
4381
4351
|
C: (f, a) => f(...a)
|
|
4382
4352
|
});
|
|
@@ -4394,7 +4364,7 @@ var ServiceContext = class {
|
|
|
4394
4364
|
await this.metadataStore.close();
|
|
4395
4365
|
(0, import_log13.log)("closed", void 0, {
|
|
4396
4366
|
F: __dxlog_file15,
|
|
4397
|
-
L:
|
|
4367
|
+
L: 162,
|
|
4398
4368
|
S: this,
|
|
4399
4369
|
C: (f, a) => f(...a)
|
|
4400
4370
|
});
|
|
@@ -4408,7 +4378,7 @@ var ServiceContext = class {
|
|
|
4408
4378
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4409
4379
|
(0, import_invariant14.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4410
4380
|
F: __dxlog_file15,
|
|
4411
|
-
L:
|
|
4381
|
+
L: 173,
|
|
4412
4382
|
S: this,
|
|
4413
4383
|
A: [
|
|
4414
4384
|
"factory",
|
|
@@ -4440,7 +4410,7 @@ var ServiceContext = class {
|
|
|
4440
4410
|
async _initialize(ctx) {
|
|
4441
4411
|
(0, import_log13.log)("initializing spaces...", void 0, {
|
|
4442
4412
|
F: __dxlog_file15,
|
|
4443
|
-
L:
|
|
4413
|
+
L: 204,
|
|
4444
4414
|
S: this,
|
|
4445
4415
|
C: (f, a) => f(...a)
|
|
4446
4416
|
});
|
|
@@ -4458,12 +4428,12 @@ var ServiceContext = class {
|
|
|
4458
4428
|
});
|
|
4459
4429
|
}
|
|
4460
4430
|
};
|
|
4461
|
-
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore, this.automergeHost
|
|
4431
|
+
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore, this.automergeHost);
|
|
4462
4432
|
await this.dataSpaceManager.open();
|
|
4463
4433
|
this._handlerFactories.set(import_services12.Invitation.Kind.SPACE, (invitation) => {
|
|
4464
4434
|
(0, import_invariant14.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4465
4435
|
F: __dxlog_file15,
|
|
4466
|
-
L:
|
|
4436
|
+
L: 228,
|
|
4467
4437
|
S: this,
|
|
4468
4438
|
A: [
|
|
4469
4439
|
"this.dataSpaceManager",
|
|
@@ -4487,7 +4457,7 @@ var ServiceContext = class {
|
|
|
4487
4457
|
details: assertion
|
|
4488
4458
|
}, {
|
|
4489
4459
|
F: __dxlog_file15,
|
|
4490
|
-
L:
|
|
4460
|
+
L: 244,
|
|
4491
4461
|
S: this,
|
|
4492
4462
|
C: (f, a) => f(...a)
|
|
4493
4463
|
});
|
|
@@ -4498,7 +4468,7 @@ var ServiceContext = class {
|
|
|
4498
4468
|
details: assertion
|
|
4499
4469
|
}, {
|
|
4500
4470
|
F: __dxlog_file15,
|
|
4501
|
-
L:
|
|
4471
|
+
L: 248,
|
|
4502
4472
|
S: this,
|
|
4503
4473
|
C: (f, a) => f(...a)
|
|
4504
4474
|
});
|
|
@@ -4509,7 +4479,7 @@ var ServiceContext = class {
|
|
|
4509
4479
|
details: assertion
|
|
4510
4480
|
}, {
|
|
4511
4481
|
F: __dxlog_file15,
|
|
4512
|
-
L:
|
|
4482
|
+
L: 253,
|
|
4513
4483
|
S: this,
|
|
4514
4484
|
C: (f, a) => f(...a)
|
|
4515
4485
|
});
|
|
@@ -4520,7 +4490,7 @@ var ServiceContext = class {
|
|
|
4520
4490
|
} catch (err) {
|
|
4521
4491
|
import_log13.log.catch(err, void 0, {
|
|
4522
4492
|
F: __dxlog_file15,
|
|
4523
|
-
L:
|
|
4493
|
+
L: 259,
|
|
4524
4494
|
S: this,
|
|
4525
4495
|
C: (f, a) => f(...a)
|
|
4526
4496
|
});
|
|
@@ -4658,7 +4628,6 @@ var toStorageType = (type) => {
|
|
|
4658
4628
|
throw new Error(`Invalid storage type: ${StorageDriver[type]}`);
|
|
4659
4629
|
}
|
|
4660
4630
|
};
|
|
4661
|
-
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
|
|
4662
4631
|
var DevicesServiceImpl = class {
|
|
4663
4632
|
constructor(_identityManager) {
|
|
4664
4633
|
this._identityManager = _identityManager;
|
|
@@ -4675,58 +4644,22 @@ var DevicesServiceImpl = class {
|
|
|
4675
4644
|
devices: []
|
|
4676
4645
|
});
|
|
4677
4646
|
} else {
|
|
4678
|
-
(0, import_invariant17.invariant)(this._identityManager.identity?.presence, "presence not present", {
|
|
4679
|
-
F: __dxlog_file17,
|
|
4680
|
-
L: 32,
|
|
4681
|
-
S: this,
|
|
4682
|
-
A: [
|
|
4683
|
-
"this._identityManager.identity?.presence",
|
|
4684
|
-
"'presence not present'"
|
|
4685
|
-
]
|
|
4686
|
-
});
|
|
4687
|
-
const peers = this._identityManager.identity.presence.getPeersOnline();
|
|
4688
4647
|
next({
|
|
4689
|
-
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => {
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services14.DeviceKind.CURRENT : import_services14.DeviceKind.TRUSTED,
|
|
4695
|
-
profile,
|
|
4696
|
-
presence: isMe ? import_services14.Device.PresenceState.ONLINE : peerState ? import_services14.Device.PresenceState.ONLINE : import_services14.Device.PresenceState.OFFLINE
|
|
4697
|
-
};
|
|
4698
|
-
})
|
|
4699
|
-
});
|
|
4700
|
-
}
|
|
4701
|
-
};
|
|
4702
|
-
let identitySubscribed = false;
|
|
4703
|
-
let presenceSubscribed = false;
|
|
4704
|
-
const subscribeIdentity = () => {
|
|
4705
|
-
if (!identitySubscribed) {
|
|
4706
|
-
this._identityManager.identity?.stateUpdate.on(() => {
|
|
4707
|
-
update();
|
|
4648
|
+
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
|
|
4649
|
+
deviceKey: key,
|
|
4650
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services14.DeviceKind.CURRENT : import_services14.DeviceKind.TRUSTED,
|
|
4651
|
+
profile
|
|
4652
|
+
}))
|
|
4708
4653
|
});
|
|
4709
|
-
identitySubscribed = true;
|
|
4710
|
-
}
|
|
4711
|
-
};
|
|
4712
|
-
const subscribePresence = () => {
|
|
4713
|
-
if (!presenceSubscribed) {
|
|
4714
|
-
this._identityManager.identity?.presence?.updated.on(() => {
|
|
4715
|
-
update();
|
|
4716
|
-
});
|
|
4717
|
-
presenceSubscribed = true;
|
|
4718
4654
|
}
|
|
4719
4655
|
};
|
|
4720
4656
|
const subscriptions = new import_async16.EventSubscriptions();
|
|
4721
|
-
if (this._identityManager.identity) {
|
|
4722
|
-
subscribeIdentity();
|
|
4723
|
-
subscribePresence();
|
|
4724
|
-
}
|
|
4725
4657
|
subscriptions.add(this._identityManager.stateUpdate.on(() => {
|
|
4726
4658
|
update();
|
|
4727
4659
|
if (this._identityManager.identity) {
|
|
4728
|
-
|
|
4729
|
-
|
|
4660
|
+
subscriptions.add(this._identityManager.identity.stateUpdate.on(() => {
|
|
4661
|
+
update();
|
|
4662
|
+
}));
|
|
4730
4663
|
}
|
|
4731
4664
|
}));
|
|
4732
4665
|
update();
|
|
@@ -4936,7 +4869,7 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
4936
4869
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4937
4870
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4938
4871
|
}
|
|
4939
|
-
var
|
|
4872
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4940
4873
|
var createDefaultModelFactory = () => {
|
|
4941
4874
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4942
4875
|
};
|
|
@@ -4949,8 +4882,7 @@ var ClientServicesHost = class {
|
|
|
4949
4882
|
storage,
|
|
4950
4883
|
// TODO(wittjosiah): Turn this on by default.
|
|
4951
4884
|
lockKey,
|
|
4952
|
-
callbacks
|
|
4953
|
-
runtimeParams
|
|
4885
|
+
callbacks
|
|
4954
4886
|
} = {}) {
|
|
4955
4887
|
this._tracingService = import_tracing7.TRACE_PROCESSOR.createTraceSender();
|
|
4956
4888
|
this._statusUpdate = new import_async15.Event();
|
|
@@ -4959,7 +4891,6 @@ var ClientServicesHost = class {
|
|
|
4959
4891
|
this._storage = storage;
|
|
4960
4892
|
this._modelFactory = modelFactory;
|
|
4961
4893
|
this._callbacks = callbacks;
|
|
4962
|
-
this._runtimeParams = runtimeParams;
|
|
4963
4894
|
if (config) {
|
|
4964
4895
|
this.initialize({
|
|
4965
4896
|
config,
|
|
@@ -5027,8 +4958,8 @@ var ClientServicesHost = class {
|
|
|
5027
4958
|
*/
|
|
5028
4959
|
initialize({ config, ...options }) {
|
|
5029
4960
|
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
5030
|
-
F:
|
|
5031
|
-
L:
|
|
4961
|
+
F: __dxlog_file17,
|
|
4962
|
+
L: 186,
|
|
5032
4963
|
S: this,
|
|
5033
4964
|
A: [
|
|
5034
4965
|
"!this._open",
|
|
@@ -5036,15 +4967,15 @@ var ClientServicesHost = class {
|
|
|
5036
4967
|
]
|
|
5037
4968
|
});
|
|
5038
4969
|
(0, import_log15.log)("initializing...", void 0, {
|
|
5039
|
-
F:
|
|
5040
|
-
L:
|
|
4970
|
+
F: __dxlog_file17,
|
|
4971
|
+
L: 187,
|
|
5041
4972
|
S: this,
|
|
5042
4973
|
C: (f, a) => f(...a)
|
|
5043
4974
|
});
|
|
5044
4975
|
if (config) {
|
|
5045
4976
|
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
5046
|
-
F:
|
|
5047
|
-
L:
|
|
4977
|
+
F: __dxlog_file17,
|
|
4978
|
+
L: 190,
|
|
5048
4979
|
S: this,
|
|
5049
4980
|
A: [
|
|
5050
4981
|
"!this._config",
|
|
@@ -5061,8 +4992,8 @@ var ClientServicesHost = class {
|
|
|
5061
4992
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
5062
4993
|
this._signalManager = signalManager;
|
|
5063
4994
|
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
5064
|
-
F:
|
|
5065
|
-
L:
|
|
4995
|
+
F: __dxlog_file17,
|
|
4996
|
+
L: 206,
|
|
5066
4997
|
S: this,
|
|
5067
4998
|
A: [
|
|
5068
4999
|
"!this._networkManager",
|
|
@@ -5075,8 +5006,8 @@ var ClientServicesHost = class {
|
|
|
5075
5006
|
signalManager
|
|
5076
5007
|
});
|
|
5077
5008
|
(0, import_log15.log)("initialized", void 0, {
|
|
5078
|
-
F:
|
|
5079
|
-
L:
|
|
5009
|
+
F: __dxlog_file17,
|
|
5010
|
+
L: 213,
|
|
5080
5011
|
S: this,
|
|
5081
5012
|
C: (f, a) => f(...a)
|
|
5082
5013
|
});
|
|
@@ -5089,14 +5020,14 @@ var ClientServicesHost = class {
|
|
|
5089
5020
|
import_log15.log.trace("dxos.client-services.host.open", import_protocols14.trace.begin({
|
|
5090
5021
|
id: traceId
|
|
5091
5022
|
}), {
|
|
5092
|
-
F:
|
|
5093
|
-
L:
|
|
5023
|
+
F: __dxlog_file17,
|
|
5024
|
+
L: 224,
|
|
5094
5025
|
S: this,
|
|
5095
5026
|
C: (f, a) => f(...a)
|
|
5096
5027
|
});
|
|
5097
5028
|
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
5098
|
-
F:
|
|
5099
|
-
L:
|
|
5029
|
+
F: __dxlog_file17,
|
|
5030
|
+
L: 226,
|
|
5100
5031
|
S: this,
|
|
5101
5032
|
A: [
|
|
5102
5033
|
"this._config",
|
|
@@ -5104,8 +5035,8 @@ var ClientServicesHost = class {
|
|
|
5104
5035
|
]
|
|
5105
5036
|
});
|
|
5106
5037
|
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
5107
|
-
F:
|
|
5108
|
-
L:
|
|
5038
|
+
F: __dxlog_file17,
|
|
5039
|
+
L: 227,
|
|
5109
5040
|
S: this,
|
|
5110
5041
|
A: [
|
|
5111
5042
|
"this._storage",
|
|
@@ -5113,8 +5044,8 @@ var ClientServicesHost = class {
|
|
|
5113
5044
|
]
|
|
5114
5045
|
});
|
|
5115
5046
|
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
5116
|
-
F:
|
|
5117
|
-
L:
|
|
5047
|
+
F: __dxlog_file17,
|
|
5048
|
+
L: 228,
|
|
5118
5049
|
S: this,
|
|
5119
5050
|
A: [
|
|
5120
5051
|
"this._signalManager",
|
|
@@ -5122,8 +5053,8 @@ var ClientServicesHost = class {
|
|
|
5122
5053
|
]
|
|
5123
5054
|
});
|
|
5124
5055
|
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
5125
|
-
F:
|
|
5126
|
-
L:
|
|
5056
|
+
F: __dxlog_file17,
|
|
5057
|
+
L: 229,
|
|
5127
5058
|
S: this,
|
|
5128
5059
|
A: [
|
|
5129
5060
|
"this._networkManager",
|
|
@@ -5134,14 +5065,14 @@ var ClientServicesHost = class {
|
|
|
5134
5065
|
(0, import_log15.log)("opening...", {
|
|
5135
5066
|
lockKey: this._resourceLock?.lockKey
|
|
5136
5067
|
}, {
|
|
5137
|
-
F:
|
|
5138
|
-
L:
|
|
5068
|
+
F: __dxlog_file17,
|
|
5069
|
+
L: 232,
|
|
5139
5070
|
S: this,
|
|
5140
5071
|
C: (f, a) => f(...a)
|
|
5141
5072
|
});
|
|
5142
5073
|
await this._resourceLock?.acquire();
|
|
5143
5074
|
await this._loggingService.open();
|
|
5144
|
-
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory
|
|
5075
|
+
this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
|
|
5145
5076
|
this._serviceRegistry.setServices({
|
|
5146
5077
|
SystemService: this._systemService,
|
|
5147
5078
|
IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
|
|
@@ -5180,16 +5111,16 @@ var ClientServicesHost = class {
|
|
|
5180
5111
|
(0, import_log15.log)("opened", {
|
|
5181
5112
|
deviceKey
|
|
5182
5113
|
}, {
|
|
5183
|
-
F:
|
|
5184
|
-
L:
|
|
5114
|
+
F: __dxlog_file17,
|
|
5115
|
+
L: 305,
|
|
5185
5116
|
S: this,
|
|
5186
5117
|
C: (f, a) => f(...a)
|
|
5187
5118
|
});
|
|
5188
5119
|
import_log15.log.trace("dxos.client-services.host.open", import_protocols14.trace.end({
|
|
5189
5120
|
id: traceId
|
|
5190
5121
|
}), {
|
|
5191
|
-
F:
|
|
5192
|
-
L:
|
|
5122
|
+
F: __dxlog_file17,
|
|
5123
|
+
L: 306,
|
|
5193
5124
|
S: this,
|
|
5194
5125
|
C: (f, a) => f(...a)
|
|
5195
5126
|
});
|
|
@@ -5202,8 +5133,8 @@ var ClientServicesHost = class {
|
|
|
5202
5133
|
(0, import_log15.log)("closing...", {
|
|
5203
5134
|
deviceKey
|
|
5204
5135
|
}, {
|
|
5205
|
-
F:
|
|
5206
|
-
L:
|
|
5136
|
+
F: __dxlog_file17,
|
|
5137
|
+
L: 317,
|
|
5207
5138
|
S: this,
|
|
5208
5139
|
C: (f, a) => f(...a)
|
|
5209
5140
|
});
|
|
@@ -5218,8 +5149,8 @@ var ClientServicesHost = class {
|
|
|
5218
5149
|
(0, import_log15.log)("closed", {
|
|
5219
5150
|
deviceKey
|
|
5220
5151
|
}, {
|
|
5221
|
-
F:
|
|
5222
|
-
L:
|
|
5152
|
+
F: __dxlog_file17,
|
|
5153
|
+
L: 324,
|
|
5223
5154
|
S: this,
|
|
5224
5155
|
C: (f, a) => f(...a)
|
|
5225
5156
|
});
|
|
@@ -5229,30 +5160,30 @@ var ClientServicesHost = class {
|
|
|
5229
5160
|
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols14.trace.begin({
|
|
5230
5161
|
id: traceId
|
|
5231
5162
|
}), {
|
|
5232
|
-
F:
|
|
5233
|
-
L:
|
|
5163
|
+
F: __dxlog_file17,
|
|
5164
|
+
L: 329,
|
|
5234
5165
|
S: this,
|
|
5235
5166
|
C: (f, a) => f(...a)
|
|
5236
5167
|
});
|
|
5237
5168
|
(0, import_log15.log)("resetting...", void 0, {
|
|
5238
|
-
F:
|
|
5239
|
-
L:
|
|
5169
|
+
F: __dxlog_file17,
|
|
5170
|
+
L: 331,
|
|
5240
5171
|
S: this,
|
|
5241
5172
|
C: (f, a) => f(...a)
|
|
5242
5173
|
});
|
|
5243
5174
|
await this._serviceContext?.close();
|
|
5244
5175
|
await this._storage.reset();
|
|
5245
5176
|
(0, import_log15.log)("reset", void 0, {
|
|
5246
|
-
F:
|
|
5247
|
-
L:
|
|
5177
|
+
F: __dxlog_file17,
|
|
5178
|
+
L: 334,
|
|
5248
5179
|
S: this,
|
|
5249
5180
|
C: (f, a) => f(...a)
|
|
5250
5181
|
});
|
|
5251
5182
|
import_log15.log.trace("dxos.sdk.client-services-host.reset", import_protocols14.trace.end({
|
|
5252
5183
|
id: traceId
|
|
5253
5184
|
}), {
|
|
5254
|
-
F:
|
|
5255
|
-
L:
|
|
5185
|
+
F: __dxlog_file17,
|
|
5186
|
+
L: 335,
|
|
5256
5187
|
S: this,
|
|
5257
5188
|
C: (f, a) => f(...a)
|
|
5258
5189
|
});
|
|
@@ -5266,8 +5197,8 @@ var ClientServicesHost = class {
|
|
|
5266
5197
|
obj[import_client_protocol5.defaultKey] = identity.identityKey.toHex();
|
|
5267
5198
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
5268
5199
|
(0, import_invariant16.invariant)(automergeIndex, void 0, {
|
|
5269
|
-
F:
|
|
5270
|
-
L:
|
|
5200
|
+
F: __dxlog_file17,
|
|
5201
|
+
L: 350,
|
|
5271
5202
|
S: this,
|
|
5272
5203
|
A: [
|
|
5273
5204
|
"automergeIndex",
|
|
@@ -5336,4 +5267,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
5336
5267
|
subscribeToSpaces,
|
|
5337
5268
|
subscribeToSwarmInfo
|
|
5338
5269
|
});
|
|
5339
|
-
//# sourceMappingURL=chunk-
|
|
5270
|
+
//# sourceMappingURL=chunk-TG6QYWRX.cjs.map
|