@dxos/protocols 0.1.2 → 0.1.3

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 (123) hide show
  1. package/dist/src/proto/gen/dxos/bot.d.ts +11 -11
  2. package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -1
  3. package/dist/src/proto/gen/dxos/client/services.d.ts +247 -0
  4. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -0
  5. package/dist/src/proto/gen/dxos/client/services.js +32 -0
  6. package/dist/src/proto/gen/dxos/client/services.js.map +1 -0
  7. package/dist/src/proto/gen/dxos/client.d.ts +49 -68
  8. package/dist/src/proto/gen/dxos/client.d.ts.map +1 -1
  9. package/dist/src/proto/gen/dxos/config.d.ts +0 -16
  10. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  11. package/dist/src/proto/gen/dxos/config.js +0 -12
  12. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  13. package/dist/src/proto/gen/dxos/devtools/host.d.ts +52 -21
  14. package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  15. package/dist/src/proto/gen/dxos/devtools/{swarmLog.d.ts → swarm.d.ts} +4 -4
  16. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts.map +1 -0
  17. package/dist/src/proto/gen/dxos/devtools/{swarmLog.js → swarm.js} +1 -1
  18. package/dist/src/proto/gen/dxos/devtools/swarm.js.map +1 -0
  19. package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
  20. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +5 -5
  21. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  22. package/dist/src/proto/gen/dxos/echo/service.d.ts +3 -3
  23. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  24. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +2 -2
  25. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts +3 -3
  26. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts +1 -1
  27. package/dist/src/proto/gen/dxos/halo/credentials.d.ts +25 -27
  28. package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
  29. package/dist/src/proto/gen/dxos/halo/credentials.js +5 -5
  30. package/dist/src/proto/gen/dxos/halo/invitations.d.ts +10 -44
  31. package/dist/src/proto/gen/dxos/halo/invitations.d.ts.map +1 -1
  32. package/dist/src/proto/gen/dxos/halo/invitations.js +0 -13
  33. package/dist/src/proto/gen/dxos/halo/invitations.js.map +1 -1
  34. package/dist/src/proto/gen/dxos/halo/keys.d.ts +2 -2
  35. package/dist/src/proto/gen/dxos/halo/keys.js +1 -1
  36. package/dist/src/proto/gen/dxos/halo/signed.d.ts +1 -1
  37. package/dist/src/proto/gen/dxos/service/publisher.d.ts.map +1 -1
  38. package/dist/src/proto/gen/dxos/service/scheduler.d.ts +1 -1
  39. package/dist/src/proto/gen/dxos/service/scheduler.d.ts.map +1 -1
  40. package/dist/src/proto/gen/index.d.ts +56 -41
  41. package/dist/src/proto/gen/index.d.ts.map +1 -1
  42. package/dist/src/proto/gen/index.js +1 -1
  43. package/dist/src/proto/gen/index.js.map +1 -1
  44. package/package.json +5 -5
  45. package/proto/dxos/client/services.d.ts +2 -0
  46. package/proto/dxos/{devtools/swarmLog.d.ts.map → client/services.d.ts.map} +2 -2
  47. package/proto/dxos/client/services.js +2 -0
  48. package/proto/dxos/devtools/diagnostics.d.ts +2 -0
  49. package/proto/dxos/devtools/diagnostics.d.ts.map +10 -0
  50. package/proto/dxos/devtools/diagnostics.js +2 -0
  51. package/proto/dxos/devtools/swarm.d.ts +2 -0
  52. package/proto/dxos/{halo/credentials/party.d.ts.map → devtools/swarm.d.ts.map} +2 -2
  53. package/proto/dxos/devtools/{swarmLog.js → swarm.js} +1 -1
  54. package/src/proto/dxos/bot.proto +11 -11
  55. package/src/proto/dxos/client/services.proto +197 -0
  56. package/src/proto/dxos/client.proto +49 -55
  57. package/src/proto/dxos/config.proto +2 -15
  58. package/src/proto/dxos/devtools/diagnostics.proto +28 -0
  59. package/src/proto/dxos/devtools/host.proto +21 -23
  60. package/src/proto/dxos/devtools/{swarmLog.proto → swarm.proto} +1 -1
  61. package/src/proto/dxos/echo/metadata.proto +6 -6
  62. package/src/proto/dxos/echo/service.proto +3 -3
  63. package/src/proto/dxos/echo/snapshot.proto +5 -5
  64. package/src/proto/dxos/echo/timeframe.proto +1 -1
  65. package/src/proto/dxos/halo/credentials/auth.proto +3 -3
  66. package/src/proto/dxos/halo/credentials/greet.proto +19 -19
  67. package/src/proto/dxos/halo/credentials.proto +21 -20
  68. package/src/proto/dxos/halo/invitations.proto +9 -27
  69. package/src/proto/dxos/halo/keys.proto +2 -2
  70. package/src/proto/dxos/halo/signed.proto +1 -1
  71. package/src/proto/dxos/service/scheduler.proto +1 -1
  72. package/src/proto/gen/dxos/bot.ts +12 -12
  73. package/src/proto/gen/dxos/client/services.ts +283 -0
  74. package/src/proto/gen/dxos/client.ts +50 -69
  75. package/src/proto/gen/dxos/config.ts +2 -18
  76. package/src/proto/gen/dxos/devtools/host.ts +53 -22
  77. package/src/proto/gen/dxos/devtools/{swarmLog.ts → swarm.ts} +4 -4
  78. package/src/proto/gen/dxos/echo/feed.ts +2 -2
  79. package/src/proto/gen/dxos/echo/metadata.ts +7 -7
  80. package/src/proto/gen/dxos/echo/model/messenger.ts +2 -2
  81. package/src/proto/gen/dxos/echo/model/object.ts +2 -2
  82. package/src/proto/gen/dxos/echo/model/text.ts +2 -2
  83. package/src/proto/gen/dxos/echo/service.ts +5 -5
  84. package/src/proto/gen/dxos/echo/snapshot.ts +4 -4
  85. package/src/proto/gen/dxos/echo/timeframe.ts +2 -2
  86. package/src/proto/gen/dxos/halo/credentials/auth.ts +5 -5
  87. package/src/proto/gen/dxos/halo/credentials/greet.ts +3 -3
  88. package/src/proto/gen/dxos/halo/credentials/identity.ts +2 -2
  89. package/src/proto/gen/dxos/halo/credentials.ts +27 -29
  90. package/src/proto/gen/dxos/halo/invitations.ts +12 -46
  91. package/src/proto/gen/dxos/halo/keyring.ts +2 -2
  92. package/src/proto/gen/dxos/halo/keys.ts +4 -4
  93. package/src/proto/gen/dxos/halo/signed.ts +3 -3
  94. package/src/proto/gen/dxos/iframe.ts +2 -2
  95. package/src/proto/gen/dxos/keys.ts +2 -2
  96. package/src/proto/gen/dxos/mesh/bridge.ts +2 -2
  97. package/src/proto/gen/dxos/mesh/broadcast.ts +2 -2
  98. package/src/proto/gen/dxos/mesh/messaging.ts +2 -2
  99. package/src/proto/gen/dxos/mesh/presence.ts +2 -2
  100. package/src/proto/gen/dxos/mesh/protocol.ts +2 -2
  101. package/src/proto/gen/dxos/mesh/replicator.ts +2 -2
  102. package/src/proto/gen/dxos/mesh/signal.ts +2 -2
  103. package/src/proto/gen/dxos/mesh/swarm.ts +2 -2
  104. package/src/proto/gen/dxos/registry.ts +2 -2
  105. package/src/proto/gen/dxos/rpc.ts +2 -2
  106. package/src/proto/gen/dxos/service/publisher.ts +2 -2
  107. package/src/proto/gen/dxos/service/scheduler.ts +3 -3
  108. package/src/proto/gen/dxos/type.ts +2 -2
  109. package/src/proto/gen/example/testing/data.ts +2 -2
  110. package/src/proto/gen/example/testing/rpc.ts +2 -2
  111. package/src/proto/gen/google/protobuf.ts +2 -2
  112. package/src/proto/gen/index.ts +57 -42
  113. package/dist/src/proto/gen/dxos/devtools/swarmLog.d.ts.map +0 -1
  114. package/dist/src/proto/gen/dxos/devtools/swarmLog.js.map +0 -1
  115. package/dist/src/proto/gen/dxos/halo/credentials/party.d.ts +0 -82
  116. package/dist/src/proto/gen/dxos/halo/credentials/party.d.ts.map +0 -1
  117. package/dist/src/proto/gen/dxos/halo/credentials/party.js +0 -19
  118. package/dist/src/proto/gen/dxos/halo/credentials/party.js.map +0 -1
  119. package/proto/dxos/devtools/swarmLog.d.ts +0 -2
  120. package/proto/dxos/halo/credentials/party.d.ts +0 -2
  121. package/proto/dxos/halo/credentials/party.js +0 -2
  122. package/src/proto/dxos/halo/credentials/party.proto +0 -127
  123. package/src/proto/gen/dxos/halo/credentials/party.ts +0 -119
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/proto/gen/index.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA8C;AAyC9C,qEAA6C;AAsVhC,QAAA,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,g+7GAAg+7G,CAAC,CAAC;AAC1/7G,QAAA,MAAM,GAAG,uBAAM,CAAC,QAAQ,CAAkB,kBAAU,EAAE,uBAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/proto/gen/index.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA8C;AAyC9C,qEAA6C;AAqWhC,QAAA,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,gjhHAAgjhH,CAAC,CAAC;AAC1khH,QAAA,MAAM,GAAG,uBAAM,CAAC,QAAQ,CAAkB,kBAAU,EAAE,uBAAa,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/protocols",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Protobuf definitions for DXOS protocols.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -18,10 +18,10 @@
18
18
  "src"
