@dxos/client-services 0.4.7-main.e015b9e → 0.4.7-main.e5c4f14
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-M3HBHYHU.mjs → chunk-LI6HSB3L.mjs} +206 -139
- package/dist/lib/browser/chunk-LI6HSB3L.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/index.mjs.map +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-UPGNRF2T.cjs → chunk-EQSVNVMB.cjs} +197 -130
- package/dist/lib/node/chunk-EQSVNVMB.cjs.map +7 -0
- package/dist/lib/node/index.cjs +38 -38
- package/dist/lib/node/index.cjs.map +1 -1
- 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 +8 -2
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +5 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +5 -3
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +4 -2
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +7 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.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 +8 -4
- package/src/packlets/devices/devices-service.ts +47 -11
- package/src/packlets/identity/identity-manager.ts +48 -6
- package/src/packlets/identity/identity.ts +9 -1
- package/src/packlets/services/service-context.ts +17 -3
- package/src/packlets/services/service-host.ts +8 -3
- package/src/packlets/spaces/data-space-manager.ts +18 -3
- package/src/packlets/spaces/spaces-service.ts +1 -3
- package/src/packlets/vault/shared-worker-connection.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-M3HBHYHU.mjs.map +0 -7
- package/dist/lib/node/chunk-UPGNRF2T.cjs.map +0 -7
|
@@ -6,6 +6,7 @@ import { type Space } from '@dxos/echo-pipeline';
|
|
|
6
6
|
import { PublicKey } from '@dxos/keys';
|
|
7
7
|
import { type DeviceProfileDocument, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
8
8
|
import { type DeviceAdmissionRequest } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
9
|
+
import { type Presence } from '@dxos/teleport-extension-gossip';
|
|
9
10
|
import { type ComplexMap } from '@dxos/util';
|
|
10
11
|
import { TrustedKeySetAuthVerifier } from './authenticator';
|
|
11
12
|
export type IdentityParams = {
|
|
@@ -13,6 +14,7 @@ export type IdentityParams = {
|
|
|
13
14
|
deviceKey: PublicKey;
|
|
14
15
|
signer: Signer;
|
|
15
16
|
space: Space;
|
|
17
|
+
presence?: Presence;
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* Agent identity manager, which includes the agent's Halo space.
|
|
@@ -20,13 +22,14 @@ export type IdentityParams = {
|
|
|
20
22
|
export declare class Identity {
|
|
21
23
|
readonly space: Space;
|
|
22
24
|
private readonly _signer;
|
|
25
|
+
private readonly _presence?;
|
|
23
26
|
private readonly _deviceStateMachine;
|
|
24
27
|
private readonly _profileStateMachine;
|
|
25
28
|
readonly authVerifier: TrustedKeySetAuthVerifier;
|
|
26
29
|
readonly identityKey: PublicKey;
|
|
27
30
|
readonly deviceKey: PublicKey;
|
|
28
31
|
readonly stateUpdate: Event<void>;
|
|
29
|
-
constructor({ space, signer, identityKey, deviceKey }: IdentityParams);
|
|
32
|
+
constructor({ space, signer, identityKey, deviceKey, presence }: IdentityParams);
|
|
30
33
|
get authorizedDeviceKeys(): ComplexMap<PublicKey, DeviceProfileDocument>;
|
|
31
34
|
open(ctx: Context): Promise<void>;
|
|
32
35
|
close(ctx: Context): Promise<void>;
|
|
@@ -39,6 +42,7 @@ export declare class Identity {
|
|
|
39
42
|
get haloSpaceKey(): PublicKey;
|
|
40
43
|
get haloGenesisFeedKey(): PublicKey;
|
|
41
44
|
get deviceCredentialChain(): import("@dxos/protocols/proto/dxos/halo/credentials").Chain | undefined;
|
|
45
|
+
get presence(): Presence | undefined;
|
|
42
46
|
/**
|
|
43
47
|
* Issues credentials as identity.
|
|
44
48
|
* Requires identity to be ready.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAEL,KA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C,SAAS,EAAE,qBAAqB,CAAC,CAEvE;IAGK,IAAI,CAAC,GAAG,EAAE,OAAO;IAOjB,KAAK,CAAC,GAAG,EAAE,OAAO;IAOlB,KAAK;IAMX,IAAI,eAAe,IAAI,eAAe,GAAG,SAAS,CAEjD;IAED;;OAEG;IACH,IAAI,eAAe,mDAElB;IAED,IAAI,YAAY,cAEf;IAED,IAAI,kBAAkB,cAErB;IAED,IAAI,qBAAqB,4EAExB;IAED,IAAI,QAAQ,yBAEX;IAED;;;OAGG;IACH,2BAA2B,IAAI,gBAAgB;IAS/C;;OAEG;IACH,yBAAyB,IAAI,gBAAgB;IAIvC,WAAW,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,sBAAsB;CA2CrF"}
|
|
@@ -11,9 +11,10 @@ import type { FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
|
11
11
|
import { type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
12
12
|
import { type Storage } from '@dxos/random-access-storage';
|
|
13
13
|
import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
14
|
-
import { type CreateIdentityOptions, IdentityManager } from '../identity';
|
|
14
|
+
import { type CreateIdentityOptions, IdentityManager, type IdentityManagerRuntimeParams } from '../identity';
|
|
15
15
|
import { InvitationsHandler, type InvitationProtocol } from '../invitations';
|
|
16
|
-
import { DataSpaceManager } from '../spaces';
|
|
16
|
+
import { DataSpaceManager, type DataSpaceManagerRuntimeParams } from '../spaces';
|
|
17
|
+
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams;
|
|
17
18
|
/**
|
|
18
19
|
* Shared backend for all client services.
|
|
19
20
|
*/
|
|
@@ -22,6 +23,7 @@ export declare class ServiceContext {
|
|
|
22
23
|
readonly networkManager: NetworkManager;
|
|
23
24
|
readonly signalManager: SignalManager;
|
|
24
25
|
readonly modelFactory: ModelFactory;
|
|
26
|
+
readonly _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined;
|
|
25
27
|
readonly initialized: Trigger<void>;
|
|
26
28
|
readonly dataServiceSubscriptions: DataServiceSubscriptions;
|
|
27
29
|
readonly metadataStore: MetadataStore;
|
|
@@ -40,7 +42,7 @@ export declare class ServiceContext {
|
|
|
40
42
|
private readonly _handlerFactories;
|
|
41
43
|
private _deviceSpaceSync?;
|
|
42
44
|
private readonly _instanceId;
|
|
43
|
-
constructor(storage: Storage, networkManager: NetworkManager, signalManager: SignalManager, modelFactory: ModelFactory);
|
|
45
|
+
constructor(storage: Storage, networkManager: NetworkManager, signalManager: SignalManager, modelFactory: ModelFactory, _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined);
|
|
44
46
|
open(ctx: Context): Promise<void>;
|
|
45
47
|
close(): Promise<void>;
|
|
46
48
|
createIdentity(params?: CreateIdentityOptions): Promise<import("../identity").Identity>;
|
|
@@ -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;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,
|
|
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;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EACL,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,4BAA4B,EAElC,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,kBAAkB,EAClB,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAA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OAAO,EAAE,eAAe,GAAG,SAAS;YAUnD,eAAe;YAMf,oBAAoB;YAUpB,WAAW;CAgE1B"}
|
|
@@ -5,7 +5,7 @@ import { type SignalManager } from '@dxos/messaging';
|
|
|
5
5
|
import { ModelFactory } from '@dxos/model-factory';
|
|
6
6
|
import { type TransportFactory } from '@dxos/network-manager';
|
|
7
7
|
import { type Storage } from '@dxos/random-access-storage';
|
|
8
|
-
import { ServiceContext } from './service-context';
|
|
8
|
+
import { ServiceContext, type ServiceContextRuntimeParams } from './service-context';
|
|
9
9
|
import { ServiceRegistry } from './service-registry';
|
|
10
10
|
export declare const createDefaultModelFactory: () => ModelFactory;
|
|
11
11
|
export type ClientServicesHostParams = {
|
|
@@ -20,6 +20,7 @@ export type ClientServicesHostParams = {
|
|
|
20
20
|
storage?: Storage;
|
|
21
21
|
lockKey?: string;
|
|
22
22
|
callbacks?: ClientServicesHostCallbacks;
|
|
23
|
+
runtimeParams?: ServiceContextRuntimeParams;
|
|
23
24
|
};
|
|
24
25
|
export type ClientServicesHostCallbacks = {
|
|
25
26
|
onReset?: () => Promise<void>;
|
|
@@ -48,9 +49,10 @@ export declare class ClientServicesHost {
|
|
|
48
49
|
private _callbacks?;
|
|
49
50
|
private _devtoolsProxy?;
|
|
50
51
|
private _serviceContext;
|
|
52
|
+
private readonly _runtimeParams?;
|
|
51
53
|
private _opening;
|
|
52
54
|
private _open;
|
|
53
|
-
constructor({ config, modelFactory, transportFactory, signalManager, storage, lockKey, callbacks, }?: ClientServicesHostParams);
|
|
55
|
+
constructor({ config, modelFactory, transportFactory, signalManager, storage, lockKey, callbacks, runtimeParams, }?: ClientServicesHostParams);
|
|
54
56
|
get isOpen(): boolean;
|
|
55
57
|
get config(): Config | undefined;
|
|
56
58
|
get context(): ServiceContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB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B,OAAO,CAAC,KAAK,CAAS;gBAEV,EACV,MAAM,EACN,YAA0C,EAC1C,gBAAgB,EAChB,aAAa,EACb,OAAO,EAEP,OAAO,EACP,SAAS,EACT,aAAa,GACd,GAAE,wBAA6B;IAkDhC,IAAI,MAAM,YAET;IAED,IAAI,MAAM,uBAET;IAED,IAAI,OAAO,mBAEV;IAED,IAAI,eAAe,oCAElB;IAED,IAAI,WAAW,sDAEd;IAED,IAAI,QAAQ,4BAEX;IAED;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB;IAiC9C,IAAI,CAAC,GAAG,EAAE,OAAO;IA8FjB,KAAK;IAgBL,KAAK;YAYG,eAAe;CAqB9B"}
|
|
@@ -30,6 +30,10 @@ export type AcceptSpaceOptions = {
|
|
|
30
30
|
*/
|
|
31
31
|
dataTimeframe?: Timeframe;
|
|
32
32
|
};
|
|
33
|
+
export type DataSpaceManagerRuntimeParams = {
|
|
34
|
+
spaceMemberPresenceAnnounceInterval?: number;
|
|
35
|
+
spaceMemberPresenceOfflineTimeout?: number;
|
|
36
|
+
};
|
|
33
37
|
export declare class DataSpaceManager {
|
|
34
38
|
private readonly _spaceManager;
|
|
35
39
|
private readonly _metadataStore;
|
|
@@ -43,7 +47,9 @@ export declare class DataSpaceManager {
|
|
|
43
47
|
private readonly _spaces;
|
|
44
48
|
private _isOpen;
|
|
45
49
|
private readonly _instanceId;
|
|
46
|
-
|
|
50
|
+
private readonly _spaceMemberPresenceAnnounceInterval;
|
|
51
|
+
private readonly _spaceMemberPresenceOfflineTimeout;
|
|
52
|
+
constructor(_spaceManager: SpaceManager, _metadataStore: MetadataStore, _dataServiceSubscriptions: DataServiceSubscriptions, _keyring: Keyring, _signingContext: SigningContext, _feedStore: FeedStore<FeedMessage>, _automergeHost: AutomergeHost, params?: DataSpaceManagerRuntimeParams);
|
|
47
53
|
get spaces(): ComplexMap<PublicKey, DataSpace>;
|
|
48
54
|
open(): Promise<void>;
|
|
49
55
|
close(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA4B,MAAM,aAAa,CAAC;AAE9D,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,mBAAmB,CAAC;AAClF,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAElB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAEpG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAA+B,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D,UAAU,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,EAAE,SAAS,CAAC;IAE1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;I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,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAHpB,gBAAgB,EAAE,eAAe,EACjC,aAAa,EAAE,YAAY,EAC3B,yBAAyB,EAAE,wBAAwB,EACnD,oBAAoB,EAAE,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAGtE,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC;IAU7B,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB;IAmBzD,WAAW,IAAI,MAAM,CAAC,mBAAmB,CAAC;IAqDpC,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,kBAAkB;IAMpE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,wBAAwB;IAajE,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC;IAmB7E,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,uBAAuB;IAmBnE,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB;IAMlD,OAAO,CAAC,eAAe;CA8CxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.4.7-main.
|
|
1
|
+
export declare const DXOS_VERSION = "0.4.7-main.e5c4f14";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.7-main.
|
|
3
|
+
"version": "0.4.7-main.e5c4f14",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,44 +22,44 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"platform": "^1.3.6",
|
|
25
|
-
"@dxos/async": "0.4.7-main.
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/debug": "0.4.7-main.
|
|
31
|
-
"@dxos/crypto": "0.4.7-main.
|
|
32
|
-
"@dxos/credentials": "0.4.7-main.
|
|
33
|
-
"@dxos/echo-db": "0.4.7-main.
|
|
34
|
-
"@dxos/document-model": "0.4.7-main.
|
|
35
|
-
"@dxos/echo-pipeline": "0.4.7-main.
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/network-manager": "0.4.7-main.
|
|
46
|
-
"@dxos/node-std": "0.4.7-main.
|
|
47
|
-
"@dxos/protocols": "0.4.7-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/teleport": "0.4.7-main.
|
|
51
|
-
"@dxos/teleport-extension-gossip": "0.4.7-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/tracing": "0.4.7-main.
|
|
56
|
-
"@dxos/websocket-rpc": "0.4.7-main.
|
|
57
|
-
"@dxos/
|
|
25
|
+
"@dxos/async": "0.4.7-main.e5c4f14",
|
|
26
|
+
"@dxos/codec-protobuf": "0.4.7-main.e5c4f14",
|
|
27
|
+
"@dxos/config": "0.4.7-main.e5c4f14",
|
|
28
|
+
"@dxos/context": "0.4.7-main.e5c4f14",
|
|
29
|
+
"@dxos/client-protocol": "0.4.7-main.e5c4f14",
|
|
30
|
+
"@dxos/debug": "0.4.7-main.e5c4f14",
|
|
31
|
+
"@dxos/crypto": "0.4.7-main.e5c4f14",
|
|
32
|
+
"@dxos/credentials": "0.4.7-main.e5c4f14",
|
|
33
|
+
"@dxos/echo-db": "0.4.7-main.e5c4f14",
|
|
34
|
+
"@dxos/document-model": "0.4.7-main.e5c4f14",
|
|
35
|
+
"@dxos/echo-pipeline": "0.4.7-main.e5c4f14",
|
|
36
|
+
"@dxos/invariant": "0.4.7-main.e5c4f14",
|
|
37
|
+
"@dxos/echo-schema": "0.4.7-main.e5c4f14",
|
|
38
|
+
"@dxos/feed-store": "0.4.7-main.e5c4f14",
|
|
39
|
+
"@dxos/keys": "0.4.7-main.e5c4f14",
|
|
40
|
+
"@dxos/log": "0.4.7-main.e5c4f14",
|
|
41
|
+
"@dxos/keyring": "0.4.7-main.e5c4f14",
|
|
42
|
+
"@dxos/messaging": "0.4.7-main.e5c4f14",
|
|
43
|
+
"@dxos/model-factory": "0.4.7-main.e5c4f14",
|
|
44
|
+
"@dxos/lock-file": "0.4.7-main.e5c4f14",
|
|
45
|
+
"@dxos/network-manager": "0.4.7-main.e5c4f14",
|
|
46
|
+
"@dxos/node-std": "0.4.7-main.e5c4f14",
|
|
47
|
+
"@dxos/protocols": "0.4.7-main.e5c4f14",
|
|
48
|
+
"@dxos/rpc": "0.4.7-main.e5c4f14",
|
|
49
|
+
"@dxos/random-access-storage": "0.4.7-main.e5c4f14",
|
|
50
|
+
"@dxos/teleport": "0.4.7-main.e5c4f14",
|
|
51
|
+
"@dxos/teleport-extension-gossip": "0.4.7-main.e5c4f14",
|
|
52
|
+
"@dxos/text-model": "0.4.7-main.e5c4f14",
|
|
53
|
+
"@dxos/teleport-extension-object-sync": "0.4.7-main.e5c4f14",
|
|
54
|
+
"@dxos/timeframe": "0.4.7-main.e5c4f14",
|
|
55
|
+
"@dxos/tracing": "0.4.7-main.e5c4f14",
|
|
56
|
+
"@dxos/websocket-rpc": "0.4.7-main.e5c4f14",
|
|
57
|
+
"@dxos/util": "0.4.7-main.e5c4f14"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/platform": "^1.3.4",
|
|
61
61
|
"@types/readable-stream": "^2.3.9",
|
|
62
|
-
"@dxos/signal": "0.4.7-main.
|
|
62
|
+
"@dxos/signal": "0.4.7-main.e5c4f14"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
@@ -6,6 +6,7 @@ import { expect } from 'chai';
|
|
|
6
6
|
|
|
7
7
|
import { Trigger } from '@dxos/async';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
9
10
|
import { type DevicesService, type Device } from '@dxos/protocols/proto/dxos/client/services';
|
|
10
11
|
import { afterEach, afterTest, beforeEach, describe, test } from '@dxos/test';
|
|
11
12
|
|
|
@@ -44,10 +45,13 @@ describe('DevicesService', () => {
|
|
|
44
45
|
test('returns empty list if no identity is available', async () => {
|
|
45
46
|
const query = devicesService.queryDevices();
|
|
46
47
|
const result = new Trigger<Device[] | undefined>();
|
|
47
|
-
query.subscribe(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
query.subscribe(
|
|
49
|
+
({ devices }) => {
|
|
50
|
+
result.wake(devices);
|
|
51
|
+
},
|
|
52
|
+
(err) => log.catch(err),
|
|
53
|
+
);
|
|
54
|
+
afterTest(() => query.close().catch((err) => log.catch(err)));
|
|
51
55
|
expect(await result.wait()).to.be.length(0);
|
|
52
56
|
});
|
|
53
57
|
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { EventSubscriptions } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
|
+
import { invariant } from '@dxos/invariant';
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
+
Device,
|
|
9
10
|
DeviceKind,
|
|
10
11
|
type DevicesService,
|
|
11
12
|
type QueryDevicesResponse,
|
|
@@ -28,27 +29,62 @@ export class DevicesServiceImpl implements DevicesService {
|
|
|
28
29
|
if (!deviceKeys) {
|
|
29
30
|
next({ devices: [] });
|
|
30
31
|
} else {
|
|
32
|
+
invariant(this._identityManager.identity?.presence, 'presence not present');
|
|
33
|
+
const peers = this._identityManager.identity.presence.getPeersOnline();
|
|
31
34
|
next({
|
|
32
|
-
devices: Array.from(deviceKeys.entries()).map(([key, profile]) =>
|
|
33
|
-
deviceKey
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => {
|
|
36
|
+
const isMe = this._identityManager.identity?.deviceKey.equals(key);
|
|
37
|
+
const peerState = peers.find((peer) => peer.identityKey.equals(key));
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
deviceKey: key,
|
|
41
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind.CURRENT : DeviceKind.TRUSTED,
|
|
42
|
+
profile,
|
|
43
|
+
presence: isMe
|
|
44
|
+
? Device.PresenceState.ONLINE
|
|
45
|
+
: peerState
|
|
46
|
+
? Device.PresenceState.ONLINE
|
|
47
|
+
: Device.PresenceState.OFFLINE,
|
|
48
|
+
};
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
let identitySubscribed = false;
|
|
55
|
+
let presenceSubscribed = false;
|
|
56
|
+
const subscribeIdentity = () => {
|
|
57
|
+
if (!identitySubscribed) {
|
|
58
|
+
this._identityManager.identity?.stateUpdate.on(() => {
|
|
59
|
+
update();
|
|
37
60
|
});
|
|
61
|
+
identitySubscribed = true;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const subscribePresence = () => {
|
|
66
|
+
if (!presenceSubscribed) {
|
|
67
|
+
this._identityManager.identity?.presence?.updated.on(() => {
|
|
68
|
+
update();
|
|
69
|
+
});
|
|
70
|
+
presenceSubscribed = true;
|
|
38
71
|
}
|
|
39
72
|
};
|
|
40
73
|
|
|
41
74
|
const subscriptions = new EventSubscriptions();
|
|
75
|
+
|
|
76
|
+
if (this._identityManager.identity) {
|
|
77
|
+
subscribeIdentity();
|
|
78
|
+
subscribePresence();
|
|
79
|
+
}
|
|
80
|
+
|
|
42
81
|
subscriptions.add(
|
|
43
82
|
this._identityManager.stateUpdate.on(() => {
|
|
44
83
|
update();
|
|
45
84
|
|
|
46
85
|
if (this._identityManager.identity) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
update();
|
|
50
|
-
}),
|
|
51
|
-
);
|
|
86
|
+
subscribeIdentity();
|
|
87
|
+
subscribePresence();
|
|
52
88
|
}
|
|
53
89
|
}),
|
|
54
90
|
);
|
|
@@ -13,7 +13,7 @@ import { type Keyring } from '@dxos/keyring';
|
|
|
13
13
|
import { PublicKey } from '@dxos/keys';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
15
|
import { trace } from '@dxos/protocols';
|
|
16
|
-
import {
|
|
16
|
+
import { Device, DeviceKind } from '@dxos/protocols/proto/dxos/client/services';
|
|
17
17
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
18
18
|
import { type IdentityRecord, type SpaceMetadata } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
19
19
|
import {
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
DeviceType,
|
|
23
23
|
type ProfileDocument,
|
|
24
24
|
} from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
25
|
+
import { Gossip, Presence } from '@dxos/teleport-extension-gossip';
|
|
25
26
|
import { Timeframe } from '@dxos/timeframe';
|
|
26
27
|
import { trace as Trace } from '@dxos/tracing';
|
|
27
28
|
import { isNode, deferFunction } from '@dxos/util';
|
|
@@ -29,10 +30,14 @@ import { isNode, deferFunction } from '@dxos/util';
|
|
|
29
30
|
import { createAuthProvider } from './authenticator';
|
|
30
31
|
import { Identity } from './identity';
|
|
31
32
|
|
|
33
|
+
const DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 10_000;
|
|
34
|
+
const DEVICE_PRESENCE_OFFLINE_TIMEOUT = 20_000;
|
|
35
|
+
|
|
32
36
|
interface ConstructSpaceParams {
|
|
33
37
|
spaceRecord: SpaceMetadata;
|
|
34
38
|
swarmIdentity: SwarmIdentity;
|
|
35
39
|
identityKey: PublicKey;
|
|
40
|
+
gossip: Gossip;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
export type JoinIdentityParams = {
|
|
@@ -58,12 +63,19 @@ export type CreateIdentityOptions = {
|
|
|
58
63
|
deviceProfile?: DeviceProfileDocument;
|
|
59
64
|
};
|
|
60
65
|
|
|
66
|
+
export type IdentityManagerRuntimeParams = {
|
|
67
|
+
devicePresenceAnnounceInterval?: number;
|
|
68
|
+
devicePresenceOfflineTimeout?: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
61
71
|
// TODO(dmaretskyi): Rename: represents the peer's state machine.
|
|
62
72
|
@Trace.resource()
|
|
63
73
|
export class IdentityManager {
|
|
64
74
|
readonly stateUpdate = new Event();
|
|
65
75
|
|
|
66
76
|
private _identity?: Identity;
|
|
77
|
+
private readonly _devicePresenceAnnounceInterval: number;
|
|
78
|
+
private readonly _devicePresenceOfflineTimeout: number;
|
|
67
79
|
|
|
68
80
|
// TODO(burdon): IdentityManagerParams.
|
|
69
81
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -72,7 +84,15 @@ export class IdentityManager {
|
|
|
72
84
|
private readonly _keyring: Keyring,
|
|
73
85
|
private readonly _feedStore: FeedStore<FeedMessage>,
|
|
74
86
|
private readonly _spaceManager: SpaceManager,
|
|
75
|
-
|
|
87
|
+
params?: IdentityManagerRuntimeParams,
|
|
88
|
+
) {
|
|
89
|
+
const {
|
|
90
|
+
devicePresenceAnnounceInterval = DEVICE_PRESENCE_ANNOUNCE_INTERVAL,
|
|
91
|
+
devicePresenceOfflineTimeout = DEVICE_PRESENCE_OFFLINE_TIMEOUT,
|
|
92
|
+
} = params ?? {};
|
|
93
|
+
this._devicePresenceAnnounceInterval = devicePresenceAnnounceInterval;
|
|
94
|
+
this._devicePresenceOfflineTimeout = devicePresenceOfflineTimeout;
|
|
95
|
+
}
|
|
76
96
|
|
|
77
97
|
get identity() {
|
|
78
98
|
return this._identity;
|
|
@@ -284,13 +304,28 @@ export class IdentityManager {
|
|
|
284
304
|
const receipt = await this._identity.controlPipeline.writer.write({ credential: { credential } });
|
|
285
305
|
await this._identity.controlPipeline.state.waitUntilTimeframe(new Timeframe([[receipt.feedKey, receipt.seq]]));
|
|
286
306
|
this.stateUpdate.emit();
|
|
287
|
-
return {
|
|
307
|
+
return {
|
|
308
|
+
deviceKey: this._identity.deviceKey,
|
|
309
|
+
kind: DeviceKind.CURRENT,
|
|
310
|
+
presence: Device.PresenceState.ONLINE,
|
|
311
|
+
profile,
|
|
312
|
+
};
|
|
288
313
|
}
|
|
289
314
|
|
|
290
315
|
private async _constructIdentity(identityRecord: IdentityRecord) {
|
|
291
316
|
invariant(!this._identity);
|
|
292
317
|
log('constructing identity', { identityRecord });
|
|
293
318
|
|
|
319
|
+
const gossip = new Gossip({
|
|
320
|
+
localPeerId: identityRecord.deviceKey,
|
|
321
|
+
});
|
|
322
|
+
const presence = new Presence({
|
|
323
|
+
announceInterval: this._devicePresenceAnnounceInterval,
|
|
324
|
+
offlineTimeout: this._devicePresenceOfflineTimeout,
|
|
325
|
+
identityKey: identityRecord.deviceKey,
|
|
326
|
+
gossip,
|
|
327
|
+
});
|
|
328
|
+
|
|
294
329
|
// Must be created before the space so the feeds are writable.
|
|
295
330
|
invariant(identityRecord.haloSpace.controlFeedKey);
|
|
296
331
|
const controlFeed = await this._feedStore.openFeed(identityRecord.haloSpace.controlFeedKey, {
|
|
@@ -309,13 +344,15 @@ export class IdentityManager {
|
|
|
309
344
|
credentialProvider: createAuthProvider(createCredentialSignerWithKey(this._keyring, identityRecord.deviceKey)),
|
|
310
345
|
credentialAuthenticator: deferFunction(() => identity.authVerifier.verifier),
|
|
311
346
|
},
|
|
347
|
+
gossip,
|
|
312
348
|
identityKey: identityRecord.identityKey,
|
|
313
349
|
});
|
|
314
350
|
await space.setControlFeed(controlFeed);
|
|
315
|
-
space.setDataFeed(dataFeed);
|
|
351
|
+
void space.setDataFeed(dataFeed); // TODO(dmaretskyi): Should this be awaited?
|
|
316
352
|
|
|
317
353
|
const identity: Identity = new Identity({
|
|
318
354
|
space,
|
|
355
|
+
presence,
|
|
319
356
|
signer: this._keyring,
|
|
320
357
|
identityKey: identityRecord.identityKey,
|
|
321
358
|
deviceKey: identityRecord.deviceKey,
|
|
@@ -331,14 +368,19 @@ export class IdentityManager {
|
|
|
331
368
|
return identity;
|
|
332
369
|
}
|
|
333
370
|
|
|
334
|
-
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey }: ConstructSpaceParams) {
|
|
371
|
+
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey, gossip }: ConstructSpaceParams) {
|
|
335
372
|
return this._spaceManager.constructSpace({
|
|
336
373
|
metadata: {
|
|
337
374
|
key: spaceRecord.key,
|
|
338
375
|
genesisFeedKey: spaceRecord.genesisFeedKey,
|
|
339
376
|
},
|
|
340
377
|
swarmIdentity,
|
|
341
|
-
onAuthorizedConnection: () => {
|
|
378
|
+
onAuthorizedConnection: (session) => {
|
|
379
|
+
session.addExtension(
|
|
380
|
+
'dxos.mesh.teleport.gossip',
|
|
381
|
+
gossip.createExtension({ remotePeerId: session.remotePeerId }),
|
|
382
|
+
);
|
|
383
|
+
},
|
|
342
384
|
onAuthFailure: () => {
|
|
343
385
|
log.warn('auth failure');
|
|
344
386
|
},
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type ProfileDocument,
|
|
26
26
|
} from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
27
27
|
import { type DeviceAdmissionRequest } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
28
|
+
import { type Presence } from '@dxos/teleport-extension-gossip';
|
|
28
29
|
import { trace } from '@dxos/tracing';
|
|
29
30
|
import { type ComplexMap, ComplexSet } from '@dxos/util';
|
|
30
31
|
|
|
@@ -35,6 +36,7 @@ export type IdentityParams = {
|
|
|
35
36
|
deviceKey: PublicKey;
|
|
36
37
|
signer: Signer;
|
|
37
38
|
space: Space;
|
|
39
|
+
presence?: Presence;
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
/**
|
|
@@ -44,6 +46,7 @@ export type IdentityParams = {
|
|
|
44
46
|
export class Identity {
|
|
45
47
|
public readonly space: Space;
|
|
46
48
|
private readonly _signer: Signer;
|
|
49
|
+
private readonly _presence?: Presence;
|
|
47
50
|
private readonly _deviceStateMachine: DeviceStateMachine;
|
|
48
51
|
private readonly _profileStateMachine: ProfileStateMachine;
|
|
49
52
|
public readonly authVerifier: TrustedKeySetAuthVerifier;
|
|
@@ -53,9 +56,10 @@ export class Identity {
|
|
|
53
56
|
|
|
54
57
|
public readonly stateUpdate = new Event();
|
|
55
58
|
|
|
56
|
-
constructor({ space, signer, identityKey, deviceKey }: IdentityParams) {
|
|
59
|
+
constructor({ space, signer, identityKey, deviceKey, presence }: IdentityParams) {
|
|
57
60
|
this.space = space;
|
|
58
61
|
this._signer = signer;
|
|
62
|
+
this._presence = presence;
|
|
59
63
|
|
|
60
64
|
this.identityKey = identityKey;
|
|
61
65
|
this.deviceKey = deviceKey;
|
|
@@ -128,6 +132,10 @@ export class Identity {
|
|
|
128
132
|
return this._deviceStateMachine.deviceCredentialChain;
|
|
129
133
|
}
|
|
130
134
|
|
|
135
|
+
get presence() {
|
|
136
|
+
return this._presence;
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
/**
|
|
132
140
|
* Issues credentials as identity.
|
|
133
141
|
* Requires identity to be ready.
|
|
@@ -31,15 +31,21 @@ import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
|
31
31
|
import { trace as Trace } from '@dxos/tracing';
|
|
32
32
|
import { safeInstanceof } from '@dxos/util';
|
|
33
33
|
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
type CreateIdentityOptions,
|
|
36
|
+
IdentityManager,
|
|
37
|
+
type IdentityManagerRuntimeParams,
|
|
38
|
+
type JoinIdentityParams,
|
|
39
|
+
} from '../identity';
|
|
35
40
|
import {
|
|
36
41
|
DeviceInvitationProtocol,
|
|
37
42
|
InvitationsHandler,
|
|
38
43
|
type InvitationProtocol,
|
|
39
44
|
SpaceInvitationProtocol,
|
|
40
45
|
} from '../invitations';
|
|
41
|
-
import { DataSpaceManager, type SigningContext } from '../spaces';
|
|
46
|
+
import { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';
|
|
42
47
|
|
|
48
|
+
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams;
|
|
43
49
|
/**
|
|
44
50
|
* Shared backend for all client services.
|
|
45
51
|
*/
|
|
@@ -80,6 +86,7 @@ export class ServiceContext {
|
|
|
80
86
|
public readonly networkManager: NetworkManager,
|
|
81
87
|
public readonly signalManager: SignalManager,
|
|
82
88
|
public readonly modelFactory: ModelFactory,
|
|
89
|
+
public readonly _runtimeParams?: IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams,
|
|
83
90
|
) {
|
|
84
91
|
// TODO(burdon): Move strings to constants.
|
|
85
92
|
this.metadataStore = new MetadataStore(storage.createDirectory('metadata'));
|
|
@@ -107,7 +114,13 @@ export class ServiceContext {
|
|
|
107
114
|
snapshotStore: this.snapshotStore,
|
|
108
115
|
});
|
|
109
116
|
|
|
110
|
-
this.identityManager = new IdentityManager(
|
|
117
|
+
this.identityManager = new IdentityManager(
|
|
118
|
+
this.metadataStore,
|
|
119
|
+
this.keyring,
|
|
120
|
+
this.feedStore,
|
|
121
|
+
this.spaceManager,
|
|
122
|
+
this._runtimeParams as IdentityManagerRuntimeParams,
|
|
123
|
+
);
|
|
111
124
|
|
|
112
125
|
this.automergeHost = new AutomergeHost(storage.createDirectory('automerge'));
|
|
113
126
|
|
|
@@ -221,6 +234,7 @@ export class ServiceContext {
|
|
|
221
234
|
signingContext,
|
|
222
235
|
this.feedStore,
|
|
223
236
|
this.automergeHost,
|
|
237
|
+
this._runtimeParams as DataSpaceManagerRuntimeParams,
|
|
224
238
|
);
|
|
225
239
|
await this.dataSpaceManager.open();
|
|
226
240
|
|