@dxos/client-protocol 0.8.4-main.b97322e → 0.8.4-main.dedc0f3

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.
@@ -66,14 +66,23 @@ var InvitationEncoder = class {
66
66
  import { MulticastObservable } from "@dxos/async";
67
67
  import { invariant } from "@dxos/invariant";
68
68
  import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
69
+ function _define_property(obj, key, value) {
70
+ if (key in obj) {
71
+ Object.defineProperty(obj, key, {
72
+ value,
73
+ enumerable: true,
74
+ configurable: true,
75
+ writable: true
76
+ });
77
+ } else {
78
+ obj[key] = value;
79
+ }
80
+ return obj;
81
+ }
69
82
  var __dxlog_file = "/__w/dxos/dxos/packages/sdk/client-protocol/src/invitations/invitations.ts";
70
83
  var AUTHENTICATION_CODE_LENGTH = 6;
71
84
  var INVITATION_TIMEOUT = 3 * 6e4;
72
85
  var CancellableInvitation = class extends MulticastObservable {
73
- constructor({ subscriber, initialInvitation, onCancel }) {
74
- super(subscriber, initialInvitation);
75
- this._onCancel = onCancel;
76
- }
77
86
  cancel() {
78
87
  return this._onCancel();
79
88
  }
@@ -84,19 +93,23 @@ var CancellableInvitation = class extends MulticastObservable {
84
93
  get expiry() {
85
94
  return getExpirationTime(this.get());
86
95
  }
96
+ constructor({ subscriber, initialInvitation, onCancel }) {
97
+ super(subscriber, initialInvitation), _define_property(this, "_onCancel", void 0);
98
+ this._onCancel = onCancel;
99
+ }
87
100
  };
88
101
  var AuthenticatingInvitation = class extends CancellableInvitation {
102
+ async authenticate(authCode) {
103
+ return this._onAuthenticate(authCode);
104
+ }
89
105
  constructor({ subscriber, initialInvitation, onCancel, onAuthenticate }) {
90
106
  super({
91
107
  subscriber,
92
108
  initialInvitation,
93
109
  onCancel
94
- });
110
+ }), _define_property(this, "_onAuthenticate", void 0);
95
111
  this._onAuthenticate = onAuthenticate;
96
112
  }
97
- async authenticate(authCode) {
98
- return this._onAuthenticate(authCode);
99
- }
100
113
  };