19
19
  ],
20
20
  "dependencies": {
21
- "@dxos/codec-protobuf": "0.1.2",
22
- "@dxos/hypercore": "0.1.2",
23
- "@dxos/keys": "0.1.2",
24
- "@dxos/timeframe": "0.1.2",
21
+ "@dxos/codec-protobuf": "0.1.3",
22
+ "@dxos/hypercore": "0.1.3",
23
+ "@dxos/keys": "0.1.3",
24
+ "@dxos/timeframe": "0.1.3",
25
25
  "assert": "^2.0.0",
26
26
  "util": "^0.12.4"
27
27
  },
@@ -0,0 +1,2 @@
1
+ // Generated file: do not edit.
2
+ export * from '../../../dist/src/proto/gen/dxos/client/services';
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "version": 3,
3
- "file": "swarmLog.d.ts",
3
+ "file": "services.d.ts",
4
4
  "sourceRoot": "",
5
5
  "sources": [
6
- "../../../src/proto/dxos/devtools/swarmLog.proto"
6
+ "../../../src/proto/dxos/client/services.proto"
7
7
  ],
8
8
  "names": [],
9
9
  "mappings": "AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"
@@ -0,0 +1,2 @@
1
+ // Generated file: do not edit.
2
+ module.exports = require('../../../dist/src/proto/gen/dxos/client/services');
@@ -0,0 +1,2 @@
1
+ // Generated file: do not edit.
2
+ export * from '../../../dist/src/proto/gen/dxos/devtools/diagnostics';
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "file": "diagnostics.d.ts",
4
+ "sourceRoot": "",
5
+ "sources": [
6
+ "../../../src/proto/dxos/devtools/diagnostics.proto"
7
+ ],
8
+ "names": [],
9
+ "mappings": "AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"
10
+ }
@@ -0,0 +1,2 @@
1
+ // Generated file: do not edit.
2
+ module.exports = require('../../../dist/src/proto/gen/dxos/devtools/diagnostics');
@@ -0,0 +1,2 @@
1
+ // Generated file: do not edit.
2
+ export * from '../../../dist/src/proto/gen/dxos/devtools/swarm';
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "version": 3,
3
- "file": "party.d.ts",
3
+ "file": "swarm.d.ts",
4
4
  "sourceRoot": "",
