@dxos/client-services 0.4.7-main.b23cefb → 0.4.7-main.b51ad3a
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-Q4ZW7SKD.mjs → chunk-W4YHONPO.mjs} +122 -70
- package/dist/lib/browser/{chunk-Q4ZW7SKD.mjs.map → chunk-W4YHONPO.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +4 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +4 -2
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-QTXFCLVV.cjs → chunk-UGRBM6TA.cjs} +97 -45
- package/dist/lib/node/chunk-UGRBM6TA.cjs.map +7 -0
- package/dist/lib/node/index.cjs +40 -38
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +11 -9
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/logging/logging-service.d.ts +1 -0
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +2 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/automerge-space-state.d.ts +2 -0
- package/dist/types/src/packlets/spaces/automerge-space-state.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shared-worker-connection.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/logging/logging-service.ts +9 -2
- package/src/packlets/services/automerge-host.test.ts +1 -1
- package/src/packlets/services/service-context.ts +7 -1
- package/src/packlets/spaces/automerge-space-state.ts +15 -0
- package/src/packlets/spaces/data-space.ts +33 -11
- package/src/packlets/spaces/spaces-service.ts +3 -5
- package/src/packlets/testing/test-builder.ts +1 -1
- package/src/packlets/vault/shared-worker-connection.ts +2 -0
- package/src/version.ts +1 -1
- package/dist/lib/node/chunk-QTXFCLVV.cjs.map +0 -7
|
@@ -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};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n const hostObservable = createInvitation(host, options);\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\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 await guestObservable.authenticate(await authCode.wait());\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 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 return [hostComplete.wait(), guestComplete.wait()];\n};\n\nconst createInvitation = (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): CancellableInvitation => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n const hostHandler = host.getInvitationHandler({ kind: Invitation.Kind.SPACE, ...options });\n return host.invitations.createInvitation(hostHandler, options);\n }\n\n return host.share(options);\n};\n\nconst acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n const guestHandler = guest.getInvitationHandler({ kind: invitation.kind });\n return guest.invitations.acceptInvitation(guestHandler, invitation, guestDeviceProfile);\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 {\n SnapshotStore,\n type DataPipeline,\n MetadataStore,\n SpaceManager,\n valueEncoding,\n DataServiceSubscriptions,\n AutomergeHost,\n} from '@dxos/echo-pipeline';\nimport { testLocalDatabase } from '@dxos/echo-pipeline/testing';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { createStorage, type Storage, StorageType } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { ClientServicesHost, createDefaultModelFactory, ServiceContext } from '../services';\nimport { DataSpaceManager, 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 = ({\n signalContext = new MemorySignalManagerContext(),\n storage = createStorage({ type: StorageType.RAM }),\n}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\n const networkManager = new NetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n\n const modelFactory = createDefaultModelFactory();\n return new ServiceContext(storage, networkManager, signalManager, modelFactory);\n};\n\nexport const createPeers = async (numPeers: number) => {\n const signalContext = new MemorySignalManagerContext();\n\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = createServiceContext({ signalContext });\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\n// TODO(burdon): Remove @dxos/client-testing.\n// TODO(burdon): Create builder and make configurable.\nexport const syncItemsLocal = async (db1: DataPipeline, db2: DataPipeline) => {\n await testLocalDatabase(db1, db2);\n await testLocalDatabase(db2, db1);\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};\n\nexport type TestPeerProps = {\n storage?: Storage;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: NetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n snapshotStore?: SnapshotStore;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n automergeHost?: AutomergeHost;\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 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 snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new NetworkManager({\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 modelFactory: createDefaultModelFactory(),\n snapshotStore: this.snapshotStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get automergeHost() {\n return (this._props.automergeHost ??= new AutomergeHost(this.storage.createDirectory('automerge')));\n }\n\n get dataSpaceManager() {\n return (this._props.dataSpaceManager ??= new DataSpaceManager(\n this.spaceManager,\n this.metadataStore,\n new DataServiceSubscriptions(),\n this.keyring,\n this.identity,\n this.feedStore,\n this.automergeHost,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\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 recordCred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Q,KAAKZ,OAAOY,kBAAkB,IAAIC,mCAAc,KAAK/C,QAAQsC,gBAAgB,UAAA,CAAA;EACvF;EAEA,IAAIU,YAAY;AACd,WAAQ,KAAKd,OAAOc,cAAc,IAAIC,gDAAU,KAAKjD,QAAQsC,gBAAgB,OAAA,CAAA;EAC/E;EAEA,IAAIY,gBAAgB;AAClB,WAAQ,KAAKhB,OAAOgB,kBAAkB,IAAIC,mCAAc,KAAKnD,QAAQsC,gBAAgB,WAAA,CAAA;EACvF;EAEA,IAAIjC,iBAAiB;AACnB,WAAQ,KAAK6B,OAAO7B,mBAAmB,IAAIC,sCAAe;MACxDb,eAAe,IAAIC,qCAAoB,KAAKI,aAAa;MACzDH,kBAAkBC;IACpB,CAAA;EACF;EAEA,IAAIwD,eAAe;AACjB,WAAQ,KAAKlB,OAAOkB,iBAAiB,IAAIC,kCAAa;MACpDd,WAAW,KAAKA;MAChBlC,gBAAgB,KAAKA;MACrByC,eAAe,KAAKA;MACpBvC,kBAAcC,iDAAAA;MACd0C,eAAe,KAAKA;MACpBF,WAAW,KAAKA;IAClB,CAAA;EACF;EAEA,IAAIM,WAAW;AACb,WAAO,KAAKpB,OAAOqB,sBAAkBC,4BAAAA;EACvC;EAEA,IAAIC,gBAAgB;AAClB,WAAQ,KAAKvB,OAAOuB,kBAAkB,IAAIC,mCAAc,
|
|
6
|
-
"names": ["import_credentials", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "hostComplete", "Trigger", "guestComplete", "authCode", "hostObservable", "createInvitation", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "authenticate", "wait", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "hostHandler", "getInvitationHandler", "kind", "Kind", "SPACE", "invitations", "share", "guestHandler", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "networkManager", "NetworkManager", "modelFactory", "createDefaultModelFactory", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "open", "Context", "createIdentity", "syncItemsLocal", "db1", "db2", "testLocalDatabase", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "snapshotStore", "SnapshotStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "automergeHost", "AutomergeHost", "dataSpaceManager", "DataSpaceManager", "DataServiceSubscriptions", "createSigningContext", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile", "undefined"]
|
|
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};\n\nexport type Result = { invitation?: Invitation; error?: Error };\n\nexport const performInvitation = ({\n host,\n guest,\n options,\n hooks,\n guestDeviceProfile,\n}: PerformInvitationParams): [Promise<Result>, Promise<Result>] => {\n const hostComplete = new Trigger<Result>();\n const guestComplete = new Trigger<Result>();\n const authCode = new Trigger<string>();\n\n const hostObservable = createInvitation(host, options);\n hostObservable.subscribe(\n async (hostInvitation: Invitation) => {\n switch (hostInvitation.state) {\n case Invitation.State.CONNECTING: {\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 await guestObservable.authenticate(await authCode.wait());\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 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 return [hostComplete.wait(), guestComplete.wait()];\n};\n\nconst createInvitation = (\n host: ServiceContext | InvitationHost,\n options?: Partial<Invitation>,\n): CancellableInvitation => {\n options ??= {\n authMethod: Invitation.AuthMethod.NONE,\n ...(options ?? {}),\n };\n\n if (host instanceof ServiceContext) {\n const hostHandler = host.getInvitationHandler({ kind: Invitation.Kind.SPACE, ...options });\n return host.invitations.createInvitation(hostHandler, options);\n }\n\n return host.share(options);\n};\n\nconst acceptInvitation = (\n guest: ServiceContext | InvitationGuest,\n invitation: Invitation,\n guestDeviceProfile?: DeviceProfileDocument,\n): AuthenticatingInvitation => {\n invitation = sanitizeInvitation(invitation);\n\n if (guest instanceof ServiceContext) {\n const guestHandler = guest.getInvitationHandler({ kind: invitation.kind });\n return guest.invitations.acceptInvitation(guestHandler, invitation, guestDeviceProfile);\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 {\n SnapshotStore,\n type DataPipeline,\n MetadataStore,\n SpaceManager,\n valueEncoding,\n DataServiceSubscriptions,\n AutomergeHost,\n} from '@dxos/echo-pipeline';\nimport { testLocalDatabase } from '@dxos/echo-pipeline/testing';\nimport { FeedFactory, FeedStore } from '@dxos/feed-store';\nimport { Keyring } from '@dxos/keyring';\nimport { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';\nimport { MemoryTransportFactory, NetworkManager } from '@dxos/network-manager';\nimport { createStorage, type Storage, StorageType } from '@dxos/random-access-storage';\nimport { BlobStore } from '@dxos/teleport-extension-object-sync';\n\nimport { ClientServicesHost, createDefaultModelFactory, ServiceContext } from '../services';\nimport { DataSpaceManager, 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 = ({\n signalContext = new MemorySignalManagerContext(),\n storage = createStorage({ type: StorageType.RAM }),\n}: {\n signalContext?: MemorySignalManagerContext;\n storage?: Storage;\n} = {}) => {\n const signalManager = new MemorySignalManager(signalContext);\n const networkManager = new NetworkManager({\n signalManager,\n transportFactory: MemoryTransportFactory,\n });\n\n const modelFactory = createDefaultModelFactory();\n return new ServiceContext(storage, networkManager, signalManager, modelFactory);\n};\n\nexport const createPeers = async (numPeers: number) => {\n const signalContext = new MemorySignalManagerContext();\n\n return await Promise.all(\n Array.from(Array(numPeers)).map(async () => {\n const peer = createServiceContext({ signalContext });\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\n// TODO(burdon): Remove @dxos/client-testing.\n// TODO(burdon): Create builder and make configurable.\nexport const syncItemsLocal = async (db1: DataPipeline, db2: DataPipeline) => {\n await testLocalDatabase(db1, db2);\n await testLocalDatabase(db2, db1);\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};\n\nexport type TestPeerProps = {\n storage?: Storage;\n feedStore?: FeedStore<any>;\n metadataStore?: MetadataStore;\n keyring?: Keyring;\n networkManager?: NetworkManager;\n spaceManager?: SpaceManager;\n dataSpaceManager?: DataSpaceManager;\n snapshotStore?: SnapshotStore;\n signingContext?: SigningContext;\n blobStore?: BlobStore;\n automergeHost?: AutomergeHost;\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 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 snapshotStore() {\n return (this._props.snapshotStore ??= new SnapshotStore(this.storage.createDirectory('snapshots')));\n }\n\n get networkManager() {\n return (this._props.networkManager ??= new NetworkManager({\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 modelFactory: createDefaultModelFactory(),\n snapshotStore: this.snapshotStore,\n blobStore: this.blobStore,\n }));\n }\n\n get identity() {\n return this._props.signingContext ?? failUndefined();\n }\n\n get automergeHost() {\n return (this._props.automergeHost ??= new AutomergeHost({ directory: this.storage.createDirectory('automerge') }));\n }\n\n get dataSpaceManager() {\n return (this._props.dataSpaceManager ??= new DataSpaceManager(\n this.spaceManager,\n this.metadataStore,\n new DataServiceSubscriptions(),\n this.keyring,\n this.identity,\n this.feedStore,\n this.automergeHost,\n ));\n }\n\n async createIdentity() {\n this._props.signingContext ??= await createSigningContext(this.keyring);\n }\n\n async destroy() {\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,2BAQO;AACP,qBAAkC;AAClC,wBAAuC;AACvC,qBAAwB;AACxB,uBAAgE;AAChE,6BAAuD;AACvD,mCAAyD;AACzD,4CAA0B;AFdnB,IAAMC,uBAAuB,OAAO,EACzCC,QACAC,OAAM,UAKNC,qCAAiB;EACfF;EACAC;EACAE,SAAS,IAAIC,sBAAUC,OAAOC,KAAK,MAAA,CAAA;EACnCC,WAAW;IACT,SAAS;IACTC,SAAS;MACP,SAAS;MACTC,OAAOJ,OAAOC,KAAK,MAAA;IACrB;EACF;AACF,CAAA;;ACZK,IAAMI,qBAAqB,CAACC,eAAAA;AACjC,SAAOC,yCAAkBC,OAAOD,yCAAkBE,OAAOH,UAAAA,CAAAA;AAC3D;AAkCO,IAAMI,oBAAoB,CAAC,EAChCC,MACAC,OACAC,SACAC,O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ACvC;EAEA,IAAIC,gBAAgB;AAClB,WAAQ,KAAKvB,OAAOuB,kBAAkB,IAAIC,mCAAc;MAAEC,WAAW,KAAK3D,QAAQsC,gBAAgB,WAAA;IAAa,CAAA;EACjH;EAEA,IAAIsB,mBAAmB;AACrB,WAAQ,KAAK1B,OAAO0B,qBAAqB,IAAIC,uCAC3C,KAAKT,cACL,KAAKN,eACL,IAAIgB,8CAAAA,GACJ,KAAK1B,SACL,KAAKkB,UACL,KAAKf,WACL,KAAKkB,aAAa;EAEtB;EAEA,MAAMvC,iBAAiB;AACrB,SAAKgB,OAAOqB,mBAAmB,MAAMQ,qBAAqB,KAAK3B,OAAO;EACxE;EAEA,MAAMP,UAAU;AACd,UAAM,KAAK7B,QAAQgE,MAAK;EAC1B;AACF;AAEO,IAAMD,uBAAuB,OAAO3B,YAAAA;AACzC,QAAM6B,cAAc,MAAM7B,QAAQ8B,UAAS;AAC3C,QAAMC,YAAY,MAAM/B,QAAQ8B,UAAS;AAEzC,SAAO;IACLD;IACAE;IACAC,sBAAkBC,qDAChBjC,SACA;MACEkC,YAAY,MAAM,IAAIC,wCAAoBnC,SAAS6B,aAAaE,SAAAA,EAAWK,0BAA0BL,SAAAA;IACvG,GACAA,SAAAA;IAEFM,kBAAkB,YAAA;IAAa;IAC/BC,YAAY,MAAMC;EACpB;AACF;",
|
|
6
|
+
"names": ["import_credentials", "createMockCredential", "signer", "issuer", "createCredential", "subject", "PublicKey", "Buffer", "from", "assertion", "payload", "value", "sanitizeInvitation", "invitation", "InvitationEncoder", "decode", "encode", "performInvitation", "host", "guest", "options", "hooks", "guestDeviceProfile", "hostComplete", "Trigger", "guestComplete", "authCode", "hostObservable", "createInvitation", "subscribe", "hostInvitation", "state", "Invitation", "State", "CONNECTING", "onConnecting", "guestObservable", "acceptInvitation", "guestInvitation", "invariant", "swarmKey", "equals", "CONNECTED", "onConnected", "READY_FOR_AUTHENTICATION", "onReady", "authenticate", "wait", "AUTHENTICATING", "onAuthenticating", "SUCCESS", "onSuccess", "wake", "CANCELLED", "onCancelled", "TIMEOUT", "onTimeout", "error", "onError", "authMethod", "AuthMethod", "NONE", "ServiceContext", "hostHandler", "getInvitationHandler", "kind", "Kind", "SPACE", "invitations", "share", "guestHandler", "join", "createServiceHost", "config", "signalManagerContext", "ClientServicesHost", "signalManager", "MemorySignalManager", "transportFactory", "MemoryTransportFactory", "createServiceContext", "signalContext", "MemorySignalManagerContext", "storage", "createStorage", "type", "StorageType", "RAM", "networkManager", "NetworkManager", "modelFactory", "createDefaultModelFactory", "createPeers", "numPeers", "Promise", "all", "Array", "map", "peer", "open", "Context", "createIdentity", "syncItemsLocal", "db1", "db2", "testLocalDatabase", "TestBuilder", "_ctx", "createPeer", "peerOptions", "TestPeer", "onDispose", "destroy", "dispose", "constructor", "opts", "dataStore", "_props", "props", "keyring", "Keyring", "createDirectory", "feedStore", "FeedStore", "factory", "FeedFactory", "root", "hypercore", "valueEncoding", "metadataStore", "MetadataStore", "blobStore", "BlobStore", "snapshotStore", "SnapshotStore", "spaceManager", "SpaceManager", "identity", "signingContext", "failUndefined", "automergeHost", "AutomergeHost", "directory", "dataSpaceManager", "DataSpaceManager", "DataServiceSubscriptions", "createSigningContext", "reset", "identityKey", "createKey", "deviceKey", "credentialSigner", "createCredentialSignerWithChain", "credential", "CredentialGenerator", "createDeviceAuthorization", "recordCredential", "getProfile", "undefined"]
|
|
7
7
|
}
|
|
@@ -6,6 +6,7 @@ import { type LogEntry, type LoggingService, QueryLogsRequest, type ControlMetri
|
|
|
6
6
|
export declare class LoggingServiceImpl implements LoggingService {
|
|
7
7
|
private readonly _logs;
|
|
8
8
|
private readonly _started;
|
|
9
|
+
private readonly _sessionId;
|
|
9
10
|
open(): Promise<void>;
|
|
10
11
|
close(): Promise<void>;
|
|
11
12
|
controlMetrics({ reset, record }: ControlMetricsRequest): Promise<ControlMetricsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/logging/logging-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"logging-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/logging/logging-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAS9C,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,EAEnB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,4CAA4C,CAAC;AAGpD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IAEnD,IAAI;IAIJ,KAAK;IAKL,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAc/F;;OAEG;IACH,YAAY,CAAC,EAAE,QAAgB,EAAE,EAAE,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,CAAC;IA+BrF,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC;IAiDtD,OAAO,CAAC,aAAa,CAEnB;CACH"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Trigger } from '@dxos/async';
|
|
2
2
|
import { Context } from '@dxos/context';
|
|
3
3
|
import { MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore, AutomergeHost } from '@dxos/echo-pipeline';
|
|
4
|
+
import { IndexMetadataStore } from '@dxos/echo-schema';
|
|
4
5
|
import { FeedStore } from '@dxos/feed-store';
|
|
5
6
|
import { Keyring } from '@dxos/keyring';
|
|
6
7
|
import { type SignalManager } from '@dxos/messaging';
|
|
@@ -38,6 +39,7 @@ export declare class ServiceContext {
|
|
|
38
39
|
readonly identityManager: IdentityManager;
|
|
39
40
|
readonly invitations: InvitationsHandler;
|
|
40
41
|
readonly automergeHost: AutomergeHost;
|
|
42
|
+
readonly indexMetadata: IndexMetadataStore;
|
|
41
43
|
dataSpaceManager?: DataSpaceManager;
|
|
42
44
|
private readonly _handlerFactories;
|
|
43
45
|
private _deviceSpaceSync?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EACL,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,4BAA4B,EAElC,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,kBAAkB,EAClB,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,KAAK,6BAA6B,EAAuB,MAAM,WAAW,CAAC;AAEtG,MAAM,MAAM,2BAA2B,GAAG,4BAA4B,GAAG,6BAA6B,CAAC;AACvG;;GAEG;AAGH,qBAEa,cAAc;
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;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,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EACL,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,4BAA4B,EAElC,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,kB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C,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;CAgE1B"}
|
|
@@ -4,7 +4,9 @@ export declare class AutomergeSpaceState implements CredentialProcessor {
|
|
|
4
4
|
private readonly _onNewRoot;
|
|
5
5
|
rootUrl: string | undefined;
|
|
6
6
|
lastEpoch: SpecificCredential<Epoch> | undefined;
|
|
7
|
+
private _isProcessingRootDocs;
|
|
7
8
|
constructor(_onNewRoot: (rootUrl: string) => void);
|
|
8
9
|
processCredential(credential: Credential): Promise<void>;
|
|
10
|
+
startProcessingRootDocs(): void;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=automerge-space-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automerge-space-state.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/automerge-space-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAuB,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAE,MAAM,6CAA6C,CAAC;AAE1F,qBAAa,mBAAoB,YAAW,mBAAmB;
|
|
1
|
+
{"version":3,"file":"automerge-space-state.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/automerge-space-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAuB,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAE,MAAM,6CAA6C,CAAC;AAE1F,qBAAa,mBAAoB,YAAW,mBAAmB;IAMjD,OAAO,CAAC,QAAQ,CAAC,UAAU;IALhC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAa;IACxC,SAAS,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,SAAS,CAAa;IAEpE,OAAO,CAAC,qBAAqB,CAAS;gBAET,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;IAE5D,iBAAiB,CAAC,UAAU,EAAE,UAAU;IAe9C,uBAAuB;CAUxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA+D,MAAM,aAAa,CAAC;AAIjG,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,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;AAGvC,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK,IAAI,UAAU,EAAsB,MAAM,4CAA4C,CAAC;AACtH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAK7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB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scribeMessagesRequest): Stream<GossipMessage>;
|
|
20
20
|
queryCredentials({ spaceKey, noTail }: QueryCredentialsRequest): Stream<Credential>;
|
|
21
21
|
writeCredentials({ spaceKey, credentials }: WriteCredentialsRequest): Promise<void>;
|
|
22
|
-
createEpoch({ spaceKey }: CreateEpochRequest): Promise<void>;
|
|
22
|
+
createEpoch({ spaceKey, migration }: CreateEpochRequest): Promise<void>;
|
|
23
23
|
private _serializeSpace;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=spaces-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaces-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/spaces-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIvF,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,KAAK,EAGV,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,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-connection.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,EAAyC,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK7E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA+C;IACnE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0C;IAC1E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,aAAa,CAAC,CAAmB;gBAE7B,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,6BAA6B;IAU5E,IAAI,KAAK,IAAI,YAAY,GAAG,SAAS,CAEpC;IAEK,IAAI;IACR;;OAEG;IACH,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"shared-worker-connection.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/shared-worker-connection.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,EAAyC,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK7E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA+C;IACnE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0C;IAC1E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,UAAU,CAAqC;IACvD,OAAO,CAAC,aAAa,CAAC,CAAmB;gBAE7B,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,6BAA6B;IAU5E,IAAI,KAAK,IAAI,YAAY,GAAG,SAAS,CAEpC;IAEK,IAAI;IACR;;OAEG;IACH,MAAM,EAAE,MAAM;IA0CV,KAAK;IAWX,OAAO,CAAC,QAAQ;CAGjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.4.7-main.
|
|
1
|
+
export declare const DXOS_VERSION = "0.4.7-main.b51ad3a";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.7-main.
|
|
3
|
+
"version": "0.4.7-main.b51ad3a",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,44 +22,44 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"platform": "^1.3.6",
|
|
25
|
-
"@dxos/async": "0.4.7-main.
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/config": "0.4.7-main.
|
|
29
|
-
"@dxos/context": "0.4.7-main.
|
|
30
|
-
"@dxos/credentials": "0.4.7-main.
|
|
31
|
-
"@dxos/crypto": "0.4.7-main.
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/echo-db": "0.4.7-main.
|
|
34
|
-
"@dxos/echo-pipeline": "0.4.7-main.
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/feed-store": "0.4.7-main.
|
|
38
|
-
"@dxos/invariant": "0.4.7-main.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/lock-file": "0.4.7-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/protocols": "0.4.7-main.
|
|
48
|
-
"@dxos/random-access-storage": "0.4.7-main.
|
|
49
|
-
"@dxos/rpc": "0.4.7-main.
|
|
50
|
-
"@dxos/teleport": "0.4.7-main.
|
|
51
|
-
"@dxos/teleport
|
|
52
|
-
"@dxos/teleport-extension-object-sync": "0.4.7-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
25
|
+
"@dxos/async": "0.4.7-main.b51ad3a",
|
|
26
|
+
"@dxos/codec-protobuf": "0.4.7-main.b51ad3a",
|
|
27
|
+
"@dxos/client-protocol": "0.4.7-main.b51ad3a",
|
|
28
|
+
"@dxos/config": "0.4.7-main.b51ad3a",
|
|
29
|
+
"@dxos/context": "0.4.7-main.b51ad3a",
|
|
30
|
+
"@dxos/credentials": "0.4.7-main.b51ad3a",
|
|
31
|
+
"@dxos/crypto": "0.4.7-main.b51ad3a",
|
|
32
|
+
"@dxos/debug": "0.4.7-main.b51ad3a",
|
|
33
|
+
"@dxos/echo-db": "0.4.7-main.b51ad3a",
|
|
34
|
+
"@dxos/echo-pipeline": "0.4.7-main.b51ad3a",
|
|
35
|
+
"@dxos/document-model": "0.4.7-main.b51ad3a",
|
|
36
|
+
"@dxos/echo-schema": "0.4.7-main.b51ad3a",
|
|
37
|
+
"@dxos/feed-store": "0.4.7-main.b51ad3a",
|
|
38
|
+
"@dxos/invariant": "0.4.7-main.b51ad3a",
|
|
39
|
+
"@dxos/keys": "0.4.7-main.b51ad3a",
|
|
40
|
+
"@dxos/keyring": "0.4.7-main.b51ad3a",
|
|
41
|
+
"@dxos/lock-file": "0.4.7-main.b51ad3a",
|
|
42
|
+
"@dxos/log": "0.4.7-main.b51ad3a",
|
|
43
|
+
"@dxos/network-manager": "0.4.7-main.b51ad3a",
|
|
44
|
+
"@dxos/model-factory": "0.4.7-main.b51ad3a",
|
|
45
|
+
"@dxos/messaging": "0.4.7-main.b51ad3a",
|
|
46
|
+
"@dxos/node-std": "0.4.7-main.b51ad3a",
|
|
47
|
+
"@dxos/protocols": "0.4.7-main.b51ad3a",
|
|
48
|
+
"@dxos/random-access-storage": "0.4.7-main.b51ad3a",
|
|
49
|
+
"@dxos/rpc": "0.4.7-main.b51ad3a",
|
|
50
|
+
"@dxos/teleport-extension-gossip": "0.4.7-main.b51ad3a",
|
|
51
|
+
"@dxos/teleport": "0.4.7-main.b51ad3a",
|
|
52
|
+
"@dxos/teleport-extension-object-sync": "0.4.7-main.b51ad3a",
|
|
53
|
+
"@dxos/tracing": "0.4.7-main.b51ad3a",
|
|
54
|
+
"@dxos/text-model": "0.4.7-main.b51ad3a",
|
|
55
|
+
"@dxos/util": "0.4.7-main.b51ad3a",
|
|
56
|
+
"@dxos/websocket-rpc": "0.4.7-main.b51ad3a",
|
|
57
|
+
"@dxos/timeframe": "0.4.7-main.b51ad3a"
|
|
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.b51ad3a"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Event } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
|
+
import { PublicKey } from '@dxos/keys';
|
|
7
8
|
import {
|
|
8
9
|
type LogLevel,
|
|
9
10
|
type LogProcessor,
|
|
@@ -21,14 +22,15 @@ import {
|
|
|
21
22
|
type QueryMetricsRequest,
|
|
22
23
|
type QueryMetricsResponse,
|
|
23
24
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
24
|
-
import { jsonify, numericalValues, tracer } from '@dxos/util';
|
|
25
|
+
import { getDebugName, jsonify, numericalValues, tracer } from '@dxos/util';
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Logging service used to spy on logs of the host.
|
|
28
29
|
*/
|
|
29
30
|
export class LoggingServiceImpl implements LoggingService {
|
|
30
31
|
private readonly _logs = new Event<NaturalLogEntry>();
|
|
31
|
-
private readonly _started =
|
|
32
|
+
private readonly _started = Date.now();
|
|
33
|
+
private readonly _sessionId = PublicKey.random().toHex();
|
|
32
34
|
|
|
33
35
|
async open() {
|
|
34
36
|
log.runtimeConfig.processors.push(this._logProcessor);
|
|
@@ -116,6 +118,11 @@ export class LoggingServiceImpl implements LoggingService {
|
|
|
116
118
|
// TODO(dmaretskyi): Fix proto.
|
|
117
119
|
file: entry.meta?.F ?? '',
|
|
118
120
|
line: entry.meta?.L ?? 0,
|
|
121
|
+
scope: {
|
|
122
|
+
hostSessionId: this._sessionId,
|
|
123
|
+
uptimeSeconds: (Date.now() - this._started) / 1000,
|
|
124
|
+
name: getDebugName(entry.meta?.S),
|
|
125
|
+
},
|
|
119
126
|
},
|
|
120
127
|
};
|
|
121
128
|
|
|
@@ -21,7 +21,7 @@ describe('AutomergeHost', () => {
|
|
|
21
21
|
|
|
22
22
|
const storageDirectory = createStorage({ type: StorageType.RAM }).createDirectory();
|
|
23
23
|
|
|
24
|
-
const host = new AutomergeHost(storageDirectory);
|
|
24
|
+
const host = new AutomergeHost({ directory: storageDirectory });
|
|
25
25
|
afterTest(() => host.close());
|
|
26
26
|
const dataService = new DataServiceImpl(
|
|
27
27
|
{} as DataServiceSubscriptions, // is not used in this test, just required argument
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
SnapshotStore,
|
|
15
15
|
AutomergeHost,
|
|
16
16
|
} from '@dxos/echo-pipeline';
|
|
17
|
+
import { IndexMetadataStore } from '@dxos/echo-schema';
|
|
17
18
|
import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
18
19
|
import { invariant } from '@dxos/invariant';
|
|
19
20
|
import { Keyring } from '@dxos/keyring';
|
|
@@ -68,6 +69,7 @@ export class ServiceContext {
|
|
|
68
69
|
public readonly identityManager: IdentityManager;
|
|
69
70
|
public readonly invitations: InvitationsHandler;
|
|
70
71
|
public readonly automergeHost: AutomergeHost;
|
|
72
|
+
public readonly indexMetadata: IndexMetadataStore;
|
|
71
73
|
|
|
72
74
|
// Initialized after identity is initialized.
|
|
73
75
|
public dataSpaceManager?: DataSpaceManager;
|
|
@@ -90,6 +92,7 @@ export class ServiceContext {
|
|
|
90
92
|
) {
|
|
91
93
|
// TODO(burdon): Move strings to constants.
|
|
92
94
|
this.metadataStore = new MetadataStore(storage.createDirectory('metadata'));
|
|
95
|
+
this.indexMetadata = new IndexMetadataStore({ directory: storage.createDirectory('index-metadata') });
|
|
93
96
|
this.snapshotStore = new SnapshotStore(storage.createDirectory('snapshots'));
|
|
94
97
|
this.blobStore = new BlobStore(storage.createDirectory('blobs'));
|
|
95
98
|
|
|
@@ -122,7 +125,10 @@ export class ServiceContext {
|
|
|
122
125
|
this._runtimeParams as IdentityManagerRuntimeParams,
|
|
123
126
|
);
|
|
124
127
|
|
|
125
|
-
this.automergeHost = new AutomergeHost(
|
|
128
|
+
this.automergeHost = new AutomergeHost({
|
|
129
|
+
directory: storage.createDirectory('automerge'),
|
|
130
|
+
metadata: this.indexMetadata,
|
|
131
|
+
});
|
|
126
132
|
|
|
127
133
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
128
134
|
|
|
@@ -9,6 +9,8 @@ export class AutomergeSpaceState implements CredentialProcessor {
|
|
|
9
9
|
public rootUrl: string | undefined = undefined;
|
|
10
10
|
public lastEpoch: SpecificCredential<Epoch> | undefined = undefined;
|
|
11
11
|
|
|
12
|
+
private _isProcessingRootDocs = false;
|
|
13
|
+
|
|
12
14
|
constructor(private readonly _onNewRoot: (rootUrl: string) => void) {}
|
|
13
15
|
|
|
14
16
|
async processCredential(credential: Credential) {
|
|
@@ -20,7 +22,20 @@ export class AutomergeSpaceState implements CredentialProcessor {
|
|
|
20
22
|
if (credential.subject.assertion.automergeRoot) {
|
|
21
23
|
this.rootUrl = credential.subject.assertion.automergeRoot;
|
|
22
24
|
|
|
25
|
+
if (this._isProcessingRootDocs) {
|
|
26
|
+
this._onNewRoot(this.rootUrl);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
startProcessingRootDocs() {
|
|
32
|
+
if (this._isProcessingRootDocs) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (this.rootUrl) {
|
|
23
37
|
this._onNewRoot(this.rootUrl);
|
|
24
38
|
}
|
|
39
|
+
this._isProcessingRootDocs = true;
|
|
25
40
|
}
|
|
26
41
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Event, scheduleTask, sleep, synchronized, trackLeaks } from '@dxos/async';
|
|
5
|
+
import { Event, asyncTimeout, scheduleTask, sleep, synchronized, trackLeaks } from '@dxos/async';
|
|
6
6
|
import { AUTH_TIMEOUT } from '@dxos/client-protocol';
|
|
7
7
|
import { cancelWithContext, Context, ContextDisposedError } from '@dxos/context';
|
|
8
8
|
import { timed, warnAfterTimeout } from '@dxos/debug';
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type AutomergeHost,
|
|
16
16
|
} from '@dxos/echo-pipeline';
|
|
17
17
|
import { type FeedStore } from '@dxos/feed-store';
|
|
18
|
-
import { failedInvariant } from '@dxos/invariant';
|
|
18
|
+
import { failedInvariant, invariant } from '@dxos/invariant';
|
|
19
19
|
import { type Keyring } from '@dxos/keyring';
|
|
20
20
|
import { PublicKey } from '@dxos/keys';
|
|
21
21
|
import { log } from '@dxos/log';
|
|
@@ -276,6 +276,8 @@ export class DataSpace {
|
|
|
276
276
|
// Allow other tasks to run before loading the data pipeline.
|
|
277
277
|
await sleep(1);
|
|
278
278
|
|
|
279
|
+
this._automergeSpaceState.startProcessingRootDocs();
|
|
280
|
+
|
|
279
281
|
await this._inner.initializeDataPipeline();
|
|
280
282
|
|
|
281
283
|
this.metrics.dataPipelineOpen = new Date();
|
|
@@ -423,18 +425,38 @@ export class DataSpace {
|
|
|
423
425
|
case undefined:
|
|
424
426
|
case CreateEpochRequest.Migration.NONE:
|
|
425
427
|
{
|
|
428
|
+
// TODO(dmaretskyi): Unify epoch construction.
|
|
426
429
|
epoch = await this.dataPipeline.createEpoch();
|
|
427
430
|
}
|
|
428
431
|
break;
|
|
429
|
-
case CreateEpochRequest.Migration.INIT_AUTOMERGE:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
432
|
+
case CreateEpochRequest.Migration.INIT_AUTOMERGE:
|
|
433
|
+
{
|
|
434
|
+
const document = this._automergeHost.repo.create();
|
|
435
|
+
// TODO(dmaretskyi): Unify epoch construction.
|
|
436
|
+
epoch = {
|
|
437
|
+
previousId: this._automergeSpaceState.lastEpoch?.id,
|
|
438
|
+
number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
|
|
439
|
+
timeframe: this._automergeSpaceState.lastEpoch?.subject.assertion.timeframe ?? new Timeframe(),
|
|
440
|
+
automergeRoot: document.url,
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
case CreateEpochRequest.Migration.PRUNE_AUTOMERGE_ROOT_HISTORY:
|
|
445
|
+
{
|
|
446
|
+
const currentRootUrl = this._automergeSpaceState.rootUrl;
|
|
447
|
+
const rootHandle = this._automergeHost.repo.find(currentRootUrl as any);
|
|
448
|
+
await cancelWithContext(this._ctx, asyncTimeout(rootHandle.whenReady(), 10_000));
|
|
449
|
+
const newRoot = this._automergeHost.repo.create(rootHandle.docSync());
|
|
450
|
+
invariant(typeof newRoot.url === 'string' && newRoot.url.length > 0);
|
|
451
|
+
// TODO(dmaretskyi): Unify epoch construction.
|
|
452
|
+
epoch = {
|
|
453
|
+
previousId: this._automergeSpaceState.lastEpoch?.id,
|
|
454
|
+
number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
|
|
455
|
+
timeframe: this._automergeSpaceState.lastEpoch?.subject.assertion.timeframe ?? new Timeframe(),
|
|
456
|
+
automergeRoot: newRoot.url,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
break;
|
|
438
460
|
}
|
|
439
461
|
|
|
440
462
|
if (!epoch) {
|
|
@@ -178,10 +178,10 @@ export class SpacesServiceImpl implements SpacesService {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
async createEpoch({ spaceKey }: CreateEpochRequest) {
|
|
181
|
+
async createEpoch({ spaceKey, migration }: CreateEpochRequest) {
|
|
182
182
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
183
183
|
const space = dataSpaceManager.spaces.get(spaceKey) ?? raise(new SpaceNotFoundError(spaceKey));
|
|
184
|
-
await space.createEpoch();
|
|
184
|
+
await space.createEpoch({ migration });
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
private _serializeSpace(space: DataSpace): Space {
|
|
@@ -215,9 +215,7 @@ export class SpacesServiceImpl implements SpacesService {
|
|
|
215
215
|
return {
|
|
216
216
|
identity: {
|
|
217
217
|
identityKey: member.key,
|
|
218
|
-
profile: {
|
|
219
|
-
displayName: member.profile?.displayName,
|
|
220
|
-
},
|
|
218
|
+
profile: member.profile ?? {},
|
|
221
219
|
},
|
|
222
220
|
presence: member.removed
|
|
223
221
|
? SpaceMember.PresenceState.REMOVED
|
|
@@ -179,7 +179,7 @@ export class TestPeer {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
get automergeHost() {
|
|
182
|
-
return (this._props.automergeHost ??= new AutomergeHost(this.storage.createDirectory('automerge')));
|
|
182
|
+
return (this._props.automergeHost ??= new AutomergeHost({ directory: this.storage.createDirectory('automerge') }));
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
get dataSpaceManager() {
|
|
@@ -76,6 +76,8 @@ export class SharedWorkerConnection {
|
|
|
76
76
|
BridgeService: this._transportService,
|
|
77
77
|
},
|
|
78
78
|
port: this._systemPort,
|
|
79
|
+
// TODO(wittjosiah): Make longer and factor out to constant.
|
|
80
|
+
// TODO(wittjosiah): If this is too long then it breaks the reset flows in Composer.
|
|
79
81
|
timeout: 200,
|
|
80
82
|
});
|
|
81
83
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.7-main.
|
|
1
|
+
export const DXOS_VERSION = "0.4.7-main.b51ad3a";
|