@dxos/protocols 0.8.2-main.12df754 → 0.8.2-main.36232bc

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 (48) hide show
  1. package/dist/cjs/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +57 -3
  2. package/dist/cjs/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts.map +1 -1
  3. package/dist/cjs/src/buf/proto/gen/dxos/edge/messenger_pb.js +24 -2
  4. package/dist/cjs/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
  5. package/dist/cjs/src/errors/parameter.d.ts +3 -0
  6. package/dist/cjs/src/errors/parameter.d.ts.map +1 -1
  7. package/dist/cjs/src/errors/parameter.js +4 -0
  8. package/dist/cjs/src/errors/parameter.js.map +1 -1
  9. package/dist/cjs/src/proto/gen/dxos/client/services.d.ts +178 -178
  10. package/dist/cjs/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  11. package/dist/cjs/src/proto/gen/dxos/client/services.js +28 -28
  12. package/dist/cjs/src/proto/gen/dxos/client/services.js.map +1 -1
  13. package/dist/cjs/src/proto/gen/dxos/edge/messenger.d.ts +33 -0
  14. package/dist/cjs/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  15. package/dist/cjs/src/proto/gen/dxos/edge/messenger.js +11 -1
  16. package/dist/cjs/src/proto/gen/dxos/edge/messenger.js.map +1 -1
  17. package/dist/cjs/src/proto/gen/index.d.ts +1 -0
  18. package/dist/cjs/src/proto/gen/index.d.ts.map +1 -1
  19. package/dist/cjs/src/proto/gen/index.js +1 -1
  20. package/dist/cjs/src/proto/gen/index.js.map +1 -1
  21. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  22. package/dist/esm/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +57 -3
  23. package/dist/esm/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts.map +1 -1
  24. package/dist/esm/src/buf/proto/gen/dxos/edge/messenger_pb.js +23 -1
  25. package/dist/esm/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
  26. package/dist/esm/src/errors/parameter.d.ts +3 -0
  27. package/dist/esm/src/errors/parameter.d.ts.map +1 -1
  28. package/dist/esm/src/errors/parameter.js +4 -0
  29. package/dist/esm/src/errors/parameter.js.map +1 -1
  30. package/dist/esm/src/proto/gen/dxos/client/services.d.ts +178 -178
  31. package/dist/esm/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  32. package/dist/esm/src/proto/gen/dxos/client/services.js +27 -27
  33. package/dist/esm/src/proto/gen/dxos/client/services.js.map +1 -1
  34. package/dist/esm/src/proto/gen/dxos/edge/messenger.d.ts +33 -0
  35. package/dist/esm/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  36. package/dist/esm/src/proto/gen/dxos/edge/messenger.js +10 -0
  37. package/dist/esm/src/proto/gen/dxos/edge/messenger.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/package.json +7 -7
  43. package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +67 -4
  44. package/src/errors/parameter.ts +4 -0
  45. package/src/proto/dxos/edge/messenger.proto +34 -3
  46. package/src/proto/gen/dxos/client/services.ts +178 -178
  47. package/src/proto/gen/dxos/edge/messenger.ts +33 -0
  48. package/src/proto/gen/index.ts +2 -1
@@ -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;AAmEhE,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAkmBhD,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,86uHAA86uH,CAAC,CAAC,CAAC;AACv+uH,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;AAmEhE,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAmmBhD,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,ghwHAAghwH,CAAC,CAAC,CAAC;AACzkwH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAkB,UAAU,EAAE,aAAa,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/protocols",
3
- "version": "0.8.2-main.12df754",
3
+ "version": "0.8.2-main.36232bc",
4
4
  "description": "Protobuf definitions for DXOS protocols.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -72,12 +72,12 @@
72
72
  ],
