@dxos/protocols 0.1.58-main.f5feb2a → 0.1.58-main.f69fa2f

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 (54) hide show
  1. package/dist/cjs/src/errors/encoding.d.ts.map +1 -1
  2. package/dist/cjs/src/errors/encoding.js.map +1 -1
  3. package/dist/cjs/src/errors/errors.js +2 -2
  4. package/dist/cjs/src/errors/errors.js.map +1 -1
  5. package/dist/cjs/src/errors/helpers.d.ts +1 -1
  6. package/dist/cjs/src/errors/helpers.d.ts.map +1 -1
  7. package/dist/cjs/src/errors/helpers.js.map +1 -1
  8. package/dist/cjs/src/index.d.ts +2 -2
  9. package/dist/cjs/src/index.d.ts.map +1 -1
  10. package/dist/cjs/src/index.js +2 -2
  11. package/dist/cjs/src/index.js.map +1 -1
  12. package/dist/cjs/src/proto/gen/dxos/config.d.ts +51 -5
  13. package/dist/cjs/src/proto/gen/dxos/config.d.ts.map +1 -1
  14. package/dist/cjs/src/proto/gen/dxos/config.js.map +1 -1
  15. package/dist/cjs/src/proto/gen/index.d.ts +1 -0
  16. package/dist/cjs/src/proto/gen/index.d.ts.map +1 -1
  17. package/dist/cjs/src/proto/gen/index.js +1 -1
  18. package/dist/cjs/src/proto/gen/index.js.map +1 -1
  19. package/dist/cjs/src/storage.d.ts +2 -3
  20. package/dist/cjs/src/storage.d.ts.map +1 -1
  21. package/dist/cjs/src/storage.js +2 -3
  22. package/dist/cjs/src/storage.js.map +1 -1
  23. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  24. package/dist/esm/src/errors/encoding.d.ts.map +1 -1
  25. package/dist/esm/src/errors/encoding.js.map +1 -1
  26. package/dist/esm/src/errors/errors.js +2 -2
  27. package/dist/esm/src/errors/errors.js.map +1 -1
  28. package/dist/esm/src/errors/helpers.d.ts +1 -1
  29. package/dist/esm/src/errors/helpers.d.ts.map +1 -1
  30. package/dist/esm/src/errors/helpers.js.map +1 -1
  31. package/dist/esm/src/index.d.ts +2 -2
  32. package/dist/esm/src/index.d.ts.map +1 -1
  33. package/dist/esm/src/index.js +2 -2
  34. package/dist/esm/src/index.js.map +1 -1
  35. package/dist/esm/src/proto/gen/dxos/config.d.ts +51 -5
  36. package/dist/esm/src/proto/gen/dxos/config.d.ts.map +1 -1
  37. package/dist/esm/src/proto/gen/dxos/config.js.map +1 -1
  38. package/dist/esm/src/proto/gen/index.d.ts +1 -0
  39. package/dist/esm/src/proto/gen/index.d.ts.map +1 -1
  40. package/dist/esm/src/proto/gen/index.js +1 -1
  41. package/dist/esm/src/proto/gen/index.js.map +1 -1
  42. package/dist/esm/src/storage.d.ts +2 -3
  43. package/dist/esm/src/storage.d.ts.map +1 -1
  44. package/dist/esm/src/storage.js +2 -3
  45. package/dist/esm/src/storage.js.map +1 -1
  46. package/package.json +5 -5
  47. package/src/errors/encoding.ts +1 -1
  48. package/src/errors/errors.ts +2 -2
  49. package/src/errors/helpers.ts +1 -1
  50. package/src/index.ts +2 -2
  51. package/src/proto/dxos/config.proto +31 -9
  52. package/src/proto/gen/dxos/config.ts +51 -5
  53. package/src/proto/gen/index.ts +2 -1
  54. package/src/storage.ts +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAuDhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AA+e7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,qm0FAAqm0F,CAAC,CAAC,CAAC;AAC9p0F,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAkB,UAAU,EAAE,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAuDhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAgf7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,6s2FAA6s2F,CAAC,CAAC,CAAC;AACtw2F,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAkB,UAAU,EAAE,aAAa,CAAC,CAAC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Version for the schema of the stored data as defined in dxos.echo.metadata.EchoMetadata.
3
- *
4
- * Should be incremented every time there's a breaking change to the stored data.
3
+ * update when making breaking changes to the protocols or other stored data.
5
4
  */
6
- export declare const STORAGE_VERSION = 1;
5
+ export declare const STORAGE_VERSION = 2;
7
6
  //# sourceMappingURL=storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC"}
@@ -3,8 +3,7 @@
3
3
  //
4
4
  /**
5
5
  * Version for the schema of the stored data as defined in dxos.echo.metadata.EchoMetadata.
6
- *
7
- * Should be incremented every time there's a breaking change to the stored data.
6
+ * update when making breaking changes to the protocols or other stored data.
8
7
  */