5
5
  "sources": [
6
- "../../../../src/proto/dxos/halo/credentials/party.proto"
6
+ "../../../src/proto/dxos/devtools/swarm.proto"
7
7
  ],
8
8
  "names": [],
9
9
  "mappings": "AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"
@@ -1,2 +1,2 @@
1
1
  // Generated file: do not edit.
2
- module.exports = require('../../../dist/src/proto/gen/dxos/devtools/swarmLog');
2
+ module.exports = require('../../../dist/src/proto/gen/dxos/devtools/swarm');
@@ -8,8 +8,8 @@ import "google/protobuf/empty.proto";
8
8
  import "google/protobuf/timestamp.proto";
9
9
 
10
10
  import "dxos/client.proto";
11
+ import "dxos/client/services.proto";
11
12
  import "dxos/config.proto";
12
- import "dxos/halo/invitations.proto";
13
13
  import "dxos/keys.proto";
14
14
 
15
15
  package dxos.bot;
@@ -47,7 +47,7 @@ message Bot {
47
47
 
48
48
  optional BotPackageSpecifier package_specifier = 3;
49
49
  optional google.protobuf.Timestamp last_start = 4;
50
- optional dxos.keys.PublicKey party_key = 5;
50
+ optional dxos.keys.PublicKey space_key = 5;
51
51
 
52
52
  message Runtime {
53
53
  optional int32 exit_code = 1;
@@ -66,11 +66,11 @@ message GetBotsResponse {
66
66
  message SpawnBotRequest {
67
67
  optional BotPackageSpecifier package = 1;
68
68
 
69
- /// Invitation for the bot to join the target party.
70
- optional dxos.halo.invitations.InvitationDescriptor invitation = 2;
69
+ /// Invitation for the bot to join the target space.
70
+ optional dxos.client.services.Invitation invitation = 2;
71
71
 
72
- /// Key of the party bot is invited to.
73
- optional dxos.keys.PublicKey party_key = 3;
72
+ /// Key of the space bot is invited to.
73
+ optional dxos.keys.PublicKey space_key = 3;
74
74
  }
75
75
 
76
76
  message SendCommandRequest {
@@ -92,8 +92,8 @@ message GetLogsRequest {
92
92
  }
93
93
 
94
94
  message BotReport {
95
- /// Details of the party the bot was spawned for.
96
- optional dxos.client.PartyDetails party_details = 1;
95
+ /// Details of the space the bot was spawned for.
96
+ optional dxos.client.SpaceDetails space_details = 1;
97
97
  }
98
98
 
99
99
  /// Service that is used by clients to communicate with bot factory.
@@ -120,8 +120,8 @@ message InitializeRequest {
120
120
  /// Bot runtime configuration.
121
121
  optional dxos.config.Config config = 1;
122
122
 
123
- /// Invitation for the bot to join the target party.
124
- optional dxos.halo.invitations.InvitationDescriptor invitation = 2;
123
+ /// Invitation for the bot to join the target space.
124
+ optional dxos.client.services.Invitation invitation = 2;
125
125
 
126
126
  /// ID of the bot.
127
127
  optional string id = 3;
@@ -134,7 +134,7 @@ message StartRequest {
134
134
 
135
135
  /// Service that is used by bots communicating with bot factory.
136
136
  service BotService {
137
- /// Initialize Client, create profile, and join a party.
137
+ /// Initialize Client, create profile, and join a space.
138
138
  rpc Initialize(InitializeRequest) returns (google.protobuf.Empty);
139
139
 
140
140
  /// Start an initialized bot.
@@ -0,0 +1,197 @@
1
+ //
2
+ // Copyright 2021 DXOS.org
3
+ //
4
+
5
+ syntax = "proto3";
6
+
7
+ import "google/protobuf/empty.proto";
8
+
9
+ import "dxos/config.proto";
10
+ import "dxos/halo/credentials.proto";
11
+ import "dxos/keys.proto";
12
+
13
+ // TODO(burdon): Restructure all services.
14
+ // TODO(burdon): Reorganize packages (e.g., client.services, echo.database).
15
+
16
+ package dxos.client.services;
17
+
18
+ //
19
+ // Design notes:
20
+ // - Basic CRUD methods for records (streaming queries).
21
+ // - Custom Request/Response objects for complex operations; otherwise generic structs for simplicity.
22
+ // - Normalize records for performance (e.g., Space members separate from Space metadata).
23
+ //
24
+
25
+ //
26
+ // System
27
+ //
28
+
29
+ service SystemService {
30
+ rpc GetConfig(google.protobuf.Empty) returns (dxos.config.Config); // TODO(burdon): Stream?
31
+ rpc Reset(google.protobuf.Empty) returns (google.protobuf.Empty);
32
+ }
33
+
34
+ //
35
+ // Signing
36
+ // TODO(burdon): Rename Crypto/KeystoreService?
37
+ //
38
+
39
+ // TODO(burdon): Metadata (e.g., added, expired).
40
+ message KeyRecord {
41
+ dxos.keys.PublicKey public_key = 1;
42
+ }
43
+
44
+ message SignRequest {
45
+ dxos.keys.PublicKey public_key = 1;
46
+ bytes payload = 2;
47
+ }
48
+
49
+ message SignResponse {
50
+ bytes signed = 2;
51
+ }
52
+
53
+ service SigningService {
54
+ rpc UpdateKeyRecord(KeyRecord) returns (KeyRecord);
55
+ rpc Sign(SignRequest) returns (SignResponse);
56
+ }
57
+
58
+ //
59
+ // Halo
60
+ //
61
+
62
+ message Identity {
63
+ dxos.keys.PublicKey identity_key = 1;
64
+ halo.credentials.ProfileDocument profile = 2;
65
+ }
66
+
67
+ message RecoverProfileRequest {
68
+ bytes recovery_key = 1;
69
+ }
70
+
71
+ service HaloService {
72
+ rpc RecoverProfile(RecoverProfileRequest) returns (Identity);
73
+ rpc UpdateProfile(Identity) returns (google.protobuf.Empty);
74
+ rpc QueryProfile(google.protobuf.Empty) returns (stream Identity);
75
+ }
76
+
77
+ //
78
+ // Devices
79
+ //
80
+
81
+ // TODO(burdon): Preferences (in database).
82
+ message Device {
83
+ dxos.keys.PublicKey device_key = 1;
84
+ }
85
+
86
+ message QueryDevicesResponse {
87
+ repeated Device devices = 1;
88
+ }
89
+
90
+ service DevicesService {
91
+ rpc UpdateDevice(google.protobuf.Empty) returns (Device);
92
+ rpc QueryDevices(google.protobuf.Empty) returns (stream QueryDevicesResponse);
93
+ }
94
+
95
+ //
96
+ // Contacts
97
+ //
98
+
99
+ message Contact {
100
+ halo.credentials.ProfileDocument profile = 1;
101
+ }
102
+
103
+ service ContactsService {
104
+ rpc UpdateContact(google.protobuf.Empty) returns (Contact);
105
+ rpc QueryContacts(google.protobuf.Empty) returns (stream Contact);
106
+ }
107
+
108
+ //
109
+ // Data Spaces
110
+ // TODO(burdon): Move to dxos.echo? Or rename dxos.echo => dxos.database?
111
+ //
112
+
113
+ // TODO(burdon): Preferences (in database).
114
+ message Space {
115
+ dxos.keys.PublicKey space_key = 1;
116
+ }
117
+
118
+ message QueryMembersRequest {}
119
+ message QueryMembersResponse {
120
+ dxos.halo.credentials.IdentityProfile members = 1;
121
+ }
122
+
123
+ service SpacesService {
124
+ rpc CreateSpace(google.protobuf.Empty) returns (Space);
125
+ rpc QuerySpaces(google.protobuf.Empty) returns (stream Space);
126
+ rpc QueryMembers(QueryMembersRequest) returns (stream QueryMembersResponse);
127
+ }
128
+
129
+ //
130
+ // Invitations (Halo and Data Spaces).
131
+ //
132
+
133
+ /**
134
+ * Represents the invitation state passed between client and service.
135
+ */
136
+ message Invitation {
137
+ enum Type {
138
+ /// Requires both to be online with OTP to complete key exchange.
139
+ INTERACTIVE = 0;
140
+ /// Interactive without OTP.
141
+ INTERACTIVE_TESTING = 1;
142
+ /// Guest's identity key is known; invitation can be accepted by any valid peer.
143
+ OFFLINE = 2;
144
+ }
145
+
146
+ enum State {
147
+ INIT = 0;
148
+ CONNECTING = 1;
149
+ CONNECTED = 2;
150
+ AUTHENTICATING = 3;
151
+ SUCCESS = 4;
152
+ CANCELLED = 5;
153
+ TIMEOUT = 6;
154
+ ERROR = 7;
155
+ }
156
+
157
+ /// Local identifier.
158
+ optional string invitation_id = 1;
159
+
160
+ /// Determined when created.
161
+ optional Type type = 2;
162
+
163
+ /// Local state.
164
+ optional State state = 3;
165
+
166
+ /// Local error code.
167
+ optional int32 error_code = 4;
168
+
169
+ /// Swarm rendezvous (random).
170
+ optional dxos.keys.PublicKey swarm_key = 5;
171
+
172
+ /// Guest's identity (only present if OFFLINE).
173
+ optional dxos.keys.PublicKey identity_key = 6;
174
+
175
+ /// Authentication code created by host.
176
+ optional string authentication_code = 7;
177
+
178
+ /// Space key (if data invitation).
179
+ optional dxos.keys.PublicKey space_key = 8;
180
+ }
181
+
182
+ message AuthenticationRequest {
183
+ string invitation_id = 1;
184
+ string authentication_code = 2;
185
+ }
186
+
187
+ message CancelInvitationRequest {
188
+ string invitation_id = 1;
189
+ }
190
+
191
+ // TODO(burdon): Separate implementations for HALO/Data Spaces.
192
+ service InvitationsService {
193
+ rpc CreateInvitation(Invitation) returns (stream Invitation);
194
+ rpc Authenticate(AuthenticationRequest) returns (google.protobuf.Empty);
195
+ rpc AcceptInvitation(Invitation) returns (stream Invitation);
196
+ rpc CancelInvitation(CancelInvitationRequest) returns (google.protobuf.Empty);
197
+ }
@@ -6,10 +6,10 @@ syntax = "proto3";
6
6
 
7
7
  import "google/protobuf/empty.proto";
8
8
 
9
+ import "dxos/client/services.proto";
9
10
  import "dxos/config.proto";
10
11
  import "dxos/echo/snapshot.proto";
11
12
  import "dxos/echo/timeframe.proto";
12
- import "dxos/halo/invitations.proto";
13
13
  import "dxos/halo/keys.proto";
14
14
  import "dxos/keys.proto";
15
15
 
@@ -26,7 +26,6 @@ service SystemService {
26
26
 
27
27
  //
28
28
  // Invitations shared across HALO and ECHO.
29
- // TODO(burdon): Consolidate with invitation protobufs.
30
29
  //
31
30
 
32
31
  enum InvitationState {
@@ -38,7 +37,7 @@ enum InvitationState {
38
37
 
39
38
  /// Invitation process created by sender.
40
39
  message InvitationRequest {
41
- optional dxos.halo.invitations.InvitationDescriptor descriptor = 1;
40
+ optional dxos.client.services.Invitation descriptor = 1;
42
41
 
43
42
  InvitationState state = 2;
44
43
 
@@ -55,8 +54,8 @@ message RedeemedInvitation {
55
54
  /// Only if state == ERROR.
56
55
  optional string error = 3;
57
56
 
58
- /// Only on party invitations that are finished.
59
- optional dxos.keys.PublicKey party_key = 4;
57
+ /// Only on space invitations that are finished.
58
+ optional dxos.keys.PublicKey space_key = 4;
60
59
  }
61
60
 
62
61
  message AuthenticateInvitationRequest {
@@ -70,8 +69,9 @@ message AuthenticateInvitationRequest {
70
69
  //
71
70
 
72
71
  message Profile {
73
- dxos.keys.PublicKey public_key = 1;
74
- optional string username = 2;
72
+ // TODO(burdon): Remove identity from Profile (space of identity).
73
+ dxos.keys.PublicKey identity_key = 1;
74
+ optional string displayName = 2;
75
75
  }
76
76
 
77
77
  message SubscribeProfileResponse {
@@ -79,14 +79,16 @@ message SubscribeProfileResponse {
79
79
  }
80
80
 
81
81
  message CreateProfileRequest {
82
- optional string username = 1;
83
- optional bytes public_key = 2;
84
- optional bytes secret_key = 3;
82
+ optional bytes public_key = 1;
83
+ optional bytes secret_key = 2;
84
+ // TODO(burdon): Profile.
85
+ optional string displayName = 3;
85
86
  }
86
87
 
87
88
  message RecoverProfileRequest {
88
89
  string seed_phrase = 1;
89
90
  }
91
+
90
92
  message Contact {
91
93
  dxos.keys.PublicKey public_key = 1;
92
94
  optional string display_name = 2;
@@ -102,7 +104,7 @@ service ProfileService {
102
104
  rpc SubscribeProfile (google.protobuf.Empty) returns (stream SubscribeProfileResponse);
103
105
 
104
106
  rpc CreateInvitation(google.protobuf.Empty) returns (stream InvitationRequest);
105
- rpc AcceptInvitation(dxos.halo.invitations.InvitationDescriptor) returns (stream RedeemedInvitation);
107
+ rpc AcceptInvitation(dxos.client.services.Invitation) returns (stream RedeemedInvitation);
106
108
  rpc AuthenticateInvitation(AuthenticateInvitationRequest) returns (google.protobuf.Empty);
107
109
  }
108
110
 
@@ -154,54 +156,56 @@ service HaloService {
154
156
  //
155
157
 
156
158
  // TODO(burdon): Rename Space.
157
- message Party {
158
- message Member {
159
- dxos.keys.PublicKey public_key = 1;
160
- optional string display_name = 2;
161
- }
162
-
159
+ message Space {
163
160
  dxos.keys.PublicKey public_key = 1;
164
161
  bool is_open = 2;
165
162
  bool is_active = 3;
166
163
 
167
- repeated Member members = 4;
164
+ repeated SpaceMember members = 4;
168
165
  }
169
166
 
170
- message SubscribePartyRequest {
171
- dxos.keys.PublicKey party_key = 1;
167
+ message SubscribeSpaceRequest {
168
+ dxos.keys.PublicKey space_key = 1;
172
169
  }
173
170
 
174
- message GetPartyDetailsRequest {
175
- dxos.keys.PublicKey party_key = 1;
171
+ message GetSpaceDetailsRequest {
172
+ dxos.keys.PublicKey space_key = 1;
176
173
  }
177
174
 
178
- message PartyDetails {
175
+ message SpaceDetails {
179
176
  /// The timeframe of mutations processed by the client.
180
177
  dxos.echo.timeframe.TimeframeVector processed_timeframe = 1;
181
178
  }
182
179
 
183
- message SubscribePartyResponse {
184
- optional Party party = 1;
180
+ // TODO(burdon): Reconcile with dxos.halo.credentials.SpaceMember.
181
+ // TODO(burdon): Reconcile with Profile.
182
+ message SpaceMember {
183
+ dxos.keys.PublicKey identity_key = 1;
184
+ optional Profile profile = 2;
185
+ }
186
+
187
+ message SubscribeSpaceResponse {
188
+ optional Space space = 1;
185
189
  }
186
190
 
187
- message SubscribePartiesResponse {
188
- repeated Party parties = 1;
191
+ message SubscribeSpacesResponse {
192
+ repeated Space spaces = 1;
189
193
  }
190
194
 
191
195
  message CreateInvitationRequest {
192
- dxos.keys.PublicKey party_key = 1;
196
+ dxos.keys.PublicKey space_key = 1;
193
197
 
194
198
  /// When specified the invitation will be of OFFLINE type, not requiring secret exchange.
195
199
  optional dxos.keys.PublicKey invitee_key = 2;
196
200
  }
197
201
 
198
- message PartyActivationOptions {
202
+ message SpaceActivationOptions {
199
203
  bool global = 1;
200
204
  bool device = 2;
201
205
  }
202
206
 
203
- message SetPartyStateRequest {
204
- dxos.keys.PublicKey party_key = 1;
207
+ message SetSpaceStateRequest {
208
+ dxos.keys.PublicKey space_key = 1;
205
209
 
206
210
  optional bool open = 2;
207
211
  optional bool active_global = 3;
@@ -209,46 +213,36 @@ message SetPartyStateRequest {
209
213
  }
210
214
 
211
215
  message SubscribeMembersRequest {
212
- dxos.keys.PublicKey party_key = 1;
216
+ dxos.keys.PublicKey space_key = 1;
213
217
  }
214
218
 
215
219
  message SubscribeMembersResponse {
216
- message PartyMember {
217
- dxos.keys.PublicKey public_key = 1; // TODO(burdon): Rename xxx_key.
218
- optional string display_name = 2;
219
- }
220
-
221
- repeated PartyMember members = 1;
220
+ repeated SpaceMember members = 1;
222
221
  }
223
222
 
224
223
  message CreateSnapshotRequest {
225
- dxos.keys.PublicKey party_key = 1;
224
+ dxos.keys.PublicKey space_key = 1;
226
225
  }
227
226
 
228
227
  //
229
228
  // Service definition
230
229
  //
231
230
 
232
- // TODO(burdon): Rename SpaceService.
233
- service PartyService {
234
- rpc SubscribeToParty (SubscribePartyRequest) returns (stream SubscribePartyResponse);
235
- rpc SubscribeParties (google.protobuf.Empty) returns (stream SubscribePartiesResponse);
231
+ service SpaceService {
232
+ rpc SubscribeToSpace (SubscribeSpaceRequest) returns (stream SubscribeSpaceResponse);
233
+ rpc SubscribeSpaces (google.protobuf.Empty) returns (stream SubscribeSpacesResponse);
236
234
 
237
- rpc GetPartyDetails(GetPartyDetailsRequest) returns (PartyDetails);
235
+ rpc GetSpaceDetails(GetSpaceDetailsRequest) returns (SpaceDetails);
238
236
 
239
- rpc CreateParty(google.protobuf.Empty) returns (Party);
240
- rpc CloneParty(dxos.echo.snapshot.PartySnapshot) returns (Party);
237
+ rpc CreateSpace(google.protobuf.Empty) returns (Space);
238
+ rpc CloneSpace(dxos.echo.snapshot.SpaceSnapshot) returns (Space);
241
239
 
242
- /// Open and close or activate and deactivate a party.
243
- rpc SetPartyState(SetPartyStateRequest) returns (Party);
244
-
245
- // TODO(burdon): Rename.
246
- rpc CreateInvitation(CreateInvitationRequest) returns (stream InvitationRequest);
247
- rpc AcceptInvitation(dxos.halo.invitations.InvitationDescriptor) returns (stream RedeemedInvitation);
248
- rpc AuthenticateInvitation(AuthenticateInvitationRequest) returns (google.protobuf.Empty);
240
+ /// Open and close or activate and deactivate a space.
241
+ rpc SetSpaceState(SetSpaceStateRequest) returns (Space);
249
242
 
250
- // TODO(rzadp): Remove and join with Subscribing to Party.
243
+ // TODO(rzadp): Remove and join with Subscribing to Space.
244
+ // Deprecated.
251
245
  rpc SubscribeMembers (SubscribeMembersRequest) returns (stream SubscribeMembersResponse);
252
246
 
253
- rpc CreateSnapshot(CreateSnapshotRequest) returns (echo.snapshot.PartySnapshot);
247
+ rpc CreateSnapshot(CreateSnapshotRequest) returns (echo.snapshot.SpaceSnapshot);
254
248
  }
@@ -62,18 +62,6 @@ message Module {
62
62
 
63
63
  message Runtime {
64
64
  message Client {
65
- /// Whether the client services are local with ClientServiceHost or remote and need to be accessed via ClientServiceProxy. Defaults to AUTOMATIC.
66
- enum Mode {
67
- /// Connects to the browser wallet if avialable, otherwise runs services in the local mode.
68
- AUTOMATIC = 0;
69
-
70
- /// Run services in the local mode.
71
- LOCAL = 1;
72
-
73
- /// Connect to the browser wallet or to the remote services through the RPC port.
74
- REMOTE = 2;
75
- }
76
-
77
65
  message Storage {
78
66
  enum StorageDriver {
79
67
  RAM = 0;
@@ -104,9 +92,8 @@ message Runtime {
104
92
  /// Milliseconds
105
93
  optional int32 invitation_expiration = 5;
106
94
 
107
- optional Mode mode = 6;
108
-
109
- optional string remote_source = 7;
95
+ // TODO(burdon): Remove?
96
+ optional string remote_source = 6;
110
97
  }
111
98
 
112
99
  message App {
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2021 DXOS.org
3
+ //
4
+
5
+ syntax = "proto3";
6
+
7
+ import "dxos/keys.proto";
8
+
9
+ package dxos.devtools.host;
10
+
11
+ message Services {
12
+ repeated SpaceStats spaces = 1;
13
+ }
14
+
15
+ message SpaceStats {
16
+ dxos.keys.PublicKey key = 1;
17
+ repeated PeerStats peers = 2;
18
+ }
19
+
20
+ message PeerStats {
21
+ FeedStats control_feed = 1;
22
+ FeedStats data_feed = 2;
23
+ }
24
+
25
+ message FeedStats {
26
+ dxos.keys.PublicKey key = 1;
27
+ int32 length = 2;
28
+ }