@dxos/client-services 0.3.2-main.9928d98 → 0.3.2-main.ce2190e
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-UU6RPLAK.mjs → chunk-ZGPBGQ4M.mjs} +131 -67
- package/dist/lib/browser/chunk-ZGPBGQ4M.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/index.cjs +190 -126
- 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 +164 -100
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- 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 +4 -0
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity.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.ts +16 -3
- package/src/packlets/identity/identity-manager.test.ts +11 -0
- package/src/packlets/identity/identity-manager.ts +20 -0
- package/src/packlets/identity/identity.test.ts +2 -2
- package/src/packlets/identity/identity.ts +3 -3
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-UU6RPLAK.mjs.map +0 -7
|
@@ -52,7 +52,7 @@ var createMockCredential = async ({ signer, issuer }) => (0, import_credentials.
|
|
|
52
52
|
|
|
53
53
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
54
54
|
var import_async18 = require("@dxos/async");
|
|
55
|
-
var
|
|
55
|
+
var import_invariant17 = require("@dxos/invariant");
|
|
56
56
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
57
57
|
|
|
58
58
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
@@ -99,7 +99,7 @@ var getPlatform = () => {
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
// packages/sdk/client-services/src/version.ts
|
|
102
|
-
var DXOS_VERSION = "0.3.2-main.
|
|
102
|
+
var DXOS_VERSION = "0.3.2-main.ce2190e";
|
|
103
103
|
|
|
104
104
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
105
105
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
@@ -228,13 +228,13 @@ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
|
228
228
|
var import_feed_store3 = require("@dxos/feed-store");
|
|
229
229
|
var import_invariant13 = require("@dxos/invariant");
|
|
230
230
|
var import_keyring = require("@dxos/keyring");
|
|
231
|
-
var
|
|
231
|
+
var import_keys9 = require("@dxos/keys");
|
|
232
232
|
var import_log13 = require("@dxos/log");
|
|
233
233
|
var import_protocols10 = require("@dxos/protocols");
|
|
234
234
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
235
235
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
236
236
|
var import_tracing4 = require("@dxos/tracing");
|
|
237
|
-
var
|
|
237
|
+
var import_util6 = require("@dxos/util");
|
|
238
238
|
|
|
239
239
|
// packages/sdk/client-services/src/packlets/identity/authenticator.ts
|
|
240
240
|
var import_async = require("@dxos/async");
|
|
@@ -358,9 +358,11 @@ var import_credentials4 = require("@dxos/credentials");
|
|
|
358
358
|
var import_debug2 = require("@dxos/debug");
|
|
359
359
|
var import_feed_store = require("@dxos/feed-store");
|
|
360
360
|
var import_invariant2 = require("@dxos/invariant");
|
|
361
|
+
var import_keys2 = require("@dxos/keys");
|
|
361
362
|
var import_log3 = require("@dxos/log");
|
|
362
363
|
var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
363
364
|
var import_tracing = require("@dxos/tracing");
|
|
365
|
+
var import_util = require("@dxos/util");
|
|
364
366
|
function _ts_decorate(decorators, target, key, desc) {
|
|
365
367
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
366
368
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -389,7 +391,7 @@ var Identity = class Identity2 {
|
|
|
389
391
|
onUpdate: () => this.stateUpdate.emit()
|
|
390
392
|
});
|
|
391
393
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
392
|
-
trustedKeysProvider: () => this.authorizedDeviceKeys,
|
|
394
|
+
trustedKeysProvider: () => new import_util.ComplexSet(import_keys2.PublicKey.hash, this.authorizedDeviceKeys.keys()),
|
|
393
395
|
update: this.stateUpdate,
|
|
394
396
|
authTimeout: import_client_protocol.AUTH_TIMEOUT
|
|
395
397
|
});
|
|
@@ -527,13 +529,13 @@ var import_async3 = require("@dxos/async");
|
|
|
527
529
|
var import_context2 = require("@dxos/context");
|
|
528
530
|
var import_credentials6 = require("@dxos/credentials");
|
|
529
531
|
var import_invariant3 = require("@dxos/invariant");
|
|
530
|
-
var
|
|
532
|
+
var import_keys3 = require("@dxos/keys");
|
|
531
533
|
var import_log4 = require("@dxos/log");
|
|
532
534
|
var import_protocols3 = require("@dxos/protocols");
|
|
533
535
|
var import_credentials7 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
534
536
|
var import_timeframe = require("@dxos/timeframe");
|
|
535
537
|
var import_tracing2 = require("@dxos/tracing");
|
|
536
|
-
var
|
|
538
|
+
var import_util2 = require("@dxos/util");
|
|
537
539
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
538
540
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
539
541
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -559,7 +561,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
559
561
|
return this._identity;
|
|
560
562
|
}
|
|
561
563
|
async open(ctx) {
|
|
562
|
-
const traceId =
|
|
564
|
+
const traceId = import_keys3.PublicKey.random().toHex();
|
|
563
565
|
import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.begin({
|
|
564
566
|
id: traceId
|
|
565
567
|
}), {
|
|
@@ -789,10 +791,51 @@ var IdentityManager = class IdentityManager2 {
|
|
|
789
791
|
this.stateUpdate.emit();
|
|
790
792
|
return profile;
|
|
791
793
|
}
|
|
794
|
+
async updateDevice({ deviceKey, profile }) {
|
|
795
|
+
(0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
|
|
796
|
+
F: __dxlog_file4,
|
|
797
|
+
L: 216,
|
|
798
|
+
S: this,
|
|
799
|
+
A: [
|
|
800
|
+
"this._identity",
|
|
801
|
+
"'Identity not initialized.'"
|
|
802
|
+
]
|
|
803
|
+
});
|
|
804
|
+
(0, import_invariant3.invariant)(this._identity.authorizedDeviceKeys.has(deviceKey), "Device not authorized.", {
|
|
805
|
+
F: __dxlog_file4,
|
|
806
|
+
L: 218,
|
|
807
|
+
S: this,
|
|
808
|
+
A: [
|
|
809
|
+
"this._identity.authorizedDeviceKeys.has(deviceKey)",
|
|
810
|
+
"'Device not authorized.'"
|
|
811
|
+
]
|
|
812
|
+
});
|
|
813
|
+
const credential = await this._identity.getIdentityCredentialSigner().createCredential({
|
|
814
|
+
subject: this._identity.identityKey,
|
|
815
|
+
assertion: {
|
|
816
|
+
"@type": "dxos.halo.credentials.DeviceProfile",
|
|
817
|
+
deviceKey,
|
|
818
|
+
profile
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
const receipt = await this._identity.controlPipeline.writer.write({
|
|
822
|
+
credential: {
|
|
823
|
+
credential
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
await this._identity.controlPipeline.state.waitUntilTimeframe(new import_timeframe.Timeframe([
|
|
827
|
+
[
|
|
828
|
+
receipt.feedKey,
|
|
829
|
+
receipt.seq
|
|
830
|
+
]
|
|
831
|
+
]));
|
|
832
|
+
this.stateUpdate.emit();
|
|
833
|
+
return profile;
|
|
834
|
+
}
|
|
792
835
|
async _constructIdentity(identityRecord) {
|
|
793
836
|
(0, import_invariant3.invariant)(!this._identity, void 0, {
|
|
794
837
|
F: __dxlog_file4,
|
|
795
|
-
L:
|
|
838
|
+
L: 236,
|
|
796
839
|
S: this,
|
|
797
840
|
A: [
|
|
798
841
|
"!this._identity",
|
|
@@ -803,13 +846,13 @@ var IdentityManager = class IdentityManager2 {
|
|
|
803
846
|
identityRecord
|
|
804
847
|
}, {
|
|
805
848
|
F: __dxlog_file4,
|
|
806
|
-
L:
|
|
849
|
+
L: 237,
|
|
807
850
|
S: this,
|
|
808
851
|
C: (f, a) => f(...a)
|
|
809
852
|
});
|
|
810
853
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
811
854
|
F: __dxlog_file4,
|
|
812
|
-
L:
|
|
855
|
+
L: 240,
|
|
813
856
|
S: this,
|
|
814
857
|
A: [
|
|
815
858
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -821,7 +864,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
821
864
|
});
|
|
822
865
|
(0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
823
866
|
F: __dxlog_file4,
|
|
824
|
-
L:
|
|
867
|
+
L: 244,
|
|
825
868
|
S: this,
|
|
826
869
|
A: [
|
|
827
870
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -837,7 +880,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
837
880
|
swarmIdentity: {
|
|
838
881
|
peerKey: identityRecord.deviceKey,
|
|
839
882
|
credentialProvider: createAuthProvider((0, import_credentials6.createCredentialSignerWithKey)(this._keyring, identityRecord.deviceKey)),
|
|
840
|
-
credentialAuthenticator: (0,
|
|
883
|
+
credentialAuthenticator: (0, import_util2.deferFunction)(() => identity.authVerifier.verifier)
|
|
841
884
|
},
|
|
842
885
|
identityKey: identityRecord.identityKey
|
|
843
886
|
});
|
|
@@ -853,7 +896,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
853
896
|
identityKey: identityRecord.identityKey
|
|
854
897
|
}, {
|
|
855
898
|
F: __dxlog_file4,
|
|
856
|
-
L:
|
|
899
|
+
L: 268,
|
|
857
900
|
S: this,
|
|
858
901
|
C: (f, a) => f(...a)
|
|
859
902
|
});
|
|
@@ -874,7 +917,7 @@ var IdentityManager = class IdentityManager2 {
|
|
|
874
917
|
onAuthFailure: () => {
|
|
875
918
|
import_log4.log.warn("auth failure", void 0, {
|
|
876
919
|
F: __dxlog_file4,
|
|
877
|
-
L:
|
|
920
|
+
L: 287,
|
|
878
921
|
S: this,
|
|
879
922
|
C: (f, a) => f(...a)
|
|
880
923
|
});
|
|
@@ -1059,7 +1102,7 @@ var import_client_protocol2 = require("@dxos/client-protocol");
|
|
|
1059
1102
|
var import_context4 = require("@dxos/context");
|
|
1060
1103
|
var import_credentials9 = require("@dxos/credentials");
|
|
1061
1104
|
var import_invariant7 = require("@dxos/invariant");
|
|
1062
|
-
var
|
|
1105
|
+
var import_keys5 = require("@dxos/keys");
|
|
1063
1106
|
var import_log6 = require("@dxos/log");
|
|
1064
1107
|
var import_network_manager = require("@dxos/network-manager");
|
|
1065
1108
|
var import_protocols5 = require("@dxos/protocols");
|
|
@@ -1070,7 +1113,7 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
|
|
|
1070
1113
|
var import_async4 = require("@dxos/async");
|
|
1071
1114
|
var import_context3 = require("@dxos/context");
|
|
1072
1115
|
var import_invariant6 = require("@dxos/invariant");
|
|
1073
|
-
var
|
|
1116
|
+
var import_keys4 = require("@dxos/keys");
|
|
1074
1117
|
var import_log5 = require("@dxos/log");
|
|
1075
1118
|
var import_protocols4 = require("@dxos/protocols");
|
|
1076
1119
|
var import_services3 = require("@dxos/protocols/proto/dxos/client/services");
|
|
@@ -1118,7 +1161,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1118
1161
|
},
|
|
1119
1162
|
introduce: async (request) => {
|
|
1120
1163
|
const { profile, invitationId } = request;
|
|
1121
|
-
const traceId =
|
|
1164
|
+
const traceId = import_keys4.PublicKey.random().toHex();
|
|
1122
1165
|
import_log5.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols4.trace.begin({
|
|
1123
1166
|
id: traceId
|
|
1124
1167
|
}), {
|
|
@@ -1170,7 +1213,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1170
1213
|
};
|
|
1171
1214
|
},
|
|
1172
1215
|
authenticate: async ({ authCode: code }) => {
|
|
1173
|
-
const traceId =
|
|
1216
|
+
const traceId = import_keys4.PublicKey.random().toHex();
|
|
1174
1217
|
import_log5.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols4.trace.begin({
|
|
1175
1218
|
id: traceId
|
|
1176
1219
|
}), {
|
|
@@ -1250,7 +1293,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1250
1293
|
};
|
|
1251
1294
|
},
|
|
1252
1295
|
admit: async (request) => {
|
|
1253
|
-
const traceId =
|
|
1296
|
+
const traceId = import_keys4.PublicKey.random().toHex();
|
|
1254
1297
|
import_log5.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols4.trace.begin({
|
|
1255
1298
|
id: traceId
|
|
1256
1299
|
}), {
|
|
@@ -1416,7 +1459,7 @@ var InvitationsHandler = class {
|
|
|
1416
1459
|
this._networkManager = _networkManager;
|
|
1417
1460
|
}
|
|
1418
1461
|
createInvitation(protocol, options) {
|
|
1419
|
-
const { invitationId =
|
|
1462
|
+
const { invitationId = import_keys5.PublicKey.random().toHex(), type = import_services4.Invitation.Type.INTERACTIVE, authMethod = import_services4.Invitation.AuthMethod.SHARED_SECRET, state = import_services4.Invitation.State.INIT, timeout = import_client_protocol2.INVITATION_TIMEOUT, swarmKey = import_keys5.PublicKey.random() } = options ?? {};
|
|
1420
1463
|
const authCode = options?.authCode ?? (authMethod === import_services4.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials9.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1421
1464
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1422
1465
|
F: __dxlog_file8,
|
|
@@ -1491,7 +1534,7 @@ var InvitationsHandler = class {
|
|
|
1491
1534
|
},
|
|
1492
1535
|
onOpen: () => {
|
|
1493
1536
|
(0, import_async5.scheduleTask)(ctx, async () => {
|
|
1494
|
-
const traceId =
|
|
1537
|
+
const traceId = import_keys5.PublicKey.random().toHex();
|
|
1495
1538
|
try {
|
|
1496
1539
|
import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.begin({
|
|
1497
1540
|
id: traceId
|
|
@@ -1724,7 +1767,7 @@ var InvitationsHandler = class {
|
|
|
1724
1767
|
}
|
|
1725
1768
|
});
|
|
1726
1769
|
(0, import_async5.scheduleTask)(ctx, async () => {
|
|
1727
|
-
const traceId =
|
|
1770
|
+
const traceId = import_keys5.PublicKey.random().toHex();
|
|
1728
1771
|
try {
|
|
1729
1772
|
import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.begin({
|
|
1730
1773
|
id: traceId
|
|
@@ -1931,7 +1974,7 @@ var InvitationsHandler = class {
|
|
|
1931
1974
|
const topic = invitation.swarmKey;
|
|
1932
1975
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
1933
1976
|
topic,
|
|
1934
|
-
peerId:
|
|
1977
|
+
peerId: import_keys5.PublicKey.random(),
|
|
1935
1978
|
protocolProvider: (0, import_network_manager.createTeleportProtocolFactory)(async (teleport) => {
|
|
1936
1979
|
teleport.addExtension("dxos.halo.invitations", createExtension());
|
|
1937
1980
|
}),
|
|
@@ -2310,12 +2353,12 @@ var import_async9 = require("@dxos/async");
|
|
|
2310
2353
|
var import_context7 = require("@dxos/context");
|
|
2311
2354
|
var import_credentials14 = require("@dxos/credentials");
|
|
2312
2355
|
var import_invariant11 = require("@dxos/invariant");
|
|
2313
|
-
var
|
|
2356
|
+
var import_keys8 = require("@dxos/keys");
|
|
2314
2357
|
var import_log11 = require("@dxos/log");
|
|
2315
2358
|
var import_protocols8 = require("@dxos/protocols");
|
|
2316
2359
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2317
2360
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2318
|
-
var
|
|
2361
|
+
var import_util5 = require("@dxos/util");
|
|
2319
2362
|
|
|
2320
2363
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2321
2364
|
var import_async8 = require("@dxos/async");
|
|
@@ -2323,24 +2366,24 @@ var import_client_protocol3 = require("@dxos/client-protocol");
|
|
|
2323
2366
|
var import_context6 = require("@dxos/context");
|
|
2324
2367
|
var import_debug4 = require("@dxos/debug");
|
|
2325
2368
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2326
|
-
var
|
|
2369
|
+
var import_keys7 = require("@dxos/keys");
|
|
2327
2370
|
var import_log10 = require("@dxos/log");
|
|
2328
2371
|
var import_protocols7 = require("@dxos/protocols");
|
|
2329
2372
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2330
2373
|
var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2331
2374
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
2332
2375
|
var import_tracing3 = require("@dxos/tracing");
|
|
2333
|
-
var
|
|
2376
|
+
var import_util4 = require("@dxos/util");
|
|
2334
2377
|
|
|
2335
2378
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2336
2379
|
var import_async7 = require("@dxos/async");
|
|
2337
2380
|
var import_context5 = require("@dxos/context");
|
|
2338
2381
|
var import_invariant10 = require("@dxos/invariant");
|
|
2339
|
-
var
|
|
2382
|
+
var import_keys6 = require("@dxos/keys");
|
|
2340
2383
|
var import_log9 = require("@dxos/log");
|
|
2341
2384
|
var import_protocols6 = require("@dxos/protocols");
|
|
2342
2385
|
var import_teleport2 = require("@dxos/teleport");
|
|
2343
|
-
var
|
|
2386
|
+
var import_util3 = require("@dxos/util");
|
|
2344
2387
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2345
2388
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2346
2389
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
@@ -2351,8 +2394,8 @@ var NotarizationPlugin = class {
|
|
|
2351
2394
|
this._ctx = new import_context5.Context();
|
|
2352
2395
|
this._extensionOpened = new import_async7.Event();
|
|
2353
2396
|
this._extensions = /* @__PURE__ */ new Set();
|
|
2354
|
-
this._processedCredentials = new
|
|
2355
|
-
this._processCredentialsTriggers = new
|
|
2397
|
+
this._processedCredentials = new import_util3.ComplexSet(import_keys6.PublicKey.hash);
|
|
2398
|
+
this._processCredentialsTriggers = new import_util3.ComplexMap(import_keys6.PublicKey.hash);
|
|
2356
2399
|
}
|
|
2357
2400
|
get hasWriter() {
|
|
2358
2401
|
return !!this._writer;
|
|
@@ -2514,7 +2557,7 @@ var NotarizationPlugin = class {
|
|
|
2514
2557
|
if (this._processedCredentials.has(id)) {
|
|
2515
2558
|
return;
|
|
2516
2559
|
}
|
|
2517
|
-
await (0,
|
|
2560
|
+
await (0, import_util3.entry)(this._processCredentialsTriggers, id).orInsert(new import_async7.Trigger()).value.wait();
|
|
2518
2561
|
}
|
|
2519
2562
|
/**
|
|
2520
2563
|
* Requests from other peers to notarize credentials.
|
|
@@ -2634,7 +2677,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2634
2677
|
this._signingContext = params.signingContext;
|
|
2635
2678
|
this._callbacks = params.callbacks ?? {};
|
|
2636
2679
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2637
|
-
trustedKeysProvider: () => new
|
|
2680
|
+
trustedKeysProvider: () => new import_util4.ComplexSet(import_keys7.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
2638
2681
|
update: this._inner.stateUpdate,
|
|
2639
2682
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
2640
2683
|
});
|
|
@@ -3053,9 +3096,9 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3053
3096
|
this._feedStore = _feedStore;
|
|
3054
3097
|
this._ctx = new import_context7.Context();
|
|
3055
3098
|
this.updated = new import_async9.Event();
|
|
3056
|
-
this._spaces = new
|
|
3099
|
+
this._spaces = new import_util5.ComplexMap(import_keys8.PublicKey.hash);
|
|
3057
3100
|
this._isOpen = false;
|
|
3058
|
-
this._instanceId =
|
|
3101
|
+
this._instanceId = import_keys8.PublicKey.random().toHex();
|
|
3059
3102
|
}
|
|
3060
3103
|
// TODO(burdon): Remove.
|
|
3061
3104
|
get spaces() {
|
|
@@ -3084,7 +3127,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3084
3127
|
S: this,
|
|
3085
3128
|
C: (f, a) => f(...a)
|
|
3086
3129
|
});
|
|
3087
|
-
await (0,
|
|
3130
|
+
await (0, import_util5.forEachAsync)(this._metadataStore.spaces, async (spaceMetadata) => {
|
|
3088
3131
|
try {
|
|
3089
3132
|
(0, import_log11.log)("load space", {
|
|
3090
3133
|
spaceMetadata
|
|
@@ -3266,7 +3309,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3266
3309
|
swarmIdentity: {
|
|
3267
3310
|
peerKey: this._signingContext.deviceKey,
|
|
3268
3311
|
credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
|
|
3269
|
-
credentialAuthenticator: (0,
|
|
3312
|
+
credentialAuthenticator: (0, import_util5.deferFunction)(() => dataSpace.authVerifier.verifier)
|
|
3270
3313
|
},
|
|
3271
3314
|
onNetworkConnection: (session) => {
|
|
3272
3315
|
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
@@ -3606,7 +3649,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3606
3649
|
this.initialized = new import_async11.Trigger();
|
|
3607
3650
|
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
3608
3651
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3609
|
-
this._instanceId =
|
|
3652
|
+
this._instanceId = import_keys9.PublicKey.random().toHex();
|
|
3610
3653
|
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
3611
3654
|
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
3612
3655
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
@@ -3827,7 +3870,7 @@ _ts_decorate5([
|
|
|
3827
3870
|
import_tracing4.trace.span()
|
|
3828
3871
|
], ServiceContext.prototype, "_initialize", null);
|
|
3829
3872
|
ServiceContext = _ts_decorate5([
|
|
3830
|
-
(0,
|
|
3873
|
+
(0, import_util6.safeInstanceof)("dxos.client-services.ServiceContext"),
|
|
3831
3874
|
import_tracing4.trace.resource()
|
|
3832
3875
|
], ServiceContext);
|
|
3833
3876
|
|
|
@@ -3838,8 +3881,8 @@ var import_context10 = require("@dxos/context");
|
|
|
3838
3881
|
var import_document_model2 = require("@dxos/document-model");
|
|
3839
3882
|
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
3840
3883
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
3841
|
-
var
|
|
3842
|
-
var
|
|
3884
|
+
var import_invariant16 = require("@dxos/invariant");
|
|
3885
|
+
var import_keys13 = require("@dxos/keys");
|
|
3843
3886
|
var import_log16 = require("@dxos/log");
|
|
3844
3887
|
var import_messaging = require("@dxos/messaging");
|
|
3845
3888
|
var import_model_factory = require("@dxos/model-factory");
|
|
@@ -3877,13 +3920,33 @@ var ServiceRegistry = class {
|
|
|
3877
3920
|
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
3878
3921
|
var import_async12 = require("@dxos/async");
|
|
3879
3922
|
var import_codec_protobuf6 = require("@dxos/codec-protobuf");
|
|
3923
|
+
var import_invariant14 = require("@dxos/invariant");
|
|
3880
3924
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3925
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
|
|
3881
3926
|
var DevicesServiceImpl = class {
|
|
3882
3927
|
constructor(_identityManager) {
|
|
3883
3928
|
this._identityManager = _identityManager;
|
|
3884
3929
|
}
|
|
3885
|
-
updateDevice(
|
|
3886
|
-
|
|
3930
|
+
async updateDevice(profile) {
|
|
3931
|
+
(0, import_invariant14.invariant)(this._identityManager.identity, "Identity not initialized", {
|
|
3932
|
+
F: __dxlog_file16,
|
|
3933
|
+
L: 17,
|
|
3934
|
+
S: this,
|
|
3935
|
+
A: [
|
|
3936
|
+
"this._identityManager.identity",
|
|
3937
|
+
"'Identity not initialized'"
|
|
3938
|
+
]
|
|
3939
|
+
});
|
|
3940
|
+
const deviceKey = this._identityManager.identity.deviceKey;
|
|
3941
|
+
await this._identityManager.updateDevice({
|
|
3942
|
+
deviceKey,
|
|
3943
|
+
profile
|
|
3944
|
+
});
|
|
3945
|
+
return {
|
|
3946
|
+
deviceKey,
|
|
3947
|
+
kind: import_services11.DeviceKind.CURRENT,
|
|
3948
|
+
profile
|
|
3949
|
+
};
|
|
3887
3950
|
}
|
|
3888
3951
|
queryDevices() {
|
|
3889
3952
|
return new import_codec_protobuf6.Stream(({ next }) => {
|
|
@@ -3895,9 +3958,10 @@ var DevicesServiceImpl = class {
|
|
|
3895
3958
|
});
|
|
3896
3959
|
} else {
|
|
3897
3960
|
next({
|
|
3898
|
-
devices: Array.from(deviceKeys.
|
|
3961
|
+
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
|
|
3899
3962
|
deviceKey: key,
|
|
3900
|
-
kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services11.DeviceKind.CURRENT : import_services11.DeviceKind.TRUSTED
|
|
3963
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services11.DeviceKind.CURRENT : import_services11.DeviceKind.TRUSTED,
|
|
3964
|
+
profile
|
|
3901
3965
|
}))
|
|
3902
3966
|
});
|
|
3903
3967
|
}
|
|
@@ -3925,12 +3989,12 @@ var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
|
3925
3989
|
var import_async13 = require("@dxos/async");
|
|
3926
3990
|
var import_codec_protobuf7 = require("@dxos/codec-protobuf");
|
|
3927
3991
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
3928
|
-
var
|
|
3929
|
-
var
|
|
3992
|
+
var import_keys10 = require("@dxos/keys");
|
|
3993
|
+
var import_util7 = require("@dxos/util");
|
|
3930
3994
|
var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
|
|
3931
3995
|
return new import_codec_protobuf7.Stream(({ next }) => {
|
|
3932
3996
|
const subscriptions = new import_async13.EventSubscriptions();
|
|
3933
|
-
const feedMap = new
|
|
3997
|
+
const feedMap = new import_util7.ComplexMap(import_keys10.PublicKey.hash);
|
|
3934
3998
|
const update = () => {
|
|
3935
3999
|
const { feeds } = feedStore;
|
|
3936
4000
|
feeds.filter((feed) => !feedKeys?.length || feedKeys.some((feedKey) => feedKey.equals(feed.key))).forEach((feed) => {
|
|
@@ -4022,7 +4086,7 @@ var subscribeToMetadata = ({ context }) => new import_codec_protobuf9.Stream(({
|
|
|
4022
4086
|
// packages/sdk/client-services/src/packlets/devtools/network.ts
|
|
4023
4087
|
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
4024
4088
|
var import_context9 = require("@dxos/context");
|
|
4025
|
-
var
|
|
4089
|
+
var import_keys11 = require("@dxos/keys");
|
|
4026
4090
|
var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf10.Stream(({ next, close }) => {
|
|
4027
4091
|
const update = () => {
|
|
4028
4092
|
try {
|
|
@@ -4226,7 +4290,7 @@ var DevtoolsServiceImpl = class {
|
|
|
4226
4290
|
};
|
|
4227
4291
|
|
|
4228
4292
|
// packages/sdk/client-services/src/packlets/locks/node.ts
|
|
4229
|
-
var
|
|
4293
|
+
var import_invariant15 = require("@dxos/invariant");
|
|
4230
4294
|
var import_lock_file = require("@dxos/lock-file");
|
|
4231
4295
|
var import_log14 = require("@dxos/log");
|
|
4232
4296
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -4239,7 +4303,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4239
4303
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4240
4304
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4241
4305
|
}
|
|
4242
|
-
var
|
|
4306
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
|
|
4243
4307
|
var Lock = class {
|
|
4244
4308
|
constructor({ lockKey: lockPath, onAcquire, onRelease }) {
|
|
4245
4309
|
this._lockPath = lockPath;
|
|
@@ -4251,7 +4315,7 @@ var Lock = class {
|
|
|
4251
4315
|
}
|
|
4252
4316
|
async acquire() {
|
|
4253
4317
|
(0, import_log14.log)("acquiring lock...", void 0, {
|
|
4254
|
-
F:
|
|
4318
|
+
F: __dxlog_file17,
|
|
4255
4319
|
L: 32,
|
|
4256
4320
|
S: this,
|
|
4257
4321
|
C: (f, a) => f(...a)
|
|
@@ -4259,7 +4323,7 @@ var Lock = class {
|
|
|
4259
4323
|
this._fileHandle = await import_lock_file.LockFile.acquire(this._lockPath);
|
|
4260
4324
|
await this._onAcquire?.();
|
|
4261
4325
|
(0, import_log14.log)("acquired lock", void 0, {
|
|
4262
|
-
F:
|
|
4326
|
+
F: __dxlog_file17,
|
|
4263
4327
|
L: 37,
|
|
4264
4328
|
S: this,
|
|
4265
4329
|
C: (f, a) => f(...a)
|
|
@@ -4267,8 +4331,8 @@ var Lock = class {
|
|
|
4267
4331
|
}
|
|
4268
4332
|
async release() {
|
|
4269
4333
|
await this._onRelease?.();
|
|
4270
|
-
(0,
|
|
4271
|
-
F:
|
|
4334
|
+
(0, import_invariant15.invariant)(this._fileHandle, "Lock is not acquired", {
|
|
4335
|
+
F: __dxlog_file17,
|
|
4272
4336
|
L: 42,
|
|
4273
4337
|
S: this,
|
|
4274
4338
|
A: [
|
|
@@ -4288,7 +4352,7 @@ var import_async16 = require("@dxos/async");
|
|
|
4288
4352
|
var import_codec_protobuf13 = require("@dxos/codec-protobuf");
|
|
4289
4353
|
var import_log15 = require("@dxos/log");
|
|
4290
4354
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4291
|
-
var
|
|
4355
|
+
var import_util8 = require("@dxos/util");
|
|
4292
4356
|
var LoggingServiceImpl = class {
|
|
4293
4357
|
constructor() {
|
|
4294
4358
|
this._logs = new import_async16.Event();
|
|
@@ -4306,15 +4370,15 @@ var LoggingServiceImpl = class {
|
|
|
4306
4370
|
}
|
|
4307
4371
|
async controlMetrics({ reset, record }) {
|
|
4308
4372
|
if (reset) {
|
|
4309
|
-
|
|
4373
|
+
import_util8.tracer.clear();
|
|
4310
4374
|
}
|
|
4311
4375
|
if (record === true) {
|
|
4312
|
-
|
|
4376
|
+
import_util8.tracer.start();
|
|
4313
4377
|
} else if (record === false) {
|
|
4314
|
-
|
|
4378
|
+
import_util8.tracer.stop();
|
|
4315
4379
|
}
|
|
4316
4380
|
return {
|
|
4317
|
-
recording:
|
|
4381
|
+
recording: import_util8.tracer.recording
|
|
4318
4382
|
};
|
|
4319
4383
|
}
|
|
4320
4384
|
/**
|
|
@@ -4322,10 +4386,10 @@ var LoggingServiceImpl = class {
|
|
|
4322
4386
|
*/
|
|
4323
4387
|
queryMetrics({ interval = 5e3 }) {
|
|
4324
4388
|
const getNumericalValues = (key) => {
|
|
4325
|
-
const events =
|
|
4389
|
+
const events = import_util8.tracer.get(key) ?? [];
|
|
4326
4390
|
return {
|
|
4327
4391
|
key,
|
|
4328
|
-
stats: (0,
|
|
4392
|
+
stats: (0, import_util8.numericalValues)(events, "duration")
|
|
4329
4393
|
};
|
|
4330
4394
|
};
|
|
4331
4395
|
return new import_codec_protobuf13.Stream(({ next }) => {
|
|
@@ -4363,7 +4427,7 @@ var LoggingServiceImpl = class {
|
|
|
4363
4427
|
}
|
|
4364
4428
|
const record = {
|
|
4365
4429
|
...entry2,
|
|
4366
|
-
context: (0,
|
|
4430
|
+
context: (0, import_util8.jsonify)((0, import_log15.getContextFromEntry)(entry2)),
|
|
4367
4431
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4368
4432
|
meta: {
|
|
4369
4433
|
// TODO(dmaretskyi): Fix proto.
|
|
@@ -4437,10 +4501,10 @@ var import_client_protocol4 = require("@dxos/client-protocol");
|
|
|
4437
4501
|
var import_protocols11 = require("@dxos/protocols");
|
|
4438
4502
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
4439
4503
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
4440
|
-
var
|
|
4504
|
+
var import_util9 = require("@dxos/util");
|
|
4441
4505
|
var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
4442
4506
|
var createStorageObjects = (config) => {
|
|
4443
|
-
const { persistent = false, keyStore, dataStore, dataRoot = (0,
|
|
4507
|
+
const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util9.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
|
|
4444
4508
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
4445
4509
|
throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4446
4510
|
}
|
|
@@ -4484,7 +4548,7 @@ var toStorageType = (type) => {
|
|
|
4484
4548
|
// packages/sdk/client-services/src/packlets/system/system-service.ts
|
|
4485
4549
|
var import_codec_protobuf15 = require("@dxos/codec-protobuf");
|
|
4486
4550
|
var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4487
|
-
var
|
|
4551
|
+
var import_util10 = require("@dxos/util");
|
|
4488
4552
|
var SystemServiceImpl = class {
|
|
4489
4553
|
constructor({ config, statusUpdate, getDiagnostics, onUpdateStatus, getCurrentStatus, onReset }) {
|
|
4490
4554
|
this._config = config;
|
|
@@ -4504,7 +4568,7 @@ var SystemServiceImpl = class {
|
|
|
4504
4568
|
const diagnostics = await this._getDiagnostics();
|
|
4505
4569
|
return {
|
|
4506
4570
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4507
|
-
diagnostics: JSON.parse(JSON.stringify(diagnostics, (0,
|
|
4571
|
+
diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util10.jsonKeyReplacer)({
|
|
4508
4572
|
truncate: keys === import_services13.GetDiagnosticsRequest.KEY_OPTION.TRUNCATE,
|
|
4509
4573
|
humanize: keys === import_services13.GetDiagnosticsRequest.KEY_OPTION.HUMANIZE
|
|
4510
4574
|
})))
|
|
@@ -4546,7 +4610,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4546
4610
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4547
4611
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4548
4612
|
}
|
|
4549
|
-
var
|
|
4613
|
+
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4550
4614
|
var createDefaultModelFactory = () => {
|
|
4551
4615
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4552
4616
|
};
|
|
@@ -4646,8 +4710,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4646
4710
|
* Can only be called once.
|
|
4647
4711
|
*/
|
|
4648
4712
|
initialize({ config, ...options }) {
|
|
4649
|
-
(0,
|
|
4650
|
-
F:
|
|
4713
|
+
(0, import_invariant16.invariant)(!this._open, "service host is open", {
|
|
4714
|
+
F: __dxlog_file18,
|
|
4651
4715
|
L: 201,
|
|
4652
4716
|
S: this,
|
|
4653
4717
|
A: [
|
|
@@ -4656,14 +4720,14 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4656
4720
|
]
|
|
4657
4721
|
});
|
|
4658
4722
|
(0, import_log16.log)("initializing...", void 0, {
|
|
4659
|
-
F:
|
|
4723
|
+
F: __dxlog_file18,
|
|
4660
4724
|
L: 202,
|
|
4661
4725
|
S: this,
|
|
4662
4726
|
C: (f, a) => f(...a)
|
|
4663
4727
|
});
|
|
4664
4728
|
if (config) {
|
|
4665
|
-
(0,
|
|
4666
|
-
F:
|
|
4729
|
+
(0, import_invariant16.invariant)(!this._config, "config already set", {
|
|
4730
|
+
F: __dxlog_file18,
|
|
4667
4731
|
L: 205,
|
|
4668
4732
|
S: this,
|
|
4669
4733
|
A: [
|
|
@@ -4680,8 +4744,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4680
4744
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4681
4745
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4682
4746
|
this._signalManager = signalManager;
|
|
4683
|
-
(0,
|
|
4684
|
-
F:
|
|
4747
|
+
(0, import_invariant16.invariant)(!this._networkManager, "network manager already set", {
|
|
4748
|
+
F: __dxlog_file18,
|
|
4685
4749
|
L: 221,
|
|
4686
4750
|
S: this,
|
|
4687
4751
|
A: [
|
|
@@ -4695,7 +4759,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4695
4759
|
signalManager
|
|
4696
4760
|
});
|
|
4697
4761
|
(0, import_log16.log)("initialized", void 0, {
|
|
4698
|
-
F:
|
|
4762
|
+
F: __dxlog_file18,
|
|
4699
4763
|
L: 228,
|
|
4700
4764
|
S: this,
|
|
4701
4765
|
C: (f, a) => f(...a)
|
|
@@ -4705,17 +4769,17 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4705
4769
|
if (this._open) {
|
|
4706
4770
|
return;
|
|
4707
4771
|
}
|
|
4708
|
-
const traceId =
|
|
4772
|
+
const traceId = import_keys13.PublicKey.random().toHex();
|
|
4709
4773
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4710
4774
|
id: traceId
|
|
4711
4775
|
}), {
|
|
4712
|
-
F:
|
|
4776
|
+
F: __dxlog_file18,
|
|
4713
4777
|
L: 239,
|
|
4714
4778
|
S: this,
|
|
4715
4779
|
C: (f, a) => f(...a)
|
|
4716
4780
|
});
|
|
4717
|
-
(0,
|
|
4718
|
-
F:
|
|
4781
|
+
(0, import_invariant16.invariant)(this._config, "config not set", {
|
|
4782
|
+
F: __dxlog_file18,
|
|
4719
4783
|
L: 241,
|
|
4720
4784
|
S: this,
|
|
4721
4785
|
A: [
|
|
@@ -4723,8 +4787,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4723
4787
|
"'config not set'"
|
|
4724
4788
|
]
|
|
4725
4789
|
});
|
|
4726
|
-
(0,
|
|
4727
|
-
F:
|
|
4790
|
+
(0, import_invariant16.invariant)(this._storage, "storage not set", {
|
|
4791
|
+
F: __dxlog_file18,
|
|
4728
4792
|
L: 242,
|
|
4729
4793
|
S: this,
|
|
4730
4794
|
A: [
|
|
@@ -4732,8 +4796,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4732
4796
|
"'storage not set'"
|
|
4733
4797
|
]
|
|
4734
4798
|
});
|
|
4735
|
-
(0,
|
|
4736
|
-
F:
|
|
4799
|
+
(0, import_invariant16.invariant)(this._signalManager, "signal manager not set", {
|
|
4800
|
+
F: __dxlog_file18,
|
|
4737
4801
|
L: 243,
|
|
4738
4802
|
S: this,
|
|
4739
4803
|
A: [
|
|
@@ -4741,8 +4805,8 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4741
4805
|
"'signal manager not set'"
|
|
4742
4806
|
]
|
|
4743
4807
|
});
|
|
4744
|
-
(0,
|
|
4745
|
-
F:
|
|
4808
|
+
(0, import_invariant16.invariant)(this._networkManager, "network manager not set", {
|
|
4809
|
+
F: __dxlog_file18,
|
|
4746
4810
|
L: 244,
|
|
4747
4811
|
S: this,
|
|
4748
4812
|
A: [
|
|
@@ -4754,7 +4818,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4754
4818
|
(0, import_log16.log)("opening...", {
|
|
4755
4819
|
lockKey: this._resourceLock?.lockKey
|
|
4756
4820
|
}, {
|
|
4757
|
-
F:
|
|
4821
|
+
F: __dxlog_file18,
|
|
4758
4822
|
L: 247,
|
|
4759
4823
|
S: this,
|
|
4760
4824
|
C: (f, a) => f(...a)
|
|
@@ -4800,7 +4864,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4800
4864
|
(0, import_log16.log)("opened", {
|
|
4801
4865
|
deviceKey
|
|
4802
4866
|
}, {
|
|
4803
|
-
F:
|
|
4867
|
+
F: __dxlog_file18,
|
|
4804
4868
|
L: 316,
|
|
4805
4869
|
S: this,
|
|
4806
4870
|
C: (f, a) => f(...a)
|
|
@@ -4808,7 +4872,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4808
4872
|
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.end({
|
|
4809
4873
|
id: traceId
|
|
4810
4874
|
}), {
|
|
4811
|
-
F:
|
|
4875
|
+
F: __dxlog_file18,
|
|
4812
4876
|
L: 317,
|
|
4813
4877
|
S: this,
|
|
4814
4878
|
C: (f, a) => f(...a)
|
|
@@ -4822,7 +4886,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4822
4886
|
(0, import_log16.log)("closing...", {
|
|
4823
4887
|
deviceKey
|
|
4824
4888
|
}, {
|
|
4825
|
-
F:
|
|
4889
|
+
F: __dxlog_file18,
|
|
4826
4890
|
L: 328,
|
|
4827
4891
|
S: this,
|
|
4828
4892
|
C: (f, a) => f(...a)
|
|
@@ -4838,24 +4902,24 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4838
4902
|
(0, import_log16.log)("closed", {
|
|
4839
4903
|
deviceKey
|
|
4840
4904
|
}, {
|
|
4841
|
-
F:
|
|
4905
|
+
F: __dxlog_file18,
|
|
4842
4906
|
L: 335,
|
|
4843
4907
|
S: this,
|
|
4844
4908
|
C: (f, a) => f(...a)
|
|
4845
4909
|
});
|
|
4846
4910
|
}
|
|
4847
4911
|
async reset() {
|
|
4848
|
-
const traceId =
|
|
4912
|
+
const traceId = import_keys13.PublicKey.random().toHex();
|
|
4849
4913
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4850
4914
|
id: traceId
|
|
4851
4915
|
}), {
|
|
4852
|
-
F:
|
|
4916
|
+
F: __dxlog_file18,
|
|
4853
4917
|
L: 340,
|
|
4854
4918
|
S: this,
|
|
4855
4919
|
C: (f, a) => f(...a)
|
|
4856
4920
|
});
|
|
4857
4921
|
(0, import_log16.log)("resetting...", void 0, {
|
|
4858
|
-
F:
|
|
4922
|
+
F: __dxlog_file18,
|
|
4859
4923
|
L: 342,
|
|
4860
4924
|
S: this,
|
|
4861
4925
|
C: (f, a) => f(...a)
|
|
@@ -4863,7 +4927,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4863
4927
|
await this._serviceContext?.close();
|
|
4864
4928
|
await this._storage.reset();
|
|
4865
4929
|
(0, import_log16.log)("reset", void 0, {
|
|
4866
|
-
F:
|
|
4930
|
+
F: __dxlog_file18,
|
|
4867
4931
|
L: 345,
|
|
4868
4932
|
S: this,
|
|
4869
4933
|
C: (f, a) => f(...a)
|
|
@@ -4871,7 +4935,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4871
4935
|
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.end({
|
|
4872
4936
|
id: traceId
|
|
4873
4937
|
}), {
|
|
4874
|
-
F:
|
|
4938
|
+
F: __dxlog_file18,
|
|
4875
4939
|
L: 346,
|
|
4876
4940
|
S: this,
|
|
4877
4941
|
C: (f, a) => f(...a)
|
|
@@ -4917,7 +4981,7 @@ ClientServicesHost = _ts_decorate7([
|
|
|
4917
4981
|
], ClientServicesHost);
|
|
4918
4982
|
|
|
4919
4983
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
4920
|
-
var
|
|
4984
|
+
var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
|
|
4921
4985
|
var sanitizeInvitation = (invitation) => {
|
|
4922
4986
|
return {
|
|
4923
4987
|
invitationId: invitation.invitationId,
|
|
@@ -4947,8 +5011,8 @@ var performInvitation = ({ host, guest, options, hooks }) => {
|
|
|
4947
5011
|
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
4948
5012
|
break;
|
|
4949
5013
|
}
|
|
4950
|
-
(0,
|
|
4951
|
-
F:
|
|
5014
|
+
(0, import_invariant17.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
5015
|
+
F: __dxlog_file19,
|
|
4952
5016
|
L: 84,
|
|
4953
5017
|
S: void 0,
|
|
4954
5018
|
A: [
|