@dxos/client-services 0.4.7-main.0aeacda → 0.4.7-main.731b147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-N4RGR7MX.mjs → chunk-XPIRHRIB.mjs} +133 -202
- package/dist/lib/browser/chunk-XPIRHRIB.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-IG3MUK6Q.cjs → chunk-BIYZDTFF.cjs} +125 -194
- package/dist/lib/node/chunk-BIYZDTFF.cjs.map +7 -0
- package/dist/lib/node/index.cjs +37 -37
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/devices/devices-service.d.ts +1 -1
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -8
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +1 -5
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -5
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +2 -4
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -7
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/devices/devices-service.test.ts +4 -8
- package/src/packlets/devices/devices-service.ts +11 -47
- package/src/packlets/identity/identity-manager.ts +5 -47
- package/src/packlets/identity/identity.ts +1 -9
- package/src/packlets/services/service-context.ts +3 -17
- package/src/packlets/services/service-host.ts +1 -6
- package/src/packlets/spaces/data-space-manager.ts +3 -18
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-N4RGR7MX.mjs.map +0 -7
- package/dist/lib/node/chunk-IG3MUK6Q.cjs.map +0 -7
|
@@ -31,7 +31,7 @@ __export(testing_exports, {
|
|
|
31
31
|
syncItemsLocal: () => syncItemsLocal
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(testing_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_chunk_BIYZDTFF = require("../../chunk-BIYZDTFF.cjs");
|
|
35
35
|
var import_credentials = require("@dxos/credentials");
|
|
36
36
|
var import_keys = require("@dxos/keys");
|
|
37
37
|
var import_async = require("@dxos/async");
|
|
@@ -209,7 +209,7 @@ var createInvitation = (host, options) => {
|
|
|
209
209
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
210
210
|
...options ?? {}
|
|
211
211
|
};
|
|
212
|
-
if (host instanceof
|
|
212
|
+
if (host instanceof import_chunk_BIYZDTFF.ServiceContext) {
|
|
213
213
|
const hostHandler = host.getInvitationHandler({
|
|
214
214
|
kind: import_services.Invitation.Kind.SPACE,
|
|
215
215
|
...options
|
|
@@ -220,7 +220,7 @@ var createInvitation = (host, options) => {
|
|
|
220
220
|
};
|
|
221
221
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
222
222
|
invitation = sanitizeInvitation(invitation);
|
|
223
|
-
if (guest instanceof
|
|
223
|
+
if (guest instanceof import_chunk_BIYZDTFF.ServiceContext) {
|
|
224
224
|
const guestHandler = guest.getInvitationHandler({
|
|
225
225
|
kind: invitation.kind
|
|
226
226
|
});
|
|
@@ -229,7 +229,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
229
229
|
return guest.join(invitation, guestDeviceProfile);
|
|
230
230
|
};
|
|
231
231
|
var createServiceHost = (config, signalManagerContext) => {
|
|
232
|
-
return new
|
|
232
|
+
return new import_chunk_BIYZDTFF.ClientServicesHost({
|
|
233
233
|
config,
|
|
234
234
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
235
235
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -243,8 +243,8 @@ var createServiceContext = ({ signalContext = new import_messaging.MemorySignalM
|
|
|
243
243
|
signalManager,
|
|
244
244
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
245
245
|
});
|
|
246
|
-
const modelFactory = (0,
|
|
247
|
-
return new
|
|
246
|
+
const modelFactory = (0, import_chunk_BIYZDTFF.createDefaultModelFactory)();
|
|
247
|
+
return new import_chunk_BIYZDTFF.ServiceContext(storage, networkManager, signalManager, modelFactory);
|
|
248
248
|
};
|
|
249
249
|
var createPeers = async (numPeers) => {
|
|
250
250
|
const signalContext = new import_messaging.MemorySignalManagerContext();
|
|
@@ -328,7 +328,7 @@ var TestPeer = class {
|
|
|
328
328
|
feedStore: this.feedStore,
|
|
329
329
|
networkManager: this.networkManager,
|
|
330
330
|
metadataStore: this.metadataStore,
|
|
331
|
-
modelFactory: (0,
|
|
331
|
+
modelFactory: (0, import_chunk_BIYZDTFF.createDefaultModelFactory)(),
|
|
332
332
|
snapshotStore: this.snapshotStore,
|
|
333
333
|
blobStore: this.blobStore
|
|
334
334
|
});
|
|
@@ -340,7 +340,7 @@ var TestPeer = class {
|
|
|
340
340
|
return this._props.automergeHost ??= new import_echo_pipeline.AutomergeHost(this.storage.createDirectory("automerge"));
|
|
341
341
|
}
|
|
342
342
|
get dataSpaceManager() {
|
|
343
|
-
return this._props.dataSpaceManager ??= new
|
|
343
|
+
return this._props.dataSpaceManager ??= new import_chunk_BIYZDTFF.DataSpaceManager(this.spaceManager, this.metadataStore, new import_echo_pipeline.DataServiceSubscriptions(), this.keyring, this.identity, this.feedStore, this.automergeHost);
|
|
344
344
|
}
|
|
345
345
|
async createIdentity() {
|
|
346
346
|
this._props.signingContext ??= await createSigningContext(this.keyring);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf';
|
|
2
|
-
import { Device, type DevicesService, type QueryDevicesResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
+
import { type Device, type DevicesService, type QueryDevicesResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
3
|
import { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
4
4
|
import { type IdentityManager } from '../identity';
|
|
5
5
|
export declare class DevicesServiceImpl implements DevicesService {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devices/devices-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"devices-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/devices/devices-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,KAAK,MAAM,EAEX,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,kBAAmB,YAAW,cAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,eAAe;IAExD,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAInE,YAAY,IAAI,MAAM,CAAC,oBAAoB,CAAC;CAqC7C"}
|
|
@@ -4,7 +4,7 @@ import { type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
|
4
4
|
import { type FeedStore } from '@dxos/feed-store';
|
|
5
5
|
import { type Keyring } from '@dxos/keyring';
|
|
6
6
|
import { PublicKey } from '@dxos/keys';
|
|
7
|
-
import { Device } from '@dxos/protocols/proto/dxos/client/services';
|
|
7
|
+
import { type Device } from '@dxos/protocols/proto/dxos/client/services';
|
|
8
8
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
9
9
|
import { type DeviceProfileDocument, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
10
10
|
import { Timeframe } from '@dxos/timeframe';
|
|
@@ -27,10 +27,6 @@ export type CreateIdentityOptions = {
|
|
|
27
27
|
displayName?: string;
|
|
28
28
|
deviceProfile?: DeviceProfileDocument;
|
|
29
29
|
};
|
|
30
|
-
export type IdentityManagerRuntimeParams = {
|
|
31
|
-
devicePresenceAnnounceInterval?: number;
|
|
32
|
-
devicePresenceOfflineTimeout?: number;
|
|
33
|
-
};
|
|
34
30
|
export declare class IdentityManager {
|
|
35
31
|
private readonly _metadataStore;
|
|
36
32
|
private readonly _keyring;
|
|
@@ -38,9 +34,7 @@ export declare class IdentityManager {
|
|
|
38
34
|
private readonly _spaceManager;
|
|
39
35
|
readonly stateUpdate: Event<void>;
|
|
40
36
|
private _identity?;
|
|
41
|
-
|
|
42
|
-
private readonly _devicePresenceOfflineTimeout;
|
|
43
|
-
constructor(_metadataStore: MetadataStore, _keyring: Keyring, _feedStore: FeedStore<FeedMessage>, _spaceManager: SpaceManager, params?: IdentityManagerRuntimeParams);
|
|
37
|
+
constructor(_metadataStore: MetadataStore, _keyring: Keyring, _feedStore: FeedStore<FeedMessage>, _spaceManager: SpaceManager);
|
|
44
38
|
get identity(): Identity | undefined;
|
|
45
39
|
open(ctx: Context): Promise<void>;
|
|
46
40
|
close(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-manager.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAsB,MAA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AAa,CAAC,EAAE,qBAAqB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC,CAAC;AAGF,qBACa,eAAe;IAQxB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAVhC,QAAQ,CAAC,WAAW,cAAe;IAEnC,OAAO,CAAC,SAAS,CAAC,CAAW;gBAKV,cAAc,EAAE,aAAa,EAC7B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,EAClC,aAAa,EAAE,YAAY;IAG9C,IAAI,QAAQ,yBAEX;IAGK,IAAI,CAAC,GAAG,EAAE,OAAO;IAoBjB,KAAK;IAIL,cAAc,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,GAAE,qBAA0B;IAgF/E,0BAA0B,IAAI,qBAAqB;IAyBnD;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,kBAAkB;IAmC/C;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,eAAe;IAiBtC,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;YAqB5D,kBAAkB;YA4ClB,eAAe;CAc9B"}
|
|
@@ -6,7 +6,6 @@ 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';
|
|
10
9
|
import { type ComplexMap } from '@dxos/util';
|
|
11
10
|
import { TrustedKeySetAuthVerifier } from './authenticator';
|
|
12
11
|
export type IdentityParams = {
|
|
@@ -14,7 +13,6 @@ export type IdentityParams = {
|
|
|
14
13
|
deviceKey: PublicKey;
|
|
15
14
|
signer: Signer;
|
|
16
15
|
space: Space;
|
|
17
|
-
presence?: Presence;
|
|
18
16
|
};
|
|
19
17
|
/**
|
|
20
18
|
* Agent identity manager, which includes the agent's Halo space.
|
|
@@ -22,14 +20,13 @@ export type IdentityParams = {
|
|
|
22
20
|
export declare class Identity {
|
|
23
21
|
readonly space: Space;
|
|
24
22
|
private readonly _signer;
|
|
25
|
-
private readonly _presence?;
|
|
26
23
|
private readonly _deviceStateMachine;
|
|
27
24
|
private readonly _profileStateMachine;
|
|
28
25
|
readonly authVerifier: TrustedKeySetAuthVerifier;
|
|
29
26
|
readonly identityKey: PublicKey;
|
|
30
27
|
readonly deviceKey: PublicKey;
|
|
31
28
|
readonly stateUpdate: Event<void>;
|
|
32
|
-
constructor({ space, signer, identityKey, deviceKey
|
|
29
|
+
constructor({ space, signer, identityKey, deviceKey }: IdentityParams);
|
|
33
30
|
get authorizedDeviceKeys(): ComplexMap<PublicKey, DeviceProfileDocument>;
|
|
34
31
|
open(ctx: Context): Promise<void>;
|
|
35
32
|
close(ctx: Context): Promise<void>;
|
|
@@ -42,7 +39,6 @@ export declare class Identity {
|
|
|
42
39
|
get haloSpaceKey(): PublicKey;
|
|
43
40
|
get haloGenesisFeedKey(): PublicKey;
|
|
44
41
|
get deviceCredentialChain(): import("@dxos/protocols/proto/dxos/halo/credentials").Chain | undefined;
|
|
45
|
-
get presence(): Presence | undefined;
|
|
46
42
|
/**
|
|
47
43
|
* Issues credentials as identity.
|
|
48
44
|
* 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,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F;;GAEG;AACH,qBACa,QAAQ;IACnB,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAsB;IAC3D,SAAgB,YAAY,EAAE,yBAAyB,CAAC;IAExD,SAAgB,WAAW,EAAE,SAAS,CAAC;IACvC,SAAgB,SAAS,EAAE,SAAS,CAAC;IAErC,SAAgB,WAAW,cAAe;gBAE9B,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,cAAc;IA2BrE,IAAI,oBAAoB,IAAI,UAAU,CAAC,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;;;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,10 +11,9 @@ 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
|
|
14
|
+
import { type CreateIdentityOptions, IdentityManager } from '../identity';
|
|
15
15
|
import { InvitationsHandler, type InvitationProtocol } from '../invitations';
|
|
16
|
-
import { DataSpaceManager
|
|
17
|
-
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams;
|
|
16
|
+
import { DataSpaceManager } from '../spaces';
|
|
18
17
|
/**
|
|
19
18
|
* Shared backend for all client services.
|
|
20
19
|
*/
|
|
@@ -23,7 +22,6 @@ export declare class ServiceContext {
|
|
|
23
22
|
readonly networkManager: NetworkManager;
|
|
24
23
|
readonly signalManager: SignalManager;
|
|
25
24
|
readonly modelFactory: ModelFactory;
|
|
26
|
-
readonly _runtimeParams?: (IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams) | undefined;
|
|
27
25
|
readonly initialized: Trigger<void>;
|
|
28
26
|
readonly dataServiceSubscriptions: DataServiceSubscriptions;
|
|
29
27
|
readonly metadataStore: MetadataStore;
|
|
@@ -42,7 +40,7 @@ export declare class ServiceContext {
|
|
|
42
40
|
private readonly _handlerFactories;
|
|
43
41
|
private _deviceSpaceSync?;
|
|
44
42
|
private readonly _instanceId;
|
|
45
|
-
constructor(storage: Storage, networkManager: NetworkManager, signalManager: SignalManager, modelFactory: ModelFactory
|
|
43
|
+
constructor(storage: Storage, networkManager: NetworkManager, signalManager: SignalManager, modelFactory: ModelFactory);
|
|
46
44
|
open(ctx: Context): Promise<void>;
|
|
47
45
|
close(): Promise<void>;
|
|
48
46
|
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,EAA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AAc,CAAC,MAAM,GAAE,qBAA0B;IAMvD,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,kBAAkB;IAM9F,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;YAUnD,eAAe;YAMf,oBAAoB;YAUpB,WAAW;CA+D1B"}
|
|
@@ -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
|
|
8
|
+
import { ServiceContext } from './service-context';
|
|
9
9
|
import { ServiceRegistry } from './service-registry';
|
|
10
10
|
export declare const createDefaultModelFactory: () => ModelFactory;
|
|
11
11
|
export type ClientServicesHostParams = {
|
|
@@ -20,7 +20,6 @@ export type ClientServicesHostParams = {
|
|
|
20
20
|
storage?: Storage;
|
|
21
21
|
lockKey?: string;
|
|
22
22
|
callbacks?: ClientServicesHostCallbacks;
|
|
23
|
-
runtimeParams?: ServiceContextRuntimeParams;
|
|
24
23
|
};
|
|
25
24
|
export type ClientServicesHostCallbacks = {
|
|
26
25
|
onReset?: () => Promise<void>;
|
|
@@ -49,10 +48,9 @@ export declare class ClientServicesHost {
|
|
|
49
48
|
private _callbacks?;
|
|
50
49
|
private _devtoolsProxy?;
|
|
51
50
|
private _serviceContext;
|
|
52
|
-
private readonly _runtimeParams?;
|
|
53
51
|
private _opening;
|
|
54
52
|
private _open;
|
|
55
|
-
constructor({ config, modelFactory, transportFactory, signalManager, storage, lockKey, callbacks,
|
|
53
|
+
constructor({ config, modelFactory, transportFactory, signalManager, storage, lockKey, callbacks, }?: ClientServicesHostParams);
|
|
56
54
|
get isOpen(): boolean;
|
|
57
55
|
get config(): Config | undefined;
|
|
58
56
|
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,KAAK,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAoD,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGhH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAO3D,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAoD,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGhH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAO3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAarD,eAAO,MAAM,yBAAyB,oBAErC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YA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AAK,CAAS;gBAEV,EACV,MAAM,EACN,YAA0C,EAC1C,gBAAgB,EAChB,aAAa,EACb,OAAO,EAEP,OAAO,EACP,SAAS,GACV,GAAE,wBAA6B;IAiDhC,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;IA6FjB,KAAK;IAgBL,KAAK;YAYG,eAAe;CAqB9B"}
|
|
@@ -30,10 +30,6 @@ export type AcceptSpaceOptions = {
|
|
|
30
30
|
*/
|
|
31
31
|
dataTimeframe?: Timeframe;
|
|
32
32
|
};
|
|
33
|
-
export type DataSpaceManagerRuntimeParams = {
|
|
34
|
-
spaceMemberPresenceAnnounceInterval?: number;
|
|
35
|
-
spaceMemberPresenceOfflineTimeout?: number;
|
|
36
|
-
};
|
|
37
33
|
export declare class DataSpaceManager {
|
|
38
34
|
private readonly _spaceManager;
|
|
39
35
|
private readonly _metadataStore;
|
|
@@ -47,9 +43,7 @@ export declare class DataSpaceManager {
|
|
|
47
43
|
private readonly _spaces;
|
|
48
44
|
private _isOpen;
|
|
49
45
|
private readonly _instanceId;
|
|
50
|
-
|
|
51
|
-
private readonly _spaceMemberPresenceOfflineTimeout;
|
|
52
|
-
constructor(_spaceManager: SpaceManager, _metadataStore: MetadataStore, _dataServiceSubscriptions: DataServiceSubscriptions, _keyring: Keyring, _signingContext: SigningContext, _feedStore: FeedStore<FeedMessage>, _automergeHost: AutomergeHost, params?: DataSpaceManagerRuntimeParams);
|
|
46
|
+
constructor(_spaceManager: SpaceManager, _metadataStore: MetadataStore, _dataServiceSubscriptions: DataServiceSubscriptions, _keyring: Keyring, _signingContext: SigningContext, _feedStore: FeedStore<FeedMessage>, _automergeHost: AutomergeHost);
|
|
53
47
|
get spaces(): ComplexMap<PublicKey, DataSpace>;
|
|
54
48
|
open(): Promise<void>;
|
|
55
49
|
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;IAC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ANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.7-main.
|
|
3
|
+
"version": "0.4.7-main.731b147",
|
|
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/client-protocol": "0.4.7-main.
|
|
27
|
-
"@dxos/codec-protobuf": "0.4.7-main.
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/context": "0.4.7-main.
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/document-model": "0.4.7-main.
|
|
34
|
-
"@dxos/echo-
|
|
35
|
-
"@dxos/echo-
|
|
36
|
-
"@dxos/echo-
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/keyring": "0.4.7-main.
|
|
40
|
-
"@dxos/keys": "0.4.7-main.
|
|
41
|
-
"@dxos/lock-file": "0.4.7-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/model-factory": "0.4.7-main.
|
|
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/teleport": "0.4.7-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/teleport-extension-
|
|
52
|
-
"@dxos/text-model": "0.4.7-main.
|
|
53
|
-
"@dxos/teleport-extension-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/websocket-rpc": "0.4.7-main.
|
|
25
|
+
"@dxos/async": "0.4.7-main.731b147",
|
|
26
|
+
"@dxos/client-protocol": "0.4.7-main.731b147",
|
|
27
|
+
"@dxos/codec-protobuf": "0.4.7-main.731b147",
|
|
28
|
+
"@dxos/credentials": "0.4.7-main.731b147",
|
|
29
|
+
"@dxos/context": "0.4.7-main.731b147",
|
|
30
|
+
"@dxos/crypto": "0.4.7-main.731b147",
|
|
31
|
+
"@dxos/debug": "0.4.7-main.731b147",
|
|
32
|
+
"@dxos/config": "0.4.7-main.731b147",
|
|
33
|
+
"@dxos/document-model": "0.4.7-main.731b147",
|
|
34
|
+
"@dxos/echo-db": "0.4.7-main.731b147",
|
|
35
|
+
"@dxos/echo-pipeline": "0.4.7-main.731b147",
|
|
36
|
+
"@dxos/echo-schema": "0.4.7-main.731b147",
|
|
37
|
+
"@dxos/invariant": "0.4.7-main.731b147",
|
|
38
|
+
"@dxos/feed-store": "0.4.7-main.731b147",
|
|
39
|
+
"@dxos/keyring": "0.4.7-main.731b147",
|
|
40
|
+
"@dxos/keys": "0.4.7-main.731b147",
|
|
41
|
+
"@dxos/lock-file": "0.4.7-main.731b147",
|
|
42
|
+
"@dxos/messaging": "0.4.7-main.731b147",
|
|
43
|
+
"@dxos/log": "0.4.7-main.731b147",
|
|
44
|
+
"@dxos/model-factory": "0.4.7-main.731b147",
|
|
45
|
+
"@dxos/network-manager": "0.4.7-main.731b147",
|
|
46
|
+
"@dxos/node-std": "0.4.7-main.731b147",
|
|
47
|
+
"@dxos/protocols": "0.4.7-main.731b147",
|
|
48
|
+
"@dxos/rpc": "0.4.7-main.731b147",
|
|
49
|
+
"@dxos/teleport": "0.4.7-main.731b147",
|
|
50
|
+
"@dxos/random-access-storage": "0.4.7-main.731b147",
|
|
51
|
+
"@dxos/teleport-extension-gossip": "0.4.7-main.731b147",
|
|
52
|
+
"@dxos/text-model": "0.4.7-main.731b147",
|
|
53
|
+
"@dxos/teleport-extension-object-sync": "0.4.7-main.731b147",
|
|
54
|
+
"@dxos/timeframe": "0.4.7-main.731b147",
|
|
55
|
+
"@dxos/util": "0.4.7-main.731b147",
|
|
56
|
+
"@dxos/tracing": "0.4.7-main.731b147",
|
|
57
|
+
"@dxos/websocket-rpc": "0.4.7-main.731b147"
|
|
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.731b147"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
@@ -6,7 +6,6 @@ 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';
|
|
10
9
|
import { type DevicesService, type Device } from '@dxos/protocols/proto/dxos/client/services';
|
|
11
10
|
import { afterEach, afterTest, beforeEach, describe, test } from '@dxos/test';
|
|
12
11
|
|
|
@@ -45,13 +44,10 @@ describe('DevicesService', () => {
|
|
|
45
44
|
test('returns empty list if no identity is available', async () => {
|
|
46
45
|
const query = devicesService.queryDevices();
|
|
47
46
|
const result = new Trigger<Device[] | undefined>();
|
|
48
|
-
query.subscribe(
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(err) => log.catch(err),
|
|
53
|
-
);
|
|
54
|
-
afterTest(() => query.close().catch((err) => log.catch(err)));
|
|
47
|
+
query.subscribe(({ devices }) => {
|
|
48
|
+
result.wake(devices);
|
|
49
|
+
});
|
|
50
|
+
afterTest(() => query.close());
|
|
55
51
|
expect(await result.wait()).to.be.length(0);
|
|
56
52
|
});
|
|
57
53
|
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { EventSubscriptions } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
|
-
import { invariant } from '@dxos/invariant';
|
|
8
7
|
import {
|
|
9
|
-
Device,
|
|
8
|
+
type Device,
|
|
10
9
|
DeviceKind,
|
|
11
10
|
type DevicesService,
|
|
12
11
|
type QueryDevicesResponse,
|
|
@@ -29,62 +28,27 @@ export class DevicesServiceImpl implements DevicesService {
|
|
|
29
28
|
if (!deviceKeys) {
|
|
30
29
|
next({ devices: [] });
|
|
31
30
|
} else {
|
|
32
|
-
invariant(this._identityManager.identity?.presence, 'presence not present');
|
|
33
|
-
const peers = this._identityManager.identity.presence.getPeersOnline();
|
|
34
31
|
next({
|
|
35
|
-
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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();
|
|
32
|
+
devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
|
|
33
|
+
deviceKey: key,
|
|
34
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind.CURRENT : DeviceKind.TRUSTED,
|
|
35
|
+
profile,
|
|
36
|
+
})),
|
|
60
37
|
});
|
|
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;
|
|
71
38
|
}
|
|
72
39
|
};
|
|
73
40
|
|
|
74
41
|
const subscriptions = new EventSubscriptions();
|
|
75
|
-
|
|
76
|
-
if (this._identityManager.identity) {
|
|
77
|
-
subscribeIdentity();
|
|
78
|
-
subscribePresence();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
42
|
subscriptions.add(
|
|
82
43
|
this._identityManager.stateUpdate.on(() => {
|
|
83
44
|
update();
|
|
84
45
|
|
|
85
46
|
if (this._identityManager.identity) {
|
|
86
|
-
|
|
87
|
-
|
|
47
|
+
subscriptions.add(
|
|
48
|
+
this._identityManager.identity.stateUpdate.on(() => {
|
|
49
|
+
update();
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
88
52
|
}
|
|
89
53
|
}),
|
|
90
54
|
);
|
|
@@ -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 { Device, DeviceKind } from '@dxos/protocols/proto/dxos/client/services';
|
|
16
|
+
import { type 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,7 +22,6 @@ 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';
|
|
26
25
|
import { Timeframe } from '@dxos/timeframe';
|
|
27
26
|
import { trace as Trace } from '@dxos/tracing';
|
|
28
27
|
import { isNode, deferFunction } from '@dxos/util';
|
|
@@ -30,14 +29,10 @@ import { isNode, deferFunction } from '@dxos/util';
|
|
|
30
29
|
import { createAuthProvider } from './authenticator';
|
|
31
30
|
import { Identity } from './identity';
|
|
32
31
|
|
|
33
|
-
const DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 10_000;
|
|
34
|
-
const DEVICE_PRESENCE_OFFLINE_TIMEOUT = 20_000;
|
|
35
|
-
|
|
36
32
|
interface ConstructSpaceParams {
|
|
37
33
|
spaceRecord: SpaceMetadata;
|
|
38
34
|
swarmIdentity: SwarmIdentity;
|
|
39
35
|
identityKey: PublicKey;
|
|
40
|
-
gossip: Gossip;
|
|
41
36
|
}
|
|
42
37
|
|
|
43
38
|
export type JoinIdentityParams = {
|
|
@@ -63,19 +58,12 @@ export type CreateIdentityOptions = {
|
|
|
63
58
|
deviceProfile?: DeviceProfileDocument;
|
|
64
59
|
};
|
|
65
60
|
|
|
66
|
-
export type IdentityManagerRuntimeParams = {
|
|
67
|
-
devicePresenceAnnounceInterval?: number;
|
|
68
|
-
devicePresenceOfflineTimeout?: number;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
61
|
// TODO(dmaretskyi): Rename: represents the peer's state machine.
|
|
72
62
|
@Trace.resource()
|
|
73
63
|
export class IdentityManager {
|
|
74
64
|
readonly stateUpdate = new Event();
|
|
75
65
|
|
|
76
66
|
private _identity?: Identity;
|
|
77
|
-
private readonly _devicePresenceAnnounceInterval: number;
|
|
78
|
-
private readonly _devicePresenceOfflineTimeout: number;
|
|
79
67
|
|
|
80
68
|
// TODO(burdon): IdentityManagerParams.
|
|
81
69
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -84,15 +72,7 @@ export class IdentityManager {
|
|
|
84
72
|
private readonly _keyring: Keyring,
|
|
85
73
|
private readonly _feedStore: FeedStore<FeedMessage>,
|
|
86
74
|
private readonly _spaceManager: SpaceManager,
|
|
87
|
-
|
|
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
|
-
}
|
|
75
|
+
) {}
|
|
96
76
|
|
|
97
77
|
get identity() {
|
|
98
78
|
return this._identity;
|
|
@@ -304,28 +284,13 @@ export class IdentityManager {
|
|
|
304
284
|
const receipt = await this._identity.controlPipeline.writer.write({ credential: { credential } });
|
|
305
285
|
await this._identity.controlPipeline.state.waitUntilTimeframe(new Timeframe([[receipt.feedKey, receipt.seq]]));
|
|
306
286
|
this.stateUpdate.emit();
|
|
307
|
-
return {
|
|
308
|
-
deviceKey: this._identity.deviceKey,
|
|
309
|
-
kind: DeviceKind.CURRENT,
|
|
310
|
-
presence: Device.PresenceState.ONLINE,
|
|
311
|
-
profile,
|
|
312
|
-
};
|
|
287
|
+
return { deviceKey: this._identity.deviceKey, kind: DeviceKind.CURRENT, profile };
|
|
313
288
|
}
|
|
314
289
|
|
|
315
290
|
private async _constructIdentity(identityRecord: IdentityRecord) {
|
|
316
291
|
invariant(!this._identity);
|
|
317
292
|
log('constructing identity', { identityRecord });
|
|
318
293
|
|
|
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
|
-
|
|
329
294
|
// Must be created before the space so the feeds are writable.
|
|
330
295
|
invariant(identityRecord.haloSpace.controlFeedKey);
|
|
331
296
|
const controlFeed = await this._feedStore.openFeed(identityRecord.haloSpace.controlFeedKey, {
|
|
@@ -344,7 +309,6 @@ export class IdentityManager {
|
|
|
344
309
|
credentialProvider: createAuthProvider(createCredentialSignerWithKey(this._keyring, identityRecord.deviceKey)),
|
|
345
310
|
credentialAuthenticator: deferFunction(() => identity.authVerifier.verifier),
|
|
346
311
|
},
|
|
347
|
-
gossip,
|
|
348
312
|
identityKey: identityRecord.identityKey,
|
|
349
313
|
});
|
|
350
314
|
await space.setControlFeed(controlFeed);
|
|
@@ -352,7 +316,6 @@ export class IdentityManager {
|
|
|
352
316
|
|
|
353
317
|
const identity: Identity = new Identity({
|
|
354
318
|
space,
|
|
355
|
-
presence,
|
|
356
319
|
signer: this._keyring,
|
|
357
320
|
identityKey: identityRecord.identityKey,
|
|
358
321
|
deviceKey: identityRecord.deviceKey,
|
|
@@ -368,19 +331,14 @@ export class IdentityManager {
|
|
|
368
331
|
return identity;
|
|
369
332
|
}
|
|
370
333
|
|
|
371
|
-
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey
|
|
334
|
+
private async _constructSpace({ spaceRecord, swarmIdentity, identityKey }: ConstructSpaceParams) {
|
|
372
335
|
return this._spaceManager.constructSpace({
|
|
373
336
|
metadata: {
|
|
374
337
|
key: spaceRecord.key,
|
|
375
338
|
genesisFeedKey: spaceRecord.genesisFeedKey,
|
|
376
339
|
},
|
|
377
340
|
swarmIdentity,
|
|
378
|
-
onAuthorizedConnection: (
|
|
379
|
-
session.addExtension(
|
|
380
|
-
'dxos.mesh.teleport.gossip',
|
|
381
|
-
gossip.createExtension({ remotePeerId: session.remotePeerId }),
|
|
382
|
-
);
|
|
383
|
-
},
|
|
341
|
+
onAuthorizedConnection: () => {},
|
|
384
342
|
onAuthFailure: () => {
|
|
385
343
|
log.warn('auth failure');
|
|
386
344
|
},
|