@dxos/client-protocol 0.4.10-main.fa5a270 → 0.4.10-main.fd4f2a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +6 -36
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +6 -36
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/schema.d.ts +18 -8
- package/dist/types/src/schema.d.ts.map +1 -1
- package/dist/types/src/space.d.ts +2 -2
- package/dist/types/src/space.d.ts.map +1 -1
- package/package.json +12 -15
- package/src/index.ts +2 -1
- package/src/schema.ts +9 -7
- package/src/space.ts +2 -2
- package/dist/types/src/proto/gen/schema.d.ts +0 -15
- package/dist/types/src/proto/gen/schema.d.ts.map +0 -1
- package/dist/types/src/proto/index.d.ts +0 -2
- package/dist/types/src/proto/index.d.ts.map +0 -1
- package/src/proto/gen/schema.ts +0 -41
- package/src/proto/index.ts +0 -5
- package/src/proto/schema.proto +0 -16
|
@@ -109,34 +109,6 @@ var wrapObservable = async (observable) => {
|
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
// packages/sdk/client-protocol/src/proto/gen/schema.ts
|
|
113
|
-
import * as dxos_echo_schema from "@dxos/echo-schema";
|
|
114
|
-
var types = new dxos_echo_schema.TypeCollection();
|
|
115
|
-
var Properties = class _Properties extends dxos_echo_schema.TypedObject {
|
|
116
|
-
static filter(filter) {
|
|
117
|
-
return dxos_echo_schema.Filter.typename("dxos.sdk.client.Properties", filter);
|
|
118
|
-
}
|
|
119
|
-
constructor(initValues, opts) {
|
|
120
|
-
super({
|
|
121
|
-
...initValues
|
|
122
|
-
}, {
|
|
123
|
-
schema: _Properties.schema,
|
|
124
|
-
...opts
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
types.registerPrototype(Properties, {
|
|
129
|
-
typename: "dxos.sdk.client.Properties",
|
|
130
|
-
props: [
|
|
131
|
-
{
|
|
132
|
-
id: "name",
|
|
133
|
-
type: 1,
|
|
134
|
-
repeated: false
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
});
|
|
138
|
-
types.link();
|
|
139
|
-
|
|
140
112
|
// packages/sdk/client-protocol/src/service-definitions.ts
|
|
141
113
|
import { schema as schema2 } from "@dxos/protocols";
|
|
142
114
|
import { createServiceBundle } from "@dxos/rpc";
|
|
@@ -181,13 +153,13 @@ var LOAD_CONTROL_FEEDS_TIMEOUT = 3e3;
|
|
|
181
153
|
// packages/sdk/client-protocol/src/schema.ts
|
|
182
154
|
import * as S from "@effect/schema/Schema";
|
|
183
155
|
import * as E from "@dxos/echo-schema";
|
|
184
|
-
var
|
|
185
|
-
name: S.optional(S.string)
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"braneframe.Folder": S.optional(E.ref(E.AnyEchoObject))
|
|
156
|
+
var _Properties = S.struct({
|
|
157
|
+
name: S.optional(S.string)
|
|
158
|
+
}, {
|
|
159
|
+
key: S.string,
|
|
160
|
+
value: S.any
|
|
190
161
|
}).pipe(E.echoObject("dxos.sdk.client.Properties", "0.1.0"));
|
|
162
|
+
var Properties = _Properties;
|
|
191
163
|
export {
|
|
192
164
|
AUTHENTICATION_CODE_LENGTH,
|
|
193
165
|
AUTH_TIMEOUT,
|
|
@@ -214,7 +186,6 @@ export {
|
|
|
214
186
|
LOAD_PROPERTIES_TIMEOUT,
|
|
215
187
|
PROXY_CONNECTION_TIMEOUT,
|
|
216
188
|
Properties,
|
|
217
|
-
PropertiesSchema,
|
|
218
189
|
RESOURCE_LOCK_TIMEOUT,
|
|
219
190
|
STATUS_TIMEOUT,
|
|
220
191
|
appServiceBundle,
|
|
@@ -224,7 +195,6 @@ export {
|
|
|
224
195
|
getProfilePath,
|
|
225
196
|
iframeServiceBundle,
|
|
226
197
|
shellServiceBundle,
|
|
227
|
-
types,
|
|
228
198
|
workerServiceBundle,
|
|
229
199
|
wrapObservable
|
|
230
200
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config.ts", "../../../src/echo.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\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';\n\nexport const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';\nexport const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/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_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport type { MulticastObservable } from '@dxos/async';\nimport type { TypeCollection } from '@dxos/echo-schema';\nimport type { PublicKey } from '@dxos/keys';\nimport type { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nimport type { AuthenticatingInvitation } from './invitations';\nimport type { Space } from './space';\n\n// Space properties key for default metadata.\n// TODO(wittjosiah): Remove. Default space should be indicated by data in HALO space.\nexport const defaultKey = '__DEFAULT__';\n\n/**\n * TODO(burdon): Public API (move comments here).\n */\n// TODO(wittjosiah): Rename?\n// https://ts.dev/style/#naming-style\n// ClientApi? ClientProtocol?\nexport interface Echo extends MulticastObservable<Space[]> {\n /**\n * Resolves when the default space is available.\n */\n // TODO(wittjosiah): Remove. Ensure default space is always available.\n get isReady(): MulticastObservable<boolean>;\n\n /**\n * Returns the list of spaces.\n */\n get(): Space[];\n\n /**\n * Returns the space with the given key.\n */\n get(spaceKey: PublicKey): Space | undefined;\n\n /**\n * Returns the default space.\n */\n get default(): Space;\n\n /**\n * Creates a new space.\n */\n create(): Promise<Space>;\n\n /**\n * Creates a space from the given snapshot.\n */\n // clone(snapshot: SpaceSnapshot): Promise<Space>;\n\n /**\n * Joins an existing space using the given invitation.\n */\n join(invitation: Invitation | string): AuthenticatingInvitation;\n\n /**\n * Adds a schema to ECHO.\n */\n // TODO(dmaretskyi): Rename `addTypes`.\n addSchema(schema: TypeCollection): void;\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { type 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 return codec.decode(base62.decode(text));\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 // 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 invitation = this.get();\n return (\n invitation.created &&\n invitation.lifetime &&\n invitation.lifetime !== 0 &&\n invitation.created.getTime() + invitation.lifetime * 1000 < Date.now()\n );\n }\n\n get expiry() {\n const invitation = this.get();\n return invitation.created && invitation.lifetime && invitation.lifetime !== 0\n ? new Date(invitation.created.getTime() + invitation.lifetime * 1000)\n : undefined;\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", "/**\n * @generated @dxos/echo-typegen src/proto/schema.proto\n **/\n\nimport * as dxos_echo_schema from \"@dxos/echo-schema\";\n\nexport const types = new dxos_echo_schema.TypeCollection();\n\nexport type PropertiesProps = {\n name: string;\n};\n\nexport class Properties extends dxos_echo_schema.TypedObject<PropertiesProps> {\n declare static readonly schema: dxos_echo_schema.Schema;\n\n static filter(\n filter?:\n | Partial<PropertiesProps>\n | dxos_echo_schema.OperatorFilter<Properties>,\n ): dxos_echo_schema.Filter<Properties> {\n return dxos_echo_schema.Filter.typename(\n \"dxos.sdk.client.Properties\",\n filter,\n );\n }\n\n constructor(\n initValues?: Partial<PropertiesProps>,\n opts?: dxos_echo_schema.TypedObjectOptions,\n ) {\n super({ ...initValues }, { schema: Properties.schema, ...opts });\n }\n declare name: string;\n}\n\ntypes.registerPrototype(Properties, {\n typename: \"dxos.sdk.client.Properties\",\n props: [{ id: \"name\", type: 1, repeated: false }],\n});\n\ntypes.link();\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { type Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { type FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n type IndexService,\n type DevicesService,\n type IdentityService,\n type InvitationsService,\n type LoggingService,\n type NetworkService,\n type SpacesService,\n type SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\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 { createServiceBundle, type ServiceBundle } 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 IndexService: IndexService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\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 termintaed.\n *\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 open(ctx: Context): Promise<void>;\n close(ctx: Context): 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 IndexService: schema.getService('dxos.client.services.IndexService'),\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\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 * as S from '@effect/schema/Schema';\n\nimport * as E from '@dxos/echo-schema';\n\nexport const PropertiesSchema = S.struct({\n name: S.optional(S.string),\n // TODO(dmaretskyi): Remove.\n 'composer.dxos.org.opened': S.optional(S.number),\n 'composer.dxos.org.version': S.optional(S.union(S.string, S.number)),\n 'braneframe.Folder': S.optional(E.ref(E.AnyEchoObject)),\n}).pipe(E.echoObject('dxos.sdk.client.Properties', '0.1.0'));\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAE9B,IAAMC,uBAAuB;AAC7B,IAAMC,oBAAoBD,uBAAuB;AAEjD,IAAME,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAcA,SAASC,KAAKF,QAAQ,KAAK;AAMlE,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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AMP,aAAa,KAAKC,IAAG;AAC3B,WAAOD,WAAWE,WAAWF,WAAWG,YAAYH,WAAWG,aAAa,IACxE,IAAIE,KAAKL,WAAWE,QAAQE,QAAO,IAAKJ,WAAWG,WAAW,GAAA,IAC9DK;EACN;AACF;AAKO,IAAMC,2BAAN,cAAuCjB,sBAAAA;EAG5CC,YAAY,EACVC,YACAC,mBACAC,UACAc,eAAc,GAMb;AACD,UAAM;MAAEhB;MAAYC;MAAmBC;IAAS,CAAA;AAChD,SAAKe,kBAAkBD;EACzB;EAEA,MAAME,aAAaC,UAAiC;AAClD,WAAO,KAAKF,gBAAgBE,QAAAA;EAC9B;AACF;AAQO,IAAMC,iBAAiB,OAAOC,eAAAA;AACnC,SAAO,IAAIC,QAAQ,CAACC,SAASC,WAAAA;AAC3B,UAAMC,eAAeJ,WAAWK,UAC9B,CAACpB,eAAAA;AAECZ,gBAAUY,YAAYqB,UAAUhC,WAAWiC,MAAMC,SAAO,QAAA;;;;;;;;;AACxDJ,mBAAaK,YAAW;AACxBP,cAAQjB,UAAAA;IACV,GACA,CAACyB,QAAAA;AACCN,mBAAaK,YAAW;AACxBN,aAAOO,GAAAA;IACT,CAAA;EAEJ,CAAA;AACF;;;
|
|
6
|
-
"names": ["DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_VAULT_ORIGIN", "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_PROFILE", "ENV_DX_PROFILE_DEFAULT", "defaultKey", "base", "schema", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "encode", "invitation", "invitationId", "type", "kind", "authMethod", "swarmKey", "state", "timeout", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "constructor", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "expired", "invitation", "get", "created", "lifetime", "getTime", "Date", "now", "expiry", "undefined", "AuthenticatingInvitation", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "state", "State", "SUCCESS", "unsubscribe", "err", "
|
|
3
|
+
"sources": ["../../../src/config.ts", "../../../src/echo.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/service-definitions.ts", "../../../src/timeouts.ts", "../../../src/schema.ts"],
|
|
4
|
+
"sourcesContent": ["//\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';\n\nexport const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';\nexport const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/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_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport type { MulticastObservable } from '@dxos/async';\nimport type { TypeCollection } from '@dxos/echo-schema';\nimport type { PublicKey } from '@dxos/keys';\nimport type { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nimport type { AuthenticatingInvitation } from './invitations';\nimport type { Space } from './space';\n\n// Space properties key for default metadata.\n// TODO(wittjosiah): Remove. Default space should be indicated by data in HALO space.\nexport const defaultKey = '__DEFAULT__';\n\n/**\n * TODO(burdon): Public API (move comments here).\n */\n// TODO(wittjosiah): Rename?\n// https://ts.dev/style/#naming-style\n// ClientApi? ClientProtocol?\nexport interface Echo extends MulticastObservable<Space[]> {\n /**\n * Resolves when the default space is available.\n */\n // TODO(wittjosiah): Remove. Ensure default space is always available.\n get isReady(): MulticastObservable<boolean>;\n\n /**\n * Returns the list of spaces.\n */\n get(): Space[];\n\n /**\n * Returns the space with the given key.\n */\n get(spaceKey: PublicKey): Space | undefined;\n\n /**\n * Returns the default space.\n */\n get default(): Space;\n\n /**\n * Creates a new space.\n */\n create(): Promise<Space>;\n\n /**\n * Creates a space from the given snapshot.\n */\n // clone(snapshot: SpaceSnapshot): Promise<Space>;\n\n /**\n * Joins an existing space using the given invitation.\n */\n join(invitation: Invitation | string): AuthenticatingInvitation;\n\n /**\n * Adds a schema to ECHO.\n */\n // TODO(dmaretskyi): Rename `addTypes`.\n addSchema(schema: TypeCollection): void;\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { type 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 return codec.decode(base62.decode(text));\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 // 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 invitation = this.get();\n return (\n invitation.created &&\n invitation.lifetime &&\n invitation.lifetime !== 0 &&\n invitation.created.getTime() + invitation.lifetime * 1000 < Date.now()\n );\n }\n\n get expiry() {\n const invitation = this.get();\n return invitation.created && invitation.lifetime && invitation.lifetime !== 0\n ? new Date(invitation.created.getTime() + invitation.lifetime * 1000)\n : undefined;\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", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { type Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { type FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n type IndexService,\n type DevicesService,\n type IdentityService,\n type InvitationsService,\n type LoggingService,\n type NetworkService,\n type SpacesService,\n type SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\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 { createServiceBundle, type ServiceBundle } 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 IndexService: IndexService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\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 termintaed.\n *\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 open(ctx: Context): Promise<void>;\n close(ctx: Context): 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 IndexService: schema.getService('dxos.client.services.IndexService'),\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\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 * as S from '@effect/schema/Schema';\n\nimport * as E from '@dxos/echo-schema';\n\nconst _Properties = S.struct({ name: S.optional(S.string) }, { key: S.string, value: S.any }).pipe(\n E.echoObject('dxos.sdk.client.Properties', '0.1.0'),\n);\nexport interface Properties extends S.Schema.Type<typeof _Properties> {}\nexport const Properties = _Properties;\n\nexport type PropertiesProps = {\n name?: string;\n};\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAE9B,IAAMC,uBAAuB;AAC7B,IAAMC,oBAAoBD,uBAAuB;AAEjD,IAAME,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAcA,SAASC,KAAKF,QAAQ,KAAK;AAMlE,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,iBAAiB;AACvB,IAAMC,yBAAyB;;;AC9B/B,IAAMC,aAAa;;;ACV1B,OAAOC,UAAU;AAEjB,SAASC,cAAc;AAIvB,IAAMC,SAASC,KAAK,gEAAA;AAEpB,IAAMC,QAAQC,OAAOC,gBAAgB,iCAAA;AAK9B,IAAMC,oBAAN,MAAMA;EACX,OAAOC,OAAOC,MAA0B;AACtC,WAAOL,MAAMI,OAAON,OAAOM,OAAOC,IAAAA,CAAAA;EACpC;EAEA,OAAOC,OAAOC,YAAgC;AAC5C,WAAOT,OAAOQ,OACZN,MAAMM,OAAO;MACXE,cAAcD,WAAWC;MACzBC,MAAMF,WAAWE;MACjBC,MAAMH,WAAWG;MACjBC,YAAYJ,WAAWI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AAYC,OAAO;AAEnB,YAAYC,OAAO;AAEnB,IAAMC,cAAgBC,SAAO;EAAEC,MAAQC,WAAWC,QAAM;AAAE,GAAG;EAAEC,KAAOD;EAAQE,OAASC;AAAI,CAAA,EAAGC,KAC1FC,aAAW,8BAA8B,OAAA,CAAA;AAGtC,IAAMC,aAAaV;",
|
|
6
|
+
"names": ["DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_VAULT_ORIGIN", "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_PROFILE", "ENV_DX_PROFILE_DEFAULT", "defaultKey", "base", "schema", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "encode", "invitation", "invitationId", "type", "kind", "authMethod", "swarmKey", "state", "timeout", "spaceKey", "target", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "constructor", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "expired", "invitation", "get", "created", "lifetime", "getTime", "Date", "now", "expiry", "undefined", "AuthenticatingInvitation", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "state", "State", "SUCCESS", "unsubscribe", "err", "schema", "createServiceBundle", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "IndexService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "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", "S", "E", "_Properties", "struct", "name", "optional", "string", "key", "value", "any", "pipe", "echoObject", "Properties"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":5856,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/echo.ts":{"bytes":2848,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/halo.ts":{"bytes":1813,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytes":4282,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytes":9484,"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"},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/client-protocol/src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"packages/sdk/client-protocol/src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"packages/sdk/client-protocol/src/
|
|
1
|
+
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":5856,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/echo.ts":{"bytes":2848,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/halo.ts":{"bytes":1813,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytes":4282,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytes":9484,"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"},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/client-protocol/src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"packages/sdk/client-protocol/src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytes":8910,"imports":[{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/shell.ts":{"bytes":1064,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/space.ts":{"bytes":3979,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/timeouts.ts":{"bytes":3134,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/schema.ts":{"bytes":1717,"imports":[{"path":"@effect/schema/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/index.ts":{"bytes":1368,"imports":[{"path":"packages/sdk/client-protocol/src/config.ts","kind":"import-statement","original":"./config"},{"path":"packages/sdk/client-protocol/src/echo.ts","kind":"import-statement","original":"./echo"},{"path":"packages/sdk/client-protocol/src/halo.ts","kind":"import-statement","original":"./halo"},{"path":"packages/sdk/client-protocol/src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/sdk/client-protocol/src/service-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"packages/sdk/client-protocol/src/shell.ts","kind":"import-statement","original":"./shell"},{"path":"packages/sdk/client-protocol/src/space.ts","kind":"import-statement","original":"./space"},{"path":"packages/sdk/client-protocol/src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"packages/sdk/client-protocol/src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"}},"outputs":{"packages/sdk/client-protocol/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18770},"packages/sdk/client-protocol/dist/lib/browser/index.mjs":{"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","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","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@effect/schema/Schema","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","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_ORIGIN","DEFAULT_VAULT_URL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","Properties","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","appServiceBundle","clientServiceBundle","defaultConfig","defaultKey","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"packages/sdk/client-protocol/src/index.ts","inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytesInOutput":797},"packages/sdk/client-protocol/src/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/echo.ts":{"bytesInOutput":32},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytesInOutput":905},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytesInOutput":1925},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytesInOutput":1499},"packages/sdk/client-protocol/src/timeouts.ts":{"bytesInOutput":224},"packages/sdk/client-protocol/src/schema.ts":{"bytesInOutput":271}},"bytes":6830}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -53,7 +53,6 @@ __export(node_exports, {
|
|
|
53
53
|
LOAD_PROPERTIES_TIMEOUT: () => LOAD_PROPERTIES_TIMEOUT,
|
|
54
54
|
PROXY_CONNECTION_TIMEOUT: () => PROXY_CONNECTION_TIMEOUT,
|
|
55
55
|
Properties: () => Properties,
|
|
56
|
-
PropertiesSchema: () => PropertiesSchema,
|
|
57
56
|
RESOURCE_LOCK_TIMEOUT: () => RESOURCE_LOCK_TIMEOUT,
|
|
58
57
|
STATUS_TIMEOUT: () => STATUS_TIMEOUT,
|
|
59
58
|
appServiceBundle: () => appServiceBundle,
|
|
@@ -63,7 +62,6 @@ __export(node_exports, {
|
|
|
63
62
|
getProfilePath: () => getProfilePath,
|
|
64
63
|
iframeServiceBundle: () => iframeServiceBundle,
|
|
65
64
|
shellServiceBundle: () => shellServiceBundle,
|
|
66
|
-
types: () => types,
|
|
67
65
|
workerServiceBundle: () => workerServiceBundle,
|
|
68
66
|
wrapObservable: () => wrapObservable
|
|
69
67
|
});
|
|
@@ -73,7 +71,6 @@ var import_protocols = require("@dxos/protocols");
|
|
|
73
71
|
var import_async = require("@dxos/async");
|
|
74
72
|
var import_invariant = require("@dxos/invariant");
|
|
75
73
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
76
|
-
var dxos_echo_schema = __toESM(require("@dxos/echo-schema"));
|
|
77
74
|
var import_protocols2 = require("@dxos/protocols");
|
|
78
75
|
var import_rpc = require("@dxos/rpc");
|
|
79
76
|
var S = __toESM(require("@effect/schema/Schema"));
|
|
@@ -176,31 +173,6 @@ var wrapObservable = async (observable) => {
|
|
|
176
173
|
});
|
|
177
174
|
});
|
|
178
175
|
};
|
|
179
|
-
var types = new dxos_echo_schema.TypeCollection();
|
|
180
|
-
var Properties = class _Properties extends dxos_echo_schema.TypedObject {
|
|
181
|
-
static filter(filter) {
|
|
182
|
-
return dxos_echo_schema.Filter.typename("dxos.sdk.client.Properties", filter);
|
|
183
|
-
}
|
|
184
|
-
constructor(initValues, opts) {
|
|
185
|
-
super({
|
|
186
|
-
...initValues
|
|
187
|
-
}, {
|
|
188
|
-
schema: _Properties.schema,
|
|
189
|
-
...opts
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
types.registerPrototype(Properties, {
|
|
194
|
-
typename: "dxos.sdk.client.Properties",
|
|
195
|
-
props: [
|
|
196
|
-
{
|
|
197
|
-
id: "name",
|
|
198
|
-
type: 1,
|
|
199
|
-
repeated: false
|
|
200
|
-
}
|
|
201
|
-
]
|
|
202
|
-
});
|
|
203
|
-
types.link();
|
|
204
176
|
var clientServiceBundle = (0, import_rpc.createServiceBundle)({
|
|
205
177
|
SystemService: import_protocols2.schema.getService("dxos.client.services.SystemService"),
|
|
206
178
|
NetworkService: import_protocols2.schema.getService("dxos.client.services.NetworkService"),
|
|
@@ -236,13 +208,13 @@ var RESOURCE_LOCK_TIMEOUT = 3e3;
|
|
|
236
208
|
var LOAD_PROPERTIES_TIMEOUT = 3e3;
|
|
237
209
|
var CREATE_SPACE_TIMEOUT = 5e3;
|
|
238
210
|
var LOAD_CONTROL_FEEDS_TIMEOUT = 3e3;
|
|
239
|
-
var
|
|
240
|
-
name: S.optional(S.string)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
"braneframe.Folder": S.optional(E.ref(E.AnyEchoObject))
|
|
211
|
+
var _Properties = S.struct({
|
|
212
|
+
name: S.optional(S.string)
|
|
213
|
+
}, {
|
|
214
|
+
key: S.string,
|
|
215
|
+
value: S.any
|
|
245
216
|
}).pipe(E.echoObject("dxos.sdk.client.Properties", "0.1.0"));
|
|
217
|
+
var Properties = _Properties;
|
|
246
218
|
// Annotate the CommonJS export names for ESM import in node:
|
|
247
219
|
0 && (module.exports = {
|
|
248
220
|
AUTHENTICATION_CODE_LENGTH,
|
|
@@ -270,7 +242,6 @@ var PropertiesSchema = S.struct({
|
|
|
270
242
|
LOAD_PROPERTIES_TIMEOUT,
|
|
271
243
|
PROXY_CONNECTION_TIMEOUT,
|
|
272
244
|
Properties,
|
|
273
|
-
PropertiesSchema,
|
|
274
245
|
RESOURCE_LOCK_TIMEOUT,
|
|
275
246
|
STATUS_TIMEOUT,
|
|
276
247
|
appServiceBundle,
|
|
@@ -280,7 +251,6 @@ var PropertiesSchema = S.struct({
|
|
|
280
251
|
getProfilePath,
|
|
281
252
|
iframeServiceBundle,
|
|
282
253
|
shellServiceBundle,
|
|
283
|
-
types,
|
|
284
254
|
workerServiceBundle,
|
|
285
255
|
wrapObservable
|
|
286
256
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config.ts", "../../../src/echo.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\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';\n\nexport const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';\nexport const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/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_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport type { MulticastObservable } from '@dxos/async';\nimport type { TypeCollection } from '@dxos/echo-schema';\nimport type { PublicKey } from '@dxos/keys';\nimport type { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nimport type { AuthenticatingInvitation } from './invitations';\nimport type { Space } from './space';\n\n// Space properties key for default metadata.\n// TODO(wittjosiah): Remove. Default space should be indicated by data in HALO space.\nexport const defaultKey = '__DEFAULT__';\n\n/**\n * TODO(burdon): Public API (move comments here).\n */\n// TODO(wittjosiah): Rename?\n// https://ts.dev/style/#naming-style\n// ClientApi? ClientProtocol?\nexport interface Echo extends MulticastObservable<Space[]> {\n /**\n * Resolves when the default space is available.\n */\n // TODO(wittjosiah): Remove. Ensure default space is always available.\n get isReady(): MulticastObservable<boolean>;\n\n /**\n * Returns the list of spaces.\n */\n get(): Space[];\n\n /**\n * Returns the space with the given key.\n */\n get(spaceKey: PublicKey): Space | undefined;\n\n /**\n * Returns the default space.\n */\n get default(): Space;\n\n /**\n * Creates a new space.\n */\n create(): Promise<Space>;\n\n /**\n * Creates a space from the given snapshot.\n */\n // clone(snapshot: SpaceSnapshot): Promise<Space>;\n\n /**\n * Joins an existing space using the given invitation.\n */\n join(invitation: Invitation | string): AuthenticatingInvitation;\n\n /**\n * Adds a schema to ECHO.\n */\n // TODO(dmaretskyi): Rename `addTypes`.\n addSchema(schema: TypeCollection): void;\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { type 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 return codec.decode(base62.decode(text));\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 // 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 invitation = this.get();\n return (\n invitation.created &&\n invitation.lifetime &&\n invitation.lifetime !== 0 &&\n invitation.created.getTime() + invitation.lifetime * 1000 < Date.now()\n );\n }\n\n get expiry() {\n const invitation = this.get();\n return invitation.created && invitation.lifetime && invitation.lifetime !== 0\n ? new Date(invitation.created.getTime() + invitation.lifetime * 1000)\n : undefined;\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", "/**\n * @generated @dxos/echo-typegen src/proto/schema.proto\n **/\n\nimport * as dxos_echo_schema from \"@dxos/echo-schema\";\n\nexport const types = new dxos_echo_schema.TypeCollection();\n\nexport type PropertiesProps = {\n name: string;\n};\n\nexport class Properties extends dxos_echo_schema.TypedObject<PropertiesProps> {\n declare static readonly schema: dxos_echo_schema.Schema;\n\n static filter(\n filter?:\n | Partial<PropertiesProps>\n | dxos_echo_schema.OperatorFilter<Properties>,\n ): dxos_echo_schema.Filter<Properties> {\n return dxos_echo_schema.Filter.typename(\n \"dxos.sdk.client.Properties\",\n filter,\n );\n }\n\n constructor(\n initValues?: Partial<PropertiesProps>,\n opts?: dxos_echo_schema.TypedObjectOptions,\n ) {\n super({ ...initValues }, { schema: Properties.schema, ...opts });\n }\n declare name: string;\n}\n\ntypes.registerPrototype(Properties, {\n typename: \"dxos.sdk.client.Properties\",\n props: [{ id: \"name\", type: 1, repeated: false }],\n});\n\ntypes.link();\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { type Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { type FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n type IndexService,\n type DevicesService,\n type IdentityService,\n type InvitationsService,\n type LoggingService,\n type NetworkService,\n type SpacesService,\n type SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\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 { createServiceBundle, type ServiceBundle } 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 IndexService: IndexService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\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 termintaed.\n *\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 open(ctx: Context): Promise<void>;\n close(ctx: Context): 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 IndexService: schema.getService('dxos.client.services.IndexService'),\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\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 * as S from '@effect/schema/Schema';\n\nimport * as E from '@dxos/echo-schema';\n\nexport const PropertiesSchema = S.struct({\n name: S.optional(S.string),\n // TODO(dmaretskyi): Remove.\n 'composer.dxos.org.opened': S.optional(S.number),\n 'composer.dxos.org.version': S.optional(S.union(S.string, S.number)),\n 'braneframe.Folder': S.optional(E.ref(E.AnyEchoObject)),\n}).pipe(E.echoObject('dxos.sdk.client.Properties', '0.1.0'));\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["import_protocols", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_VAULT_ORIGIN", "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_PROFILE", "ENV_DX_PROFILE_DEFAULT", "defaultKey", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "encode", "invitation", "invitationId", "type", "kind", "authMethod", "swarmKey", "state", "timeout", "spaceKey", "target", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "MulticastObservable", "constructor", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "expired", "get", "created", "lifetime", "getTime", "Date", "now", "expiry", "AuthenticatingInvitation", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invariant", "Invitation", "State", "SUCCESS", "unsubscribe", "err", "
|
|
3
|
+
"sources": ["../../../src/config.ts", "../../../src/echo.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/service-definitions.ts", "../../../src/timeouts.ts", "../../../src/schema.ts"],
|
|
4
|
+
"sourcesContent": ["//\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';\n\nexport const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';\nexport const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/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_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport type { MulticastObservable } from '@dxos/async';\nimport type { TypeCollection } from '@dxos/echo-schema';\nimport type { PublicKey } from '@dxos/keys';\nimport type { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nimport type { AuthenticatingInvitation } from './invitations';\nimport type { Space } from './space';\n\n// Space properties key for default metadata.\n// TODO(wittjosiah): Remove. Default space should be indicated by data in HALO space.\nexport const defaultKey = '__DEFAULT__';\n\n/**\n * TODO(burdon): Public API (move comments here).\n */\n// TODO(wittjosiah): Rename?\n// https://ts.dev/style/#naming-style\n// ClientApi? ClientProtocol?\nexport interface Echo extends MulticastObservable<Space[]> {\n /**\n * Resolves when the default space is available.\n */\n // TODO(wittjosiah): Remove. Ensure default space is always available.\n get isReady(): MulticastObservable<boolean>;\n\n /**\n * Returns the list of spaces.\n */\n get(): Space[];\n\n /**\n * Returns the space with the given key.\n */\n get(spaceKey: PublicKey): Space | undefined;\n\n /**\n * Returns the default space.\n */\n get default(): Space;\n\n /**\n * Creates a new space.\n */\n create(): Promise<Space>;\n\n /**\n * Creates a space from the given snapshot.\n */\n // clone(snapshot: SpaceSnapshot): Promise<Space>;\n\n /**\n * Joins an existing space using the given invitation.\n */\n join(invitation: Invitation | string): AuthenticatingInvitation;\n\n /**\n * Adds a schema to ECHO.\n */\n // TODO(dmaretskyi): Rename `addTypes`.\n addSchema(schema: TypeCollection): void;\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { type 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 return codec.decode(base62.decode(text));\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 // 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 invitation = this.get();\n return (\n invitation.created &&\n invitation.lifetime &&\n invitation.lifetime !== 0 &&\n invitation.created.getTime() + invitation.lifetime * 1000 < Date.now()\n );\n }\n\n get expiry() {\n const invitation = this.get();\n return invitation.created && invitation.lifetime && invitation.lifetime !== 0\n ? new Date(invitation.created.getTime() + invitation.lifetime * 1000)\n : undefined;\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", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Event } from '@dxos/async';\nimport { type Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { type FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n type IndexService,\n type DevicesService,\n type IdentityService,\n type InvitationsService,\n type LoggingService,\n type NetworkService,\n type SpacesService,\n type SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { type DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\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 { createServiceBundle, type ServiceBundle } 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 IndexService: IndexService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\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 termintaed.\n *\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 open(ctx: Context): Promise<void>;\n close(ctx: Context): 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 IndexService: schema.getService('dxos.client.services.IndexService'),\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\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 * as S from '@effect/schema/Schema';\n\nimport * as E from '@dxos/echo-schema';\n\nconst _Properties = S.struct({ name: S.optional(S.string) }, { key: S.string, value: S.any }).pipe(\n E.echoObject('dxos.sdk.client.Properties', '0.1.0'),\n);\nexport interface Properties extends S.Schema.Type<typeof _Properties> {}\nexport const Properties = _Properties;\n\nexport type PropertiesProps = {\n name?: string;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEIA,oBAAiB;AAEjB,uBAAuB;ACFvB,mBAAsE;AACtE,uBAA0B;AAC1B,sBAA2B;ACA3B,IAAAA,oBAAuB;AAiBvB,iBAAwD;AEnBxD,QAAmB;AAEnB,QAAmB;ANAZ,IAAMC,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAE9B,IAAMC,uBAAuB;AAC7B,IAAMC,oBAAoBD,uBAAuB;AAEjD,IAAME,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAcA,SAASC,KAAKF,QAAQ,KAAK;AAMlE,IAAMG,iBAAiB,CAACC,MAAcC,SAAiBC,OAA2BC,WACvF,GAAGH,IAAAA,YAAgBC,OAAAA,MAAaC,OAAO,IAAIA,IAAAA,KAAS;AAG/C,IAA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jCQ,aAAa/D,kBAAAA,OAAOuD,WAAW,+BAAA;;EAG/BS,yBAAyBhE,kBAAAA,OAAOuD,WAAW,8CAAA;;EAG3CU,cAAcjE,kBAAAA,OAAOuD,WAAW,iCAAA;EAEhCW,gBAAgBlE,kBAAAA,OAAOuD,WAAW,6BAAA;AACpC,CAAA;AAMO,IAAMY,sBAA0D;EACrEC,eAAepE,kBAAAA,OAAOuD,WAAW,gCAAA;AACnC;AAMO,IAAMc,sBAA0D;EACrEC,eAAetE,kBAAAA,OAAOuD,WAAW,2BAAA;AACnC;AAMO,IAAMgB,mBAAoD;EAC/DC,YAAYxE,kBAAAA,OAAOuD,WAAW,wBAAA;AAChC;AAMO,IAAMkB,qBAAwD;EACnEC,cAAc1E,kBAAAA,OAAOuD,WAAW,0BAAA;AAClC;ACjHO,IAAMoB,2BAA2B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;AC9B1C,IAAMC,cAAgBC,EAAAA,OAAO;EAAEC,MAAQC,EAAAA,SAAWC,EAAAA,MAAM;AAAE,GAAG;EAAEC,KAAOD,EAAAA;EAAQE,OAASC,EAAAA;AAAI,CAAA,EAAGC,KAC1FC,EAAAA,WAAW,8BAA8B,OAAA,CAAA;AAGtC,IAAMC,aAAaV;",
|
|
6
|
+
"names": ["import_protocols", "DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_VAULT_ORIGIN", "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_PROFILE", "ENV_DX_PROFILE_DEFAULT", "defaultKey", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "encode", "invitation", "invitationId", "type", "kind", "authMethod", "swarmKey", "state", "timeout", "spaceKey", "target", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitation", "MulticastObservable", "constructor", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "expired", "get", "created", "lifetime", "getTime", "Date", "now", "expiry", "AuthenticatingInvitation", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invariant", "Invitation", "State", "SUCCESS", "unsubscribe", "err", "clientServiceBundle", "createServiceBundle", "SystemService", "getService", "NetworkService", "LoggingService", "IdentityService", "IndexService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "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", "_Properties", "struct", "name", "optional", "string", "key", "value", "any", "pipe", "echoObject", "Properties"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":5856,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/echo.ts":{"bytes":2848,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/halo.ts":{"bytes":1813,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytes":4282,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytes":9484,"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"},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/client-protocol/src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"packages/sdk/client-protocol/src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"packages/sdk/client-protocol/src/
|
|
1
|
+
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":5856,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/echo.ts":{"bytes":2848,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/halo.ts":{"bytes":1813,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytes":4282,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytes":9484,"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"},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/client-protocol/src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"packages/sdk/client-protocol/src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytes":8910,"imports":[{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/shell.ts":{"bytes":1064,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/space.ts":{"bytes":3979,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/timeouts.ts":{"bytes":3134,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/schema.ts":{"bytes":1717,"imports":[{"path":"@effect/schema/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/index.ts":{"bytes":1368,"imports":[{"path":"packages/sdk/client-protocol/src/config.ts","kind":"import-statement","original":"./config"},{"path":"packages/sdk/client-protocol/src/echo.ts","kind":"import-statement","original":"./echo"},{"path":"packages/sdk/client-protocol/src/halo.ts","kind":"import-statement","original":"./halo"},{"path":"packages/sdk/client-protocol/src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/sdk/client-protocol/src/service-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"packages/sdk/client-protocol/src/shell.ts","kind":"import-statement","original":"./shell"},{"path":"packages/sdk/client-protocol/src/space.ts","kind":"import-statement","original":"./space"},{"path":"packages/sdk/client-protocol/src/timeouts.ts","kind":"import-statement","original":"./timeouts"},{"path":"packages/sdk/client-protocol/src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"}},"outputs":{"packages/sdk/client-protocol/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18770},"packages/sdk/client-protocol/dist/lib/node/index.cjs":{"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","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","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true},{"path":"@effect/schema/Schema","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","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_ORIGIN","DEFAULT_VAULT_URL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","Properties","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","appServiceBundle","clientServiceBundle","defaultConfig","defaultKey","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"packages/sdk/client-protocol/src/index.ts","inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytesInOutput":797},"packages/sdk/client-protocol/src/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/echo.ts":{"bytesInOutput":32},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytesInOutput":905},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytesInOutput":1925},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytesInOutput":1499},"packages/sdk/client-protocol/src/timeouts.ts":{"bytesInOutput":224},"packages/sdk/client-protocol/src/schema.ts":{"bytesInOutput":271}},"bytes":6830}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import * as S from '@effect/schema/Schema';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare const _Properties: S.Schema<{
|
|
3
|
+
[x: string]: any;
|
|
4
4
|
readonly id: string;
|
|
5
5
|
name?: string | undefined;
|
|
6
|
-
"composer.dxos.org.opened"?: number | undefined;
|
|
7
|
-
"composer.dxos.org.version"?: string | number | undefined;
|
|
8
|
-
"braneframe.Folder"?: E.AnyEchoObject | undefined;
|
|
9
6
|
}, {
|
|
7
|
+
[x: string]: any;
|
|
10
8
|
readonly id: string;
|
|
11
9
|
name?: string | undefined;
|
|
12
|
-
"composer.dxos.org.opened"?: number | undefined;
|
|
13
|
-
"composer.dxos.org.version"?: string | number | undefined;
|
|
14
|
-
"braneframe.Folder"?: E.AnyEchoObject | undefined;
|
|
15
10
|
}, never>;
|
|
11
|
+
export interface Properties extends S.Schema.Type<typeof _Properties> {
|
|
12
|
+
}
|
|
13
|
+
export declare const Properties: S.Schema<{
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
readonly id: string;
|
|
16
|
+
name?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
name?: string | undefined;
|
|
21
|
+
}, never>;
|
|
22
|
+
export type PropertiesProps = {
|
|
23
|
+
name?: string;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
16
26
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAI3C,QAAA,MAAM,WAAW;;;;;;;;SAEhB,CAAC;AACF,MAAM,WAAW,UAAW,SAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC;CAAG;AACxE,eAAO,MAAM,UAAU;;;;;;;;SAAc,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MulticastObservable, type UnsubscribeCallback } from '@dxos/async';
|
|
2
|
-
import { type EchoDatabase, type
|
|
2
|
+
import { type EchoDatabase, type EchoReactiveObject } from '@dxos/echo-schema';
|
|
3
3
|
import { type PublicKey } from '@dxos/keys';
|
|
4
4
|
import { type Invitation, type Space as SpaceData, type SpaceMember, type SpaceState } from '@dxos/protocols/proto/dxos/client/services';
|
|
5
5
|
import { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';
|
|
@@ -35,7 +35,7 @@ export interface Space {
|
|
|
35
35
|
/**
|
|
36
36
|
* Properties object.
|
|
37
37
|
*/
|
|
38
|
-
get properties():
|
|
38
|
+
get properties(): EchoReactiveObject<any>;
|
|
39
39
|
/**
|
|
40
40
|
* Current state of the space.
|
|
41
41
|
* The database is ready to be used in `SpaceState.READY` state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,m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IAAI,mBAAmB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAChE,IAAI,OAAO,IAAI,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC;IAElD,IAAI,QAAQ,IAAI,aAAa,CAAC;IAE9B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAGhC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,KAAK,mBAAmB,CAAC;IAE7F,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,qBAAqB,CAAC;IAE5D,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-protocol",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.fd4f2a3",
|
|
4
4
|
"description": "Core DXOS Client API.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -20,24 +20,21 @@
|
|
|
20
20
|
"@effect/schema": "0.64.7",
|
|
21
21
|
"base-x": "~3.0.9",
|
|
22
22
|
"effect": "2.4.9",
|
|
23
|
-
"@dxos/async": "0.4.10-main.
|
|
24
|
-
"@dxos/config": "0.4.10-main.
|
|
25
|
-
"@dxos/context": "0.4.10-main.
|
|
26
|
-
"@dxos/echo-
|
|
27
|
-
"@dxos/invariant": "0.4.10-main.
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
23
|
+
"@dxos/async": "0.4.10-main.fd4f2a3",
|
|
24
|
+
"@dxos/config": "0.4.10-main.fd4f2a3",
|
|
25
|
+
"@dxos/context": "0.4.10-main.fd4f2a3",
|
|
26
|
+
"@dxos/echo-schema": "0.4.10-main.fd4f2a3",
|
|
27
|
+
"@dxos/invariant": "0.4.10-main.fd4f2a3",
|
|
28
|
+
"@dxos/echo-db": "0.4.10-main.fd4f2a3",
|
|
29
|
+
"@dxos/keys": "0.4.10-main.fd4f2a3",
|
|
30
|
+
"@dxos/protocols": "0.4.10-main.fd4f2a3",
|
|
31
|
+
"@dxos/rpc": "0.4.10-main.fd4f2a3",
|
|
32
|
+
"@dxos/node-std": "0.4.10-main.fd4f2a3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@dxos/echo-typegen": "0.4.10-main.
|
|
35
|
+
"@dxos/echo-typegen": "0.4.10-main.fd4f2a3"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"prebuild": "dxtype src/proto/schema.proto src/proto/gen/schema.ts"
|
|
42
39
|
}
|
|
43
40
|
}
|
package/src/index.ts
CHANGED
|
@@ -6,9 +6,10 @@ export * from './config';
|
|
|
6
6
|
export * from './echo';
|
|
7
7
|
export * from './halo';
|
|
8
8
|
export * from './invitations';
|
|
9
|
-
export * from './proto';
|
|
10
9
|
export * from './service-definitions';
|
|
11
10
|
export * from './shell';
|
|
12
11
|
export * from './space';
|
|
13
12
|
export * from './timeouts';
|
|
14
13
|
export * from './schema';
|
|
14
|
+
|
|
15
|
+
// This comment is here to bust NX cache. Remove it after the code changes.
|
package/src/schema.ts
CHANGED
|
@@ -6,10 +6,12 @@ import * as S from '@effect/schema/Schema';
|
|
|
6
6
|
|
|
7
7
|
import * as E from '@dxos/echo-schema';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const _Properties = S.struct({ name: S.optional(S.string) }, { key: S.string, value: S.any }).pipe(
|
|
10
|
+
E.echoObject('dxos.sdk.client.Properties', '0.1.0'),
|
|
11
|
+
);
|
|
12
|
+
export interface Properties extends S.Schema.Type<typeof _Properties> {}
|
|
13
|
+
export const Properties = _Properties;
|
|
14
|
+
|
|
15
|
+
export type PropertiesProps = {
|
|
16
|
+
name?: string;
|
|
17
|
+
};
|
package/src/space.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type MulticastObservable, type UnsubscribeCallback } from '@dxos/async';
|
|
6
|
-
import { type EchoDatabase, type
|
|
6
|
+
import { type EchoDatabase, type EchoReactiveObject } from '@dxos/echo-schema';
|
|
7
7
|
import { type PublicKey } from '@dxos/keys';
|
|
8
8
|
import {
|
|
9
9
|
type Invitation,
|
|
@@ -56,7 +56,7 @@ export interface Space {
|
|
|
56
56
|
/**
|
|
57
57
|
* Properties object.
|
|
58
58
|
*/
|
|
59
|
-
get properties():
|
|
59
|
+
get properties(): EchoReactiveObject<any>;
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Current state of the space.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated @dxos/echo-typegen src/proto/schema.proto
|
|
3
|
-
**/
|
|
4
|
-
import * as dxos_echo_schema from "@dxos/echo-schema";
|
|
5
|
-
export declare const types: dxos_echo_schema.TypeCollection;
|
|
6
|
-
export type PropertiesProps = {
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class Properties extends dxos_echo_schema.TypedObject<PropertiesProps> {
|
|
10
|
-
static readonly schema: dxos_echo_schema.Schema;
|
|
11
|
-
static filter(filter?: Partial<PropertiesProps> | dxos_echo_schema.OperatorFilter<Properties>): dxos_echo_schema.Filter<Properties>;
|
|
12
|
-
constructor(initValues?: Partial<PropertiesProps>, opts?: dxos_echo_schema.TypedObjectOptions);
|
|
13
|
-
name: string;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/proto/gen/schema.ts"],"names":[],"mappings":"AAAA;;IAEI;AAEJ,OAAO,KAAK,gBAAgB,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,KAAK,iCAAwC,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,qBAAa,UAAW,SAAQ,gBAAgB,CAAC,WAAW,CAAC,eAAe,CAAC;IAC3E,gBAAwB,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAExD,MAAM,CAAC,MAAM,CACX,MAAM,CAAC,EACH,OAAO,CAAC,eAAe,CAAC,GACxB,gBAAgB,CAAC,cAAc,CAAC,UAAU,CAAC,GAC9C,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC;gBAQpC,UAAU,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EACrC,IAAI,CAAC,EAAE,gBAAgB,CAAC,kBAAkB;IAIpC,IAAI,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/proto/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
package/src/proto/gen/schema.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated @dxos/echo-typegen src/proto/schema.proto
|
|
3
|
-
**/
|
|
4
|
-
|
|
5
|
-
import * as dxos_echo_schema from "@dxos/echo-schema";
|
|
6
|
-
|
|
7
|
-
export const types = new dxos_echo_schema.TypeCollection();
|
|
8
|
-
|
|
9
|
-
export type PropertiesProps = {
|
|
10
|
-
name: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export class Properties extends dxos_echo_schema.TypedObject<PropertiesProps> {
|
|
14
|
-
declare static readonly schema: dxos_echo_schema.Schema;
|
|
15
|
-
|
|
16
|
-
static filter(
|
|
17
|
-
filter?:
|
|
18
|
-
| Partial<PropertiesProps>
|
|
19
|
-
| dxos_echo_schema.OperatorFilter<Properties>,
|
|
20
|
-
): dxos_echo_schema.Filter<Properties> {
|
|
21
|
-
return dxos_echo_schema.Filter.typename(
|
|
22
|
-
"dxos.sdk.client.Properties",
|
|
23
|
-
filter,
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
constructor(
|
|
28
|
-
initValues?: Partial<PropertiesProps>,
|
|
29
|
-
opts?: dxos_echo_schema.TypedObjectOptions,
|
|
30
|
-
) {
|
|
31
|
-
super({ ...initValues }, { schema: Properties.schema, ...opts });
|
|
32
|
-
}
|
|
33
|
-
declare name: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
types.registerPrototype(Properties, {
|
|
37
|
-
typename: "dxos.sdk.client.Properties",
|
|
38
|
-
props: [{ id: "name", type: 1, repeated: false }],
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
types.link();
|
package/src/proto/index.ts
DELETED