@dxos/client-services 0.1.32-next.86f5578 → 0.1.34
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-E3FD43YN.mjs → chunk-H5IXSSI7.mjs} +125 -39
- package/dist/lib/browser/chunk-H5IXSSI7.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 +132 -46
- 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 +134 -48
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/identity/identity-manager.d.ts +1 -0
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/packlets/identity/identity-manager.ts +18 -0
- package/src/packlets/services/service-context.ts +8 -0
- package/src/packlets/services/service-host.ts +8 -1
- package/dist/lib/browser/chunk-E3FD43YN.mjs.map +0 -7
|
@@ -29,6 +29,7 @@ export declare class IdentityManager {
|
|
|
29
29
|
private readonly _spaceManager;
|
|
30
30
|
readonly stateUpdate: Event<void>;
|
|
31
31
|
private _identity?;
|
|
32
|
+
private readonly _instanceId;
|
|
32
33
|
constructor(_metadataStore: MetadataStore, _keyring: Keyring, _feedStore: FeedStore<FeedMessage>, _spaceManager: SpaceManager);
|
|
33
34
|
get identity(): Identity | undefined;
|
|
34
35
|
open(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC,oBAAY,kBAAkB,GAAG;IAC/B,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,SAAS,CAAC;IACxB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,cAAc,EAAE,SAAS,CAAC;IAC1B,WAAW,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF,qBAAa,eAAe;IAUxB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAZhC,QAAQ,CAAC,WAAW,cAAe;IAEnC,OAAO,CAAC,SAAS,CAAC,CAAW;IAE7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAKvC,cAAc,EAAE,aAAa,EAC7B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,EAClC,aAAa,EAAE,YAAY;IAG9C,IAAI,QAAQ,yBAEX;IAEK,IAAI;IAkBJ,KAAK;IAKL,cAAc,CAAC,EAAE,WAAW,EAAE,GAAE,qBAA0B;IAmEhE;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,kBAAkB;YA+BjC,kBAAkB;YAwClB,eAAe;CAU9B"}
|
|
@@ -28,6 +28,7 @@ export declare class ServiceContext {
|
|
|
28
28
|
private _deviceSpaceSync?;
|
|
29
29
|
dataSpaceManager?: DataSpaceManager;
|
|
30
30
|
spaceInvitations?: SpaceInvitationsHandler;
|
|
31
|
+
private readonly _instanceId;
|
|
31
32
|
constructor(storage: Storage, networkManager: NetworkManager, modelFactory: ModelFactory);
|
|
32
33
|
open(): Promise<void>;
|
|
33
34
|
close(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAEL,aAAa,EACb,YAAY,EAEZ,wBAAwB,EACxB,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAEL,aAAa,EACb,YAAY,EAEZ,wBAAwB,EACxB,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAsB,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AAEH,qBAAa,cAAc;aAqBP,OAAO,EAAE,OAAO;aAChB,cAAc,EAAE,cAAc;aAC9B,YAAY,EAAE,YAAY;IAtB5C,SAAgB,WAAW,gBAAiB;IAC5C,SAAgB,wBAAwB,2BAAkC;IAC1E,SAAgB,aAAa,EAAE,aAAa,CAAC;IAC7C,SAAgB,aAAa,EAAE,aAAa,CAAC;IAC7C,SAAgB,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAClD,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAgB,eAAe,EAAE,eAAe,CAAC;IACjD,SAAgB,iBAAiB,EAAE,wBAAwB,CAAC;IAE5D,OAAO,CAAC,gBAAgB,CAAC,CAA0B;IAG5C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAElD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAIxC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY;IAuCtC,IAAI;IAaJ,KAAK;IAcL,KAAK;IAOL,cAAc,CAAC,MAAM,GAAE,qBAA0B;YAOzC,eAAe;YAQf,WAAW;CAiE1B"}
|
|
@@ -32,6 +32,7 @@ export declare class ClientServicesHost {
|
|
|
32
32
|
private _storage?;
|
|
33
33
|
private _opening;
|
|
34
34
|
private _open;
|
|
35
|
+
private readonly _instanceId;
|
|
35
36
|
constructor({ config, modelFactory, networkManager, storage, lockKey }?: ClientServicesHostParams);
|
|
36
37
|
get isOpen(): boolean;
|
|
37
38
|
get serviceRegistry(): ServiceRegistry<ClientServices>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,cAAc,
|
|
1
|
+
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,cAAc,EAAwC,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAatD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,oBAAY,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAoB;IACnD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkC;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoB;IAEnD,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,CAAU;IAM3B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAE9C,EACV,MAAM,EACN,YAA0C,EAE1C,cAAc,EACd,OAAO,EAEP,OAAO,EACR,GAAE,wBAA6B;IA6ChC,IAAI,MAAM,YAET;IAED,IAAI,eAAe,oCAElB;IAED,IAAI,WAAW,sDAEd;IAED,IAAI,QAAQ,4BAEX;IAED;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,iBAAiB;IAkBlD,IAAI;IAqEJ,KAAK;CAeZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -20,39 +20,39 @@
|
|
|
20
20
|
"src"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@dxos/async": "0.1.
|
|
24
|
-
"@dxos/client": "0.1.
|
|
25
|
-
"@dxos/codec-protobuf": "0.1.
|
|
26
|
-
"@dxos/config": "0.1.
|
|
27
|
-
"@dxos/context": "0.1.
|
|
28
|
-
"@dxos/credentials": "0.1.
|
|
29
|
-
"@dxos/crypto": "0.1.
|
|
30
|
-
"@dxos/debug": "0.1.
|
|
31
|
-
"@dxos/document-model": "0.1.
|
|
32
|
-
"@dxos/echo-db": "0.1.
|
|
33
|
-
"@dxos/echo-pipeline": "0.1.
|
|
34
|
-
"@dxos/errors": "0.1.
|
|
35
|
-
"@dxos/feed-store": "0.1.
|
|
36
|
-
"@dxos/keyring": "0.1.
|
|
37
|
-
"@dxos/keys": "0.1.
|
|
38
|
-
"@dxos/log": "0.1.
|
|
39
|
-
"@dxos/messaging": "0.1.
|
|
40
|
-
"@dxos/model-factory": "0.1.
|
|
41
|
-
"@dxos/network-manager": "0.1.
|
|
42
|
-
"@dxos/node-std": "0.1.
|
|
43
|
-
"@dxos/protocols": "0.1.
|
|
44
|
-
"@dxos/random-access-storage": "0.1.
|
|
45
|
-
"@dxos/rpc": "0.1.
|
|
46
|
-
"@dxos/teleport": "0.1.
|
|
47
|
-
"@dxos/teleport-extension-gossip": "0.1.
|
|
48
|
-
"@dxos/text-model": "0.1.
|
|
49
|
-
"@dxos/timeframe": "0.1.
|
|
50
|
-
"@dxos/util": "0.1.
|
|
23
|
+
"@dxos/async": "0.1.34",
|
|
24
|
+
"@dxos/client": "0.1.34",
|
|
25
|
+
"@dxos/codec-protobuf": "0.1.34",
|
|
26
|
+
"@dxos/config": "0.1.34",
|
|
27
|
+
"@dxos/context": "0.1.34",
|
|
28
|
+
"@dxos/credentials": "0.1.34",
|
|
29
|
+
"@dxos/crypto": "0.1.34",
|
|
30
|
+
"@dxos/debug": "0.1.34",
|
|
31
|
+
"@dxos/document-model": "0.1.34",
|
|
32
|
+
"@dxos/echo-db": "0.1.34",
|
|
33
|
+
"@dxos/echo-pipeline": "0.1.34",
|
|
34
|
+
"@dxos/errors": "0.1.34",
|
|
35
|
+
"@dxos/feed-store": "0.1.34",
|
|
36
|
+
"@dxos/keyring": "0.1.34",
|
|
37
|
+
"@dxos/keys": "0.1.34",
|
|
38
|
+
"@dxos/log": "0.1.34",
|
|
39
|
+
"@dxos/messaging": "0.1.34",
|
|
40
|
+
"@dxos/model-factory": "0.1.34",
|
|
41
|
+
"@dxos/network-manager": "0.1.34",
|
|
42
|
+
"@dxos/node-std": "0.1.34",
|
|
43
|
+
"@dxos/protocols": "0.1.34",
|
|
44
|
+
"@dxos/random-access-storage": "0.1.34",
|
|
45
|
+
"@dxos/rpc": "0.1.34",
|
|
46
|
+
"@dxos/teleport": "0.1.34",
|
|
47
|
+
"@dxos/teleport-extension-gossip": "0.1.34",
|
|
48
|
+
"@dxos/text-model": "0.1.34",
|
|
49
|
+
"@dxos/timeframe": "0.1.34",
|
|
50
|
+
"@dxos/util": "0.1.34"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/readable-stream": "^2.3.9",
|
|
54
54
|
"fast-check": "~3.3.0",
|
|
55
|
-
"@dxos/signal": "0.1.
|
|
55
|
+
"@dxos/signal": "0.1.34"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
@@ -11,6 +11,7 @@ import { FeedStore } from '@dxos/feed-store';
|
|
|
11
11
|
import { Keyring } from '@dxos/keyring';
|
|
12
12
|
import { PublicKey } from '@dxos/keys';
|
|
13
13
|
import { log } from '@dxos/log';
|
|
14
|
+
import { trace } from '@dxos/protocols';
|
|
14
15
|
import { FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
15
16
|
import { IdentityRecord, SpaceMetadata } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
16
17
|
import { AdmittedFeed } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
@@ -51,6 +52,8 @@ export class IdentityManager {
|
|
|
51
52
|
|
|
52
53
|
private _identity?: Identity;
|
|
53
54
|
|
|
55
|
+
private readonly _instanceId = PublicKey.random().toHex();
|
|
56
|
+
|
|
54
57
|
// TODO(burdon): IdentityManagerParams.
|
|
55
58
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
56
59
|
constructor(
|
|
@@ -65,6 +68,7 @@ export class IdentityManager {
|
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
async open() {
|
|
71
|
+
log.trace('dxos.halo.identity-manager', trace.begin({ id: this._instanceId }));
|
|
68
72
|
await this._metadataStore.load();
|
|
69
73
|
|
|
70
74
|
const identityRecord = this._metadataStore.getIdentityRecord();
|
|
@@ -73,12 +77,17 @@ export class IdentityManager {
|
|
|
73
77
|
this._identity = await this._constructIdentity(identityRecord);
|
|
74
78
|
await this._identity.open();
|
|
75
79
|
await this._identity.ready();
|
|
80
|
+
log.trace('dxos.halo.identity', {
|
|
81
|
+
identityKey: identityRecord.identityKey,
|
|
82
|
+
displayName: this._identity.profileDocument?.displayName
|
|
83
|
+
});
|
|
76
84
|
this.stateUpdate.emit();
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
async close() {
|
|
81
89
|
await this._identity?.close();
|
|
90
|
+
log.trace('dxos.halo.identity-manager', trace.end({ id: this._instanceId }));
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
async createIdentity({ displayName }: CreateIdentityOptions = {}) {
|
|
@@ -138,6 +147,10 @@ export class IdentityManager {
|
|
|
138
147
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
139
148
|
this._identity = identity;
|
|
140
149
|
await this._identity.ready();
|
|
150
|
+
log.trace('dxos.halo.identity', {
|
|
151
|
+
identityKey: identityRecord.identityKey,
|
|
152
|
+
displayName: this._identity.profileDocument?.displayName
|
|
153
|
+
});
|
|
141
154
|
this.stateUpdate.emit();
|
|
142
155
|
|
|
143
156
|
log('created identity', { identityKey: identity.identityKey, deviceKey: identity.deviceKey });
|
|
@@ -168,6 +181,11 @@ export class IdentityManager {
|
|
|
168
181
|
this._identity = identity;
|
|
169
182
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
170
183
|
await this._identity.ready();
|
|
184
|
+
log.trace('dxos.halo.identity', {
|
|
185
|
+
identityKey: identityRecord.identityKey,
|
|
186
|
+
displayName: this._identity.profileDocument?.displayName
|
|
187
|
+
});
|
|
188
|
+
|
|
171
189
|
this.stateUpdate.emit();
|
|
172
190
|
log('accepted identity', { identityKey: identity.identityKey, deviceKey: identity.deviceKey });
|
|
173
191
|
return identity;
|
|
@@ -15,9 +15,11 @@ import {
|
|
|
15
15
|
} from '@dxos/echo-pipeline';
|
|
16
16
|
import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
17
17
|
import { Keyring } from '@dxos/keyring';
|
|
18
|
+
import { PublicKey } from '@dxos/keys';
|
|
18
19
|
import { log } from '@dxos/log';
|
|
19
20
|
import { ModelFactory } from '@dxos/model-factory';
|
|
20
21
|
import { NetworkManager } from '@dxos/network-manager';
|
|
22
|
+
import { trace } from '@dxos/protocols';
|
|
21
23
|
import type { FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
22
24
|
import { Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
23
25
|
import { Storage } from '@dxos/random-access-storage';
|
|
@@ -47,6 +49,8 @@ export class ServiceContext {
|
|
|
47
49
|
public dataSpaceManager?: DataSpaceManager;
|
|
48
50
|
public spaceInvitations?: SpaceInvitationsHandler;
|
|
49
51
|
|
|
52
|
+
private readonly _instanceId = PublicKey.random().toHex();
|
|
53
|
+
|
|
50
54
|
// prettier-ignore
|
|
51
55
|
constructor(
|
|
52
56
|
public readonly storage: Storage,
|
|
@@ -91,6 +95,8 @@ export class ServiceContext {
|
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
async open() {
|
|
98
|
+
log.trace('dxos.sdk.client-services', trace.begin({ id: this._instanceId }));
|
|
99
|
+
|
|
94
100
|
log('opening...');
|
|
95
101
|
await this.networkManager.open();
|
|
96
102
|
await this.spaceManager.open();
|
|
@@ -111,6 +117,8 @@ export class ServiceContext {
|
|
|
111
117
|
await this.networkManager.close();
|
|
112
118
|
this.dataServiceSubscriptions.clear();
|
|
113
119
|
log('closed');
|
|
120
|
+
|
|
121
|
+
log.trace('dxos.sdk.client-services', trace.end({ id: this._instanceId }));
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
async reset() {
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import assert from 'node:assert';
|
|
6
6
|
|
|
7
7
|
import { Event } from '@dxos/async';
|
|
8
|
-
import { clientServiceBundle, ClientServices, createDefaultModelFactory } from '@dxos/client';
|
|
8
|
+
import { clientServiceBundle, ClientServices, createDefaultModelFactory, PublicKey } from '@dxos/client';
|
|
9
9
|
import { Config } from '@dxos/config';
|
|
10
10
|
import { raise } from '@dxos/debug';
|
|
11
11
|
import { DataServiceImpl } from '@dxos/echo-pipeline';
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
13
|
import { ModelFactory } from '@dxos/model-factory';
|
|
14
14
|
import { NetworkManager } from '@dxos/network-manager';
|
|
15
|
+
import { trace } from '@dxos/protocols';
|
|
15
16
|
import { SystemStatus } from '@dxos/protocols/proto/dxos/client/services';
|
|
16
17
|
import { Storage } from '@dxos/random-access-storage';
|
|
17
18
|
|
|
@@ -65,6 +66,8 @@ export class ClientServicesHost {
|
|
|
65
66
|
private _opening = false;
|
|
66
67
|
private _open = false;
|
|
67
68
|
|
|
69
|
+
private readonly _instanceId = PublicKey.random().toHex();
|
|
70
|
+
|
|
68
71
|
constructor({
|
|
69
72
|
config,
|
|
70
73
|
modelFactory = createDefaultModelFactory(),
|
|
@@ -162,6 +165,8 @@ export class ClientServicesHost {
|
|
|
162
165
|
return;
|
|
163
166
|
}
|
|
164
167
|
|
|
168
|
+
log.trace('dxos.sdk.client-services-host', trace.begin({ id: this._instanceId }));
|
|
169
|
+
|
|
165
170
|
assert(this._config, 'config not set');
|
|
166
171
|
assert(this._storage, 'storage not set');
|
|
167
172
|
assert(this._networkManager, 'network manager not set');
|
|
@@ -236,5 +241,7 @@ export class ClientServicesHost {
|
|
|
236
241
|
this._open = false;
|
|
237
242
|
this._statusUpdate.emit();
|
|
238
243
|
log('closed', { deviceKey });
|
|
244
|
+
|
|
245
|
+
log.trace('dxos.sdk.client-services-host', trace.end({ id: this._instanceId }));
|
|
239
246
|
}
|
|
240
247
|
}
|