@dxos/client-protocol 0.8.4-main.d05673bc65 → 0.8.4-main.e00bdcdb52

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 (32) hide show
  1. package/dist/lib/browser/{chunk-HQBTSFTW.mjs → chunk-GCBXMPTW.mjs} +21 -5
  2. package/dist/lib/browser/chunk-GCBXMPTW.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +7 -12
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +5 -1
  7. package/dist/lib/node-esm/{chunk-URWCZ2QB.mjs → chunk-2RN4CLEW.mjs} +21 -5
  8. package/dist/lib/node-esm/chunk-2RN4CLEW.mjs.map +7 -0
  9. package/dist/lib/node-esm/index.mjs +7 -12
  10. package/dist/lib/node-esm/index.mjs.map +3 -3
  11. package/dist/lib/node-esm/meta.json +1 -1
  12. package/dist/lib/node-esm/types/index.mjs +5 -1
  13. package/dist/types/src/config.d.ts.map +1 -1
  14. package/dist/types/src/echo.d.ts +5 -13
  15. package/dist/types/src/echo.d.ts.map +1 -1
  16. package/dist/types/src/invitations/encoder.d.ts.map +1 -1
  17. package/dist/types/src/invitations/invitations.d.ts +2 -2
  18. package/dist/types/src/invitations/invitations.d.ts.map +1 -1
  19. package/dist/types/src/service.d.ts +0 -2
  20. package/dist/types/src/service.d.ts.map +1 -1
  21. package/dist/types/src/space.d.ts +20 -3
  22. package/dist/types/src/space.d.ts.map +1 -1
  23. package/dist/types/src/types/SpaceProperties.d.ts +43 -3
  24. package/dist/types/src/types/SpaceProperties.d.ts.map +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +13 -20
  27. package/src/echo.ts +5 -17
  28. package/src/service.ts +0 -4
  29. package/src/space.ts +23 -3
  30. package/src/types/SpaceProperties.ts +32 -4
  31. package/dist/lib/browser/chunk-HQBTSFTW.mjs.map +0 -7
  32. package/dist/lib/node-esm/chunk-URWCZ2QB.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/client-protocol",
3
- "version": "0.8.4-main.d05673bc65",
3
+ "version": "0.8.4-main.e00bdcdb52",
4
4
  "description": "Core DXOS Client API.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -27,33 +27,26 @@
27
27
  }
28
28
  },
29
29
  "types": "dist/types/src/index.d.ts",
30
- "typesVersions": {
31
- "*": {
32
- "./types": [
33
- "./dist/types/src/types/index.d.ts"
34
- ]
35
- }
36
- },
37
30
  "files": [
38
31
  "dist",
39
32
  "src"
40
33
  ],
41
34
  "dependencies": {
42
35
  "base-x": "~3.0.11",
43
- "effect": "3.19.16",
44
- "@dxos/context": "0.8.4-main.d05673bc65",
45
- "@dxos/credentials": "0.8.4-main.d05673bc65",
46
- "@dxos/echo": "0.8.4-main.d05673bc65",
47
- "@dxos/echo-db": "0.8.4-main.d05673bc65",
48
- "@dxos/invariant": "0.8.4-main.d05673bc65",
49
- "@dxos/keys": "0.8.4-main.d05673bc65",
50
- "@dxos/node-std": "0.8.4-main.d05673bc65",
51
- "@dxos/protocols": "0.8.4-main.d05673bc65",
52
- "@dxos/rpc": "0.8.4-main.d05673bc65",
53
- "@dxos/async": "0.8.4-main.d05673bc65"
36
+ "effect": "3.20.0",
37
+ "@dxos/async": "0.8.4-main.e00bdcdb52",
38
+ "@dxos/context": "0.8.4-main.e00bdcdb52",
39
+ "@dxos/echo": "0.8.4-main.e00bdcdb52",
40
+ "@dxos/invariant": "0.8.4-main.e00bdcdb52",
41
+ "@dxos/echo-db": "0.8.4-main.e00bdcdb52",
42
+ "@dxos/node-std": "0.8.4-main.e00bdcdb52",
43
+ "@dxos/protocols": "0.8.4-main.e00bdcdb52",
44
+ "@dxos/rpc": "0.8.4-main.e00bdcdb52",
45
+ "@dxos/credentials": "0.8.4-main.e00bdcdb52",
46
+ "@dxos/keys": "0.8.4-main.e00bdcdb52"
54
47
  },