73
73
  "dependencies": {
74
74
  "@bufbuild/protobuf": "^2.1.0",
75
- "@dxos/effect": "0.8.2-main.12df754",
76
- "@dxos/codec-protobuf": "0.8.2-main.12df754",
77
- "@dxos/invariant": "0.8.2-main.12df754",
78
- "@dxos/keys": "0.8.2-main.12df754",
79
- "@dxos/timeframe": "0.8.2-main.12df754",
80
- "@dxos/util": "0.8.2-main.12df754"
75
+ "@dxos/codec-protobuf": "0.8.2-main.36232bc",
76
+ "@dxos/effect": "0.8.2-main.36232bc",
77
+ "@dxos/invariant": "0.8.2-main.36232bc",
78
+ "@dxos/keys": "0.8.2-main.36232bc",
79
+ "@dxos/timeframe": "0.8.2-main.36232bc",
80
+ "@dxos/util": "0.8.2-main.36232bc"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@bufbuild/buf": "^1.43.0",
@@ -20,7 +20,7 @@ import type { Message as Message$1 } from "@bufbuild/protobuf";
20
20
  * Describes the file dxos/edge/messenger.proto.
21
21
  */
22
22
  export const file_dxos_edge_messenger: GenFile = /*@__PURE__*/
23
- fileDesc("ChlkeG9zL2VkZ2UvbWVzc2VuZ2VyLnByb3RvEhNkeG9zLmVkZ2UubWVzc2VuZ2VyIoMBCgRQZWVyEhUKCHN3YXJtS2V5GAEgASgJSACIAQESGAoLaWRlbnRpdHlLZXkYAiABKAlIAYgBARIPCgdwZWVyS2V5GAMgASgJEhIKBXN0YXRlGAQgASgMSAKIAQFCCwoJX3N3YXJtS2V5Qg4KDF9pZGVudGl0eUtleUIICgZfc3RhdGUi9QEKB01lc3NhZ2USFgoJdGltZXN0YW1wGAEgASgJSACIAQESLgoGc291cmNlGAogASgLMhkuZHhvcy5lZGdlLm1lc3Nlbmdlci5QZWVySAGIAQESKQoGdGFyZ2V0GAsgAygLMhkuZHhvcy5lZGdlLm1lc3Nlbmdlci5QZWVyEhcKCnNlcnZpY2VfaWQYFCABKAlIAogBARIqCgdwYXlsb2FkGGQgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUgDiAEBQgwKCl90aW1lc3RhbXBCCQoHX3NvdXJjZUINCgtfc2VydmljZV9pZEIKCghfcGF5bG9hZCKUAQoMU3dhcm1SZXF1ZXN0Ej0KBmFjdGlvbhgBIAEoDjIoLmR4b3MuZWRnZS5tZXNzZW5nZXIuU3dhcm1SZXF1ZXN0LkFjdGlvbkgAiAEBEhEKCXN3YXJtS2V5cxgCIAMoCSInCgZBY3Rpb24SCAoESU5GTxAAEggKBEpPSU4QARIJCgVMRUFWRRACQgkKB19hY3Rpb24iSwoNU3dhcm1SZXNwb25zZRIQCghzd2FybUtleRgBIAEoCRIoCgVwZWVycxgCIAMoCzIZLmR4b3MuZWRnZS5tZXNzZW5nZXIuUGVlciIvCgtUZXh0TWVzc2FnZRIUCgdtZXNzYWdlGAEgASgJSACIAQFCCgoIX21lc3NhZ2ViBnByb3RvMw", [file_google_protobuf_any]);
23
+ fileDesc("ChlkeG9zL2VkZ2UvbWVzc2VuZ2VyLnByb3RvEhNkeG9zLmVkZ2UubWVzc2VuZ2VyIrQCCgRQZWVyEhYKCXN3YXJtX2tleRgBIAEoCUgAiAEBEhkKDGlkZW50aXR5X2tleRgCIAEoCUgBiAEBEhAKCHBlZXJfa2V5GAMgASgJEkMKEGNvbm5lY3Rpb25fc3RhdGUYBSABKA4yJC5keG9zLmVkZ2UubWVzc2VuZ2VyLkNvbm5lY3Rpb25TdGF0ZUgCiAEBEhYKCWNvbm5lY3RlZBgGIAEoAUgDiAEBEhkKDGRpc2Nvbm5lY3RlZBgHIAEoAUgEiAEBEhIKBXN0YXRlGAQgASgMSAWIAQFCDAoKX3N3YXJtX2tleUIPCg1faWRlbnRpdHlfa2V5QhMKEV9jb25uZWN0aW9uX3N0YXRlQgwKCl9jb25uZWN0ZWRCDwoNX2Rpc2Nvbm5lY3RlZEIICgZfc3RhdGUi9QEKB01lc3NhZ2USFgoJdGltZXN0YW1wGAEgASgJSACIAQESLgoGc291cmNlGAogASgLMhkuZHhvcy5lZGdlLm1lc3Nlbmdlci5QZWVySAGIAQESKQoGdGFyZ2V0GAsgAygLMhkuZHhvcy5lZGdlLm1lc3Nlbmdlci5QZWVyEhcKCnNlcnZpY2VfaWQYFCABKAlIAogBARIqCgdwYXlsb2FkGGQgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUgDiAEBQgwKCl90aW1lc3RhbXBCCQoHX3NvdXJjZUINCgtfc2VydmljZV9pZEIKCghfcGF5bG9hZCKUAQoMU3dhcm1SZXF1ZXN0Ej0KBmFjdGlvbhgBIAEoDjIoLmR4b3MuZWRnZS5tZXNzZW5nZXIuU3dhcm1SZXF1ZXN0LkFjdGlvbkgAiAEBEhEKCXN3YXJtS2V5cxgCIAMoCSInCgZBY3Rpb24SCAoESU5GTxAAEggKBEpPSU4QARIJCgVMRUFWRRACQgkKB19hY3Rpb24ifgoNU3dhcm1SZXNwb25zZRIQCghzd2FybUtleRgBIAEoCRIoCgVwZWVycxgCIAMoCzIZLmR4b3MuZWRnZS5tZXNzZW5nZXIuUGVlchIxCg5pbmFjdGl2ZV9wZWVycxgDIAMoCzIZLmR4b3MuZWRnZS5tZXNzZW5nZXIuUGVlciIvCgtUZXh0TWVzc2FnZRIUCgdtZXNzYWdlGAEgASgJSACIAQFCCgoIX21lc3NhZ2UqUgoPQ29ubmVjdGlvblN0YXRlEg0KCUNPTk5FQ1RFRBAAEhcKE0RJU0NPTk5FQ1RFRF9OT1JNQUwQARIXChNESVNDT05ORUNURURfQUJSVVBUEAJiBnByb3RvMw", [file_google_protobuf_any]);
24
24
 
25
25
  /**
26
26
  *
@@ -28,6 +28,7 @@ export const file_dxos_edge_messenger: GenFile = /*@__PURE__*/
28
28
  *
29
29
  * TODO(burdon): Distinguish between point-to-point and broadcast messaging.
30
30
  * TODO(burdon): Rename PeerInfo?
31
+ * TODO(mykola): Separate peer info and peer state into different messages.
31
32
  *
32
33
  * @generated from message dxos.edge.messenger.Peer
33
34
  */
@@ -35,20 +36,48 @@ export type Peer = Message$1<"dxos.edge.messenger.Peer"> & {
35
36
  /**
36
37
  * TODO(burdon): Rename topic?
37
38
  *
38
- * @generated from field: optional string swarmKey = 1;
39
+ * @generated from field: optional string swarm_key = 1;
39
40
  */
40
41
  swarmKey?: string;
41
42
 
42
43
  /**
43
- * @generated from field: optional string identityKey = 2;
44
+ * @generated from field: optional string identity_key = 2;
44
45
  */
45
46
  identityKey?: string;
46
47
 
47
48
  /**
48
- * @generated from field: string peerKey = 3;
49
+ * @generated from field: string peer_key = 3;
49
50
  */
50
51
  peerKey: string;
51
52
 
53
+ /**
54
+ * *
55
+ * State of the connection to the swarm.
56
+ *
57
+ * *
58
+ * UNIX timestamp of the connection.
59
+ * @example 1715142000000
60
+ *
61
+ * @generated from field: optional dxos.edge.messenger.ConnectionState connection_state = 5;
62
+ */
63
+ connectionState?: ConnectionState;
64
+
65
+ /**
66
+ * Note: it is not `int64` because `int64` is compiled as a `string` in 'buf' and as a `number` in 'proto-js'.
67
+ *
68
+ * @generated from field: optional double connected = 6;
69
+ */
70
+ connected?: number;
71
+
72
+ /**
73
+ * *
74
+ * UNIX timestamp of the disconnection.
75
+ * @example 1715142000000
76
+ *
77
+ * @generated from field: optional double disconnected = 7;
78
+ */
79
+ disconnected?: number;
80
+
52
81
  /**
53
82
  * *
54
83
  * Optional opeage data that represents peer state is updated on `join` request and all peers in swarm are notified.
@@ -182,6 +211,14 @@ export type SwarmResponse = Message$1<"dxos.edge.messenger.SwarmResponse"> & {
182
211
  * @generated from field: repeated dxos.edge.messenger.Peer peers = 2;
183
212
  */
184
213
  peers: Peer[];
214
+
215
+ /**
216
+ * *
217
+ * The list of peers that recently left the swarm.
218
+ *
219
+ * @generated from field: repeated dxos.edge.messenger.Peer inactive_peers = 3;
220
+ */
221
+ inactivePeers: Peer[];
185
222
  };
186
223
 
187
224
  /**
@@ -212,3 +249,29 @@ export type TextMessage = Message$1<"dxos.edge.messenger.TextMessage"> & {
212
249
  export const TextMessageSchema: GenMessage<TextMessage> = /*@__PURE__*/
213
250
  messageDesc(file_dxos_edge_messenger, 4);
214
251
 
252
+ /**
253
+ * @generated from enum dxos.edge.messenger.ConnectionState
254
+ */
255
+ export enum ConnectionState {
256
+ /**
257
+ * @generated from enum value: CONNECTED = 0;
258
+ */
259
+ CONNECTED = 0,
260
+
261
+ /**
262
+ * @generated from enum value: DISCONNECTED_NORMAL = 1;
263
+ */
264
+ DISCONNECTED_NORMAL = 1,
265
+
266
+ /**
267
+ * @generated from enum value: DISCONNECTED_ABRUPT = 2;
268
+ */
269
+ DISCONNECTED_ABRUPT = 2,
270
+ }
271
+
272
+ /**
273
+ * Describes the enum dxos.edge.messenger.ConnectionState.
274
+ */
275
+ export const ConnectionStateSchema: GenEnum<ConnectionState> = /*@__PURE__*/
276
+ enumDesc(file_dxos_edge_messenger, 0);
277
+
@@ -2,6 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ /**
6
+ * @deprecated Use `invariant` instead?
7
+ */
8
+ // TODO(burdon): Use consistently.
5
9
  export const assertParameter = (parameterName: string, condition: unknown, expected?: string): asserts condition => {
6
10
  if (!condition) {
7
11
  throw new TypeError(`Parameter \`${parameterName}\` is invalid. Expected ${expected}.`);
@@ -19,16 +19,42 @@ package dxos.edge.messenger;
19
19
  // - Do peers without a HALO (that are joining existing identity) have the indentity key missing? How are they identified.
20
20
  // - Do point-to-point messages need to go through a swarm, or can routers communicate directly?
21
21
 
22
+
23
+ enum ConnectionState {
24
+ CONNECTED = 0;
25
+ DISCONNECTED_NORMAL = 1;
26
+ DISCONNECTED_ABRUPT = 2;
27
+ }
28
+
22
29
  //
23
30
  // Network peer.
24
31
  //
25
32
  // TODO(burdon): Distinguish between point-to-point and broadcast messaging.
26
33
  // TODO(burdon): Rename PeerInfo?
34
+ // TODO(mykola): Separate peer info and peer state into different messages.
27
35
  message Peer {
36
+
28
37
  // TODO(burdon): Rename topic?
29
- optional string swarmKey = 1;
30
- optional string identityKey = 2;
31
- string peerKey = 3;
38
+ optional string swarm_key = 1;
39
+ optional string identity_key = 2;
40
+ string peer_key = 3;
41
+
42
+ /**
43
+ * State of the connection to the swarm.
44
+ */
45
+ optional ConnectionState connection_state = 5;
46
+ /**
47
+ * UNIX timestamp of the connection.
48
+ * @example 1715142000000
49
+ */
50
+ // Note: it is not `int64` because `int64` is compiled as a `string` in 'buf' and as a `number` in 'proto-js'.
51
+ optional double connected = 6;
52
+ /**
53
+ * UNIX timestamp of the disconnection.
54
+ * @example 1715142000000
55
+ */
56
+ optional double disconnected = 7;
57
+
32
58
  /**
33
59
  * Optional opeage data that represents peer state is updated on `join` request and all peers in swarm are notified.
34
60
  * Is not used for WebRTC protocol, but is useful for another purposes of Swarms, e. g. call room users states.
@@ -73,6 +99,11 @@ message SwarmResponse {
73
99
  * The list of peers in the swarm.
74
100
  */
75
101
  repeated Peer peers = 2;
102
+
103
+ /**
104
+ * The list of peers that recently left the swarm.
105
+ */
106
+ repeated Peer inactive_peers = 3;
76
107
  }
77
108
 
78
109
  //
@@ -65,6 +65,184 @@ import * as dxos_value from "../value.js";
65
65
  import * as example_testing_data from "../../example/testing/data.js";
66
66
  import * as example_testing_rpc from "../../example/testing/rpc.js";
67
67
  import * as google_protobuf from "../../google/protobuf.js";
68
+ /**
69
+ * Defined in:
70
+ * {@link file://./../../../dxos/client/logging.proto}
71
+ */
72
+ export interface Metrics {
73
+ timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
74
+ values?: Metrics.KeyPair[];
75
+ }
76
+ export namespace Metrics {
77
+ /**
78
+ * Defined in:
79
+ * {@link file://./../../../dxos/client/logging.proto}
80
+ */
81
+ export interface KeyPair {
82
+ /**
83
+ * Options:
84
+ * - proto3_optional = true
85
+ */
86
+ key?: string;
87
+ /**
88
+ * Options:
89
+ * - proto3_optional = true
90
+ */
91
+ value?: dxos_value.Value;
92
+ /**
93
+ * Options:
94
+ * - proto3_optional = true
95
+ */
96
+ stats?: dxos_value.Stats;
97
+ }
98
+ }
99
+ /**
100
+ * Defined in:
101
+ * {@link file://./../../../dxos/client/logging.proto}
102
+ */
103
+ export interface ControlMetricsRequest {
104
+ /**
105
+ * Options:
106
+ * - proto3_optional = true
107
+ */
108
+ reset?: boolean;
109
+ /**
110
+ * Options:
111
+ * - proto3_optional = true
112
+ */
113
+ record?: boolean;
114
+ }
115
+ /**
116
+ * Defined in:
117
+ * {@link file://./../../../dxos/client/logging.proto}
118
+ */
119
+ export interface ControlMetricsResponse {
120
+ /**
121
+ * Options:
122
+ * - proto3_optional = true
123
+ */
124
+ recording?: boolean;
125
+ }
126
+ /**
127
+ * Defined in:
128
+ * {@link file://./../../../dxos/client/logging.proto}
129
+ */
130
+ export interface QueryMetricsRequest {
131
+ /**
132
+ * Options:
133
+ * - proto3_optional = true
134
+ */
135
+ interval?: number;
136
+ }
137
+ /**
138
+ * Defined in:
139
+ * {@link file://./../../../dxos/client/logging.proto}
140
+ */
141
+ export interface QueryMetricsResponse {
142
+ timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
143
+ metrics: Metrics;
144
+ }
145
+ /**
146
+ * Defined in:
147
+ * {@link file://./../../../dxos/client/logging.proto}
148
+ */
149
+ export enum LogLevel {
150
+ NONE = 0,
151
+ TRACE = 5,
152
+ DEBUG = 10,
153
+ VERBOSE = 11,
154
+ INFO = 12,
155
+ WARN = 13,
156
+ ERROR = 14
157
+ }
158
+ /**
159
+ * Defined in:
160
+ * {@link file://./../../../dxos/client/logging.proto}
161
+ */
162
+ export interface QueryLogsRequest {
163
+ filters?: QueryLogsRequest.Filter[];
164
+ /**
165
+ * Options:
166
+ * - proto3_optional = true
167
+ */
168
+ options?: QueryLogsRequest.MatchingOptions;
169
+ }
170
+ export namespace QueryLogsRequest {
171
+ /**
172
+ * Defined in:
173
+ * {@link file://./../../../dxos/client/logging.proto}
174
+ */
175
+ export enum MatchingOptions {
176
+ NONE = 0,
177
+ INCLUSIVE = 1,
178
+ EXPLICIT = 2
179
+ }
180
+ /**
181
+ * Defined in:
182
+ * {@link file://./../../../dxos/client/logging.proto}
183
+ */
184
+ export interface Filter {
185
+ level: LogLevel;
186
+ /**
187
+ * Options:
188
+ * - proto3_optional = true
189
+ */
190
+ pattern?: string;
191
+ }
192
+ }
193
+ /**
194
+ * Defined in:
195
+ * {@link file://./../../../dxos/client/logging.proto}
196
+ */
197
+ export interface LogEntry {
198
+ level: LogLevel;
199
+ message: string;
200
+ /**
201
+ * Options:
202
+ * - proto3_optional = true
203
+ */
204
+ context?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
205
+ /**
206
+ * Options:
207
+ * - proto3_optional = true
208
+ */
209
+ meta?: LogEntry.Meta;
210
+ /**
211
+ * Options:
212
+ * - proto3_optional = true
213
+ */
214
+ error?: dxos_error.Error;
215
+ timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
216
+ }
217
+ export namespace LogEntry {
218
+ /**
219
+ * Defined in:
220
+ * {@link file://./../../../dxos/client/logging.proto}
221
+ */
222
+ export interface Meta {
223
+ file: string;
224
+ line: number;
225
+ /**
226
+ * Options:
227
+ * - proto3_optional = true
228
+ */
229
+ scope?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
230
+ /**
231
+ * Options:
232
+ * - proto3_optional = true
233
+ */
234
+ resourceId?: number;
235
+ }
236
+ }
237
+ /**
238
+ * Defined in:
239
+ * {@link file://./../../../dxos/client/logging.proto}
240
+ */
241
+ export interface LoggingService {
242
+ controlMetrics: (request: ControlMetricsRequest, options?: RequestOptions) => Promise<ControlMetricsResponse>;
243
+ queryMetrics: (request: QueryMetricsRequest, options?: RequestOptions) => Stream<QueryMetricsResponse>;
244
+ queryLogs: (request: QueryLogsRequest, options?: RequestOptions) => Stream<LogEntry>;
245
+ }
68
246
  /**
69
247
  * Defined in:
70
248
  * {@link file://./../../../dxos/client/invitation.proto}
@@ -257,184 +435,6 @@ export namespace Invitation {
257
435
  EXPIRED = 9
258
436
  }
259
437
  }
260
- /**
261
- * Defined in:
262
- * {@link file://./../../../dxos/client/logging.proto}
263
- */
264
- export interface Metrics {
265
- timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
266
- values?: Metrics.KeyPair[];
267
- }
268
- export namespace Metrics {
269
- /**
270
- * Defined in:
271
- * {@link file://./../../../dxos/client/logging.proto}
272
- */
273
- export interface KeyPair {
274
- /**
275
- * Options:
276
- * - proto3_optional = true
277
- */
278
- key?: string;
279
- /**
280
- * Options:
281
- * - proto3_optional = true
282
- */
283
- value?: dxos_value.Value;
284
- /**
285
- * Options:
286
- * - proto3_optional = true
287
- */
288
- stats?: dxos_value.Stats;
289
- }
290
- }
291
- /**
292
- * Defined in:
293
- * {@link file://./../../../dxos/client/logging.proto}
294
- */
295
- export interface ControlMetricsRequest {
296
- /**
297
- * Options:
298
- * - proto3_optional = true
299
- */
300
- reset?: boolean;
301
- /**
302
- * Options:
303
- * - proto3_optional = true
304
- */
305
- record?: boolean;
306
- }
307
- /**
308
- * Defined in:
309
- * {@link file://./../../../dxos/client/logging.proto}
310
- */
311
- export interface ControlMetricsResponse {
312
- /**
313
- * Options:
314
- * - proto3_optional = true
315
- */
316
- recording?: boolean;
317
- }
318
- /**
319
- * Defined in:
320
- * {@link file://./../../../dxos/client/logging.proto}
321
- */
322
- export interface QueryMetricsRequest {
323
- /**
324
- * Options:
325
- * - proto3_optional = true
326
- */
327
- interval?: number;
328
- }
329
- /**
330
- * Defined in:
331
- * {@link file://./../../../dxos/client/logging.proto}
332
- */
333
- export interface QueryMetricsResponse {
334
- timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
335
- metrics: Metrics;
336
- }
337
- /**
338
- * Defined in:
339
- * {@link file://./../../../dxos/client/logging.proto}
340
- */
341
- export enum LogLevel {
342
- NONE = 0,
343
- TRACE = 5,
344
- DEBUG = 10,
345
- VERBOSE = 11,
346
- INFO = 12,
347
- WARN = 13,
348
- ERROR = 14
349
- }
350
- /**
351
- * Defined in:
352
- * {@link file://./../../../dxos/client/logging.proto}
353
- */
354
- export interface QueryLogsRequest {
355
- filters?: QueryLogsRequest.Filter[];
356
- /**
357
- * Options:
358
- * - proto3_optional = true
359
- */
360
- options?: QueryLogsRequest.MatchingOptions;
361
- }
362
- export namespace QueryLogsRequest {
363
- /**
364
- * Defined in:
365
- * {@link file://./../../../dxos/client/logging.proto}
366
- */
367
- export enum MatchingOptions {
368
- NONE = 0,
369
- INCLUSIVE = 1,
370
- EXPLICIT = 2
371
- }
372
- /**
373
- * Defined in:
374
- * {@link file://./../../../dxos/client/logging.proto}
375
- */
376
- export interface Filter {
377
- level: LogLevel;
378
- /**
379
- * Options:
380
- * - proto3_optional = true
381
- */
382
- pattern?: string;
383
- }
384
- }
385
- /**
386
- * Defined in:
387
- * {@link file://./../../../dxos/client/logging.proto}
388
- */
389
- export interface LogEntry {
390
- level: LogLevel;
391
- message: string;
392
- /**
393
- * Options:
394
- * - proto3_optional = true
395
- */
396
- context?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
397
- /**
398
- * Options:
399
- * - proto3_optional = true
400
- */
401
- meta?: LogEntry.Meta;
402
- /**
403
- * Options:
404
- * - proto3_optional = true
405
- */
406
- error?: dxos_error.Error;
407
- timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
408
- }
409
- export namespace LogEntry {
410
- /**
411
- * Defined in:
412
- * {@link file://./../../../dxos/client/logging.proto}
413
- */
414
- export interface Meta {
415
- file: string;
416
- line: number;
417
- /**
418
- * Options:
419
- * - proto3_optional = true
420
- */
421
- scope?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
422
- /**
423
- * Options:
424
- * - proto3_optional = true
425
- */
426
- resourceId?: number;
427
- }
428
- }
429
- /**
430
- * Defined in:
431
- * {@link file://./../../../dxos/client/logging.proto}
432
- */
433
- export interface LoggingService {
434
- controlMetrics: (request: ControlMetricsRequest, options?: RequestOptions) => Promise<ControlMetricsResponse>;
435
- queryMetrics: (request: QueryMetricsRequest, options?: RequestOptions) => Stream<QueryMetricsResponse>;
436
- queryLogs: (request: QueryLogsRequest, options?: RequestOptions) => Stream<LogEntry>;
437
- }
438
438
  /**
439
439
  * Defined in:
440
440
  * {@link file://./../../../dxos/client/services.proto}
@@ -65,6 +65,15 @@ import * as dxos_value from "../value.js";
65
65
  import * as example_testing_data from "../../example/testing/data.js";
66
66
  import * as example_testing_rpc from "../../example/testing/rpc.js";
67
67
  import * as google_protobuf from "../../google/protobuf.js";
68
+ /**
69
+ * Defined in:
70
+ * {@link file://./../../../dxos/edge/messenger.proto}
71
+ */
72
+ export enum ConnectionState {
73
+ CONNECTED = 0,
74
+ DISCONNECTED_NORMAL = 1,
75
+ DISCONNECTED_ABRUPT = 2
76
+ }
68
77
  /**
69
78
  * Defined in:
70
79
  * {@link file://./../../../dxos/edge/messenger.proto}
@@ -81,6 +90,26 @@ export interface Peer {
81
90
  */
82
91
  identityKey?: string;
83
92
  peerKey: string;
93
+ /**
94
+ * State of the connection to the swarm.
95
+ *
96
+ * Options:
97
+ * - proto3_optional = true
98
+ */
99
+ connectionState?: ConnectionState;
100
+ /**
101
+ * Options:
102
+ * - proto3_optional = true
103
+ */
104
+ connected?: number;
105
+ /**
106
+ * UNIX timestamp of the disconnection.
107
+ * @example 1715142000000
108
+ *
109
+ * Options:
110
+ * - proto3_optional = true
111
+ */
112
+ disconnected?: number;
84
113
  /**
85
114
  * Optional opeage data that represents peer state is updated on `join` request and all peers in swarm are notified.
86
115
  * Is not used for WebRTC protocol, but is useful for another purposes of Swarms, e. g. call room users states.
@@ -152,6 +181,10 @@ export interface SwarmResponse {
152
181
  * The list of peers in the swarm.
153
182
  */
154
183
  peers?: Peer[];
184
+ /**
185
+ * The list of peers that recently left the swarm.
186
+ */
187
+ inactivePeers?: Peer[];
155
188
  }
156
189
  /**
157
190
  * Defined in: