@dxos/client-protocol 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe

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.
Files changed (38) hide show
  1. package/dist/lib/browser/chunk-HIQWFHOK.mjs +25 -0
  2. package/dist/lib/browser/chunk-HIQWFHOK.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +17 -43
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +9 -0
  7. package/dist/lib/browser/types/index.mjs.map +7 -0
  8. package/dist/lib/node-esm/chunk-TN3JZMTK.mjs +27 -0
  9. package/dist/lib/node-esm/chunk-TN3JZMTK.mjs.map +7 -0
  10. package/dist/lib/node-esm/index.mjs +16 -43
  11. package/dist/lib/node-esm/index.mjs.map +4 -4
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/lib/node-esm/types/index.mjs +10 -0
  14. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  15. package/dist/types/src/echo.d.ts +8 -14
  16. package/dist/types/src/echo.d.ts.map +1 -1
  17. package/dist/types/src/index.d.ts +1 -1
  18. package/dist/types/src/index.d.ts.map +1 -1
  19. package/dist/types/src/service-definitions.d.ts +0 -2
  20. package/dist/types/src/service-definitions.d.ts.map +1 -1
  21. package/dist/types/src/space.d.ts +9 -1
  22. package/dist/types/src/space.d.ts.map +1 -1
  23. package/dist/types/src/timeouts.d.ts +4 -0
  24. package/dist/types/src/timeouts.d.ts.map +1 -1
  25. package/dist/types/src/{schema.d.ts → types/Properties.d.ts} +3 -3
  26. package/dist/types/src/types/Properties.d.ts.map +1 -0
  27. package/dist/types/src/types/index.d.ts +2 -0
  28. package/dist/types/src/types/index.d.ts.map +1 -0
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +24 -15
  31. package/src/echo.ts +10 -19
  32. package/src/index.ts +1 -1
  33. package/src/service-definitions.ts +0 -7
  34. package/src/space.ts +10 -1
  35. package/src/timeouts.ts +5 -0
  36. package/src/{schema.ts → types/Properties.ts} +2 -2
  37. package/src/types/index.ts +5 -0
  38. package/dist/types/src/schema.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/client-protocol",
3
- "version": "0.8.4-main.e098934",
3
+ "version": "0.8.4-main.e8ec1fe",
4
4
  "description": "Core DXOS Client API.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -15,11 +15,21 @@
15
15
  "types": "./dist/types/src/index.d.ts",
16
16
  "browser": "./dist/lib/browser/index.mjs",
17
17
  "node": "./dist/lib/node-esm/index.mjs"
18
+ },
19
+ "./types": {
20
+ "source": "./src/types/index.ts",
21
+ "types": "./dist/types/src/types/index.d.ts",
22
+ "browser": "./dist/lib/browser/types/index.mjs",
23
+ "node": "./dist/lib/node-esm/types/index.mjs"
18
24
  }
19
25
  },
20
26
  "types": "dist/types/src/index.d.ts",
21
27
  "typesVersions": {
22
- "*": {}
28
+ "*": {
29
+ "./types": [
30
+ "./dist/types/src/types/index.d.ts"
31
+ ]
32
+ }
23
33
  },
24
34
  "files": [
25
35
  "dist",
@@ -27,19 +37,18 @@
27
37
  ],
28
38
  "dependencies": {
29
39
  "base-x": "~3.0.9",
30
- "effect": "3.17.7",
31
- "@dxos/async": "0.8.4-main.e098934",
32
- "@dxos/config": "0.8.4-main.e098934",
33
- "@dxos/echo": "0.8.4-main.e098934",
34
- "@dxos/context": "0.8.4-main.e098934",
35
- "@dxos/credentials": "0.8.4-main.e098934",
36
- "@dxos/echo-db": "0.8.4-main.e098934",
37
- "@dxos/echo-schema": "0.8.4-main.e098934",
38
- "@dxos/invariant": "0.8.4-main.e098934",
39
- "@dxos/node-std": "0.8.4-main.e098934",
40
- "@dxos/protocols": "0.8.4-main.e098934",
41
- "@dxos/rpc": "0.8.4-main.e098934",
42
- "@dxos/keys": "0.8.4-main.e098934"
40
+ "effect": "3.18.3",
41
+ "@dxos/async": "0.8.4-main.e8ec1fe",
42
+ "@dxos/config": "0.8.4-main.e8ec1fe",
43
+ "@dxos/credentials": "0.8.4-main.e8ec1fe",
44
+ "@dxos/echo": "0.8.4-main.e8ec1fe",
45
+ "@dxos/context": "0.8.4-main.e8ec1fe",
46
+ "@dxos/echo-db": "0.8.4-main.e8ec1fe",
47
+ "@dxos/invariant": "0.8.4-main.e8ec1fe",
48
+ "@dxos/keys": "0.8.4-main.e8ec1fe",
49
+ "@dxos/node-std": "0.8.4-main.e8ec1fe",
50
+ "@dxos/protocols": "0.8.4-main.e8ec1fe",
51
+ "@dxos/rpc": "0.8.4-main.e8ec1fe"
43
52
  },
