@dxos/client-services 0.6.12-staging.e11e696 → 0.6.12
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-67FEJJ6J.mjs → chunk-TOAILL4T.mjs} +5127 -5565
- package/dist/lib/browser/chunk-TOAILL4T.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -3
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +6 -5
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node/{chunk-2KIDYJ7O.cjs → chunk-H6C4XY6B.cjs} +4908 -5346
- package/dist/lib/node/chunk-H6C4XY6B.cjs.map +7 -0
- package/dist/lib/node/index.cjs +46 -46
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +12 -11
- package/dist/lib/node/testing/index.cjs.map +2 -2
- package/dist/types/src/packlets/diagnostics/diagnostics-broadcast.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.test.d.ts +2 -0
- package/dist/types/src/packlets/identity/authenticator.test.d.ts.map +1 -0
- package/dist/types/src/packlets/identity/contacts-service.d.ts +1 -1
- package/dist/types/src/packlets/identity/contacts-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +7 -19
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts +1 -8
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/services/automerge-host.test.d.ts +2 -0
- package/dist/types/src/packlets/services/automerge-host.test.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts +6 -7
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +0 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +3 -4
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +3 -3
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts +0 -3
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/epoch-migrations.d.ts +1 -1
- package/dist/types/src/packlets/spaces/epoch-migrations.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +6 -31
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/storage/storage.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +2 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +39 -43
- package/src/packlets/devices/devices-service.test.ts +5 -4
- package/src/packlets/diagnostics/diagnostics-broadcast.ts +0 -1
- package/src/packlets/identity/{authenticator.node.test.ts → authenticator.test.ts} +3 -2
- package/src/packlets/identity/authenticator.ts +2 -5
- package/src/packlets/identity/contacts-service.ts +1 -1
- package/src/packlets/identity/identity-manager.test.ts +6 -5
- package/src/packlets/identity/identity-manager.ts +19 -35
- package/src/packlets/identity/identity-service.test.ts +8 -4
- package/src/packlets/identity/identity.test.ts +239 -128
- package/src/packlets/identity/identity.ts +8 -42
- package/src/packlets/invitations/device-invitation-protocol.test.ts +4 -7
- package/src/packlets/invitations/invitation-host-extension.ts +3 -0
- package/src/packlets/invitations/invitations-handler.test.ts +7 -14
- package/src/packlets/invitations/invitations-handler.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.test.ts +3 -4
- package/src/packlets/logging/logging.test.ts +2 -1
- package/src/packlets/network/network-service.test.ts +3 -2
- package/src/packlets/services/automerge-host.test.ts +60 -0
- package/src/packlets/services/service-context.test.ts +1 -3
- package/src/packlets/services/service-context.ts +28 -64
- package/src/packlets/services/service-host.test.ts +12 -8
- package/src/packlets/services/service-host.ts +6 -8
- package/src/packlets/services/service-registry.test.ts +2 -1
- package/src/packlets/spaces/data-space-manager.test.ts +2 -2
- package/src/packlets/spaces/data-space-manager.ts +2 -9
- package/src/packlets/spaces/data-space.ts +6 -30
- package/src/packlets/spaces/edge-feed-replicator.ts +22 -80
- package/src/packlets/spaces/epoch-migrations.ts +2 -2
- package/src/packlets/spaces/notarization-plugin.test.ts +7 -10
- package/src/packlets/spaces/notarization-plugin.ts +29 -169
- package/src/packlets/spaces/spaces-service.test.ts +9 -5
- package/src/packlets/storage/storage.ts +1 -0
- package/src/packlets/system/system-service.test.ts +2 -1
- package/src/packlets/testing/test-builder.ts +3 -2
- package/src/packlets/worker/worker-runtime.ts +2 -2
- package/src/version.ts +5 -1
- package/dist/lib/browser/chunk-67FEJJ6J.mjs.map +0 -7
- package/dist/lib/node/chunk-2KIDYJ7O.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-36ZRRDQI.mjs +0 -8154
- package/dist/lib/node-esm/chunk-36ZRRDQI.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -416
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -418
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/packlets/identity/authenticator.node.test.d.ts +0 -2
- package/dist/types/src/packlets/identity/authenticator.node.test.d.ts.map +0 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.test.d.ts +0 -2
- package/dist/types/src/packlets/spaces/edge-feed-replicator.test.d.ts.map +0 -1
- package/dist/types/src/testing/setup.d.ts +0 -3
- package/dist/types/src/testing/setup.d.ts.map +0 -1
- package/src/packlets/spaces/edge-feed-replicator.test.ts +0 -251
- package/src/testing/setup.ts +0 -11
|
@@ -32,7 +32,7 @@ __export(testing_exports, {
|
|
|
32
32
|
sanitizeInvitation: () => sanitizeInvitation
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(testing_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_H6C4XY6B = require("../chunk-H6C4XY6B.cjs");
|
|
36
36
|
var import_credentials = require("@dxos/credentials");
|
|
37
37
|
var import_keys = require("@dxos/keys");
|
|
38
38
|
var import_async = require("@dxos/async");
|
|
@@ -42,6 +42,7 @@ var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
|
42
42
|
var import_context = require("@dxos/context");
|
|
43
43
|
var import_credentials2 = require("@dxos/credentials");
|
|
44
44
|
var import_debug = require("@dxos/debug");
|
|
45
|
+
var import_echo_db = require("@dxos/echo-db");
|
|
45
46
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
46
47
|
var import_feed_store = require("@dxos/feed-store");
|
|
47
48
|
var import_keyring = require("@dxos/keyring");
|
|
@@ -228,7 +229,7 @@ var createInvitation = async (host, options) => {
|
|
|
228
229
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
229
230
|
...options ?? {}
|
|
230
231
|
};
|
|
231
|
-
if (host instanceof
|
|
232
|
+
if (host instanceof import_chunk_H6C4XY6B.ServiceContext) {
|
|
232
233
|
return host.invitationsManager.createInvitation({
|
|
233
234
|
kind: import_services.Invitation.Kind.SPACE,
|
|
234
235
|
...options
|
|
@@ -238,7 +239,7 @@ var createInvitation = async (host, options) => {
|
|
|
238
239
|
};
|
|
239
240
|
var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
240
241
|
invitation = sanitizeInvitation(invitation);
|
|
241
|
-
if (guest instanceof
|
|
242
|
+
if (guest instanceof import_chunk_H6C4XY6B.ServiceContext) {
|
|
242
243
|
return guest.invitationsManager.acceptInvitation({
|
|
243
244
|
invitation,
|
|
244
245
|
deviceProfile: guestDeviceProfile
|
|
@@ -248,7 +249,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
|
|
|
248
249
|
};
|
|
249
250
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
|
|
250
251
|
var createServiceHost = (config, signalManagerContext) => {
|
|
251
|
-
return new
|
|
252
|
+
return new import_chunk_H6C4XY6B.ClientServicesHost({
|
|
252
253
|
config,
|
|
253
254
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
254
255
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -267,7 +268,7 @@ var createServiceContext = async ({ signalManagerFactory = async () => {
|
|
|
267
268
|
});
|
|
268
269
|
const level = (0, import_testing.createTestLevel)();
|
|
269
270
|
await level.open();
|
|
270
|
-
return new
|
|
271
|
+
return new import_chunk_H6C4XY6B.ServiceContext(storage, level, networkManager, signalManager, void 0, {
|
|
271
272
|
invitationConnectionDefaultParams: {
|
|
272
273
|
controlHeartbeatInterval: 200
|
|
273
274
|
},
|
|
@@ -285,7 +286,7 @@ var createPeers = async (numPeers, signalManagerFactory) => {
|
|
|
285
286
|
});
|
|
286
287
|
await peer.open(new import_context.Context(void 0, {
|
|
287
288
|
F: __dxlog_file2,
|
|
288
|
-
L:
|
|
289
|
+
L: 71
|
|
289
290
|
}));
|
|
290
291
|
return peer;
|
|
291
292
|
}));
|
|
@@ -299,7 +300,7 @@ var TestBuilder = class {
|
|
|
299
300
|
this.signalContext = new import_messaging.MemorySignalManagerContext();
|
|
300
301
|
this._ctx = new import_context.Context(void 0, {
|
|
301
302
|
F: __dxlog_file2,
|
|
302
|
-
L:
|
|
303
|
+
L: 84
|
|
303
304
|
});
|
|
304
305
|
}
|
|
305
306
|
createPeer(peerOptions) {
|
|
@@ -368,7 +369,7 @@ var TestPeer = class {
|
|
|
368
369
|
return this._props.signingContext ?? (0, import_debug.failUndefined)();
|
|
369
370
|
}
|
|
370
371
|
get echoHost() {
|
|
371
|
-
return this._props.echoHost ??= new
|
|
372
|
+
return this._props.echoHost ??= new import_echo_db.EchoHost({
|
|
372
373
|
kv: this.level
|
|
373
374
|
});
|
|
374
375
|
}
|
|
@@ -376,7 +377,7 @@ var TestPeer = class {
|
|
|
376
377
|
return this._props.meshEchoReplicator ??= new import_echo_pipeline.MeshEchoReplicator();
|
|
377
378
|
}
|
|
378
379
|
get dataSpaceManager() {
|
|
379
|
-
return this._props.dataSpaceManager ??= new
|
|
380
|
+
return this._props.dataSpaceManager ??= new import_chunk_H6C4XY6B.DataSpaceManager({
|
|
380
381
|
spaceManager: this.spaceManager,
|
|
381
382
|
metadataStore: this.metadataStore,
|
|
382
383
|
keyring: this.keyring,
|
|
@@ -391,9 +392,9 @@ var TestPeer = class {
|
|
|
391
392
|
});
|
|
392
393
|
}
|
|
393
394
|
get invitationsManager() {
|
|
394
|
-
return this._props.invitationsManager ??= new
|
|
395
|
+
return this._props.invitationsManager ??= new import_chunk_H6C4XY6B.InvitationsManager(new import_chunk_H6C4XY6B.InvitationsHandler(this.networkManager), (invitation) => {
|
|
395
396
|
if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
|
|
396
|
-
return new
|
|
397
|
+
return new import_chunk_H6C4XY6B.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
|
|
397
398
|
} else {
|
|
398
399
|
throw new Error("not implemented");
|
|
399
400
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/packlets/testing/credential-utils.ts", "../../../../src/packlets/testing/invitation-utils.ts", "../../../../src/packlets/testing/test-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { InvitationEncoder, type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\n// TODO(burdon): Make async.\n// TODO(burdon): Rename startInvitation.\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nexport const createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nexport const acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost, MetadataStore, SpaceManager, valueEncoding, MeshEchoReplicator } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext, type SignalManager } from '@dxos/messaging';\nimport { MemoryTransportFactory, SwarmNetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext, type ServiceContextRuntimeParams } from '../services';\nimport { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalManagerFactory = async () => {\n const signalContext = new MemorySignalManagerContext();\n return new MemorySignalManager(signalContext);\n },\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalManagerFactory?: () => Promise<SignalManager>;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = await signalManagerFactory();\n const networkManager = new SwarmNetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager, undefined, undefined, {\n invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number, signalManagerFactory?: () => Promise<SignalManager>) => {\n if (!signalManagerFactory) {\n const signalContext = new MemorySignalManagerContext();\n signalManagerFactory = async () => new MemorySignalManager(signalContext);\n }\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalManagerFactory });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n dataSpaceParams?: DataSpaceManagerRuntimeParams;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: SwarmNetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\n meshEchoReplicator?: MeshEchoReplicator;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly _signalContext: MemorySignalManagerContext,\n private readonly _opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this._opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new SwarmNetworkManager({\n signalManager: new MemorySignalManager(this._signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get echoHost() {\n return (this._props.echoHost ??= new EchoHost({ kv: this.level }));\n }\n\n get meshEchoReplicator() {\n return (this._props.meshEchoReplicator ??= new MeshEchoReplicator());\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager({\n spaceManager: this.spaceManager,\n metadataStore: this.metadataStore,\n keyring: this.keyring,\n signingContext: this.identity,\n feedStore: this.feedStore,\n echoHost: this.echoHost,\n invitationsManager: this.invitationsManager,\n edgeConnection: undefined,\n meshReplicator: this.meshEchoReplicator,\n echoEdgeReplicator: undefined,\n runtimeParams: this._opts.dataSpaceParams,\n }));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAiC;AAEjC,kBAA0B;ACF1B,mBAAwB;AACxB,6BAA6F;AAC7F,uBAA0B;AAC1B,sBAA2B;ACF3B,qBAAwB;AACxB,IAAAA,sBAAqE;AACrE,mBAA8B;AAC9B,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createCredential } from '@dxos/credentials';\nimport { type Signer } from '@dxos/crypto';\nimport { PublicKey } from '@dxos/keys';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nexport const createMockCredential = async ({\n signer,\n issuer,\n}: {\n signer: Signer;\n issuer: PublicKey;\n}): Promise<Credential> =>\n createCredential({\n signer,\n issuer,\n subject: new PublicKey(Buffer.from('test')),\n assertion: {\n '@type': 'example.testing.rpc.MessageWithAny',\n payload: {\n '@type': 'google.protobuf.Any',\n value: Buffer.from('test'),\n },\n },\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Trigger } from '@dxos/async';\nimport { InvitationEncoder, type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { type DeviceProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { ServiceContext } from '../services';\n\n/**\n * Strip secrets from invitation before giving it to the peer.\n */\nexport const sanitizeInvitation = (invitation: Invitation): Invitation => {\n return InvitationEncoder.decode(InvitationEncoder.encode(invitation));\n};\n\nexport type InvitationHost = {\n share(options?: Partial<Invitation>): CancellableInvitation;\n};\n\nexport type InvitationGuest = {\n join(invitation: Invitation | string, deviceProfile?: DeviceProfileDocument): AuthenticatingInvitation;\n};\n\nexport type PerformInvitationCallbacks<T> = {\n onConnecting?: (value: T) => boolean | void;\n onConnected?: (value: T) => boolean | void;\n onReady?: (value: T) => boolean | void;\n onAuthenticating?: (value: T) => boolean | void;\n onSuccess?: (value: T) => boolean | void;\n onCancelled?: (value: T) => boolean | void;\n onTimeout?: (value: T) => boolean | void;\n onError?: (value: T) => boolean | void;\n};\n\nexport type PerformInvitationParams = {\n host: ServiceContext | InvitationHost;\n guest: ServiceContext | InvitationGuest;\n options?: Partial<Invitation>;\n hooks?: {\n host?: PerformInvitationCallbacks<CancellableInvitation>;\n guest?: PerformInvitationCallbacks<AuthenticatingInvitation>;\n };\n guestDeviceProfile?: DeviceProfileDocument;\n codeInputDelay?: number;\n};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\n// TODO(burdon): Make async.\n// TODO(burdon): Rename startInvitation.\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n codeInputDelay,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n let guestError = false;\n let guestConnected = false;\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n void createInvitation(host, options).then((hostObservable) => {\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (guestConnected) {\n break;\n }\n guestConnected = true;\n if (hooks?.host?.onConnecting?.(hostObservable)) {\n break;\n }\n const guestObservable = acceptInvitation(guest, hostInvitation, guestDeviceProfile);\n guestObservable.subscribe(\n async (guestInvitation: Invitation) => {\n switch (guestInvitation.state) {\n case Invitation.State.CONNECTING: {\n if (hooks?.guest?.onConnecting?.(guestObservable)) {\n break;\n }\n invariant(hostInvitation.swarmKey!.equals(guestInvitation.swarmKey!));\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.guest?.onConnected?.(guestObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.guest?.onReady?.(guestObservable)) {\n break;\n }\n const code = await authCode.wait();\n if (codeInputDelay == null) {\n await guestObservable.authenticate(code);\n } else {\n setTimeout(async () => {\n if (!guestError) {\n await guestObservable.authenticate(code);\n }\n }, codeInputDelay);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.guest?.onAuthenticating?.(guestObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.guest?.onSuccess?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.guest?.onCancelled?.(guestObservable)) {\n break;\n }\n guestComplete.wake({ invitation: guestInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.guest?.onTimeout?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ invitation: guestInvitation });\n }\n }\n },\n (error: Error) => {\n guestError = true;\n if (hooks?.guest?.onError?.(guestObservable)) {\n return;\n }\n guestComplete.wake({ error });\n },\n );\n break;\n }\n\n case Invitation.State.CONNECTED: {\n hooks?.host?.onConnected?.(hostObservable);\n break;\n }\n\n case Invitation.State.READY_FOR_AUTHENTICATION: {\n if (hooks?.host?.onReady?.(hostObservable)) {\n break;\n }\n if (hostInvitation.authCode) {\n authCode.wake(hostInvitation.authCode);\n }\n break;\n }\n\n case Invitation.State.AUTHENTICATING: {\n hooks?.host?.onAuthenticating?.(hostObservable);\n break;\n }\n\n case Invitation.State.SUCCESS: {\n if (hooks?.host?.onSuccess?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.CANCELLED: {\n if (hooks?.host?.onCancelled?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n\n case Invitation.State.TIMEOUT: {\n if (hooks?.host?.onTimeout?.(hostObservable)) {\n break;\n }\n hostComplete.wake({ invitation: hostInvitation });\n break;\n }\n }\n },\n (error: Error) => {\n if (hooks?.host?.onError?.(hostObservable)) {\n return;\n }\n hostComplete.wake({ error });\n },\n );\n });\n\n return [hostComplete.wait(), guestComplete.wait()];\n};\n\nexport const createInvitation = async (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): Promise<CancellableInvitation> => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n return host.invitationsManager.createInvitation({\n kind: Invitation.Kind.SPACE,\n ...options,\n });\n }\n\n return host.share(options);\n};\n\nexport const acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n return guest.invitationsManager.acceptInvitation({\n invitation,\n deviceProfile: guestDeviceProfile,\n });\n }\n\n return guest.join(invitation, guestDeviceProfile);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Config } from '@dxos/config';\nimport { Context } from '@dxos/context';\nimport { createCredentialSignerWithChain, CredentialGenerator } from '@dxos/credentials';\nimport { failUndefined } from '@dxos/debug';\nimport { EchoHost } from '@dxos/echo-db';\nimport { MetadataStore, SpaceManager, valueEncoding, MeshEchoReplicator } from '@dxos/echo-pipeline';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { type LevelDB } from '@dxos/kv-store';\nimport { createTestLevel } from '@dxos/kv-store/testing';\nimport { MemorySignalManager, MemorySignalManagerContext, type SignalManager } from '@dxos/messaging';\nimport { MemoryTransportFactory, SwarmNetworkManager } from '@dxos/network-manager';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { createStorage, StorageType, type Storage } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { InvitationsHandler, InvitationsManager, SpaceInvitationProtocol } from '../invitations';\nimport { ClientServicesHost, ServiceContext, type ServiceContextRuntimeParams } from '../services';\nimport { DataSpaceManager, type DataSpaceManagerRuntimeParams, type SigningContext } from '../spaces';\n\n//\n// TODO(burdon): Replace with test builder.\n//\n\nexport const createServiceHost = (config: Config, signalManagerContext: MemorySignalManagerContext) => {\n return new ClientServicesHost({\n config,\n signalManager: new MemorySignalManager(signalManagerContext),\n transportFactory: MemoryTransportFactory,\n });\n};\n\nexport const createServiceContext = async ({\n signalManagerFactory = async () => {\n const signalContext = new MemorySignalManagerContext();\n return new MemorySignalManager(signalContext);\n },\n storage = createStorage({ type: StorageType.RAM }),\n runtimeParams,\n}: {\n signalManagerFactory?: () => Promise<SignalManager>;\n storage?: Storage;\n runtimeParams?: ServiceContextRuntimeParams;\n} = {}) => {\n const signalManager = await signalManagerFactory();\n const networkManager = new SwarmNetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n const level = createTestLevel();\n await level.open();\n\n return new ServiceContext(storage, level, networkManager, signalManager, undefined, {\n invitationConnectionDefaultParams: { controlHeartbeatInterval: 200 },\n ...runtimeParams,\n });\n};\n\nexport const createPeers = async (numPeers: number, signalManagerFactory?: () => Promise<SignalManager>) => {\n if (!signalManagerFactory) {\n const signalContext = new MemorySignalManagerContext();\n signalManagerFactory = async () => new MemorySignalManager(signalContext);\n }\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = await createServiceContext({ signalManagerFactory });\n await peer.open(new Context());\n return peer;\n }),\n );\n};\n\nexport const createIdentity = async (peer: ServiceContext) => {\n await peer.createIdentity();\n return peer;\n};\n\nexport class TestBuilder {\n public readonly signalContext = new MemorySignalManagerContext();\n private readonly _ctx = new Context();\n\n createPeer(peerOptions?: TestPeerOpts): TestPeer {\n const peer = new TestPeer(this.signalContext, peerOptions);\n this._ctx.onDispose(async () => peer.destroy());\n return peer;\n }\n\n async destroy() {\n await this._ctx.dispose();\n }\n}\n\nexport type TestPeerOpts = {\n dataStore?: StorageType;\n dataSpaceParams?: DataSpaceManagerRuntimeParams;\n};\n\nexport type TestPeerProps = {\n storage?: Storage;\n level?: LevelDB;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: SwarmNetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n echoHost?: EchoHost;\n meshEchoReplicator?: MeshEchoReplicator;\n invitationsManager?: InvitationsManager;\n};\n\nexport class TestPeer {\n private _props: TestPeerProps = {};\n\n constructor(\n private readonly _signalContext: MemorySignalManagerContext,\n private readonly _opts: TestPeerOpts = { dataStore: StorageType.RAM },\n ) {}\n\n get props() {\n return this._props;\n }\n\n get storage() {\n return (this._props.storage ??= createStorage({ type: this._opts.dataStore }));\n }\n\n get keyring() {\n return (this._props.keyring ??= new Keyring(this.storage.createDirectory('keyring')));\n }\n\n get level() {\n return (this._props.level ??= createTestLevel());\n }\n\n get feedStore() {\n return (this._props.feedStore ??= new FeedStore({\n factory: new FeedFactory({\n root: this.storage.createDirectory('feeds'),\n signer: this.keyring,\n hypercore: {\n valueEncoding,\n },\n }),\n }));\n }\n\n get metadataStore() {\n return (this._props.metadataStore ??= new MetadataStore(this.storage.createDirectory('metadata')));\n }\n\n get blobStore() {\n return (this._props.blobStore ??= new BlobStore(this.storage.createDirectory('blobs')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new SwarmNetworkManager({\n signalManager: new MemorySignalManager(this._signalContext),\n transportFactory: MemoryTransportFactory,\n }));\n }\n\n get spaceManager() {\n return (this._props.spaceManager ??= new SpaceManager({\n feedStore: this.feedStore,\n networkManager: this.networkManager,\n metadataStore: this.metadataStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get echoHost() {\n return (this._props.echoHost ??= new EchoHost({ kv: this.level }));\n }\n\n get meshEchoReplicator() {\n return (this._props.meshEchoReplicator ??= new MeshEchoReplicator());\n }\n\n get dataSpaceManager(): DataSpaceManager {\n return (this._props.dataSpaceManager ??= new DataSpaceManager({\n spaceManager: this.spaceManager,\n metadataStore: this.metadataStore,\n keyring: this.keyring,\n signingContext: this.identity,\n feedStore: this.feedStore,\n echoHost: this.echoHost,\n invitationsManager: this.invitationsManager,\n edgeConnection: undefined,\n meshReplicator: this.meshEchoReplicator,\n echoEdgeReplicator: undefined,\n runtimeParams: this._opts.dataSpaceParams,\n }));\n }\n\n get invitationsManager() {\n return (this._props.invitationsManager ??= new InvitationsManager(\n new InvitationsHandler(this.networkManager),\n (invitation) => {\n if (invitation.kind === Invitation.Kind.SPACE) {\n return new SpaceInvitationProtocol(this.dataSpaceManager, this.identity!, this.keyring, invitation.spaceKey!);\n } else {\n throw new Error('not implemented');\n }\n },\n this.metadataStore,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\n await this.level.close();\n await this.storage.reset();\n }\n}\n\nexport const createSigningContext = async (keyring: Keyring): Promise<SigningContext> => {\n const identityKey = await keyring.createKey();\n const deviceKey = await keyring.createKey();\n\n return {\n identityKey,\n deviceKey,\n credentialSigner: createCredentialSignerWithChain(\n keyring,\n {\n credential: await new CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey),\n },\n deviceKey,\n ),\n recordCredential: async () => {}, // No-op.\n getProfile: () => undefined,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAiC;AAEjC,kBAA0B;ACF1B,mBAAwB;AACxB,6BAA6F;AAC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SAAS,KAAKA;MACdiB,gBAAgB,KAAKD;MACrBb,WAAW,KAAKA;MAChBgB,UAAU,KAAKA;MACf3E,oBAAoB,KAAKA;MACzBkF,gBAAgBpD;MAChBqD,gBAAgB,KAAKL;MACrBM,oBAAoBtD;MACpBN,eAAe,KAAK4B,MAAMiC;IAC5B,CAAA;EACF;EAEA,IAAIrF,qBAAqB;AACvB,WAAQ,KAAKsD,OAAOtD,uBAAuB,IAAIsF,yCAC7C,IAAIC,yCAAmB,KAAK9D,cAAc,GAC1C,CAACjF,eAAAA;AACC,UAAIA,WAAWyD,SAASlC,iBAAAA,WAAWmC,KAAKC,OAAO;AAC7C,eAAO,IAAIqF,8CAAwB,KAAKR,kBAAkB,KAAKR,UAAW,KAAKhB,SAAShH,WAAWiJ,QAAQ;MAC7G,OAAO;AACL,cAAM,IAAIC,MAAM,iBAAA;MAClB;IACF,GACA,KAAKxB,aAAa;EAEtB;EAEA,MAAMzB,iBAAiB;AACrB,SAAKa,OAAOmB,mBAAmB,MAAMkB,qBAAqB,KAAKnC,OAAO;EACxE;EAEA,MAAMR,UAAU;AACd,UAAM,KAAKrB,MAAMiE,MAAK;AACtB,UAAM,KAAKzE,QAAQ0E,MAAK;EAC1B;AACF;AAEO,IAAMF,uBAAuB,OAAOnC,YAAAA;AACzC,QAAMsC,cAAc,MAAMtC,QAAQuC,UAAS;AAC3C,QAAMC,YAAY,MAAMxC,QAAQuC,UAAS;AAEzC,SAAO;IACLD;IACAE;IACAC,sBAAkBC,qDAChB1C,SACA;MACE2C,YAAY,MAAM,IAAIC,wCAAoB5C,SAASsC,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMzE;EACpB;AACF;",
|
|
6
6
|
"names": ["import_credentials", "import_services", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "codeInputDelay", "guestError", "guestConnected", "hostComplete", "Trigger", "guestComplete", "authCode", "createInvitation", "then", "hostObservable", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "code", "wait", "authenticate", "setTimeout", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "invitationsManager", "kind", "Kind", "SPACE", "share", "deviceProfile", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalManagerFactory", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "runtimeParams", "networkManager", "SwarmNetworkManager", "level", "createTestLevel", "open", "undefined", "invitationConnectionDefaultParams", "controlHeartbeatInterval", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "Context", "createIdentity", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "_signalContext", "_opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "echoHost", "EchoHost", "kv", "meshEchoReplicator", "MeshEchoReplicator", "dataSpaceManager", "DataSpaceManager", "edgeConnection", "meshReplicator", "echoEdgeReplicator", "dataSpaceParams", "InvitationsManager", "InvitationsHandler", "SpaceInvitationProtocol", "spaceKey", "Error", "createSigningContext", "close", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics-broadcast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagnostics-broadcast.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/diagnostics/diagnostics-broadcast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACxC,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,uCAAuC,QAAO,iCAE1D,CAAC;AAEF,eAAO,MAAM,wCAAwC,MAAO,aAAa,KAAG,kCAK3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/authenticator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,eAAO,MAAM,kBAAkB,WACpB,gBAAgB,KAAG,YAW3B,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAE5C,mBAAmB,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,qBAAa,yBAAyB;IAGxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,IAAI,CAAiB;gBAEA,OAAO,EAAE,+BAA+B;IAE/D,KAAK;IAIX,IAAI,QAAQ,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/authenticator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,eAAO,MAAM,kBAAkB,WACpB,gBAAgB,KAAG,YAW3B,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAE5C,mBAAmB,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,qBAAa,yBAAyB;IAGxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,IAAI,CAAiB;gBAEA,OAAO,EAAE,+BAA+B;IAE/D,KAAK;IAIX,IAAI,QAAQ,IAAI,YAAY,CA2C3B;IAED,OAAO,CAAC,aAAa;CAItB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticator.test.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/authenticator.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf';
|
|
2
|
-
import {
|
|
2
|
+
import type { SpaceManager } from '@dxos/echo-pipeline';
|
|
3
3
|
import { type ContactBook, type ContactsService } from '@dxos/protocols/proto/dxos/client/services';
|
|
4
4
|
import { type IdentityManager } from './identity-manager';
|
|
5
5
|
import { type DataSpaceManager } from '../spaces';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/contacts-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"contacts-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/contacts-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAGlH,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,qBAAa,mBAAoB,YAAW,eAAe;IAEvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAFzB,gBAAgB,EAAE,eAAe,EACjC,aAAa,EAAE,YAAY,EAC3B,yBAAyB,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC;IAGvE,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IA8BzC,aAAa,IAAI,MAAM,CAAC,WAAW,CAAC;CAgCrC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
2
|
import { Context } from '@dxos/context';
|
|
3
3
|
import { type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
4
|
-
import { type EdgeConnection } from '@dxos/edge-client';
|
|
5
4
|
import { type FeedStore } from '@dxos/feed-store';
|
|
6
5
|
import { type Keyring } from '@dxos/keyring';
|
|
7
6
|
import { PublicKey } from '@dxos/keys';
|
|
8
7
|
import { Device } from '@dxos/protocols/proto/dxos/client/services';
|
|
9
|
-
import { type Runtime } from '@dxos/protocols/proto/dxos/config';
|
|
10
8
|
import { type FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
11
9
|
import { type DeviceProfileDocument, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
12
10
|
import { Timeframe } from '@dxos/timeframe';
|
|
@@ -29,33 +27,23 @@ export type CreateIdentityOptions = {
|
|
|
29
27
|
displayName?: string;
|
|
30
28
|
deviceProfile?: DeviceProfileDocument;
|
|
31
29
|
};
|
|
32
|
-
export type
|
|
33
|
-
onIdentityConstruction?: (identity: Identity) => void;
|
|
34
|
-
};
|
|
35
|
-
export type IdentityManagerParams = {
|
|
36
|
-
metadataStore: MetadataStore;
|
|
37
|
-
keyring: Keyring;
|
|
38
|
-
feedStore: FeedStore<FeedMessage>;
|
|
39
|
-
spaceManager: SpaceManager;
|
|
40
|
-
edgeConnection?: EdgeConnection;
|
|
41
|
-
edgeFeatures?: Runtime.Client.EdgeFeatures;
|
|
30
|
+
export type IdentityManagerRuntimeParams = {
|
|
42
31
|
devicePresenceAnnounceInterval?: number;
|
|
43
32
|
devicePresenceOfflineTimeout?: number;
|
|
44
|
-
callbacks?: IdentityManagerCallbacks;
|
|
45
33
|
};
|
|
46
34
|
export declare class IdentityManager {
|
|
47
|
-
readonly stateUpdate: Event<void>;
|
|
48
35
|
private readonly _metadataStore;
|
|
49
36
|
private readonly _keyring;
|
|
50
37
|
private readonly _feedStore;
|
|
51
38
|
private readonly _spaceManager;
|
|
39
|
+
private readonly _callbacks?;
|
|
40
|
+
readonly stateUpdate: Event<void>;
|
|
41
|
+
private _identity?;
|
|
52
42
|
private readonly _devicePresenceAnnounceInterval;
|
|
53
43
|
private readonly _devicePresenceOfflineTimeout;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
private _identity?;
|
|
58
|
-
constructor(params: IdentityManagerParams);
|
|
44
|
+
constructor(_metadataStore: MetadataStore, _keyring: Keyring, _feedStore: FeedStore<FeedMessage>, _spaceManager: SpaceManager, params?: IdentityManagerRuntimeParams, _callbacks?: {
|
|
45
|
+
onIdentityConstruction?: (identity: Identity) => void;
|
|
46
|
+
} | undefined);
|
|
59
47
|
get identity(): Identity | undefined;
|
|
60
48
|
open(ctx: Context): Promise<void>;
|
|
61
49
|
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,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,KAAK,
|
|
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,MAAM,qBAAqB,CAAC;AAChG,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;AAGvC,OAAO,EAAE,MAAM,EAAc,MAAM,4CAA4C,CAA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AO,EACjB,UAAU,EAAE,SAAS,CAAC,WAAW,CAAC,EAClC,aAAa,EAAE,YAAY,EAC5C,MAAM,CAAC,EAAE,4BAA4B,EACpB,UAAU,CAAC,EAAE;QAC5B,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;KACvD,YAAA;IAUH,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;YA0B5D,kBAAkB;YA0DlB,eAAe;CAqB9B"}
|
|
@@ -3,9 +3,7 @@ import { type Context } from '@dxos/context';
|
|
|
3
3
|
import { type CredentialSigner } from '@dxos/credentials';
|
|
4
4
|
import { type Signer } from '@dxos/crypto';
|
|
5
5
|
import { type Space } from '@dxos/echo-pipeline';
|
|
6
|
-
import { type EdgeConnection } from '@dxos/edge-client';
|
|
7
6
|
import { PublicKey, type SpaceId } from '@dxos/keys';
|
|
8
|
-
import { type Runtime } from '@dxos/protocols/proto/dxos/config';
|
|
9
7
|
import { type DeviceProfileDocument, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
10
8
|
import { type DeviceAdmissionRequest } from '@dxos/protocols/proto/dxos/halo/invitations';
|
|
11
9
|
import { type Presence } from '@dxos/teleport-extension-gossip';
|
|
@@ -17,8 +15,6 @@ export type IdentityParams = {
|
|
|
17
15
|
signer: Signer;
|
|
18
16
|
space: Space;
|
|
19
17
|
presence?: Presence;
|
|
20
|
-
edgeConnection?: EdgeConnection;
|
|
21
|
-
edgeFeatures?: Runtime.Client.EdgeFeatures;
|
|
22
18
|
};
|
|
23
19
|
/**
|
|
24
20
|
* Agent identity manager, which includes the agent's Halo space.
|
|
@@ -30,12 +26,11 @@ export declare class Identity {
|
|
|
30
26
|
private readonly _deviceStateMachine;
|
|
31
27
|
private readonly _profileStateMachine;
|
|
32
28
|
private readonly _defaultSpaceStateMachine;
|
|
33
|
-
private readonly _edgeFeedReplicator?;
|
|
34
29
|
readonly authVerifier: TrustedKeySetAuthVerifier;
|
|
35
30
|
readonly identityKey: PublicKey;
|
|
36
31
|
readonly deviceKey: PublicKey;
|
|
37
32
|
readonly stateUpdate: Event<void>;
|
|
38
|
-
constructor(
|
|
33
|
+
constructor({ space, signer, identityKey, deviceKey, presence }: IdentityParams);
|
|
39
34
|
get authorizedDeviceKeys(): ComplexMap<PublicKey, DeviceProfileDocument>;
|
|
40
35
|
get defaultSpaceId(): SpaceId | undefined;
|
|
41
36
|
open(ctx: Context): Promise<void>;
|
|
@@ -50,7 +45,6 @@ export declare class Identity {
|
|
|
50
45
|
get haloGenesisFeedKey(): PublicKey;
|
|
51
46
|
get deviceCredentialChain(): import("@dxos/protocols/proto/dxos/halo/credentials").Chain | undefined;
|
|
52
47
|
get presence(): Presence | undefined;
|
|
53
|
-
get signer(): Signer;
|
|
54
48
|
/**
|
|
55
49
|
* Issues credentials as identity.
|
|
56
50
|
* Requires identity to be ready.
|
|
@@ -62,6 +56,5 @@ export declare class Identity {
|
|
|
62
56
|
getDeviceCredentialSigner(): CredentialSigner;
|
|
63
57
|
updateDefaultSpace(spaceId: SpaceId): Promise<void>;
|
|
64
58
|
admitDevice({ deviceKey, controlFeedKey, dataFeedKey }: DeviceAdmissionRequest): Promise<void>;
|
|
65
|
-
private _onFeedAdded;
|
|
66
59
|
}
|
|
67
60
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity.ts"],"names":[],"mapp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G;AACH,qBACa,QAAQ;IACnB,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAW;IACtC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA2B;IACrE,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,QAAQ,EAAE,EAAE,cAAc;IAgC/E,IAAI,oBAAoB,IAAI,UAAU,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAEvE;IAED,IAAI,cAAc,IAAI,OAAO,GAAG,SAAS,CAExC;IAGK,IAAI,CAAC,GAAG,EAAE,OAAO;IASjB,KAAK,CAAC,GAAG,EAAE,OAAO;IASlB,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,kBAAkB,CAAC,OAAO,EAAE,OAAO;IASnC,WAAW,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,sBAAsB;CA2CrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-host-extension.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-host-extension.ts"],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EjC,YAAY,CAAC,EAAE,eAAe,CAAa;IAE3C,oBAAoB,UAAS;IAEpC;;OAEG;IACI,mBAAmB,SAAK;IAE/B;;OAEG;IACI,gBAAgB,qBAA4B;IAEnD;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAA2B;gBAGnC,oBAAoB,EAAE,KAAK,EAC3B,UAAU,EAAE,gCAAgC;IAYxD,WAAW,IAAI,OAAO;cAIJ,WAAW,IAAI,OAAO,CAAC;QAAE,qBAAqB,EAAE,qBAAqB,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"invitation-host-extension.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitation-host-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAmB,OAAO,EAAgB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAqB,OAAO,EAAE,MAAM,eAAe,CAAC;AAG3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,EAE3B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOrE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,KAAK,gCAAgC,GAAG;IACtC,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAC;IAGpC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEhC,aAAa,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,KAAK,IAAI,CAAC;IAEpD,KAAK,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,YAAY,CACvD;IAAE,qBAAqB,EAAE,qBAAqB,CAAA;CAAE,EAChD;IAAE,qBAAqB,EAAE,qBAAqB,CAAA;CAAE,CACjD;IA8BG,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU;IA1B7B,OAAO,CAAC,cAAc,CAAC,CAAoB;IAC3C,OAAO,CAAC,qBAAqB,CAAiB;IAE9C,OAAO,CAAC,UAAU,CAAC,CAAqB;IAEjC,YAAY,CAAC,EAAE,eAAe,CAAa;IAE3C,oBAAoB,UAAS;IAEpC;;OAEG;IACI,mBAAmB,SAAK;IAE/B;;OAEG;IACI,gBAAgB,qBAA4B;IAEnD;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAA2B;gBAGnC,oBAAoB,EAAE,KAAK,EAC3B,UAAU,EAAE,gCAAgC;IAYxD,WAAW,IAAI,OAAO;cAIJ,WAAW,IAAI,OAAO,CAAC;QAAE,qBAAqB,EAAE,qBAAqB,CAAA;KAAE,CAAC;IA0IlF,MAAM,CAAC,OAAO,EAAE,gBAAgB;IAkC/C,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,sBAAsB;IAWf,OAAO;IAIP,OAAO;YAIR,QAAQ;CAQvB;AAED,eAAO,MAAM,wBAAwB,eAAgB,UAAU,YACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automerge-host.test.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/automerge-host.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Trigger } from '@dxos/async';
|
|
2
2
|
import { Context, Resource } from '@dxos/context';
|
|
3
|
-
import { EchoHost
|
|
4
|
-
import
|
|
3
|
+
import { EchoHost } from '@dxos/echo-db';
|
|
4
|
+
import { MetadataStore, SpaceManager } from '@dxos/echo-pipeline';
|
|
5
|
+
import type { EdgeConnection } from '@dxos/edge-client';
|
|
5
6
|
import { FeedStore } from '@dxos/feed-store';
|
|
6
7
|
import { Keyring } from '@dxos/keyring';
|
|
7
8
|
import { type LevelDB } from '@dxos/kv-store';
|
|
@@ -14,10 +15,10 @@ import { type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credential
|
|
|
14
15
|
import { type Storage } from '@dxos/random-access-storage';
|
|
15
16
|
import type { TeleportParams } from '@dxos/teleport';
|
|
16
17
|
import { BlobStore } from '@dxos/teleport-extension-object-sync';
|
|
17
|
-
import { IdentityManager, type CreateIdentityOptions, type
|
|
18
|
+
import { IdentityManager, type CreateIdentityOptions, type IdentityManagerRuntimeParams } from '../identity';
|
|
18
19
|
import { InvitationsHandler, InvitationsManager, type InvitationProtocol } from '../invitations';
|
|
19
20
|
import { DataSpaceManager, type DataSpaceManagerRuntimeParams } from '../spaces';
|
|
20
|
-
export type ServiceContextRuntimeParams =
|
|
21
|
+
export type ServiceContextRuntimeParams = IdentityManagerRuntimeParams & DataSpaceManagerRuntimeParams & {
|
|
21
22
|
invitationConnectionDefaultParams?: Partial<TeleportParams>;
|
|
22
23
|
disableP2pReplication?: boolean;
|
|
23
24
|
};
|
|
@@ -30,10 +31,8 @@ export declare class ServiceContext extends Resource {
|
|
|
30
31
|
readonly networkManager: SwarmNetworkManager;
|
|
31
32
|
readonly signalManager: SignalManager;
|
|
32
33
|
private readonly _edgeConnection;
|
|
33
|
-
private readonly _edgeHttpClient;
|
|
34
34
|
readonly _runtimeParams?: ServiceContextRuntimeParams | undefined;
|
|
35
35
|
private readonly _edgeFeatures?;
|
|
36
|
-
private readonly _edgeIdentityUpdateMutex;
|
|
37
36
|
readonly initialized: Trigger<void>;
|
|
38
37
|
readonly metadataStore: MetadataStore;
|
|
39
38
|
readonly blobStore: BlobStore;
|
|
@@ -50,7 +49,7 @@ export declare class ServiceContext extends Resource {
|
|
|
50
49
|
private readonly _handlerFactories;
|
|
51
50
|
private _deviceSpaceSync?;
|
|
52
51
|
private readonly _instanceId;
|
|
53
|
-
constructor(storage: Storage, level: LevelDB, networkManager: SwarmNetworkManager, signalManager: SignalManager, _edgeConnection: EdgeConnection | undefined,
|
|
52
|
+
constructor(storage: Storage, level: LevelDB, networkManager: SwarmNetworkManager, signalManager: SignalManager, _edgeConnection: EdgeConnection | undefined, _runtimeParams?: ServiceContextRuntimeParams | undefined, _edgeFeatures?: Runtime.Client.EdgeFeatures | undefined);
|
|
54
53
|
protected _open(ctx: Context): Promise<void>;
|
|
55
54
|
protected _close(ctx: Context): Promise<void>;
|
|
56
55
|
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,
|
|
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,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAsB,aAAa,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AACrG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM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CAAC,eAAe,CAAC,CAA6B;IAErD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;IAC7D,OAAO,CAAC,2BAA2B,CAAqC;IAGxE,OAAO,CAAC,QAAQ,CAAS;IAGzB,OAAO,CAAC,KAAK,CAAS;gBAEV,EACV,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,KAAK,EAEL,OAAO,EACP,SAAS,EACT,aAAa,GACd,GAAE,wBAA6B;IAuDhC,IAAI,MAAM,YAET;IAED,IAAI,MAAM,uBAET;IAED,IAAI,OAAO,mBAEV;IAED,IAAI,eAAe,oCAElB;IAED,IAAI,WAAW,kFAEd;IAED,IAAI,QAAQ,4BAEX;IAED;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB;IAqD9C,IAAI,CAAC,GAAG,EAAE,OAAO;IA4GjB,KAAK;IAkBL,KAAK;YAYG,eAAe;CAK9B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
2
|
import { Resource } from '@dxos/context';
|
|
3
3
|
import { type CredentialSigner } from '@dxos/credentials';
|
|
4
|
-
import { type EchoEdgeReplicator, type EchoHost
|
|
5
|
-
import type
|
|
4
|
+
import { type EchoEdgeReplicator, type EchoHost } from '@dxos/echo-db';
|
|
5
|
+
import { type MeshEchoReplicator, type MetadataStore, type SpaceManager } from '@dxos/echo-pipeline';
|
|
6
|
+
import type { EdgeConnection } from '@dxos/edge-client';
|
|
6
7
|
import { type FeedStore } from '@dxos/feed-store';
|
|
7
8
|
import { type Keyring } from '@dxos/keyring';
|
|
8
9
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -50,7 +51,6 @@ export type DataSpaceManagerParams = {
|
|
|
50
51
|
echoHost: EchoHost;
|
|
51
52
|
invitationsManager: InvitationsManager;
|
|
52
53
|
edgeConnection?: EdgeConnection;
|
|
53
|
-
edgeHttpClient?: EdgeHttpClient;
|
|
54
54
|
meshReplicator?: MeshEchoReplicator;
|
|
55
55
|
echoEdgeReplicator?: EchoEdgeReplicator;
|
|
56
56
|
runtimeParams?: DataSpaceManagerRuntimeParams;
|
|
@@ -73,7 +73,6 @@ export declare class DataSpaceManager extends Resource {
|
|
|
73
73
|
private readonly _echoHost;
|
|
74
74
|
private readonly _invitationsManager;
|
|
75
75
|
private readonly _edgeConnection?;
|
|
76
|
-
private readonly _edgeHttpClient?;
|
|
77
76
|
private readonly _edgeFeatures?;
|
|
78
77
|
private readonly _meshReplicator?;
|
|
79
78
|
private readonly _echoEdgeReplicator?;
|
|
@@ -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;AAI9D,OAAO,EAAkB,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAC5E,OAAO,EAGL,KAAK,gBAAgB,EAGtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
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;AAI9D,OAAO,EAAkB,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAC5E,OAAO,EAGL,KAAK,gBAAgB,EAGtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAmD,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAElB,KAAK,YAAY,EAGlB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAiB,KAAK,SAAS,EAA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AC,CAA0C;IACzE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAiC;IAClE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAiC;IACtE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAA4C;gBAEhE,MAAM,EAAE,sBAAsB;IA2C1C,IAAI,MAAM,qCAET;cAGwB,KAAK;cAoBL,MAAM;IAQ/B;;OAEG;IAEG,WAAW;IAgCX,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBlD,kBAAkB;YA0BV,qBAAqB;IAU7B,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqBzD,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;IA6BnE;;;;OAIG;IACG,mBAAmB,CAAC,QAAQ,EAAE,SAAS;IAUhC,+BAA+B,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;YAcxE,eAAe;YAkHf,0BAA0B;IAaxC,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,uBAAuB;YAWjB,6BAA6B;YAiB7B,2BAA2B;CAqB1C"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
2
|
import type { SpecificCredential } from '@dxos/credentials';
|
|
3
|
-
import { type EchoHost, type DatabaseRoot
|
|
4
|
-
import type
|
|
3
|
+
import { type EchoHost, type DatabaseRoot } from '@dxos/echo-db';
|
|
4
|
+
import { type MetadataStore, type Space } from '@dxos/echo-pipeline';
|
|
5
|
+
import type { EdgeConnection } from '@dxos/edge-client';
|
|
5
6
|
import { type FeedStore } from '@dxos/feed-store';
|
|
6
7
|
import { type Keyring } from '@dxos/keyring';
|
|
7
8
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -45,7 +46,6 @@ export type DataSpaceParams = {
|
|
|
45
46
|
callbacks?: DataSpaceCallbacks;
|
|
46
47
|
cache?: SpaceCache;
|
|
47
48
|
edgeConnection?: EdgeConnection;
|
|
48
|
-
edgeHttpClient?: EdgeHttpClient;
|
|
49
49
|
edgeFeatures?: Runtime.Client.EdgeFeatures;
|
|
50
50
|
};
|
|
51
51
|
export type CreateEpochOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAwD,MAAM,aAAa,CAAC;AAG1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,
|
|
1
|
+
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAwD,MAAM,aAAa,CAAC;AAG1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EACL,KAAK,kBAAkB,EACvB,UAAU,EACV,KAAK,KAAK,IAAI,UAAU,EACzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EA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AC,OAAO,CAAM;gBAE5B,MAAM,EAAE,eAAe;IAmCnC,IACI,EAAE,iCAEL;IAED,IACI,GAAG,cAEN;IAED,IAAI,MAAM,YAET;IAED,IACI,KAAK,IAAI,UAAU,CAEtB;IAGD,IAAI,KAAK,UAER;IAED,IAAI,QAAQ,aAEX;IAED,IAAI,kBAAkB,uBAErB;IAED,IAAI,KAAK,2BAER;IAED,IAAI,mBAAmB,wBAEtB;IAED,IAAI,YAAY,IAAI,YAAY,GAAG,IAAI,CAEtC;IAGD,OAAO,KAAK,cAAc,GAKzB;IAGK,IAAI;YAMI,KAAK;IA0Bb,KAAK;YAIG,MAAM;IA4Bd,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAI/C,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI;;;IAIlE;;OAEG;IACH,2BAA2B;IAuBrB,sBAAsB;YAqBd,gBAAgB;YAWhB,iCAAiC;YAyBjC,oBAAoB;IAiDlC,OAAO,CAAC,mBAAmB;IAkDrB,gBAAgB,CAAC,OAAO,EAAE,eAAe;IAWzC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IA4C5E,QAAQ;IAWR,UAAU;IAchB,OAAO,CAAC,YAAY,CAElB;CACH;AAED,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -23,8 +23,6 @@ export declare class EdgeFeedReplicator extends Resource {
|
|
|
23
23
|
constructor({ messenger, spaceId }: EdgeFeedReplicatorParams);
|
|
24
24
|
protected _open(): Promise<void>;
|
|
25
25
|
protected _close(): Promise<void>;
|
|
26
|
-
private _startReplication;
|
|
27
|
-
private _resetConnection;
|
|
28
26
|
addFeed(feed: FeedWrapper<any>): Promise<void>;
|
|
29
27
|
private _getPushMutex;
|
|
30
28
|
private _replicateFeed;
|
|
@@ -33,6 +31,5 @@ export declare class EdgeFeedReplicator extends Resource {
|
|
|
33
31
|
private _pushBlocks;
|
|
34
32
|
private _integrateBlocks;
|
|
35
33
|
private _pushBlocksIfNeeded;
|
|
36
|
-
private _createConnectionContext;
|
|
37
34
|
}
|
|
38
35
|
//# sourceMappingURL=edge-feed-replicator.d.ts.map
|