@dxos/client-protocol 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/client.ts", "../../../src/config.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/service.ts", "../../../src/space.ts", "../../../src/timeouts.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport const ClientServicesProviderResource = Symbol.for('dxos.resource.ClientServices');\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(wittjosiah): Factor out to @dxos/config.\n\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\nexport const DEFAULT_WORKER_BROADCAST_CHANNEL = 'dxos:shared-worker';\n\n/**\n * @deprecated\n */\nexport const DEFAULT_VAULT_URL = 'https://halo.dxos.org/vault.html';\n\n/**\n * @deprecated\n */\n// TODO(burdon): Remove need (i.e., make undefined do the right thing).\nexport const DEFAULT_PROFILE = 'default';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? (process?.env?.HOME ?? '') : '';\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport enum DXEnv {\n CONFIG = 'DX_CONFIG',\n DEBUG = 'DX_DEBUG',\n NO_AGENT = 'DX_NO_AGENT',\n PROFILE = 'DX_PROFILE',\n}\n\nexport namespace DXEnv {\n /**\n * Helper to get the value from process.env\n */\n export function get(variable: DXEnv): string | undefined;\n export function get(variable: DXEnv, defaultValue: string): string;\n export function get(variable: DXEnv, defaultValue?: string): string | undefined {\n return process.env[variable] ?? defaultValue;\n }\n}\n\n// Profile layout: profile/<name> is the profile dir; profile/<name>.yml is the config file.\nexport const getProfilePath = (root: string, profile: string, file?: string) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n/** Path to the profile config file (profile/<name>.yml). */\nexport const getProfileConfigPath = (root: string, profile: string) => `${getProfilePath(root, profile)}.yml`;\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols/proto';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n const decodedInvitation = codec.decode(base62.decode(text));\n if (decodedInvitation.type === Invitation.Type.MULTIUSE) {\n decodedInvitation.type = Invitation.Type.INTERACTIVE;\n decodedInvitation.multiUse = true;\n }\n return decodedInvitation;\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n guestKeypair: invitation.guestKeypair,\n spaceId: invitation.spaceId,\n lifetime: invitation.lifetime,\n created: invitation.created,\n // TODO(wittjosiah): Make these optional to encode for greater privacy.\n ...(invitation.spaceKey ? { spaceKey: invitation.spaceKey } : {}),\n ...(invitation.target ? { target: invitation.target } : {}),\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, type Observable, type Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitation[]>;\n accepted: MulticastObservable<AuthenticatingInvitation[]>;\n share(options?: Partial<Invitation>): CancellableInvitation;\n join(invitation: Invitation): AuthenticatingInvitation;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitation extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n\n get expired() {\n const expiration = getExpirationTime(this.get());\n return expiration && expiration.getTime() < Date.now();\n }\n\n get expiry() {\n return getExpirationTime(this.get());\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitation extends CancellableInvitation {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitation): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n\nexport const getExpirationTime = (invitation: Partial<Invitation>): Date | undefined => {\n if (!(invitation.created && invitation.lifetime)) {\n return;\n }\n return new Date(invitation.created.getTime() + invitation.lifetime * 1000);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { schema } from '@dxos/protocols/proto';\nimport type {\n ContactsService,\n DevicesService,\n EdgeAgentService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n QueueService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport type { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';\nimport type { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\n\nexport type { QueueService } from '@dxos/protocols/proto/dxos/client/services';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n\n DataService: DataService;\n QueryService: QueryService;\n QueueService: QueueService;\n\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n /**\n * The connection to the services provider was terminated.\n * This should fire if the services disconnect unexpectedly or during a client reset.\n */\n closed: Event<Error | undefined>;\n\n /**\n * The underlying service connection was re-established.\n * Fires after all reconnection callbacks have completed.\n */\n reconnected?: Event<void>;\n\n /**\n * Register a callback to be invoked when services reconnect.\n * The callback should re-establish any RPC streams.\n * Reconnection waits for all callbacks to complete before emitting `reconnected`.\n */\n onReconnect?: (callback: () => Promise<void>) => void;\n\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<unknown>;\n close(): Promise<unknown>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n QueryService: schema.getService('dxos.echo.query.QueryService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n ContactsService: schema.getService('dxos.client.services.ContactsService'),\n EdgeAgentService: schema.getService('dxos.client.services.EdgeAgentService'),\n QueueService: schema.getService('dxos.client.services.QueueService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { type MulticastObservable } from '@dxos/async';\nimport { type SpecificCredential } from '@dxos/credentials';\nimport { type Database, type Obj } from '@dxos/echo';\nimport { type EchoDatabase, type QueueFactory, type SpaceSyncState } from '@dxos/echo-client';\nimport { type PublicKey, type SpaceId } from '@dxos/keys';\nimport { type Messenger } from '@dxos/protocols';\nimport {\n type Contact,\n type CreateEpochRequest,\n type Invitation,\n SpaceArchive,\n type Space as SpaceData,\n type SpaceMember,\n type SpaceState,\n type UpdateMemberRoleRequest,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';\nimport { type Credential, type Epoch, type MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { type CancellableInvitation } from './invitations';\nimport { type SpaceProperties } from './types';\n\nexport type CreateEpochOptions = {\n migration?: CreateEpochRequest.Migration;\n automergeRootUrl?: string;\n};\n\nexport type ExportSpaceOptions = {\n /**\n * Archive format.\n * @default SpaceArchive.Format.BINARY\n */\n format?: SpaceArchive.Format;\n};\n\nexport interface SpaceInternal {\n get db(): EchoDatabase;\n get data(): SpaceData;\n\n getCredentials(): Promise<Credential[]>;\n\n getEpochs(): Promise<SpecificCredential<Epoch>[]>;\n\n // TODO(dmaretskyi): Return epoch info.\n createEpoch(options?: CreateEpochOptions): Promise<void>;\n\n // TOOD(burdon): Start to factor out credentials.\n removeMember(memberKey: PublicKey): Promise<void>;\n\n export(options?: ExportSpaceOptions): Promise<SpaceArchive>;\n\n /**\n * Migrate space data to the latest version.\n */\n migrate(): Promise<void>;\n\n setEdgeReplicationPreference(setting: EdgeReplicationSetting): Promise<void>;\n\n /**\n * Waits until the space is fully synced with EDGE.\n * @throws If the EDGE sync is disabled.\n */\n syncToEdge(opts?: {\n onProgress: (state: SpaceSyncState.PeerState | undefined) => void;\n timeout?: number;\n }): Promise<void>;\n}\n\nexport const SPACE_TAG = Symbol('dxos.client.protocol.Space');\n\nexport interface Space extends Messenger {\n readonly [SPACE_TAG]: true;\n\n /**\n * @deprecated Use `id`.\n */\n get key(): PublicKey;\n\n /**\n * Unique space identifier.\n */\n get id(): SpaceId;\n\n /**\n * Echo database.\n */\n get db(): Database.Database;\n\n /**\n * Access to queues.\n */\n get queues(): QueueFactory;\n\n // TODO(burdon): Replace with state?\n get isOpen(): boolean;\n\n /**\n * Immutable tags assigned at space creation time.\n * Available on closed spaces.\n */\n get tags(): string[];\n\n /**\n * Immutable membership policy assigned at space creation time.\n * Available on closed spaces.\n */\n get membershipPolicy(): MembershipPolicy;\n\n /**\n * Current state of the space.\n * The database is ready to be used in `SpaceState.SPACE_READY` state.\n * Presence is available in `SpaceState.SPACE_CONTROL_ONLY` state.\n */\n get state(): MulticastObservable<SpaceState>;\n\n /**\n * Properties object.\n */\n get properties(): Obj.OfShape<SpaceProperties>;\n\n /**\n * Current state of space pipeline.\n */\n get pipeline(): MulticastObservable<SpaceData.PipelineState>;\n\n get invitations(): MulticastObservable<CancellableInvitation[]>;\n\n get members(): MulticastObservable<SpaceMember[]>;\n\n /**\n * @deprecated\n */\n // TODO(wittjosiah): Audit and remove. This should not be exposed (or marked as internal).\n get internal(): SpaceInternal;\n\n /**\n * Activates the space enabling the use of the database and starts replication with peers.\n * The setting is persisted on the local device.\n */\n // TODO(wittjosiah): Rename activate/deactivate?\n open(): Promise<void>;\n\n /**\n * Deactivates the space stopping replication with other peers.\n * The space will not auto-open on the next app launch.\n * The setting is persisted on the local device.\n */\n close(): Promise<void>;\n\n /**\n * Tombstones (soft-deletes) the space and replicates the deletion to the user's other devices.\n * Every device stops replicating and unloads the space. Underlying data is not removed until\n * garbage collection (future work). This is terminal: the space cannot be re-opened via {@link open}.\n */\n delete(): Promise<void>;\n\n /**\n * Waits until the space is in the ready state, with database initialized.\n */\n waitUntilReady(): Promise<this>;\n\n createSnapshot(): Promise<SpaceSnapshot>;\n\n // TODO(burdon): Create invitation?\n // TODO(burdon): Factor out membership, etc.\n share(options?: Partial<Invitation>): CancellableInvitation;\n admitContact(contact: Contact): Promise<void>;\n updateMemberRole(request: Omit<UpdateMemberRoleRequest, 'spaceKey'>): Promise<void>;\n}\n\nexport const isSpace = (object: unknown): object is Space =>\n typeof object === 'object' && object != null && (object as Space)[SPACE_TAG] === true;\n\n// TODO(burdon): Create lower-level definition (HasId, db, etc.) and move to @dxos/echo.\nexport const SpaceSchema: Schema.Schema<Space> = Schema.Any.pipe(\n Schema.filter((space) => isSpace(space)),\n Schema.annotations({ title: 'Space' }),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 5_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const IMPORT_SPACE_TIMEOUT = 30_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
5
- "mappings": ";;;;;;;AAIO,IAAMA,iCAAiCC,uBAAOC,IAAI,8BAAA;;;ACElD,IAAMC,yBAAyB;AAC/B,IAAMC,2BAA2B;AACjC,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAM1B,IAAMC,kBAAkB;AAExB,IAAMC,0BAA0B;AAChC,IAAMC,gBAAgB;EAAEC,SAAS;AAAE;AAG1C,IAAMC,OAAO,OAAOC,YAAY,cAAeA,SAASC,KAAKF,QAAQ,KAAM;AAGpE,IAAMG,YAAY,GAAGH,IAAAA;AAGrB,IAAMI,WAAW,GAAGJ,IAAAA;AAIpB,IAAMK,UAAU,GAAGL,IAAAA;AAGnB,IAAMM,WAAW,GAAGN,IAAAA;AAGpB,IAAMO,aAAa;AAEnB,IAAKC,QAAAA,0BAAAA,QAAAA;;;;;SAAAA;;UAOKA,QAAAA;AAMR,WAASC,IAAIC,UAAiBC,cAAqB;AACxD,WAAOV,QAAQC,IAAIQ,QAAAA,KAAaC;EAClC;SAFgBF,MAAAA;AAGlB,GATiBD,UAAAA,QAAAA,CAAAA,EAAAA;AAYV,IAAMI,iBAAiB,CAACC,MAAcC,SAAiBC,SAC5D,GAAGF,IAAAA,YAAgBC,OAAAA,MAAaC,OAAO,IAAIA,IAAAA,KAAS;AAG/C,IAAMC,uBAAuB,CAACH,MAAcC,YAAoB,GAAGF,eAAeC,MAAMC,OAAAA,CAAAA;;;AC/D/F,OAAOG,UAAU;AAEjB,SAASC,cAAc;AACvB,SAASC,kBAAkB;AAG3B,IAAMC,SAASH,KAAK,gEAAA;AAEpB,IAAMI,QAAQH,OAAOI,gBAAgB,iCAAA;AAK9B,IAAMC,oBAAN,MAAMA;EACX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AACnC;AAMO,IAAMe,sBAA0D;EACrEC,eAAepB,QAAOI,WAAW,2BAAA;AACnC;AAMO,IAAMiB,mBAAoD;EAC/DC,YAAYtB,QAAOI,WAAW,wBAAA;AAChC;AAMO,IAAMmB,qBAAwD;EACnEC,cAAcxB,QAAOI,WAAW,0BAAA;AAClC;;;ACnIA,YAAYqB,YAAY;AAuEjB,IAAMC,YAAYC,uBAAO,4BAAA;AAsGzB,IAAMC,UAAU,CAACC,WACtB,OAAOA,WAAW,YAAYA,UAAU,QAASA,OAAiBH,SAAAA,MAAe;AAG5E,IAAMI,cAA2CC,WAAIC,KACnDC,cAAO,CAACC,UAAUN,QAAQM,KAAAA,CAAAA,GAC1BC,mBAAY;EAAEC,OAAO;AAAQ,CAAA,CAAA;;;AChL/B,IAAMC,2BAA2B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;",
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport const ClientServicesProviderResource = Symbol.for('dxos.resource.ClientServices');\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(wittjosiah): Factor out to @dxos/config.\n\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\nexport const DEFAULT_WORKER_BROADCAST_CHANNEL = 'dxos:shared-worker';\n\n/**\n * @deprecated\n */\nexport const DEFAULT_VAULT_URL = 'https://halo.dxos.org/vault.html';\n\n/**\n * @deprecated\n */\n// TODO(burdon): Remove need (i.e., make undefined do the right thing).\nexport const DEFAULT_PROFILE = 'default';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? (process?.env?.HOME ?? '') : '';\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport enum DXEnv {\n CONFIG = 'DX_CONFIG',\n DEBUG = 'DX_DEBUG',\n NO_AGENT = 'DX_NO_AGENT',\n PROFILE = 'DX_PROFILE',\n}\n\nexport namespace DXEnv {\n /**\n * Helper to get the value from process.env\n */\n export function get(variable: DXEnv): string | undefined;\n export function get(variable: DXEnv, defaultValue: string): string;\n export function get(variable: DXEnv, defaultValue?: string): string | undefined {\n return process.env[variable] ?? defaultValue;\n }\n}\n\n// Profile layout: profile/<name> is the profile dir; profile/<name>.yml is the config file.\nexport const getProfilePath = (root: string, profile: string, file?: string) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n/** Path to the profile config file (profile/<name>.yml). */\nexport const getProfileConfigPath = (root: string, profile: string) => `${getProfilePath(root, profile)}.yml`;\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols/proto';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n const decodedInvitation = codec.decode(base62.decode(text));\n if (decodedInvitation.type === Invitation.Type.MULTIUSE) {\n decodedInvitation.type = Invitation.Type.INTERACTIVE;\n decodedInvitation.multiUse = true;\n }\n return decodedInvitation;\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n guestKeypair: invitation.guestKeypair,\n spaceId: invitation.spaceId,\n lifetime: invitation.lifetime,\n created: invitation.created,\n // TODO(wittjosiah): Make these optional to encode for greater privacy.\n ...(invitation.spaceKey ? { spaceKey: invitation.spaceKey } : {}),\n ...(invitation.target ? { target: invitation.target } : {}),\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, type Observable, type Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitation[]>;\n accepted: MulticastObservable<AuthenticatingInvitation[]>;\n share(options?: Partial<Invitation>): CancellableInvitation;\n join(invitation: Invitation): AuthenticatingInvitation;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitation extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n\n get expired() {\n const expiration = getExpirationTime(this.get());\n return expiration && expiration.getTime() < Date.now();\n }\n\n get expiry() {\n return getExpirationTime(this.get());\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitation extends CancellableInvitation {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitation): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n\nexport const getExpirationTime = (invitation: Partial<Invitation>): Date | undefined => {\n if (!(invitation.created && invitation.lifetime)) {\n return;\n }\n return new Date(invitation.created.getTime() + invitation.lifetime * 1000);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { schema } from '@dxos/protocols/proto';\nimport type {\n ContactsService,\n DevicesService,\n EdgeAgentService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n QueueService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport type { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';\nimport type { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\n\nexport type { QueueService } from '@dxos/protocols/proto/dxos/client/services';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n\n DataService: DataService;\n QueryService: QueryService;\n QueueService: QueueService;\n\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n /**\n * The connection to the services provider was terminated.\n * This should fire if the services disconnect unexpectedly or during a client reset.\n */\n closed: Event<Error | undefined>;\n\n /**\n * The underlying service connection was re-established.\n * Fires after all reconnection callbacks have completed.\n */\n reconnected?: Event<void>;\n\n /**\n * Register a callback to be invoked when services reconnect.\n * The callback should re-establish any RPC streams.\n * Reconnection waits for all callbacks to complete before emitting `reconnected`.\n */\n onReconnect?: (callback: () => Promise<void>) => void;\n\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<unknown>;\n close(): Promise<unknown>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n QueryService: schema.getService('dxos.echo.query.QueryService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n ContactsService: schema.getService('dxos.client.services.ContactsService'),\n EdgeAgentService: schema.getService('dxos.client.services.EdgeAgentService'),\n QueueService: schema.getService('dxos.client.services.QueueService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { type MulticastObservable } from '@dxos/async';\nimport { type SpecificCredential } from '@dxos/credentials';\nimport { type Obj } from '@dxos/echo';\nimport { type EchoDatabase, type SpaceSyncState } from '@dxos/echo-client';\nimport { type PublicKey, type SpaceId } from '@dxos/keys';\nimport { type Messenger } from '@dxos/protocols';\nimport {\n type Contact,\n type CreateEpochRequest,\n type Invitation,\n SpaceArchive,\n type Space as SpaceData,\n type SpaceMember,\n type SpaceState,\n type UpdateMemberRoleRequest,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';\nimport { type Credential, type Epoch, type MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { type CancellableInvitation } from './invitations';\nimport { type SpaceProperties } from './types';\n\nexport type CreateEpochOptions = {\n migration?: CreateEpochRequest.Migration;\n automergeRootUrl?: string;\n};\n\nexport type ExportSpaceOptions = {\n /**\n * Archive format.\n * @default SpaceArchive.Format.BINARY\n */\n format?: SpaceArchive.Format;\n};\n\nexport interface SpaceInternal {\n get db(): EchoDatabase;\n get data(): SpaceData;\n\n getCredentials(): Promise<Credential[]>;\n\n getEpochs(): Promise<SpecificCredential<Epoch>[]>;\n\n // TODO(dmaretskyi): Return epoch info.\n createEpoch(options?: CreateEpochOptions): Promise<void>;\n\n // TOOD(burdon): Start to factor out credentials.\n removeMember(memberKey: PublicKey): Promise<void>;\n\n export(options?: ExportSpaceOptions): Promise<SpaceArchive>;\n\n /**\n * Migrate space data to the latest version.\n */\n migrate(): Promise<void>;\n\n setEdgeReplicationPreference(setting: EdgeReplicationSetting): Promise<void>;\n\n /**\n * Waits until the space is fully synced with EDGE.\n * @throws If the EDGE sync is disabled.\n */\n syncToEdge(opts?: {\n onProgress: (state: SpaceSyncState.PeerState | undefined) => void;\n timeout?: number;\n }): Promise<void>;\n}\n\nexport const SPACE_TAG = Symbol('dxos.client.protocol.Space');\n\nexport interface Space extends Messenger {\n readonly [SPACE_TAG]: true;\n\n /**\n * @deprecated Use `id`.\n */\n get key(): PublicKey;\n\n /**\n * Unique space identifier.\n */\n get id(): SpaceId;\n\n /**\n * Echo database.\n */\n get db(): EchoDatabase;\n\n // TODO(burdon): Replace with state?\n get isOpen(): boolean;\n\n /**\n * Immutable tags assigned at space creation time.\n * Available on closed spaces.\n */\n get tags(): string[];\n\n /**\n * Immutable membership policy assigned at space creation time.\n * Available on closed spaces.\n */\n get membershipPolicy(): MembershipPolicy;\n\n /**\n * Current state of the space.\n * The database is ready to be used in `SpaceState.SPACE_READY` state.\n * Presence is available in `SpaceState.SPACE_CONTROL_ONLY` state.\n */\n get state(): MulticastObservable<SpaceState>;\n\n /**\n * Properties object.\n */\n get properties(): Obj.OfShape<SpaceProperties>;\n\n /**\n * Current state of space pipeline.\n */\n get pipeline(): MulticastObservable<SpaceData.PipelineState>;\n\n get invitations(): MulticastObservable<CancellableInvitation[]>;\n\n get members(): MulticastObservable<SpaceMember[]>;\n\n /**\n * @deprecated\n */\n // TODO(wittjosiah): Audit and remove. This should not be exposed (or marked as internal).\n get internal(): SpaceInternal;\n\n /**\n * Activates the space enabling the use of the database and starts replication with peers.\n * The setting is persisted on the local device.\n */\n // TODO(wittjosiah): Rename activate/deactivate?\n open(): Promise<void>;\n\n /**\n * Deactivates the space stopping replication with other peers.\n * The space will not auto-open on the next app launch.\n * The setting is persisted on the local device.\n */\n close(): Promise<void>;\n\n /**\n * Tombstones (soft-deletes) the space and replicates the deletion to the user's other devices.\n * Every device stops replicating and unloads the space. Underlying data is not removed until\n * garbage collection (future work). This is terminal: the space cannot be re-opened via {@link open}.\n */\n delete(): Promise<void>;\n\n /**\n * Waits until the space is in the ready state, with database initialized.\n */\n waitUntilReady(): Promise<this>;\n\n createSnapshot(): Promise<SpaceSnapshot>;\n\n // TODO(burdon): Create invitation?\n // TODO(burdon): Factor out membership, etc.\n share(options?: Partial<Invitation>): CancellableInvitation;\n admitContact(contact: Contact): Promise<void>;\n updateMemberRole(request: Omit<UpdateMemberRoleRequest, 'spaceKey'>): Promise<void>;\n}\n\nexport const isSpace = (object: unknown): object is Space =>\n typeof object === 'object' && object != null && (object as Space)[SPACE_TAG] === true;\n\n// TODO(burdon): Create lower-level definition (HasId, db, etc.) and move to @dxos/echo.\nexport const SpaceSchema: Schema.Schema<Space> = Schema.Any.pipe(\n Schema.filter((space) => isSpace(space)),\n Schema.annotations({ title: 'Space' }),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 5_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const IMPORT_SPACE_TIMEOUT = 30_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
5
+ "mappings": ";;;;;;;AAIO,IAAMA,iCAAiCC,uBAAOC,IAAI,8BAAA;;;ACElD,IAAMC,yBAAyB;AAC/B,IAAMC,2BAA2B;AACjC,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAM1B,IAAMC,kBAAkB;AAExB,IAAMC,0BAA0B;AAChC,IAAMC,gBAAgB;EAAEC,SAAS;AAAE;AAG1C,IAAMC,OAAO,OAAOC,YAAY,cAAeA,SAASC,KAAKF,QAAQ,KAAM;AAGpE,IAAMG,YAAY,GAAGH,IAAAA;AAGrB,IAAMI,WAAW,GAAGJ,IAAAA;AAIpB,IAAMK,UAAU,GAAGL,IAAAA;AAGnB,IAAMM,WAAW,GAAGN,IAAAA;AAGpB,IAAMO,aAAa;AAEnB,IAAKC,QAAAA,0BAAAA,QAAAA;;;;;SAAAA;;UAOKA,QAAAA;AAMR,WAASC,IAAIC,UAAiBC,cAAqB;AACxD,WAAOV,QAAQC,IAAIQ,QAAAA,KAAaC;EAClC;SAFgBF,MAAAA;AAGlB,GATiBD,UAAAA,QAAAA,CAAAA,EAAAA;AAYV,IAAMI,iBAAiB,CAACC,MAAcC,SAAiBC,SAC5D,GAAGF,IAAA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OI,WAAW,qCAAA;EAClCO,eAAeX,QAAOI,WAAW,oCAAA;EACjCQ,aAAaZ,QAAOI,WAAW,+BAAA;EAC/BS,iBAAiBb,QAAOI,WAAW,sCAAA;EACnCU,kBAAkBd,QAAOI,WAAW,uCAAA;EACpCW,cAAcf,QAAOI,WAAW,mCAAA;;EAGhCY,cAAchB,QAAOI,WAAW,iCAAA;AAClC,CAAA;AAMO,IAAMa,sBAA0D;EACrEC,eAAelB,QAAOI,WAAW,gCAAA;AACnC;AAMO,IAAMe,sBAA0D;EACrEC,eAAepB,QAAOI,WAAW,2BAAA;AACnC;AAMO,IAAMiB,mBAAoD;EAC/DC,YAAYtB,QAAOI,WAAW,wBAAA;AAChC;AAMO,IAAMmB,qBAAwD;EACnEC,cAAcxB,QAAOI,WAAW,0BAAA;AAClC;;;ACnIA,YAAYqB,YAAY;AAuEjB,IAAMC,YAAYC,uBAAO,4BAAA;AAiGzB,IAAMC,UAAU,CAACC,WACtB,OAAOA,WAAW,YAAYA,UAAU,QAASA,OAAiBH,SAAAA,MAAe;AAG5E,IAAMI,cAA2CC,WAAIC,KACnDC,cAAO,CAACC,UAAUN,QAAQM,KAAAA,CAAAA,GAC1BC,mBAAY;EAAEC,OAAO;AAAQ,CAAA,CAAA;;;AC3K/B,IAAMC,2BAA2B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;",
6
6
  "names": ["ClientServicesProviderResource", "Symbol", "for", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_WORKER_BROADCAST_CHANNEL", "DEFAULT_VAULT_URL", "DEFAULT_PROFILE", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "DXEnv", "get", "variable", "defaultValue", "getProfilePath", "root", "profile", "file", "getProfileConfigPath", "base", "schema", "Invitation", "base62", "codec", "getCodecForType", "InvitationEncoder", "decode", "text", "decodedInvitation", "type", "Type", "MULTIUSE", "INTERACTIVE", "multiUse", "encode", "invitation", "invitationId", "kind", "authMethod", "swarmKey", "state", "timeout", "guestKeypair", "spaceId", "lifetime", "created", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "_onCancel", "onCancel", "cancel", "expired", "expiration", "expiry", "onAuthenticate", "subscriber", "initialInvitation", "authenticate", "observable", "invitation", "state", "SUCCESS", "resolve", "err", "subscription", "unsubscribe", "reject", "schema", "createServiceBundle", "clientServiceBundle", "SystemService", "getService", "NetworkService", "LoggingService", "IdentityService", "QueryService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "ContactsService", "EdgeAgentService", "QueueService", "DevtoolsHost", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "Schema", "SPACE_TAG", "Symbol", "isSpace", "object", "SpaceSchema", "Any", "pipe", "filter", "space", "annotations", "title", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "IMPORT_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/client.ts":{"bytes":626,"imports":[],"format":"esm"},"src/config.ts":{"bytes":7251,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5726,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/invitations.ts":{"bytes":9220,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":470,"imports":[{"path":"src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"src/service.ts":{"bytes":9540,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/space.ts":{"bytes":8538,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3335,"imports":[],"format":"esm"},"src/types/SpaceProperties.ts":{"bytes":5793,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":395,"imports":[{"path":"src/types/SpaceProperties.ts","kind":"import-statement","original":"./SpaceProperties"}],"format":"esm"},"src/index.ts":{"bytes":1008,"imports":[{"path":"src/client.ts","kind":"import-statement","original":"./client"},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"src/service.ts","kind":"import-statement","original":"./service"},{"path":"src/space.ts","kind":"import-statement","original":"./space"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24083},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-46734GVM.mjs","kind":"import-statement"},{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","ComputeEnvironment","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_PROFILE","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DXEnv","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","EXPECTED_CONFIG_VERSION","IMPORT_SPACE_TIMEOUT","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","RESOURCE_LOCK_TIMEOUT","SPACE_TAG","STATUS_TIMEOUT","SpaceProperties","SpacePropertiesSchema","SpaceSchema","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfileConfigPath","getProfilePath","iframeServiceBundle","isSpace","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":97},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":1181},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/invitations.ts":{"bytesInOutput":1877},"src/service.ts":{"bytesInOutput":1552},"src/space.ts":{"bytesInOutput":332},"src/timeouts.ts":{"bytesInOutput":256}},"bytes":7878},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-46734GVM.mjs","kind":"import-statement"}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":218},"dist/lib/browser/chunk-46734GVM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2836},"dist/lib/browser/chunk-46734GVM.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"inputs":{"src/types/SpaceProperties.ts":{"bytesInOutput":1231},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1385}}}
1
+ {"inputs":{"src/client.ts":{"bytes":626,"imports":[],"format":"esm"},"src/config.ts":{"bytes":7251,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5726,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/invitations.ts":{"bytes":9220,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":470,"imports":[{"path":"src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"src/service.ts":{"bytes":9540,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/space.ts":{"bytes":8390,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3335,"imports":[],"format":"esm"},"src/types/SpaceProperties.ts":{"bytes":5793,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":395,"imports":[{"path":"src/types/SpaceProperties.ts","kind":"import-statement","original":"./SpaceProperties"}],"format":"esm"},"src/index.ts":{"bytes":1008,"imports":[{"path":"src/client.ts","kind":"import-statement","original":"./client"},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"src/service.ts","kind":"import-statement","original":"./service"},{"path":"src/space.ts","kind":"import-statement","original":"./space"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23973},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-46734GVM.mjs","kind":"import-statement"},{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","ComputeEnvironment","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_PROFILE","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DXEnv","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","EXPECTED_CONFIG_VERSION","IMPORT_SPACE_TIMEOUT","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","RESOURCE_LOCK_TIMEOUT","SPACE_TAG","STATUS_TIMEOUT","SpaceProperties","SpacePropertiesSchema","SpaceSchema","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfileConfigPath","getProfilePath","iframeServiceBundle","isSpace","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":97},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":1181},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/invitations.ts":{"bytesInOutput":1877},"src/service.ts":{"bytesInOutput":1552},"src/space.ts":{"bytesInOutput":332},"src/timeouts.ts":{"bytesInOutput":256}},"bytes":7878},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-46734GVM.mjs","kind":"import-statement"}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":218},"dist/lib/browser/chunk-46734GVM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2836},"dist/lib/browser/chunk-46734GVM.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"inputs":{"src/types/SpaceProperties.ts":{"bytesInOutput":1231},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1385}}}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/client.ts", "../../../src/config.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/service.ts", "../../../src/space.ts", "../../../src/timeouts.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport const ClientServicesProviderResource = Symbol.for('dxos.resource.ClientServices');\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(wittjosiah): Factor out to @dxos/config.\n\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\nexport const DEFAULT_WORKER_BROADCAST_CHANNEL = 'dxos:shared-worker';\n\n/**\n * @deprecated\n */\nexport const DEFAULT_VAULT_URL = 'https://halo.dxos.org/vault.html';\n\n/**\n * @deprecated\n */\n// TODO(burdon): Remove need (i.e., make undefined do the right thing).\nexport const DEFAULT_PROFILE = 'default';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? (process?.env?.HOME ?? '') : '';\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport enum DXEnv {\n CONFIG = 'DX_CONFIG',\n DEBUG = 'DX_DEBUG',\n NO_AGENT = 'DX_NO_AGENT',\n PROFILE = 'DX_PROFILE',\n}\n\nexport namespace DXEnv {\n /**\n * Helper to get the value from process.env\n */\n export function get(variable: DXEnv): string | undefined;\n export function get(variable: DXEnv, defaultValue: string): string;\n export function get(variable: DXEnv, defaultValue?: string): string | undefined {\n return process.env[variable] ?? defaultValue;\n }\n}\n\n// Profile layout: profile/<name> is the profile dir; profile/<name>.yml is the config file.\nexport const getProfilePath = (root: string, profile: string, file?: string) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n/** Path to the profile config file (profile/<name>.yml). */\nexport const getProfileConfigPath = (root: string, profile: string) => `${getProfilePath(root, profile)}.yml`;\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols/proto';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n const decodedInvitation = codec.decode(base62.decode(text));\n if (decodedInvitation.type === Invitation.Type.MULTIUSE) {\n decodedInvitation.type = Invitation.Type.INTERACTIVE;\n decodedInvitation.multiUse = true;\n }\n return decodedInvitation;\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n guestKeypair: invitation.guestKeypair,\n spaceId: invitation.spaceId,\n lifetime: invitation.lifetime,\n created: invitation.created,\n // TODO(wittjosiah): Make these optional to encode for greater privacy.\n ...(invitation.spaceKey ? { spaceKey: invitation.spaceKey } : {}),\n ...(invitation.target ? { target: invitation.target } : {}),\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, type Observable, type Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitation[]>;\n accepted: MulticastObservable<AuthenticatingInvitation[]>;\n share(options?: Partial<Invitation>): CancellableInvitation;\n join(invitation: Invitation): AuthenticatingInvitation;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitation extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n\n get expired() {\n const expiration = getExpirationTime(this.get());\n return expiration && expiration.getTime() < Date.now();\n }\n\n get expiry() {\n return getExpirationTime(this.get());\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitation extends CancellableInvitation {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitation): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n\nexport const getExpirationTime = (invitation: Partial<Invitation>): Date | undefined => {\n if (!(invitation.created && invitation.lifetime)) {\n return;\n }\n return new Date(invitation.created.getTime() + invitation.lifetime * 1000);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { schema } from '@dxos/protocols/proto';\nimport type {\n ContactsService,\n DevicesService,\n EdgeAgentService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n QueueService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport type { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';\nimport type { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\n\nexport type { QueueService } from '@dxos/protocols/proto/dxos/client/services';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n\n DataService: DataService;\n QueryService: QueryService;\n QueueService: QueueService;\n\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n /**\n * The connection to the services provider was terminated.\n * This should fire if the services disconnect unexpectedly or during a client reset.\n */\n closed: Event<Error | undefined>;\n\n /**\n * The underlying service connection was re-established.\n * Fires after all reconnection callbacks have completed.\n */\n reconnected?: Event<void>;\n\n /**\n * Register a callback to be invoked when services reconnect.\n * The callback should re-establish any RPC streams.\n * Reconnection waits for all callbacks to complete before emitting `reconnected`.\n */\n onReconnect?: (callback: () => Promise<void>) => void;\n\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<unknown>;\n close(): Promise<unknown>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n QueryService: schema.getService('dxos.echo.query.QueryService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n ContactsService: schema.getService('dxos.client.services.ContactsService'),\n EdgeAgentService: schema.getService('dxos.client.services.EdgeAgentService'),\n QueueService: schema.getService('dxos.client.services.QueueService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { type MulticastObservable } from '@dxos/async';\nimport { type SpecificCredential } from '@dxos/credentials';\nimport { type Database, type Obj } from '@dxos/echo';\nimport { type EchoDatabase, type QueueFactory, type SpaceSyncState } from '@dxos/echo-client';\nimport { type PublicKey, type SpaceId } from '@dxos/keys';\nimport { type Messenger } from '@dxos/protocols';\nimport {\n type Contact,\n type CreateEpochRequest,\n type Invitation,\n SpaceArchive,\n type Space as SpaceData,\n type SpaceMember,\n type SpaceState,\n type UpdateMemberRoleRequest,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';\nimport { type Credential, type Epoch, type MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { type CancellableInvitation } from './invitations';\nimport { type SpaceProperties } from './types';\n\nexport type CreateEpochOptions = {\n migration?: CreateEpochRequest.Migration;\n automergeRootUrl?: string;\n};\n\nexport type ExportSpaceOptions = {\n /**\n * Archive format.\n * @default SpaceArchive.Format.BINARY\n */\n format?: SpaceArchive.Format;\n};\n\nexport interface SpaceInternal {\n get db(): EchoDatabase;\n get data(): SpaceData;\n\n getCredentials(): Promise<Credential[]>;\n\n getEpochs(): Promise<SpecificCredential<Epoch>[]>;\n\n // TODO(dmaretskyi): Return epoch info.\n createEpoch(options?: CreateEpochOptions): Promise<void>;\n\n // TOOD(burdon): Start to factor out credentials.\n removeMember(memberKey: PublicKey): Promise<void>;\n\n export(options?: ExportSpaceOptions): Promise<SpaceArchive>;\n\n /**\n * Migrate space data to the latest version.\n */\n migrate(): Promise<void>;\n\n setEdgeReplicationPreference(setting: EdgeReplicationSetting): Promise<void>;\n\n /**\n * Waits until the space is fully synced with EDGE.\n * @throws If the EDGE sync is disabled.\n */\n syncToEdge(opts?: {\n onProgress: (state: SpaceSyncState.PeerState | undefined) => void;\n timeout?: number;\n }): Promise<void>;\n}\n\nexport const SPACE_TAG = Symbol('dxos.client.protocol.Space');\n\nexport interface Space extends Messenger {\n readonly [SPACE_TAG]: true;\n\n /**\n * @deprecated Use `id`.\n */\n get key(): PublicKey;\n\n /**\n * Unique space identifier.\n */\n get id(): SpaceId;\n\n /**\n * Echo database.\n */\n get db(): Database.Database;\n\n /**\n * Access to queues.\n */\n get queues(): QueueFactory;\n\n // TODO(burdon): Replace with state?\n get isOpen(): boolean;\n\n /**\n * Immutable tags assigned at space creation time.\n * Available on closed spaces.\n */\n get tags(): string[];\n\n /**\n * Immutable membership policy assigned at space creation time.\n * Available on closed spaces.\n */\n get membershipPolicy(): MembershipPolicy;\n\n /**\n * Current state of the space.\n * The database is ready to be used in `SpaceState.SPACE_READY` state.\n * Presence is available in `SpaceState.SPACE_CONTROL_ONLY` state.\n */\n get state(): MulticastObservable<SpaceState>;\n\n /**\n * Properties object.\n */\n get properties(): Obj.OfShape<SpaceProperties>;\n\n /**\n * Current state of space pipeline.\n */\n get pipeline(): MulticastObservable<SpaceData.PipelineState>;\n\n get invitations(): MulticastObservable<CancellableInvitation[]>;\n\n get members(): MulticastObservable<SpaceMember[]>;\n\n /**\n * @deprecated\n */\n // TODO(wittjosiah): Audit and remove. This should not be exposed (or marked as internal).\n get internal(): SpaceInternal;\n\n /**\n * Activates the space enabling the use of the database and starts replication with peers.\n * The setting is persisted on the local device.\n */\n // TODO(wittjosiah): Rename activate/deactivate?\n open(): Promise<void>;\n\n /**\n * Deactivates the space stopping replication with other peers.\n * The space will not auto-open on the next app launch.\n * The setting is persisted on the local device.\n */\n close(): Promise<void>;\n\n /**\n * Tombstones (soft-deletes) the space and replicates the deletion to the user's other devices.\n * Every device stops replicating and unloads the space. Underlying data is not removed until\n * garbage collection (future work). This is terminal: the space cannot be re-opened via {@link open}.\n */\n delete(): Promise<void>;\n\n /**\n * Waits until the space is in the ready state, with database initialized.\n */\n waitUntilReady(): Promise<this>;\n\n createSnapshot(): Promise<SpaceSnapshot>;\n\n // TODO(burdon): Create invitation?\n // TODO(burdon): Factor out membership, etc.\n share(options?: Partial<Invitation>): CancellableInvitation;\n admitContact(contact: Contact): Promise<void>;\n updateMemberRole(request: Omit<UpdateMemberRoleRequest, 'spaceKey'>): Promise<void>;\n}\n\nexport const isSpace = (object: unknown): object is Space =>\n typeof object === 'object' && object != null && (object as Space)[SPACE_TAG] === true;\n\n// TODO(burdon): Create lower-level definition (HasId, db, etc.) and move to @dxos/echo.\nexport const SpaceSchema: Schema.Schema<Space> = Schema.Any.pipe(\n Schema.filter((space) => isSpace(space)),\n Schema.annotations({ title: 'Space' }),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 5_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const IMPORT_SPACE_TIMEOUT = 30_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
5
- "mappings": ";;;;;;;;AAIO,IAAMA,iCAAiCC,uBAAOC,IAAI,8BAAA;;;ACElD,IAAMC,yBAAyB;AAC/B,IAAMC,2BAA2B;AACjC,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAM1B,IAAMC,kBAAkB;AAExB,IAAMC,0BAA0B;AAChC,IAAMC,gBA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N,QAAQM,KAAAA,CAAAA,GAC1BC,mBAAY;EAAEC,OAAO;AAAQ,CAAA,CAAA;;;AChL/B,IAAMC,2BAA2B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;",
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nexport const ClientServicesProviderResource = Symbol.for('dxos.resource.ClientServices');\n", "//\n// Copyright 2022 DXOS.org\n//\n\n// TODO(wittjosiah): Factor out to @dxos/config.\n\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\nexport const DEFAULT_WORKER_BROADCAST_CHANNEL = 'dxos:shared-worker';\n\n/**\n * @deprecated\n */\nexport const DEFAULT_VAULT_URL = 'https://halo.dxos.org/vault.html';\n\n/**\n * @deprecated\n */\n// TODO(burdon): Remove need (i.e., make undefined do the right thing).\nexport const DEFAULT_PROFILE = 'default';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? (process?.env?.HOME ?? '') : '';\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport enum DXEnv {\n CONFIG = 'DX_CONFIG',\n DEBUG = 'DX_DEBUG',\n NO_AGENT = 'DX_NO_AGENT',\n PROFILE = 'DX_PROFILE',\n}\n\nexport namespace DXEnv {\n /**\n * Helper to get the value from process.env\n */\n export function get(variable: DXEnv): string | undefined;\n export function get(variable: DXEnv, defaultValue: string): string;\n export function get(variable: DXEnv, defaultValue?: string): string | undefined {\n return process.env[variable] ?? defaultValue;\n }\n}\n\n// Profile layout: profile/<name> is the profile dir; profile/<name>.yml is the config file.\nexport const getProfilePath = (root: string, profile: string, file?: string) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n/** Path to the profile config file (profile/<name>.yml). */\nexport const getProfileConfigPath = (root: string, profile: string) => `${getProfilePath(root, profile)}.yml`;\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols/proto';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n const decodedInvitation = codec.decode(base62.decode(text));\n if (decodedInvitation.type === Invitation.Type.MULTIUSE) {\n decodedInvitation.type = Invitation.Type.INTERACTIVE;\n decodedInvitation.multiUse = true;\n }\n return decodedInvitation;\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n guestKeypair: invitation.guestKeypair,\n spaceId: invitation.spaceId,\n lifetime: invitation.lifetime,\n created: invitation.created,\n // TODO(wittjosiah): Make these optional to encode for greater privacy.\n ...(invitation.spaceKey ? { spaceKey: invitation.spaceKey } : {}),\n ...(invitation.target ? { target: invitation.target } : {}),\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, type Observable, type Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitation[]>;\n accepted: MulticastObservable<AuthenticatingInvitation[]>;\n share(options?: Partial<Invitation>): CancellableInvitation;\n join(invitation: Invitation): AuthenticatingInvitation;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitation extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n\n get expired() {\n const expiration = getExpirationTime(this.get());\n return expiration && expiration.getTime() < Date.now();\n }\n\n get expiry() {\n return getExpirationTime(this.get());\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitation extends CancellableInvitation {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitation): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n\nexport const getExpirationTime = (invitation: Partial<Invitation>): Date | undefined => {\n if (!(invitation.created && invitation.lifetime)) {\n return;\n }\n return new Date(invitation.created.getTime() + invitation.lifetime * 1000);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { schema } from '@dxos/protocols/proto';\nimport type {\n ContactsService,\n DevicesService,\n EdgeAgentService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n QueueService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport type { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';\nimport type { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\n\nexport type { QueueService } from '@dxos/protocols/proto/dxos/client/services';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n\n DataService: DataService;\n QueryService: QueryService;\n QueueService: QueueService;\n\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n /**\n * The connection to the services provider was terminated.\n * This should fire if the services disconnect unexpectedly or during a client reset.\n */\n closed: Event<Error | undefined>;\n\n /**\n * The underlying service connection was re-established.\n * Fires after all reconnection callbacks have completed.\n */\n reconnected?: Event<void>;\n\n /**\n * Register a callback to be invoked when services reconnect.\n * The callback should re-establish any RPC streams.\n * Reconnection waits for all callbacks to complete before emitting `reconnected`.\n */\n onReconnect?: (callback: () => Promise<void>) => void;\n\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<unknown>;\n close(): Promise<unknown>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n QueryService: schema.getService('dxos.echo.query.QueryService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n ContactsService: schema.getService('dxos.client.services.ContactsService'),\n EdgeAgentService: schema.getService('dxos.client.services.EdgeAgentService'),\n QueueService: schema.getService('dxos.client.services.QueueService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { type MulticastObservable } from '@dxos/async';\nimport { type SpecificCredential } from '@dxos/credentials';\nimport { type Obj } from '@dxos/echo';\nimport { type EchoDatabase, type SpaceSyncState } from '@dxos/echo-client';\nimport { type PublicKey, type SpaceId } from '@dxos/keys';\nimport { type Messenger } from '@dxos/protocols';\nimport {\n type Contact,\n type CreateEpochRequest,\n type Invitation,\n SpaceArchive,\n type Space as SpaceData,\n type SpaceMember,\n type SpaceState,\n type UpdateMemberRoleRequest,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';\nimport { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';\nimport { type Credential, type Epoch, type MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { type CancellableInvitation } from './invitations';\nimport { type SpaceProperties } from './types';\n\nexport type CreateEpochOptions = {\n migration?: CreateEpochRequest.Migration;\n automergeRootUrl?: string;\n};\n\nexport type ExportSpaceOptions = {\n /**\n * Archive format.\n * @default SpaceArchive.Format.BINARY\n */\n format?: SpaceArchive.Format;\n};\n\nexport interface SpaceInternal {\n get db(): EchoDatabase;\n get data(): SpaceData;\n\n getCredentials(): Promise<Credential[]>;\n\n getEpochs(): Promise<SpecificCredential<Epoch>[]>;\n\n // TODO(dmaretskyi): Return epoch info.\n createEpoch(options?: CreateEpochOptions): Promise<void>;\n\n // TOOD(burdon): Start to factor out credentials.\n removeMember(memberKey: PublicKey): Promise<void>;\n\n export(options?: ExportSpaceOptions): Promise<SpaceArchive>;\n\n /**\n * Migrate space data to the latest version.\n */\n migrate(): Promise<void>;\n\n setEdgeReplicationPreference(setting: EdgeReplicationSetting): Promise<void>;\n\n /**\n * Waits until the space is fully synced with EDGE.\n * @throws If the EDGE sync is disabled.\n */\n syncToEdge(opts?: {\n onProgress: (state: SpaceSyncState.PeerState | undefined) => void;\n timeout?: number;\n }): Promise<void>;\n}\n\nexport const SPACE_TAG = Symbol('dxos.client.protocol.Space');\n\nexport interface Space extends Messenger {\n readonly [SPACE_TAG]: true;\n\n /**\n * @deprecated Use `id`.\n */\n get key(): PublicKey;\n\n /**\n * Unique space identifier.\n */\n get id(): SpaceId;\n\n /**\n * Echo database.\n */\n get db(): EchoDatabase;\n\n // TODO(burdon): Replace with state?\n get isOpen(): boolean;\n\n /**\n * Immutable tags assigned at space creation time.\n * Available on closed spaces.\n */\n get tags(): string[];\n\n /**\n * Immutable membership policy assigned at space creation time.\n * Available on closed spaces.\n */\n get membershipPolicy(): MembershipPolicy;\n\n /**\n * Current state of the space.\n * The database is ready to be used in `SpaceState.SPACE_READY` state.\n * Presence is available in `SpaceState.SPACE_CONTROL_ONLY` state.\n */\n get state(): MulticastObservable<SpaceState>;\n\n /**\n * Properties object.\n */\n get properties(): Obj.OfShape<SpaceProperties>;\n\n /**\n * Current state of space pipeline.\n */\n get pipeline(): MulticastObservable<SpaceData.PipelineState>;\n\n get invitations(): MulticastObservable<CancellableInvitation[]>;\n\n get members(): MulticastObservable<SpaceMember[]>;\n\n /**\n * @deprecated\n */\n // TODO(wittjosiah): Audit and remove. This should not be exposed (or marked as internal).\n get internal(): SpaceInternal;\n\n /**\n * Activates the space enabling the use of the database and starts replication with peers.\n * The setting is persisted on the local device.\n */\n // TODO(wittjosiah): Rename activate/deactivate?\n open(): Promise<void>;\n\n /**\n * Deactivates the space stopping replication with other peers.\n * The space will not auto-open on the next app launch.\n * The setting is persisted on the local device.\n */\n close(): Promise<void>;\n\n /**\n * Tombstones (soft-deletes) the space and replicates the deletion to the user's other devices.\n * Every device stops replicating and unloads the space. Underlying data is not removed until\n * garbage collection (future work). This is terminal: the space cannot be re-opened via {@link open}.\n */\n delete(): Promise<void>;\n\n /**\n * Waits until the space is in the ready state, with database initialized.\n */\n waitUntilReady(): Promise<this>;\n\n createSnapshot(): Promise<SpaceSnapshot>;\n\n // TODO(burdon): Create invitation?\n // TODO(burdon): Factor out membership, etc.\n share(options?: Partial<Invitation>): CancellableInvitation;\n admitContact(contact: Contact): Promise<void>;\n updateMemberRole(request: Omit<UpdateMemberRoleRequest, 'spaceKey'>): Promise<void>;\n}\n\nexport const isSpace = (object: unknown): object is Space =>\n typeof object === 'object' && object != null && (object as Space)[SPACE_TAG] === true;\n\n// TODO(burdon): Create lower-level definition (HasId, db, etc.) and move to @dxos/echo.\nexport const SpaceSchema: Schema.Schema<Space> = Schema.Any.pipe(\n Schema.filter((space) => isSpace(space)),\n Schema.annotations({ title: 'Space' }),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 5_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const IMPORT_SPACE_TIMEOUT = 30_000;\n\n/**\n * Tim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DC,YAAYtB,QAAOI,WAAW,wBAAA;AAChC;AAMO,IAAMmB,qBAAwD;EACnEC,cAAcxB,QAAOI,WAAW,0BAAA;AAClC;;;ACnIA,YAAYqB,YAAY;AAuEjB,IAAMC,YAAYC,uBAAO,4BAAA;AAiGzB,IAAMC,UAAU,CAACC,WACtB,OAAOA,WAAW,YAAYA,UAAU,QAASA,OAAiBH,SAAAA,MAAe;AAG5E,IAAMI,cAA2CC,WAAIC,KACnDC,cAAO,CAACC,UAAUN,QAAQM,KAAAA,CAAAA,GAC1BC,mBAAY;EAAEC,OAAO;AAAQ,CAAA,CAAA;;;AC3K/B,IAAMC,2BAA2B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;",
6
6
  "names": ["ClientServicesProviderResource", "Symbol", "for", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_WORKER_BROADCAST_CHANNEL", "DEFAULT_VAULT_URL", "DEFAULT_PROFILE", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "DXEnv", "get", "variable", "defaultValue", "getProfilePath", "root", "profile", "file", "getProfileConfigPath", "base", "schema", "Invitation", "base62", "codec", "getCodecForType", "InvitationEncoder", "decode", "text", "decodedInvitation", "type", "Type", "MULTIUSE", "INTERACTIVE", "multiUse", "encode", "invitation", "invitationId", "kind", "authMethod", "swarmKey", "state", "timeout", "guestKeypair", "spaceId", "lifetime", "created", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "_onCancel", "onCancel", "cancel", "expired", "expiration", "expiry", "onAuthenticate", "subscriber", "initialInvitation", "authenticate", "observable", "invitation", "state", "SUCCESS", "resolve", "err", "subscription", "unsubscribe", "reject", "schema", "createServiceBundle", "clientServiceBundle", "SystemService", "getService", "NetworkService", "LoggingService", "IdentityService", "QueryService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "ContactsService", "EdgeAgentService", "QueueService", "DevtoolsHost", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "Schema", "SPACE_TAG", "Symbol", "isSpace", "object", "SpaceSchema", "Any", "pipe", "filter", "space", "annotations", "title", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "IMPORT_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/client.ts":{"bytes":626,"imports":[],"format":"esm"},"src/config.ts":{"bytes":7251,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5726,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/invitations.ts":{"bytes":9220,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":470,"imports":[{"path":"src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"src/service.ts":{"bytes":9540,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/space.ts":{"bytes":8538,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3335,"imports":[],"format":"esm"},"src/types/SpaceProperties.ts":{"bytes":5793,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":395,"imports":[{"path":"src/types/SpaceProperties.ts","kind":"import-statement","original":"./SpaceProperties"}],"format":"esm"},"src/index.ts":{"bytes":1008,"imports":[{"path":"src/client.ts","kind":"import-statement","original":"./client"},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"src/service.ts","kind":"import-statement","original":"./service"},{"path":"src/space.ts","kind":"import-statement","original":"./space"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24084},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-UTEDAJQA.mjs","kind":"import-statement"},{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","ComputeEnvironment","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_PROFILE","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DXEnv","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","EXPECTED_CONFIG_VERSION","IMPORT_SPACE_TIMEOUT","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","RESOURCE_LOCK_TIMEOUT","SPACE_TAG","STATUS_TIMEOUT","SpaceProperties","SpacePropertiesSchema","SpaceSchema","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfileConfigPath","getProfilePath","iframeServiceBundle","isSpace","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":97},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":1181},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/invitations.ts":{"bytesInOutput":1877},"src/service.ts":{"bytesInOutput":1552},"src/space.ts":{"bytesInOutput":332},"src/timeouts.ts":{"bytesInOutput":256}},"bytes":7970},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-UTEDAJQA.mjs","kind":"import-statement"}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":310},"dist/lib/node-esm/chunk-UTEDAJQA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2838},"dist/lib/node-esm/chunk-UTEDAJQA.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"inputs":{"src/types/SpaceProperties.ts":{"bytesInOutput":1231},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1478}}}
1
+ {"inputs":{"src/client.ts":{"bytes":626,"imports":[],"format":"esm"},"src/config.ts":{"bytes":7251,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5726,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/invitations.ts":{"bytes":9220,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":470,"imports":[{"path":"src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"src/service.ts":{"bytes":9540,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/space.ts":{"bytes":8390,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3335,"imports":[],"format":"esm"},"src/types/SpaceProperties.ts":{"bytes":5793,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":395,"imports":[{"path":"src/types/SpaceProperties.ts","kind":"import-statement","original":"./SpaceProperties"}],"format":"esm"},"src/index.ts":{"bytes":1008,"imports":[{"path":"src/client.ts","kind":"import-statement","original":"./client"},{"path":"src/config.ts","kind":"import-statement","original":"./config"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"src/service.ts","kind":"import-statement","original":"./service"},{"path":"src/space.ts","kind":"import-statement","original":"./space"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23974},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-UTEDAJQA.mjs","kind":"import-statement"},{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","ComputeEnvironment","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_PROFILE","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DXEnv","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","EXPECTED_CONFIG_VERSION","IMPORT_SPACE_TIMEOUT","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","RESOURCE_LOCK_TIMEOUT","SPACE_TAG","STATUS_TIMEOUT","SpaceProperties","SpacePropertiesSchema","SpaceSchema","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfileConfigPath","getProfilePath","iframeServiceBundle","isSpace","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":97},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":1181},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/invitations.ts":{"bytesInOutput":1877},"src/service.ts":{"bytesInOutput":1552},"src/space.ts":{"bytesInOutput":332},"src/timeouts.ts":{"bytesInOutput":256}},"bytes":7970},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-UTEDAJQA.mjs","kind":"import-statement"}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":310},"dist/lib/node-esm/chunk-UTEDAJQA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2838},"dist/lib/node-esm/chunk-UTEDAJQA.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["ComputeEnvironment","SpaceProperties","SpacePropertiesSchema"],"inputs":{"src/types/SpaceProperties.ts":{"bytesInOutput":1231},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1478}}}
@@ -16,6 +16,10 @@ export interface Halo {
16
16
  createIdentity(options?: ProfileDocument, deviceProfile?: DeviceProfileDocument): Promise<Identity>;
17
17
  recoverIdentity(args: {
18
18
  recoveryCode: string;
19
+ } | {
20
+ recoveryProof: string;
21
+ } | {
22
+ token: string;
19
23
  }): Promise<Identity>;
20
24
  updateProfile(profile: ProfileDocument): Promise<Identity>;
21
25
  share(options?: Partial<Invitation>): CancellableInvitation;
@@ -1 +1 @@
1
- {"version":3,"file":"halo.d.ts","sourceRoot":"","sources":["../../../src/halo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACvH,OAAO,EACL,KAAK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;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnH,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3D,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC;IAC5D,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,wBAAwB,CAAC;IAO9F,gBAAgB,CAAC,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,UAAU,EAAE,CAAC;IAC/E,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,kBAAkB,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,SAAS,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC9F"}
@@ -1,8 +1,8 @@
1
1
  import * as Schema from 'effect/Schema';
2
2
  import { type MulticastObservable } from '@dxos/async';
3
3
  import { type SpecificCredential } from '@dxos/credentials';
4
- import { type Database, type Obj } from '@dxos/echo';
5
- import { type EchoDatabase, type QueueFactory, type SpaceSyncState } from '@dxos/echo-client';
4
+ import { type Obj } from '@dxos/echo';
5
+ import { type EchoDatabase, type SpaceSyncState } from '@dxos/echo-client';
6
6
  import { type PublicKey, type SpaceId } from '@dxos/keys';
7
7
  import { type Messenger } from '@dxos/protocols';
8
8
  import { type Contact, type CreateEpochRequest, type Invitation, SpaceArchive, type Space as SpaceData, type SpaceMember, type SpaceState, type UpdateMemberRoleRequest } from '@dxos/protocols/proto/dxos/client/services';
@@ -58,11 +58,7 @@ export interface Space extends Messenger {
58
58
  /**
59
59
  * Echo database.
60
60
  */
61
- get db(): Database.Database;
62
- /**
63
- * Access to queues.
64
- */
65
- get queues(): QueueFactory;
61
+ get db(): EchoDatabase;
66
62
  get isOpen(): boolean;
67
63
  /**
68
64
  * Immutable tags assigned at space creation time.
@@ -1 +1 @@
1
- {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/space.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,KAAK,IAAI,SAAS,EACvB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC7B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAE,KAAK,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAEjH,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO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