44
53
  "peerDependencies": {
45
54
  "effect": "^3.13.3"
package/src/echo.ts CHANGED
@@ -3,26 +3,19 @@
3
3
  //
4
4
 
5
5
  import type { MulticastObservable } from '@dxos/async';
6
- import type { QueryFn } from '@dxos/echo-db';
6
+ import type { Queryable } from '@dxos/echo-db';
7
7
  import type { PublicKey, SpaceId } from '@dxos/keys';
8
8
  import type { Invitation, SpaceArchive } from '@dxos/protocols/proto/dxos/client/services';
9
9
 
10
10
  import type { AuthenticatingInvitation } from './invitations';
11
- import type { PropertiesTypeProps } from './schema';
12
11
  import type { Space } from './space';
12
+ import type { PropertiesTypeProps } from './types';
13
13
 
14
14
  /**
15
- * TODO(burdon): Public API (move comments here).
15
+ * Public database API.
16
16
  */
17
- // TODO(wittjosiah): Rename?
18
- // https://ts.dev/style/#naming-style
19
- // ClientApi? ClientProtocol?
20
- export interface Echo extends MulticastObservable<Space[]> {
21
- /**
22
- * Resolves when the default space is available.
23
- */
24
- waitUntilReady(): Promise<void>;
25
-
17
+ // TODO(wittjosiah): Rename Database (not product name).
18
+ export interface Echo extends MulticastObservable<Space[]>, Queryable {
26
19
  /**
27
20
  * Observable which indicates when the default space is available.
28
21
  */
@@ -50,6 +43,11 @@ export interface Echo extends MulticastObservable<Space[]> {
50
43
  */
51
44
  get default(): Space;
52
45
 
46
+ /**
47
+ * Resolves when the default space is available.
48
+ */
49
+ waitUntilReady(): Promise<void>;
50
+
53
51
  /**
54
52
  * Creates a new space.
55
53
  */
@@ -66,11 +64,4 @@ export interface Echo extends MulticastObservable<Space[]> {
66
64
  join(invitation: Invitation | string): AuthenticatingInvitation;
67
65
 
68
66
  joinBySpaceKey(spaceKey: PublicKey): Promise<Space>;
69
-
70
- /**
71
- * Query all spaces.
72
- * @param filter
73
- * @param options
74
- */
75
- query: QueryFn;
76
67
  }
package/src/index.ts CHANGED
@@ -11,4 +11,4 @@ export * from './service-definitions';
11
11
  export type * from './shell';
12
12
  export type * from './space';
13
13
  export * from './timeouts';
14
- export * from './schema';
14
+ export * from './types';
@@ -4,7 +4,6 @@
4
4
 
5
5
  import { type Event } from '@dxos/async';
6
6
  import { schema } from '@dxos/protocols/proto';
7
- import type { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';
8
7
  import type {
9
8
  ContactsService,
10
9
  DevicesService,
@@ -42,8 +41,6 @@ export type ClientServices = {
42
41
  ContactsService: ContactsService;
43
42
  EdgeAgentService: EdgeAgentService;
44
43
 
45
- FunctionRegistryService: FunctionRegistryService;
46
-
47
44
  // TODO(burdon): Deprecated.
48
45
  DevtoolsHost: DevtoolsHost;
49
46
 
@@ -84,12 +81,8 @@ export const clientServiceBundle = createServiceBundle<ClientServices>({
84
81
  ContactsService: schema.getService('dxos.client.services.ContactsService'),
85
82
  EdgeAgentService: schema.getService('dxos.client.services.EdgeAgentService'),
86
83
 
87
- // Agent-only.
88
- FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),
89
-
90
84
  // TODO(burdon): Deprecated.
91
85
  DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),
92
-
93
86
  TracingService: schema.getService('dxos.tracing.TracingService'),
94
87
  });
95
88
 
package/src/space.ts CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { type CleanupFn, type MulticastObservable } from '@dxos/async';
6
6
  import { type SpecificCredential } from '@dxos/credentials';
7
- import { type AnyLiveObject, type EchoDatabase, type QueueFactory } from '@dxos/echo-db';
7
+ import { type AnyLiveObject, type EchoDatabase, type QueueFactory, type SpaceSyncState } from '@dxos/echo-db';
8
8
  import { type PublicKey, type SpaceId } from '@dxos/keys';
9
9
  import {
10
10
  type Contact,
@@ -47,6 +47,15 @@ export interface SpaceInternal {
47
47
 
48
48
  setEdgeReplicationPreference(setting: EdgeReplicationSetting): Promise<void>;
49
49
 
50
+ /**
51
+ * Waits until the space is fully synced with EDGE.
52
+ * @throws If the EDGE sync is disabled.
53
+ */
54
+ syncToEdge(opts?: {
55
+ onProgress: (state: SpaceSyncState.PeerState | undefined) => void;
56
+ timeout?: number;
57
+ }): Promise<void>;
58
+
50
59
  export(): Promise<SpaceArchive>;
51
60
  }
52
61
 
package/src/timeouts.ts CHANGED
@@ -33,6 +33,11 @@ export const LOAD_PROPERTIES_TIMEOUT = 3_000;
33
33
  */
34
34
  export const CREATE_SPACE_TIMEOUT = 5_000;
35
35
 
36
+ /**
37
+ * Timeout for creating new spaces.
38
+ */
39
+ export const IMPORT_SPACE_TIMEOUT = 30_000;
40
+
36
41
  /**
37
42
  * Timeout for loading of control feeds.
38
43
  */
@@ -2,11 +2,11 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { Type } from '@dxos/echo';
8
+ import { TypedObject } from '@dxos/echo/internal';
8
9
  import { Queue } from '@dxos/echo-db';
9
- import { TypedObject } from '@dxos/echo-schema';
10
10
 
11
11
  export const TYPE_PROPERTIES = 'dxos.org/type/Properties';
12
12
 
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './Properties';
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,eAAO,MAAM,eAAe,6BAA6B,CAAC;;;;;;;;;;;;;;AAG1D,qBAAa,cAAe,SAAQ,mBAYnC;CAAG;AAGJ,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,sBAAsB,CAAC,CAAC"}