9
- export const STORAGE_VERSION = 1;
8
+ export const STORAGE_VERSION = 2;
10
9
  //# sourceMappingURL=storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/protocols",
3
- "version": "0.1.58-main.f5feb2a",
3
+ "version": "0.1.58-main.f69fa2f",
4
4
  "description": "Protobuf definitions for DXOS protocols.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -33,10 +33,10 @@
33
33
  "src"
34
34
  ],
35
35
  "dependencies": {
36
- "@dxos/codec-protobuf": "0.1.58-main.f5feb2a",
37
- "@dxos/invariant": "0.1.58-main.f5feb2a",
38
- "@dxos/keys": "0.1.58-main.f5feb2a",
39
- "@dxos/timeframe": "0.1.58-main.f5feb2a"
36
+ "@dxos/codec-protobuf": "0.1.58-main.f69fa2f",
37
+ "@dxos/invariant": "0.1.58-main.f69fa2f",
38
+ "@dxos/keys": "0.1.58-main.f69fa2f",
39
+ "@dxos/timeframe": "0.1.58-main.f69fa2f"
40
40
  },
41
41
  "devDependencies": {
42
42
  "glob": "~7.1.6"
@@ -2,8 +2,8 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
6
5
  import { reconstructError } from './helpers';
6
+ import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
7
7
 
8
8
  export const encodeError = (err: any): SerializedErrorProto => {
9
9
  if (typeof err === 'object' && err?.message) {
@@ -121,14 +121,14 @@ export class TimeoutError extends BaseError {
121
121
  }
122
122
  }
123
123
 
124
- // General protocol error
124
+ // General protocol error.
125
125
  export class ProtocolError extends BaseError {
126
126
  constructor(message?: string, context?: any) {
127
127
  super('PROTOCOL_ERROR', message, context);
128
128
  }
129
129
  }
130
130
 
131
- // General connectivity errors
131
+ // General connectivity errors.
132
132
  export class ConnectivityError extends BaseError {
133
133
  constructor(message?: string, context?: any) {
134
134
  super('CONNECTIVITY_ERROR', message, context);
@@ -5,7 +5,6 @@
5
5
  import { invariant } from '@dxos/invariant';
6
6
  import { PublicKey } from '@dxos/keys';
7
7
 
8
- import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
9
8
  import {
10
9
  CancelledError,
11
10
  ConnectionResetError,
@@ -28,6 +27,7 @@ import {
28
27
  UnknownModelError,
29
28
  UnknownProtocolError,
30
29
  } from './errors';
30
+ import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
31
31
 
32
32
  export const reconstructError = (error: SerializedErrorProto) => {
33
33
  const { name, message, context } = error;
package/src/index.ts CHANGED
@@ -2,9 +2,9 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
+ export * from './errors';
5
6
  export * from './proto';
6
7
  export * from './storage';
7
8
  export * from './testing';
8
- export * from './types';
9
9
  export * from './tracing';
10
- export * from './errors';
10
+ export * from './types';
@@ -45,6 +45,9 @@ message Repo {
45
45
  optional string version = 3;
46
46
  }
47
47
 
48
+ //
49
+ // Unit of deployment.
50
+ //
48
51
  message Module {
49
52
  message Build {
50
53
  optional string command = 1;
@@ -55,22 +58,23 @@ message Module {
55
58
  optional google.protobuf.Struct env = 10;
56
59
  }
57
60
 
58
- optional string name = 1; // TODO(burdon): Replace with id (or key?)
59
61
  optional string id = 8; // TODO(burdon): Ensured FQ (e.g., 'dxos.app.xxx')
60
- optional string type = 2; // TODO(burdon): Define namespace (e.g., 'dxos:type/frame' vs. 'dxos.type.frame')
62
+ optional string name = 1; // TODO(burdon): Replace with id (or key?)
63
+ optional string type = 2; // TODO(burdon): Define namespace (e.g., 'dxos.org/type/frame' vs. 'dxos.type.frame')
61
64
 
62
65
  // TODO(burdon): Developer info message.
63
66
 
67
+ // TODO(burdon): Start at 10.
64
68
  optional string display_name = 3;
65
69
  optional string description = 4;
66
70
  repeated string tags = 5;
67
- optional bytes bundle = 6;
71
+ optional bytes bundle = 6; // TODO(burdon): ???
68
72
 
69
73
  // TODO(burdon): Remove.
70
74
  optional bool tunnel = 7;
71
75
 
76
+ // TODO(burdon): Start at 100.
72
77
  repeated Module deps = 10; // TODO(burdon): E.g., types.
73
-
74
78
  optional Build build = 100;
75
79
  repeated Repo repos = 101;
76
80
 
@@ -90,15 +94,15 @@ message Runtime {
90
94
  NODE = 4;
91
95
  WEBFS = 5;
92
96
 
93
- // Key storage only
97
+ // Key storage only.
94
98
  LEVELJS = 11;
95
99
  JSONDOWN = 12;
96
100
  }
97
101
 
98
- optional bool persistent = 1; // TODO(burdon): Replace with type.
99
- optional StorageDriver key_storage = 3; // TODO(burdon): Rename key_store.
100
- optional StorageDriver storage_type = 2; // TODO(burdon): Rename data_store.
101
- optional string path = 4; // TODO(burdon): Rename data_path.
102
+ optional bool persistent = 1;
103
+ optional StorageDriver key_store = 2;
104
+ optional StorageDriver data_store = 3;
105
+ optional string data_root = 4;
102
106
  }
103
107
 
104
108
  message Log {
@@ -152,7 +156,25 @@ message Runtime {
152
156
  int32 port = 1;
153
157
  }
154
158
 
159
+ /// Automatic epoch creation.
160
+ message EpochMontior {
161
+ optional bool enabled = 5;
162
+
163
+ /// Number of mutations required since last epoch to trigger a new epoch.
164
+ optional int32 minMessagesBetweenEpochs = 1;
165
+
166
+ /// Amount of time (in milliseconds) required to pass since last epoch to trigger a new epoch.
167
+ optional int32 minTimeBetweenEpochs = 2;
168
+
169
+ /// Amount of time (in milliseconds) required to pass since last mutation to trigger a new epoch.
170
+ optional int32 minInactivityBeforeEpoch = 3;
171
+
172
+ /// Maximum amount of time (in milliseconds) to wait for an inactivity period before triggering a new epoch.
173
+ optional int32 maxInactivityDelay = 4;
174
+ }
175
+
155
176
  optional Functions functions = 1;
177
+ optional EpochMontior epoch_monitor = 2;
156
178
  }
157
179
 
158
180
  optional Plugins plugins = 1;
@@ -117,12 +117,12 @@ export interface Module {
117
117
  * Options:
118
118
  * - proto3_optional = true
119
119
  */
120
- name?: string;
120
+ id?: string;
121
121
  /**
122
122
  * Options:
123
123
  * - proto3_optional = true
124
124
  */
125
- id?: string;
125
+ name?: string;
126
126
  /**
127
127
  * Options:
128
128
  * - proto3_optional = true
@@ -307,17 +307,17 @@ export namespace Runtime {
307
307
  * Options:
308
308
  * - proto3_optional = true
309
309
  */
310
- keyStorage?: Runtime.Client.Storage.StorageDriver;
310
+ keyStore?: Runtime.Client.Storage.StorageDriver;
311
311
  /**
312
312
  * Options:
313
313
  * - proto3_optional = true
314
314
  */
315
- storageType?: Runtime.Client.Storage.StorageDriver;
315
+ dataStore?: Runtime.Client.Storage.StorageDriver;
316
316
  /**
317
317
  * Options:
318
318
  * - proto3_optional = true
319
319
  */
320
- path?: string;
320
+ dataRoot?: string;
321
321
  }
322
322
  export namespace Storage {
323
323
  /**
@@ -445,6 +445,11 @@ export namespace Runtime {
445
445
  * - proto3_optional = true
446
446
  */
447
447
  functions?: Runtime.Agent.Plugins.Functions;
448
+ /**
449
+ * Options:
450
+ * - proto3_optional = true
451
+ */
452
+ epochMonitor?: Runtime.Agent.Plugins.EpochMontior;
448
453
  }
449
454
  export namespace Plugins {
450
455
  /**
@@ -454,6 +459,47 @@ export namespace Runtime {
454
459
  export interface Functions {
455
460
  port: number;
456
461
  }
462
+ /**
463
+ * Automatic epoch creation.
464
+ *
465
+ * Defined in:
466
+ * {@link file://./../../dxos/config.proto}
467
+ */
468
+ export interface EpochMontior {
469
+ /**
470
+ * Options:
471
+ * - proto3_optional = true
472
+ */
473
+ enabled?: boolean;
474
+ /**
475
+ * Number of mutations required since last epoch to trigger a new epoch.
476
+ *
477
+ * Options:
478
+ * - proto3_optional = true
479
+ */
480
+ minMessagesBetweenEpochs?: number;
481
+ /**
482
+ * Amount of time (in milliseconds) required to pass since last epoch to trigger a new epoch.
483
+ *
484
+ * Options:
485
+ * - proto3_optional = true
486
+ */
487
+ minTimeBetweenEpochs?: number;
488
+ /**
489
+ * Amount of time (in milliseconds) required to pass since last mutation to trigger a new epoch.
490
+ *
491
+ * Options:
492
+ * - proto3_optional = true
493
+ */
494
+ minInactivityBeforeEpoch?: number;
495
+ /**
496
+ * Maximum amount of time (in milliseconds) to wait for an inactivity period before triggering a new epoch.
497
+ *
498
+ * Options:
499
+ * - proto3_optional = true
500
+ */
501
+ maxInactivityDelay?: number;
502
+ }
457
503
  }
458
504
  }
459
505
  /**