101
114
  var wrapObservable = async (observable) => {
102
115
  return new Promise((resolve, reject) => {
@@ -171,6 +184,7 @@ var LOAD_CONTROL_FEEDS_TIMEOUT = 3e3;
171
184
  // src/schema.ts
172
185
  import { Schema } from "effect";
173
186
  import { Type } from "@dxos/echo";
187
+ import { Queue } from "@dxos/echo-db";
174
188
  import { TypedObject } from "@dxos/echo-schema";
175
189
  var TYPE_PROPERTIES = "dxos.org/type/Properties";
176
190
  var PropertiesType = class extends TypedObject({
@@ -181,7 +195,7 @@ var PropertiesType = class extends TypedObject({
181
195
  // TODO(wittjosiah): Make generic?
182
196
  hue: Schema.optional(Schema.String),
183
197
  icon: Schema.optional(Schema.String),
184
- invocationTraceQueue: Schema.optional(Type.Ref(Type.Expando))
198
+ invocationTraceQueue: Schema.optional(Type.Ref(Queue))
185
199
  }, {
186
200
  record: true
187
201
  }) {
@@ -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-definitions.ts", "../../../src/timeouts.ts", "../../../src/schema.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\nimport { type ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\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\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { 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// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\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 const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_NO_AGENT = 'DX_NO_AGENT';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\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 { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport type {\n DevicesService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n SpacesService,\n SystemService,\n ContactsService,\n EdgeAgentService,\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 { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\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 QueryService: QueryService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\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 descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<void>;\n close(): Promise<void>;\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\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\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 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 loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\nimport { TypedObject } from '@dxos/echo-schema';\n\nexport const TYPE_PROPERTIES = 'dxos.org/type/Properties';\n\n// TODO(burdon): Factor out (co-locate with TYPE_PROPERTIES).\nexport class PropertiesType extends TypedObject({\n typename: TYPE_PROPERTIES,\n version: '0.1.0',\n})(\n {\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): Make generic?\n hue: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n invocationTraceQueue: Schema.optional(Type.Ref(Type.Expando)),\n },\n { record: true },\n) {}\n\n// TODO(burdon): Remove? Use PropertiesType instead?\nexport type PropertiesTypeProps = Pick<PropertiesType, 'name' | 'hue' | 'icon' | 'invocationTraceQueue'>;\n"],
5
- "mappings": ";AAIO,IAAMA,iCAAiCC,OAAOC,IAAI,8BAAA;;;ACElD,IAAMC,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAE1B,IAAMC,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAeA,SAASC,KAAKF,QAAQ,KAAM;AAMpE,IAAMG,iBAAiB,CAACC,MAAcC,SAAiBC,OAA2BC,WACvF,GAAGH,IAAAA,YAAgBC,OAAAA,MAAaC,OAAO,IAAIA,IAAAA,KAAS;AAG/C,IAAME,YAAY,GAAGR,IAAAA;AAGrB,IAAMS,WAAW,GAAGT,IAAAA;AAIpB,IAAMU,UAAU,GAAGV,IAAAA;AAGnB,IAAMW,WAAW,GAAGX,IAAAA;AAGpB,IAAMY,aAAa;AAEnB,IAAMC,gBAAgB;AACtB,IAAMC,kBAAkB;AACxB,IAAMC,iBAAiB;AACvB,IAAMC,yBAAyB;;;AC5CtC,OAAOC,UAAU;AAEjB,SAASC,cAAc;AACvB,SAASC,kBAAkB;AAG3B,IAAMC,SAASC,KAAK,gEAAA;AAEpB,IAAMC,QAAQC,OAAOC,gBAAgB,iCAAA;AAK9B,IAAMC,oBAAN,MAAMA;EACX,OAAOC,OAAOC,MAA0B;AACtC,UAAMC,oBAAoBN,MAAMI,OAAON,OAAOM,OA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EhCa,gBAAgBd,QAAOC,WAAW,6BAAA;AACpC,CAAA;AAMO,IAAMc,sBAA0D;EACrEC,eAAehB,QAAOC,WAAW,gCAAA;AACnC;AAMO,IAAMgB,sBAA0D;EACrEC,eAAelB,QAAOC,WAAW,2BAAA;AACnC;AAMO,IAAMkB,mBAAoD;EAC/DC,YAAYpB,QAAOC,WAAW,wBAAA;AAChC;AAMO,IAAMoB,qBAAwD;EACnEC,cAActB,QAAOC,WAAW,0BAAA;AAClC;;;ACtHO,IAAMsB,2BAA2B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;;;AClC1C,SAASC,cAAc;AAEvB,SAASC,YAAY;AACrB,SAASC,mBAAmB;AAErB,IAAMC,kBAAkB;AAGxB,IAAMC,iBAAN,cAA6BC,YAAY;EAC9CC,UAAUH;EACVI,SAAS;AACX,CAAA,EACE;EACEC,MAAMC,OAAOC,SAASD,OAAOE,MAAM;;EAEnCC,KAAKH,OAAOC,SAASD,OAAOE,MAAM;EAClCE,MAAMJ,OAAOC,SAASD,OAAOE,MAAM;EACnCG,sBAAsBL,OAAOC,SAASK,KAAKC,IAAID,KAAKE,OAAO,CAAA;AAC7D,GACA;EAAEC,QAAQ;AAAK,CAAA,EAAA;AACd;",
6
- "names": ["ClientServicesProviderResource", "Symbol", "for", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_WORKER_BROADCAST_CHANNEL", "DEFAULT_VAULT_URL", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "getProfilePath", "root", "profile", "file", "undefined", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "ENV_DX_CONFIG", "ENV_DX_NO_AGENT", "ENV_DX_PROFILE", "ENV_DX_PROFILE_DEFAULT", "base", "schema", "Invitation", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "decodedInvitation", "type", "Invitation", "Type", "MULTIUSE", "INTERACTIVE", "multiUse", "encode", "invitation", "invitationId", "kind", "authMethod", "swarmKey", "state", "timeout", "guestKeypair", "spaceId", "lifetime", "created", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "expired", "expiration", "getExpirationTime", "get", "getTime", "Date", "now", "expiry", "AuthenticatingInvitation", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invitation", "state", "State", "SUCCESS", "unsubscribe", "err", "created", "lifetime", "schema", "createServiceBundle", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "QueryService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "ContactsService", "EdgeAgentService", "FunctionRegistryService", "DevtoolsHost", "TracingService", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT", "Schema", "Type", "TypedObject", "TYPE_PROPERTIES", "PropertiesType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "hue", "icon", "invocationTraceQueue", "Type", "Ref", "Expando", "record"]
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\nimport { type ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\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\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { 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// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\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 const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_NO_AGENT = 'DX_NO_AGENT';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\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 { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport type {\n ContactsService,\n DevicesService,\n EdgeAgentService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\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 { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\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 QueryService: QueryService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\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 descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<void>;\n close(): Promise<void>;\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\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\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 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 loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\nimport { TypedObject } from '@dxos/echo-schema';\n\nexport const TYPE_PROPERTIES = 'dxos.org/type/Properties';\n\n// TODO(burdon): Factor out (co-locate with TYPE_PROPERTIES).\nexport class PropertiesType extends TypedObject({\n typename: TYPE_PROPERTIES,\n version: '0.1.0',\n})(\n {\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): Make generic?\n hue: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n invocationTraceQueue: Schema.optional(Type.Ref(Queue)),\n },\n { record: true },\n) {}\n\n// TODO(burdon): Remove? Use PropertiesType instead?\nexport type PropertiesTypeProps = Pick<PropertiesType, 'name' | 'hue' | 'icon' | 'invocationTraceQueue'>;\n"],
5
+ "mappings": ";AAIO,IAAMA,iCAAiCC,OAAOC,IAAI,8BAAA;;;ACElD,IAAMC,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAE1B,IAAMC,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAeA,SAASC,KAAKF,QAAQ,KAAM;AAMpE,IAAMG,iBAAiB,CAACC,MAAcC,SAAiBC,OAA2BC,WACvF,GAAGH,IAAAA,YAAgBC,OAAAA,MAAaC,OAAO,IAAIA,IAAAA,KAAS;AAG/C,IAAME,YAAY,GAAGR,IAAAA;AAGrB,IAAMS,WAAW,GAAGT,IAAAA;AAIpB,IAAMU,UAAU,GAAGV,IAAAA;AAGnB,IAAMW,WAAW,GAAGX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CG,sBAAsBL,OAAOC,SAASK,KAAKC,IAAIC,KAAAA,CAAAA;AACjD,GACA;EAAEC,QAAQ;AAAK,CAAA,EAAA;AACd;",
6
+ "names": ["ClientServicesProviderResource", "Symbol", "for", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_WORKER_BROADCAST_CHANNEL", "DEFAULT_VAULT_URL", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "getProfilePath", "root", "profile", "file", "undefined", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "ENV_DX_CONFIG", "ENV_DX_NO_AGENT", "ENV_DX_PROFILE", "ENV_DX_PROFILE_DEFAULT", "base", "schema", "Invitation", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "decodedInvitation", "type", "Invitation", "Type", "MULTIUSE", "INTERACTIVE", "multiUse", "encode", "invitation", "invitationId", "kind", "authMethod", "swarmKey", "state", "timeout", "guestKeypair", "spaceId", "lifetime", "created", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "cancel", "_onCancel", "expired", "expiration", "getExpirationTime", "get", "getTime", "Date", "now", "expiry", "subscriber", "initialInvitation", "onCancel", "AuthenticatingInvitation", "authenticate", "authCode", "_onAuthenticate", "onAuthenticate", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invitation", "state", "State", "SUCCESS", "unsubscribe", "err", "created", "lifetime", "schema", "createServiceBundle", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "QueryService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "ContactsService", "EdgeAgentService", "FunctionRegistryService", "DevtoolsHost", "TracingService", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT", "Schema", "Type", "Queue", "TypedObject", "TYPE_PROPERTIES", "PropertiesType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "hue", "icon", "invocationTraceQueue", "Type", "Ref", "Queue", "record"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/client.ts":{"bytes":710,"imports":[],"format":"esm"},"src/config.ts":{"bytes":6067,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5819,"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":9357,"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":565,"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-definitions.ts":{"bytes":9568,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3121,"imports":[],"format":"esm"},"src/schema.ts":{"bytes":2820,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1083,"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-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19132},"dist/lib/browser/index.mjs":{"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},{"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","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_NO_AGENT","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","PropertiesType","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","TYPE_PROPERTIES","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":81},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":841},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/index.ts":{"bytesInOutput":0},"src/invitations/invitations.ts":{"bytesInOutput":1889},"src/service-definitions.ts":{"bytesInOutput":1660},"src/timeouts.ts":{"bytesInOutput":224},"src/schema.ts":{"bytesInOutput":517}},"bytes":7638}}}
1
+ {"inputs":{"src/client.ts":{"bytes":710,"imports":[],"format":"esm"},"src/config.ts":{"bytes":6067,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5819,"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":9767,"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":565,"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-definitions.ts":{"bytes":9568,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3114,"imports":[],"format":"esm"},"src/schema.ts":{"bytes":2916,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1083,"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-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19262},"dist/lib/browser/index.mjs":{"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},{"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","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_NO_AGENT","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","PropertiesType","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","TYPE_PROPERTIES","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":81},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":841},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/index.ts":{"bytesInOutput":0},"src/invitations/invitations.ts":{"bytesInOutput":2233},"src/service-definitions.ts":{"bytesInOutput":1660},"src/timeouts.ts":{"bytesInOutput":224},"src/schema.ts":{"bytesInOutput":549}},"bytes":8014}}}
@@ -68,14 +68,23 @@ var InvitationEncoder = class {
68
68
  import { MulticastObservable } from "@dxos/async";
69
69
  import { invariant } from "@dxos/invariant";
70
70
  import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
71
+ function _define_property(obj, key, value) {
72
+ if (key in obj) {
73
+ Object.defineProperty(obj, key, {
74
+ value,
75
+ enumerable: true,
76
+ configurable: true,
77
+ writable: true
78
+ });
79
+ } else {
80
+ obj[key] = value;
81
+ }
82
+ return obj;
83
+ }
71
84
  var __dxlog_file = "/__w/dxos/dxos/packages/sdk/client-protocol/src/invitations/invitations.ts";
72
85
  var AUTHENTICATION_CODE_LENGTH = 6;
73
86
  var INVITATION_TIMEOUT = 3 * 6e4;
74
87
  var CancellableInvitation = class extends MulticastObservable {
75
- constructor({ subscriber, initialInvitation, onCancel }) {
76
- super(subscriber, initialInvitation);
77
- this._onCancel = onCancel;
78
- }
79
88
  cancel() {
80
89
  return this._onCancel();
81
90
  }
@@ -86,19 +95,23 @@ var CancellableInvitation = class extends MulticastObservable {
86
95
  get expiry() {
87
96
  return getExpirationTime(this.get());
88
97
  }
98
+ constructor({ subscriber, initialInvitation, onCancel }) {
99
+ super(subscriber, initialInvitation), _define_property(this, "_onCancel", void 0);
100
+ this._onCancel = onCancel;
101
+ }
89
102
  };
90
103
  var AuthenticatingInvitation = class extends CancellableInvitation {
104
+ async authenticate(authCode) {
105
+ return this._onAuthenticate(authCode);
106
+ }
91
107
  constructor({ subscriber, initialInvitation, onCancel, onAuthenticate }) {
92
108
  super({
93
109
  subscriber,
94
110
  initialInvitation,
95
111
  onCancel
96
- });
112
+ }), _define_property(this, "_onAuthenticate", void 0);
97
113
  this._onAuthenticate = onAuthenticate;
98
114
  }
99
- async authenticate(authCode) {
100
- return this._onAuthenticate(authCode);
101
- }
102
115
  };
103
116
  var wrapObservable = async (observable) => {
104
117
  return new Promise((resolve, reject) => {
@@ -173,6 +186,7 @@ var LOAD_CONTROL_FEEDS_TIMEOUT = 3e3;
173
186
  // src/schema.ts
174
187
  import { Schema } from "effect";
175
188
  import { Type } from "@dxos/echo";
189
+ import { Queue } from "@dxos/echo-db";
176
190
  import { TypedObject } from "@dxos/echo-schema";
177
191
  var TYPE_PROPERTIES = "dxos.org/type/Properties";
178
192
  var PropertiesType = class extends TypedObject({
@@ -183,7 +197,7 @@ var PropertiesType = class extends TypedObject({
183
197
  // TODO(wittjosiah): Make generic?
184
198
  hue: Schema.optional(Schema.String),
185
199
  icon: Schema.optional(Schema.String),
186
- invocationTraceQueue: Schema.optional(Type.Ref(Type.Expando))
200
+ invocationTraceQueue: Schema.optional(Type.Ref(Queue))
187
201
  }, {
188
202
  record: true
189
203
  }) {
@@ -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-definitions.ts", "../../../src/timeouts.ts", "../../../src/schema.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\nimport { type ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\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\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { 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// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\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 const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_NO_AGENT = 'DX_NO_AGENT';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\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 { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport type {\n DevicesService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n SpacesService,\n SystemService,\n ContactsService,\n EdgeAgentService,\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 { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\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 QueryService: QueryService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\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 descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<void>;\n close(): Promise<void>;\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\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\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 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 loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\nimport { TypedObject } from '@dxos/echo-schema';\n\nexport const TYPE_PROPERTIES = 'dxos.org/type/Properties';\n\n// TODO(burdon): Factor out (co-locate with TYPE_PROPERTIES).\nexport class PropertiesType extends TypedObject({\n typename: TYPE_PROPERTIES,\n version: '0.1.0',\n})(\n {\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): Make generic?\n hue: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n invocationTraceQueue: Schema.optional(Type.Ref(Type.Expando)),\n },\n { record: true },\n) {}\n\n// TODO(burdon): Remove? Use PropertiesType instead?\nexport type PropertiesTypeProps = Pick<PropertiesType, 'name' | 'hue' | 'icon' | 'invocationTraceQueue'>;\n"],
5
- "mappings": ";;;AAIO,IAAMA,iCAAiCC,OAAOC,IAAI,8BAAA;;;ACElD,IAAMC,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAE1B,IAAMC,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAeA,SAASC,KAAKF,QAAQ,KAAM;AAMpE,IAAMG,iBAAiB,CAACC,MAAcC,SAAiBC,OAA2BC,WACvF,GAAGH,IAAAA,YAAgBC,OAAAA,MAAaC,OAAO,IAAIA,IAAAA,KAAS;AAG/C,IAAME,YAAY,GAAGR,IAAAA;AAGrB,IAAMS,WAAW,GAAGT,IAAAA;AAIpB,IAAMU,UAAU,GAAGV,IAAAA;AAGnB,IAAMW,WAAW,GAAGX,IAAAA;AAGpB,IAAMY,aAAa;AAEnB,IAAMC,gBAAgB;AACtB,IAAMC,kBAAkB;AACxB,IAAMC,iBAAiB;AACvB,I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L", "DEFAULT_WORKER_BROADCAST_CHANNEL", "DEFAULT_VAULT_URL", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "getProfilePath", "root", "profile", "file", "undefined", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "ENV_DX_CONFIG", "ENV_DX_NO_AGENT", "ENV_DX_PROFILE", "ENV_DX_PROFILE_DEFAULT", "base", "schema", "Invitation", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "decodedInvitation", "type", "Invitation", "Type", "MULTIUSE", "INTERACTIVE", "multiUse", "encode", "invitation", "invitationId", "kind", "authMethod", "swarmKey", "state", "timeout", "guestKeypair", "spaceId", "lifetime", "created", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "expired", "expiration", "getExpirationTime", "get", "getTime", "Date", "now", "expiry", "AuthenticatingInvitation", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invitation", "state", "State", "SUCCESS", "unsubscribe", "err", "created", "lifetime", "schema", "createServiceBundle", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "QueryService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "ContactsService", "EdgeAgentService", "FunctionRegistryService", "DevtoolsHost", "TracingService", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT", "Schema", "Type", "TypedObject", "TYPE_PROPERTIES", "PropertiesType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "hue", "icon", "invocationTraceQueue", "Type", "Ref", "Expando", "record"]
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\nimport { type ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\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\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { 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// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\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 const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_NO_AGENT = 'DX_NO_AGENT';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\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 { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport type {\n ContactsService,\n DevicesService,\n EdgeAgentService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\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 { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { type ServiceBundle, createServiceBundle } from '@dxos/rpc';\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 QueryService: QueryService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n ContactsService: ContactsService;\n EdgeAgentService: EdgeAgentService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\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 descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n // TODO(burdon): Should take context from parent?\n open(): Promise<void>;\n close(): Promise<void>;\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\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\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 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 loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\nimport { TypedObject } from '@dxos/echo-schema';\n\nexport const TYPE_PROPERTIES = 'dxos.org/type/Properties';\n\n// TODO(burdon): Factor out (co-locate with TYPE_PROPERTIES).\nexport class PropertiesType extends TypedObject({\n typename: TYPE_PROPERTIES,\n version: '0.1.0',\n})(\n {\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): Make generic?\n hue: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n invocationTraceQueue: Schema.optional(Type.Ref(Queue)),\n },\n { record: true },\n) {}\n\n// TODO(burdon): Remove? Use PropertiesType instead?\nexport type PropertiesTypeProps = Pick<PropertiesType, 'name' | 'hue' | 'icon' | 'invocationTraceQueue'>;\n"],
5
+ "mappings": ";;;AAIO,IAAMA,iCAAiCC,OAAOC,IAAI,8BAAA;;;ACElD,IAAMC,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAC9B,IAAMC,mCAAmC;AAKzC,IAAMC,oBAAoB;AAE1B,IAAMC,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAeA,SAASC,KAAKF,QAAQ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ASC,aAAa;AACtB,SAASC,mBAAmB;AAErB,IAAMC,kBAAkB;AAGxB,IAAMC,iBAAN,cAA6BC,YAAY;EAC9CC,UAAUH;EACVI,SAAS;AACX,CAAA,EACE;EACEC,MAAMC,OAAOC,SAASD,OAAOE,MAAM;;EAEnCC,KAAKH,OAAOC,SAASD,OAAOE,MAAM;EAClCE,MAAMJ,OAAOC,SAASD,OAAOE,MAAM;EACnCG,sBAAsBL,OAAOC,SAASK,KAAKC,IAAIC,KAAAA,CAAAA;AACjD,GACA;EAAEC,QAAQ;AAAK,CAAA,EAAA;AACd;",
6
+ "names": ["ClientServicesProviderResource", "Symbol", "for", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_WORKER_BROADCAST_CHANNEL", "DEFAULT_VAULT_URL", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "getProfilePath", "root", "profile", "file", "undefined", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "ENV_DX_CONFIG", "ENV_DX_NO_AGENT", "ENV_DX_PROFILE", "ENV_DX_PROFILE_DEFAULT", "base", "schema", "Invitation", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "decodedInvitation", "type", "Invitation", "Type", "MULTIUSE", "INTERACTIVE", "multiUse", "encode", "invitation", "invitationId", "kind", "authMethod", "swarmKey", "state", "timeout", "guestKeypair", "spaceId", "lifetime", "created", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "cancel", "_onCancel", "expired", "expiration", "getExpirationTime", "get", "getTime", "Date", "now", "expiry", "subscriber", "initialInvitation", "onCancel", "AuthenticatingInvitation", "authenticate", "authCode", "_onAuthenticate", "onAuthenticate", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invitation", "state", "State", "SUCCESS", "unsubscribe", "err", "created", "lifetime", "schema", "createServiceBundle", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "QueryService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "ContactsService", "EdgeAgentService", "FunctionRegistryService", "DevtoolsHost", "TracingService", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT", "Schema", "Type", "Queue", "TypedObject", "TYPE_PROPERTIES", "PropertiesType", "TypedObject", "typename", "version", "name", "Schema", "optional", "String", "hue", "icon", "invocationTraceQueue", "Type", "Ref", "Queue", "record"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/client.ts":{"bytes":710,"imports":[],"format":"esm"},"src/config.ts":{"bytes":6067,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5819,"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":9357,"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":565,"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-definitions.ts":{"bytes":9568,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3121,"imports":[],"format":"esm"},"src/schema.ts":{"bytes":2820,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1083,"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-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19134},"dist/lib/node-esm/index.mjs":{"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},{"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","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_NO_AGENT","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","PropertiesType","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","TYPE_PROPERTIES","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":81},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":841},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/index.ts":{"bytesInOutput":0},"src/invitations/invitations.ts":{"bytesInOutput":1889},"src/service-definitions.ts":{"bytesInOutput":1660},"src/timeouts.ts":{"bytesInOutput":224},"src/schema.ts":{"bytesInOutput":517}},"bytes":7731}}}
1
+ {"inputs":{"src/client.ts":{"bytes":710,"imports":[],"format":"esm"},"src/config.ts":{"bytes":6067,"imports":[],"format":"esm"},"src/invitations/encoder.ts":{"bytes":5819,"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":9767,"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":565,"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-definitions.ts":{"bytes":9568,"imports":[{"path":"@dxos/protocols/proto","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"src/timeouts.ts":{"bytes":3114,"imports":[],"format":"esm"},"src/schema.ts":{"bytes":2916,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1083,"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-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19264},"dist/lib/node-esm/index.mjs":{"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},{"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","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitation","CREATE_SPACE_TIMEOUT","CancellableInvitation","ClientServicesProviderResource","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_URL","DEFAULT_WORKER_BROADCAST_CHANNEL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_NO_AGENT","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","PropertiesType","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","TYPE_PROPERTIES","appServiceBundle","clientServiceBundle","defaultConfig","getExpirationTime","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"src/index.ts","inputs":{"src/client.ts":{"bytesInOutput":81},"src/index.ts":{"bytesInOutput":0},"src/config.ts":{"bytesInOutput":841},"src/invitations/encoder.ts":{"bytesInOutput":1355},"src/invitations/index.ts":{"bytesInOutput":0},"src/invitations/invitations.ts":{"bytesInOutput":2233},"src/service-definitions.ts":{"bytesInOutput":1660},"src/timeouts.ts":{"bytesInOutput":224},"src/schema.ts":{"bytesInOutput":549}},"bytes":8107}}}
@@ -1,7 +1,7 @@
1
1
  import { type MulticastObservable } from '@dxos/async';
2
2
  import { type PublicKey } from '@dxos/keys';
3
3
  import { type Contact, type Device, type Identity, type Invitation } from '@dxos/protocols/proto/dxos/client/services';
4
- import { type DeviceProfileDocument, type Credential, type Presentation, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
4
+ import { type Credential, type DeviceProfileDocument, type Presentation, type ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
5
5
  import { type AuthenticatingInvitation, type CancellableInvitation } from './invitations';
6
6
  /**
7
7
  * TODO(burdon): Public API (move comments here).
@@ -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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CAAC,OAAO,CAAC,EAAE,eAAe,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpG,eAAe,CAAC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnE,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,24 +1,19 @@
1
1
  import { Schema } from 'effect';
2
2
  import { Type } from '@dxos/echo';
3
+ import { Queue } from '@dxos/echo-db';
3
4
  export declare const TYPE_PROPERTIES = "dxos.org/type/Properties";
4
5
  declare const PropertiesType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
5
6
  name: Schema.optional<typeof Schema.String>;
6
7
  hue: Schema.optional<typeof Schema.String>;
7
8
  icon: Schema.optional<typeof Schema.String>;
8
- invocationTraceQueue: Schema.optional<Type.ref<Schema.Schema<Type.Expando, {
9
- [x: string]: any;
10
- id: string;
11
- }, never>>>;
9
+ invocationTraceQueue: Schema.optional<Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
12
10
  }, {
13
11
  record: true;
14
12
  }>, Schema.Struct.Encoded<{
15
13
  name: Schema.optional<typeof Schema.String>;
16
14
  hue: Schema.optional<typeof Schema.String>;
17
15
  icon: Schema.optional<typeof Schema.String>;
18
- invocationTraceQueue: Schema.optional<Type.ref<Schema.Schema<Type.Expando, {
19
- [x: string]: any;
20
- id: string;
21
- }, never>>>;
16
+ invocationTraceQueue: Schema.optional<Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
22
17
  }>>;
23
18
  export declare class PropertiesType extends PropertiesType_base {
24
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC,eAAO,MAAM,eAAe,6BAA6B,CAAC;;;;;;;;;;;;;;;;;;;;AAG1D,qBAAa,cAAe,SAAQ,mBAYnC;CAAG;AAGJ,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,eAAO,MAAM,eAAe,6BAA6B,CAAC;;;;;;;;;;;;;;AAG1D,qBAAa,cAAe,SAAQ,mBAYnC;CAAG;AAGJ,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,sBAAsB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type Event } from '@dxos/async';
2
2
  import type { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';
3
- import type { DevicesService, IdentityService, InvitationsService, LoggingService, NetworkService, SpacesService, SystemService, ContactsService, EdgeAgentService } from '@dxos/protocols/proto/dxos/client/services';
3
+ import type { ContactsService, DevicesService, EdgeAgentService, IdentityService, InvitationsService, LoggingService, NetworkService, SpacesService, SystemService } from '@dxos/protocols/proto/dxos/client/services';
4
4
  import type { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';
5
5
  import type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';
6
6
  import type { DataService } from '@dxos/protocols/proto/dxos/echo/service';
@@ -1 +1 @@
1
- {"version":3,"file":"service-definitions.d.ts","sourceRoot":"","sources":["../../../src/service-definitions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACjG,O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C;CAC5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,kBAAkB,CAEhE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type Event } from '@dxos/async';
2
2
  import { type PublicKey } from '@dxos/keys';
3
- import { type InvitationUrlRequest, type AppContextRequest, type LayoutRequest, type ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
3
+ import { type AppContextRequest, type InvitationUrlRequest, type LayoutRequest, type ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
4
4
  export interface ShellRuntime {
5
5
  layoutUpdate: Event<LayoutRequest>;
6
6
  invitationUrlUpdate: Event<InvitationUrlRequest>;
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/shell.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACnC,mBAAmB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,aAAa,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/shell.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACnC,mBAAmB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,aAAa,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D"}
@@ -1,8 +1,8 @@
1
- import { type MulticastObservable, type CleanupFn } from '@dxos/async';
1
+ import { type CleanupFn, type MulticastObservable } from '@dxos/async';
2
2
  import { type SpecificCredential } from '@dxos/credentials';
3
- import { type QueueFactory, type EchoDatabase, type AnyLiveObject } from '@dxos/echo-db';
3
+ import { type AnyLiveObject, type EchoDatabase, type QueueFactory } from '@dxos/echo-db';
4
4
  import { type PublicKey, type SpaceId } from '@dxos/keys';
5
- import { type Contact, type CreateEpochRequest, type Invitation, type Space as SpaceData, type SpaceArchive, type SpaceMember, type SpaceState, type UpdateMemberRoleRequest } from '@dxos/protocols/proto/dxos/client/services';
5
+ import { type Contact, type CreateEpochRequest, type Invitation, type SpaceArchive, type Space as SpaceData, type SpaceMember, type SpaceState, type UpdateMemberRoleRequest } from '@dxos/protocols/proto/dxos/client/services';
6
6
  import { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
7
7
  import { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';
8
8
  import { type Credential, type Epoch } from '@dxos/protocols/proto/dxos/halo/credentials';
@@ -1 +1 @@
1
- {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,KAAK,IAAI,SAAS,EACvB,KAAK,YAAY,EACjB,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,KA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