55
48
  "peerDependencies": {
56
- "effect": "3.19.16"
49
+ "effect": "3.20.0"
57
50
  },
58
51
  "publishConfig": {
59
52
  "access": "public"
package/src/echo.ts CHANGED
@@ -6,6 +6,7 @@ import type { MulticastObservable } from '@dxos/async';
6
6
  import type { Database } from '@dxos/echo';
7
7
  import type { PublicKey, SpaceId } from '@dxos/keys';
8
8
  import type { Invitation, SpaceArchive } from '@dxos/protocols/proto/dxos/client/services';
9
+ import type { MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';
9
10
 
10
11
  import type { AuthenticatingInvitation } from './invitations';
11
12
  import type { Space } from './space';
@@ -16,12 +17,6 @@ import type { SpaceProperties } from './types';
16
17
  */
17
18
  // TODO(wittjosiah): Rename Database (not product name).
18
19
  export interface Echo extends MulticastObservable<Space[]>, Database.Queryable {
19
- /**
20
- * Observable which indicates when the default space is available.
21
- */
22
- // TODO(wittjosiah): Remove. Ensure default space is always available.
23
- get isReady(): MulticastObservable<boolean>;
24
-
25
20
  /**
26
21
  * Returns the list of spaces.
27
22
  */
@@ -38,20 +33,13 @@ export interface Echo extends MulticastObservable<Space[]>, Database.Queryable {
38
33
  */
39
34
  get(spaceKey: PublicKey): Space | undefined;
40
35
 
41
- /**
42
- * Returns the default space.
43
- */
44
- get default(): Space;
45
-
46
- /**
47
- * Resolves when the default space is available.
48
- */
49
- waitUntilReady(): Promise<void>;
50
-
51
36
  /**
52
37
  * Creates a new space.
53
38
  */
54
- create(props?: Pick<SpaceProperties, 'name' | 'hue' | 'icon' | 'invocationTraceQueue'>): Promise<Space>;
39
+ create(
40
+ props?: Pick<SpaceProperties, 'name' | 'hue' | 'icon' | 'invocationTraceFeed'>,
41
+ options?: { tags?: string[]; membershipPolicy?: MembershipPolicy },
42
+ ): Promise<Space>;
55
43
 
56
44
  /**
57
45
  * Creates a space from the given archive.
package/src/service.ts CHANGED
@@ -21,7 +21,6 @@ import type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';
21
21
  import type { DataService } from '@dxos/protocols/proto/dxos/echo/service';
22
22
  import type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';
23
23
  import type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';
24
- import type { TracingService } from '@dxos/protocols/proto/dxos/tracing';
25
24
  import { type ServiceBundle, createServiceBundle } from '@dxos/rpc';
26
25
 
27
26
  export type { QueueService } from '@dxos/protocols/proto/dxos/client/services';
@@ -49,8 +48,6 @@ export type ClientServices = {
49
48
 
50
49
  // TODO(burdon): Deprecated.
51
50
  DevtoolsHost: DevtoolsHost;
52
-
53
- TracingService: TracingService;
54
51
  };
55
52
 
56
53
  /**
@@ -104,7 +101,6 @@ export const clientServiceBundle = createServiceBundle<ClientServices>({
104
101
 
105
102
  // TODO(burdon): Deprecated.
106
103
  DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),
107
- TracingService: schema.getService('dxos.tracing.TracingService'),
108
104
  });
109
105
 
110
106
  export type IframeServiceBundle = {
package/src/space.ts CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  type Contact,
15
15
  type CreateEpochRequest,
16
16
  type Invitation,
17
- type SpaceArchive,
17
+ SpaceArchive,
18
18
  type Space as SpaceData,
19
19
  type SpaceMember,
20
20
  type SpaceState,
@@ -22,7 +22,7 @@ import {
22
22
  } from '@dxos/protocols/proto/dxos/client/services';
23
23
  import { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
24
24
  import { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';
25
- import { type Credential, type Epoch } from '@dxos/protocols/proto/dxos/halo/credentials';
25
+ import { type Credential, type Epoch, type MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';
26
26
 
27
27
  import { type CancellableInvitation } from './invitations';
28
28
  import { type SpaceProperties } from './types';
@@ -32,6 +32,14 @@ export type CreateEpochOptions = {
32
32
  automergeRootUrl?: string;
33
33
  };
34
34
 
35
+ export type ExportSpaceOptions = {
36
+ /**
37
+ * Archive format.
38
+ * @default SpaceArchive.Format.BINARY
39
+ */
40
+ format?: SpaceArchive.Format;
41
+ };
42
+
35
43
  export interface SpaceInternal {
36
44
  get db(): EchoDatabase;
37
45
  get data(): SpaceData;
@@ -46,7 +54,7 @@ export interface SpaceInternal {
46
54
  // TOOD(burdon): Start to factor out credentials.
47
55
  removeMember(memberKey: PublicKey): Promise<void>;
48
56
 
49
- export(): Promise<SpaceArchive>;
57
+ export(options?: ExportSpaceOptions): Promise<SpaceArchive>;
50
58
 
51
59
  /**
52
60
  * Migrate space data to the latest version.
@@ -93,6 +101,18 @@ export interface Space extends Messenger {
93
101
  // TODO(burdon): Replace with state?
94
102
  get isOpen(): boolean;
95
103
 
104
+ /**
105
+ * Immutable tags assigned at space creation time.
106
+ * Available on closed spaces.
107
+ */
108
+ get tags(): string[];
109
+
110
+ /**
111
+ * Immutable membership policy assigned at space creation time.
112
+ * Available on closed spaces.
113
+ */
114
+ get membershipPolicy(): MembershipPolicy;
115
+
96
116
  /**
97
117
  * Current state of the space.
98
118
  * The database is ready to be used in `SpaceState.SPACE_READY` state.
@@ -4,8 +4,13 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Annotation, Ref, Type } from '@dxos/echo';
8
- import { Queue } from '@dxos/echo-db';
7
+ import { Annotation, Feed, Ref, Type } from '@dxos/echo';
8
+
9
+ /**
10
+ * Where do triggers get executed.
11
+ */
12
+ export const ComputeEnvironment = Schema.Literal('disabled', 'local', 'edge');
13
+ export type ComputeEnvironment = Schema.Schema.Type<typeof ComputeEnvironment>;
9
14
 
10
15
  export const SpacePropertiesSchema = Schema.Struct(
11
16
  {
@@ -17,7 +22,19 @@ export const SpacePropertiesSchema = Schema.Struct(
17
22
  // TODO(burdon): Change to mode (no booleans?)
18
23
  // TODO(wittjosiah): Make optional with default value.
19
24
  edgeReplication: Schema.optional(Schema.Boolean),
20
- invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),
25
+
26
+ /**
27
+ * @deprecated
28
+ */
29
+ invocationTraceFeed: Schema.optional(Ref.Ref(Feed.Feed)),
30
+
31
+ /**
32
+ * Preference for trigger execution.
33
+ * *disabled* - triggers do not run locally or on EDGE.
34
+ * *local* - triggers are executed locally on the client, edge is not running triggers.
35
+ * *edge* - triggers are executed on the edge, triggers are not run locally.
36
+ */
37
+ computeEnvironment: Schema.optional(ComputeEnvironment),
21
38
 
22
39
  //
23
40
  // User properties.
@@ -35,11 +52,22 @@ export const SpacePropertiesSchema = Schema.Struct(
35
52
 
36
53
  export type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSchema>;
37
54
 
55
+ /** @deprecated Use SpaceProperties instead. */
56
+ export const LegacySpaceProperties = SpacePropertiesSchema.pipe(
57
+ Type.object({
58
+ typename: 'org.dxos.type.space-properties',
59
+ version: '0.1.0',
60
+ }),
61
+ Annotation.SystemTypeAnnotation.set(true),
62
+ );
63
+
64
+ export interface LegacySpaceProperties extends Schema.Schema.Type<typeof LegacySpaceProperties> {}
65
+
38
66
  // TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?
39
67
  // TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?
40
68
  export const SpaceProperties = SpacePropertiesSchema.pipe(
41
69
  Type.object({
42
- typename: 'org.dxos.type.space-properties',
70
+ typename: 'org.dxos.type.spaceProperties',
43
71
  version: '0.1.0',
44
72
  }),
45
73
  Annotation.SystemTypeAnnotation.set(true),
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/SpaceProperties.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Ref, Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\n\nexport const SpacePropertiesSchema = Schema.Struct(\n {\n //\n // System properties.\n //\n\n archived: Schema.optional(Schema.Boolean.annotations({ title: 'Archive Space' })),\n // TODO(burdon): Change to mode (no booleans?)\n // TODO(wittjosiah): Make optional with default value.\n edgeReplication: Schema.optional(Schema.Boolean),\n invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),\n\n //\n // User properties.\n //\n\n name: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n hue: Schema.optional(Schema.String),\n },\n {\n key: Schema.String,\n value: Schema.Any,\n },\n);\n\nexport type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSchema>;\n\n// TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?\n// TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?\nexport const SpaceProperties = SpacePropertiesSchema.pipe(\n Type.object({\n typename: 'org.dxos.type.space-properties',\n version: '0.1.0',\n }),\n Annotation.SystemTypeAnnotation.set(true),\n);\n\nexport interface SpaceProperties extends Schema.Schema.Type<typeof SpaceProperties> {}\n"],
5
- "mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,aAAa;AAEf,IAAMC,wBAA+BC,cAC1C;;;;EAKEC,UAAiBC,gBAAgBC,eAAQC,YAAY;IAAEC,OAAO;EAAgB,CAAA,CAAA;;;EAG9EC,iBAAwBJ,gBAAgBC,cAAO;EAC/CI,sBAA6BL,gBAASM,IAAIA,IAAIC,KAAAA,CAAAA;;;;EAM9CC,MAAaR,gBAAgBS,aAAM;EACnCC,MAAaV,gBAAgBS,aAAM;EACnCE,KAAYX,gBAAgBS,aAAM;AACpC,GACA;EACEG,KAAYH;EACZI,OAAcC;AAChB,CAAA;AAOK,IAAMC,kBAAkBlB,sBAAsBmB,KACnDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,qBAAqBC,IAAI,IAAA,CAAA;",
6
- "names": ["Schema", "Annotation", "Ref", "Type", "Queue", "SpacePropertiesSchema", "Struct", "archived", "optional", "Boolean", "annotations", "title", "edgeReplication", "invocationTraceQueue", "Ref", "Queue", "name", "String", "icon", "hue", "key", "value", "Any", "SpaceProperties", "pipe", "Type", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/SpaceProperties.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Ref, Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\n\nexport const SpacePropertiesSchema = Schema.Struct(\n {\n //\n // System properties.\n //\n\n archived: Schema.optional(Schema.Boolean.annotations({ title: 'Archive Space' })),\n // TODO(burdon): Change to mode (no booleans?)\n // TODO(wittjosiah): Make optional with default value.\n edgeReplication: Schema.optional(Schema.Boolean),\n invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),\n\n //\n // User properties.\n //\n\n name: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n hue: Schema.optional(Schema.String),\n },\n {\n key: Schema.String,\n value: Schema.Any,\n },\n);\n\nexport type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSchema>;\n\n// TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?\n// TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?\nexport const SpaceProperties = SpacePropertiesSchema.pipe(\n Type.object({\n typename: 'org.dxos.type.space-properties',\n version: '0.1.0',\n }),\n Annotation.SystemTypeAnnotation.set(true),\n);\n\nexport interface SpaceProperties extends Schema.Schema.Type<typeof SpaceProperties> {}\n"],
5
- "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,aAAa;AAEf,IAAMC,wBAA+BC,cAC1C;;;;EAKEC,UAAiBC,gBAAgBC,eAAQC,YAAY;IAAEC,OAAO;EAAgB,CAAA,CAAA;;;EAG9EC,iBAAwBJ,gBAAgBC,cAAO;EAC/CI,sBAA6BL,gBAASM,IAAIA,IAAIC,KAAAA,CAAAA;;;;EAM9CC,MAAaR,gBAAgBS,aAAM;EACnCC,MAAaV,gBAAgBS,aAAM;EACnCE,KAAYX,gBAAgBS,aAAM;AACpC,GACA;EACEG,KAAYH;EACZI,OAAcC;AAChB,CAAA;AAOK,IAAMC,kBAAkBlB,sBAAsBmB,KACnDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,qBAAqBC,IAAI,IAAA,CAAA;",
6
- "names": ["Schema", "Annotation", "Ref", "Type", "Queue", "SpacePropertiesSchema", "Struct", "archived", "optional", "Boolean", "annotations", "title", "edgeReplication", "invocationTraceQueue", "Ref", "Queue", "name", "String", "icon", "hue", "key", "value", "Any", "SpaceProperties", "pipe", "Type", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set"]
7
- }