@dxos/client-services 0.7.2 → 0.7.3-staging.971cd8d
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.
- package/dist/lib/browser/{chunk-K5O5LV2R.mjs → chunk-2DUFSBLX.mjs} +340 -422
- package/dist/lib/browser/chunk-2DUFSBLX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-SPLKKUM4.cjs → chunk-S24QKMSU.cjs} +329 -411
- package/dist/lib/node/chunk-S24QKMSU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +47 -47
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node-esm/{chunk-NSCBFSXO.mjs → chunk-2JS26IP4.mjs} +334 -416
- package/dist/lib/node-esm/chunk-2JS26IP4.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/packlets/agents/edge-agent-service.d.ts +5 -2
- package/dist/types/src/packlets/agents/edge-agent-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +1 -0
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/epoch-migrations.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +38 -38
- package/src/packlets/agents/edge-agent-service.ts +28 -3
- package/src/packlets/identity/identity-service.ts +16 -1
- package/src/packlets/services/service-context.ts +4 -1
- package/src/packlets/services/service-host.ts +1 -1
- package/src/packlets/spaces/data-space-manager.ts +4 -13
- package/src/packlets/spaces/epoch-migrations.ts +3 -84
- package/src/version.ts +1 -5
- package/dist/lib/browser/chunk-K5O5LV2R.mjs.map +0 -7
- package/dist/lib/node/chunk-SPLKKUM4.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-NSCBFSXO.mjs.map +0 -7
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_S24QKMSU_exports = {};
|
|
30
|
+
__export(chunk_S24QKMSU_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -72,7 +72,7 @@ __export(chunk_SPLKKUM4_exports, {
|
|
|
72
72
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
73
73
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
74
74
|
});
|
|
75
|
-
module.exports = __toCommonJS(
|
|
75
|
+
module.exports = __toCommonJS(chunk_S24QKMSU_exports);
|
|
76
76
|
var import_async = require("@dxos/async");
|
|
77
77
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
78
78
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -135,19 +135,14 @@ var import_util4 = require("@dxos/util");
|
|
|
135
135
|
var import_async8 = require("@dxos/async");
|
|
136
136
|
var import_context5 = require("@dxos/context");
|
|
137
137
|
var import_credentials4 = require("@dxos/credentials");
|
|
138
|
-
var import_echo_db = require("@dxos/echo-db");
|
|
139
|
-
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
140
|
-
var import_echo_protocol2 = require("@dxos/echo-protocol");
|
|
141
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
142
138
|
var import_invariant4 = require("@dxos/invariant");
|
|
143
|
-
var import_log5 = require("@dxos/log");
|
|
144
139
|
var import_services5 = require("@dxos/protocols/proto/dxos/client/services");
|
|
145
140
|
var import_async9 = require("@dxos/async");
|
|
146
141
|
var import_context6 = require("@dxos/context");
|
|
147
142
|
var import_credentials5 = require("@dxos/credentials");
|
|
148
143
|
var import_invariant5 = require("@dxos/invariant");
|
|
149
144
|
var import_keys5 = require("@dxos/keys");
|
|
150
|
-
var
|
|
145
|
+
var import_log5 = require("@dxos/log");
|
|
151
146
|
var import_protocols4 = require("@dxos/protocols");
|
|
152
147
|
var import_proto2 = require("@dxos/protocols/proto");
|
|
153
148
|
var import_teleport = require("@dxos/teleport");
|
|
@@ -158,25 +153,25 @@ var import_credentials6 = require("@dxos/credentials");
|
|
|
158
153
|
var import_feed_store2 = require("@dxos/feed-store");
|
|
159
154
|
var import_invariant6 = require("@dxos/invariant");
|
|
160
155
|
var import_keys6 = require("@dxos/keys");
|
|
161
|
-
var
|
|
156
|
+
var import_log6 = require("@dxos/log");
|
|
162
157
|
var import_credentials7 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
163
158
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
164
159
|
var import_tracing4 = require("@dxos/tracing");
|
|
165
160
|
var import_util6 = require("@dxos/util");
|
|
166
161
|
var import_credentials8 = require("@dxos/credentials");
|
|
167
162
|
var import_keys7 = require("@dxos/keys");
|
|
168
|
-
var
|
|
163
|
+
var import_log7 = require("@dxos/log");
|
|
169
164
|
var import_async11 = require("@dxos/async");
|
|
170
165
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
171
166
|
var import_context7 = require("@dxos/context");
|
|
172
167
|
var import_credentials9 = require("@dxos/credentials");
|
|
173
|
-
var
|
|
174
|
-
var
|
|
175
|
-
var
|
|
168
|
+
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
169
|
+
var import_echo_protocol2 = require("@dxos/echo-protocol");
|
|
170
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
176
171
|
var import_feed_store3 = require("@dxos/feed-store");
|
|
177
172
|
var import_invariant7 = require("@dxos/invariant");
|
|
178
173
|
var import_keys8 = require("@dxos/keys");
|
|
179
|
-
var
|
|
174
|
+
var import_log8 = require("@dxos/log");
|
|
180
175
|
var import_protocols5 = require("@dxos/protocols");
|
|
181
176
|
var import_services6 = require("@dxos/protocols/proto/dxos/client/services");
|
|
182
177
|
var import_metadata = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
@@ -194,7 +189,7 @@ var import_credentials13 = require("@dxos/credentials");
|
|
|
194
189
|
var import_debug3 = require("@dxos/debug");
|
|
195
190
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
196
191
|
var import_invariant8 = require("@dxos/invariant");
|
|
197
|
-
var
|
|
192
|
+
var import_log9 = require("@dxos/log");
|
|
198
193
|
var import_protocols6 = require("@dxos/protocols");
|
|
199
194
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
200
195
|
var import_tracing6 = require("@dxos/tracing");
|
|
@@ -204,7 +199,7 @@ var import_context8 = require("@dxos/context");
|
|
|
204
199
|
var import_credentials14 = require("@dxos/credentials");
|
|
205
200
|
var import_invariant9 = require("@dxos/invariant");
|
|
206
201
|
var import_keys9 = require("@dxos/keys");
|
|
207
|
-
var
|
|
202
|
+
var import_log10 = require("@dxos/log");
|
|
208
203
|
var import_protocols7 = require("@dxos/protocols");
|
|
209
204
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
210
205
|
var import_credentials15 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
@@ -217,7 +212,7 @@ var import_codec_protobuf9 = require("@dxos/codec-protobuf");
|
|
|
217
212
|
var import_context9 = require("@dxos/context");
|
|
218
213
|
var import_credentials16 = require("@dxos/credentials");
|
|
219
214
|
var import_invariant10 = require("@dxos/invariant");
|
|
220
|
-
var
|
|
215
|
+
var import_log11 = require("@dxos/log");
|
|
221
216
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
222
217
|
var import_util9 = require("@dxos/util");
|
|
223
218
|
var import_credentials17 = require("@dxos/credentials");
|
|
@@ -230,7 +225,7 @@ var import_context10 = require("@dxos/context");
|
|
|
230
225
|
var import_crypto = require("@dxos/crypto");
|
|
231
226
|
var import_invariant12 = require("@dxos/invariant");
|
|
232
227
|
var import_keys10 = require("@dxos/keys");
|
|
233
|
-
var
|
|
228
|
+
var import_log12 = require("@dxos/log");
|
|
234
229
|
var import_network_manager = require("@dxos/network-manager");
|
|
235
230
|
var import_protocols9 = require("@dxos/protocols");
|
|
236
231
|
var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
|
|
@@ -242,7 +237,7 @@ var import_async16 = require("@dxos/async");
|
|
|
242
237
|
var import_crypto2 = require("@dxos/crypto");
|
|
243
238
|
var import_invariant13 = require("@dxos/invariant");
|
|
244
239
|
var import_keys11 = require("@dxos/keys");
|
|
245
|
-
var
|
|
240
|
+
var import_log13 = require("@dxos/log");
|
|
246
241
|
var import_protocols10 = require("@dxos/protocols");
|
|
247
242
|
var import_proto3 = require("@dxos/protocols/proto");
|
|
248
243
|
var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
|
|
@@ -251,7 +246,7 @@ var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
|
|
|
251
246
|
var import_async17 = require("@dxos/async");
|
|
252
247
|
var import_context12 = require("@dxos/context");
|
|
253
248
|
var import_invariant14 = require("@dxos/invariant");
|
|
254
|
-
var
|
|
249
|
+
var import_log14 = require("@dxos/log");
|
|
255
250
|
var import_protocols11 = require("@dxos/protocols");
|
|
256
251
|
var import_proto4 = require("@dxos/protocols/proto");
|
|
257
252
|
var import_invitations3 = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
@@ -261,18 +256,18 @@ var import_context13 = require("@dxos/context");
|
|
|
261
256
|
var import_crypto3 = require("@dxos/crypto");
|
|
262
257
|
var import_invariant15 = require("@dxos/invariant");
|
|
263
258
|
var import_keys12 = require("@dxos/keys");
|
|
264
|
-
var
|
|
259
|
+
var import_log15 = require("@dxos/log");
|
|
265
260
|
var import_protocols12 = require("@dxos/protocols");
|
|
266
261
|
var import_proto5 = require("@dxos/protocols/proto");
|
|
267
262
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
268
263
|
var import_invitations4 = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
269
264
|
var import_teleport3 = require("@dxos/teleport");
|
|
270
265
|
var import_async19 = require("@dxos/async");
|
|
271
|
-
var
|
|
266
|
+
var import_log16 = require("@dxos/log");
|
|
272
267
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
273
268
|
var import_invariant16 = require("@dxos/invariant");
|
|
274
269
|
var import_keys13 = require("@dxos/keys");
|
|
275
|
-
var
|
|
270
|
+
var import_log17 = require("@dxos/log");
|
|
276
271
|
var import_invitations5 = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
277
272
|
var import_util11 = require("@dxos/util");
|
|
278
273
|
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
@@ -281,7 +276,7 @@ var import_tracing9 = require("@dxos/tracing");
|
|
|
281
276
|
var import_credentials18 = require("@dxos/credentials");
|
|
282
277
|
var import_feed_store5 = require("@dxos/feed-store");
|
|
283
278
|
var import_invariant17 = require("@dxos/invariant");
|
|
284
|
-
var
|
|
279
|
+
var import_log18 = require("@dxos/log");
|
|
285
280
|
var import_protocols13 = require("@dxos/protocols");
|
|
286
281
|
var import_services17 = require("@dxos/protocols/proto/dxos/client/services");
|
|
287
282
|
var import_credentials19 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
@@ -289,15 +284,15 @@ var import_async20 = require("@dxos/async");
|
|
|
289
284
|
var import_client_protocol6 = require("@dxos/client-protocol");
|
|
290
285
|
var import_context14 = require("@dxos/context");
|
|
291
286
|
var import_credentials20 = require("@dxos/credentials");
|
|
292
|
-
var
|
|
287
|
+
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
293
288
|
var import_invariant18 = require("@dxos/invariant");
|
|
294
289
|
var import_keys14 = require("@dxos/keys");
|
|
295
|
-
var
|
|
290
|
+
var import_log19 = require("@dxos/log");
|
|
296
291
|
var import_services18 = require("@dxos/protocols/proto/dxos/client/services");
|
|
297
292
|
var import_credentials21 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
298
293
|
var import_invariant19 = require("@dxos/invariant");
|
|
299
294
|
var import_lock_file = require("@dxos/lock-file");
|
|
300
|
-
var
|
|
295
|
+
var import_log20 = require("@dxos/log");
|
|
301
296
|
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
302
297
|
var import_debug4 = require("@dxos/debug");
|
|
303
298
|
var import_rpc = require("@dxos/rpc");
|
|
@@ -306,7 +301,7 @@ var import_async21 = require("@dxos/async");
|
|
|
306
301
|
var import_context15 = require("@dxos/context");
|
|
307
302
|
var import_invariant20 = require("@dxos/invariant");
|
|
308
303
|
var import_keys15 = require("@dxos/keys");
|
|
309
|
-
var
|
|
304
|
+
var import_log21 = require("@dxos/log");
|
|
310
305
|
var import_protocols14 = require("@dxos/protocols");
|
|
311
306
|
var import_services19 = require("@dxos/protocols/proto/dxos/client/services");
|
|
312
307
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
@@ -316,13 +311,13 @@ var import_async22 = require("@dxos/async");
|
|
|
316
311
|
var import_context16 = require("@dxos/context");
|
|
317
312
|
var import_credentials22 = require("@dxos/credentials");
|
|
318
313
|
var import_debug5 = require("@dxos/debug");
|
|
319
|
-
var
|
|
314
|
+
var import_echo_pipeline4 = require("@dxos/echo-pipeline");
|
|
320
315
|
var import_edge_client2 = require("@dxos/edge-client");
|
|
321
316
|
var import_feed_store6 = require("@dxos/feed-store");
|
|
322
317
|
var import_invariant21 = require("@dxos/invariant");
|
|
323
318
|
var import_keyring = require("@dxos/keyring");
|
|
324
319
|
var import_keys16 = require("@dxos/keys");
|
|
325
|
-
var
|
|
320
|
+
var import_log22 = require("@dxos/log");
|
|
326
321
|
var import_protocols16 = require("@dxos/protocols");
|
|
327
322
|
var import_services21 = require("@dxos/protocols/proto/dxos/client/services");
|
|
328
323
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
@@ -332,7 +327,7 @@ var import_credentials23 = require("@dxos/credentials");
|
|
|
332
327
|
var import_crypto4 = require("@dxos/crypto");
|
|
333
328
|
var import_invariant22 = require("@dxos/invariant");
|
|
334
329
|
var import_keys17 = require("@dxos/keys");
|
|
335
|
-
var
|
|
330
|
+
var import_log23 = require("@dxos/log");
|
|
336
331
|
var import_protocols17 = require("@dxos/protocols");
|
|
337
332
|
var import_proto6 = require("@dxos/protocols/proto");
|
|
338
333
|
var import_timeframe5 = require("@dxos/timeframe");
|
|
@@ -347,7 +342,7 @@ var import_keys18 = require("@dxos/keys");
|
|
|
347
342
|
var import_kv_store = require("@dxos/kv-store");
|
|
348
343
|
var import_automerge_repo = require("@dxos/automerge/automerge-repo");
|
|
349
344
|
var import_invariant23 = require("@dxos/invariant");
|
|
350
|
-
var
|
|
345
|
+
var import_log24 = require("@dxos/log");
|
|
351
346
|
var import_protocols19 = require("@dxos/protocols");
|
|
352
347
|
var import_util14 = require("@dxos/util");
|
|
353
348
|
var import_async23 = require("@dxos/async");
|
|
@@ -356,7 +351,7 @@ var import_context17 = require("@dxos/context");
|
|
|
356
351
|
var import_edge_client3 = require("@dxos/edge-client");
|
|
357
352
|
var import_invariant24 = require("@dxos/invariant");
|
|
358
353
|
var import_keys19 = require("@dxos/keys");
|
|
359
|
-
var
|
|
354
|
+
var import_log25 = require("@dxos/log");
|
|
360
355
|
var import_messaging = require("@dxos/messaging");
|
|
361
356
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
362
357
|
var import_protocols20 = require("@dxos/protocols");
|
|
@@ -374,7 +369,7 @@ var import_util15 = require("@dxos/util");
|
|
|
374
369
|
var import_async26 = require("@dxos/async");
|
|
375
370
|
var import_codec_protobuf15 = require("@dxos/codec-protobuf");
|
|
376
371
|
var import_keys21 = require("@dxos/keys");
|
|
377
|
-
var
|
|
372
|
+
var import_log26 = require("@dxos/log");
|
|
378
373
|
var import_services24 = require("@dxos/protocols/proto/dxos/client/services");
|
|
379
374
|
var import_util16 = require("@dxos/util");
|
|
380
375
|
var import_codec_protobuf16 = require("@dxos/codec-protobuf");
|
|
@@ -739,7 +734,7 @@ var DevtoolsServiceImpl = class {
|
|
|
739
734
|
});
|
|
740
735
|
}
|
|
741
736
|
};
|
|
742
|
-
var DXOS_VERSION = "0.7.
|
|
737
|
+
var DXOS_VERSION = "0.7.3-staging.971cd8d";
|
|
743
738
|
var getPlatform = () => {
|
|
744
739
|
if (process.browser) {
|
|
745
740
|
if (typeof window !== "undefined") {
|
|
@@ -1583,133 +1578,16 @@ var runEpochMigration = async (ctx, context) => {
|
|
|
1583
1578
|
};
|
|
1584
1579
|
}
|
|
1585
1580
|
case import_services5.CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT: {
|
|
1586
|
-
|
|
1587
|
-
F: __dxlog_file6,
|
|
1588
|
-
L: 64,
|
|
1589
|
-
S: void 0,
|
|
1590
|
-
C: (f, a) => f(...a)
|
|
1591
|
-
});
|
|
1592
|
-
const currentRootUrl = context.currentRoot;
|
|
1593
|
-
const rootHandle = await context.echoHost.loadDoc(ctx, currentRootUrl, {
|
|
1594
|
-
timeout: LOAD_DOC_TIMEOUT
|
|
1595
|
-
});
|
|
1596
|
-
const objects = Object.entries(rootHandle.docSync().objects);
|
|
1597
|
-
const properties = (0, import_echo_pipeline2.findInlineObjectOfType)(rootHandle.docSync(), import_echo_schema.TYPE_PROPERTIES);
|
|
1598
|
-
const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
|
|
1599
|
-
(0, import_invariant4.invariant)(properties, "Properties not found", {
|
|
1600
|
-
F: __dxlog_file6,
|
|
1601
|
-
L: 75,
|
|
1602
|
-
S: void 0,
|
|
1603
|
-
A: [
|
|
1604
|
-
"properties",
|
|
1605
|
-
"'Properties not found'"
|
|
1606
|
-
]
|
|
1607
|
-
});
|
|
1608
|
-
const newRoot = context.echoHost.createDoc({
|
|
1609
|
-
...rootHandle.docSync(),
|
|
1610
|
-
objects: Object.fromEntries([
|
|
1611
|
-
properties
|
|
1612
|
-
])
|
|
1613
|
-
});
|
|
1614
|
-
(0, import_invariant4.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
|
|
1615
|
-
F: __dxlog_file6,
|
|
1616
|
-
L: 82,
|
|
1617
|
-
S: void 0,
|
|
1618
|
-
A: [
|
|
1619
|
-
"typeof newRoot.url === 'string' && newRoot.url.length > 0",
|
|
1620
|
-
""
|
|
1621
|
-
]
|
|
1622
|
-
});
|
|
1623
|
-
const newLinks = [];
|
|
1624
|
-
for (const [id, objData] of otherObjects) {
|
|
1625
|
-
const handle = context.echoHost.createDoc({
|
|
1626
|
-
version: import_echo_protocol2.SpaceDocVersion.CURRENT,
|
|
1627
|
-
access: {
|
|
1628
|
-
spaceKey: context.spaceKey.toHex()
|
|
1629
|
-
},
|
|
1630
|
-
objects: {
|
|
1631
|
-
[id]: objData
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
newLinks.push([
|
|
1635
|
-
id,
|
|
1636
|
-
handle.url
|
|
1637
|
-
]);
|
|
1638
|
-
}
|
|
1639
|
-
newRoot.change((doc) => {
|
|
1640
|
-
doc.links ??= {};
|
|
1641
|
-
for (const [id, url] of newLinks) {
|
|
1642
|
-
doc.links[id] = url;
|
|
1643
|
-
}
|
|
1644
|
-
});
|
|
1645
|
-
await context.echoHost.flush();
|
|
1646
|
-
return {
|
|
1647
|
-
newRoot: newRoot.url
|
|
1648
|
-
};
|
|
1581
|
+
throw new Error("Migration not available");
|
|
1649
1582
|
}
|
|
1650
1583
|
case import_services5.CreateEpochRequest.Migration.MIGRATE_REFERENCES_TO_DXN: {
|
|
1651
|
-
|
|
1652
|
-
const rootHandle = await context.echoHost.loadDoc(ctx, currentRootUrl, {
|
|
1653
|
-
timeout: LOAD_DOC_TIMEOUT
|
|
1654
|
-
});
|
|
1655
|
-
(0, import_invariant4.invariant)(rootHandle.docSync(), "Root doc not found", {
|
|
1656
|
-
F: __dxlog_file6,
|
|
1657
|
-
L: 115,
|
|
1658
|
-
S: void 0,
|
|
1659
|
-
A: [
|
|
1660
|
-
"rootHandle.docSync()",
|
|
1661
|
-
"'Root doc not found'"
|
|
1662
|
-
]
|
|
1663
|
-
});
|
|
1664
|
-
const newRootContent = await (0, import_echo_pipeline2.convertLegacySpaceRootDoc)(structuredClone(rootHandle.docSync()));
|
|
1665
|
-
for (const [id, url] of Object.entries(newRootContent.links ?? {})) {
|
|
1666
|
-
try {
|
|
1667
|
-
const handle = await context.echoHost.loadDoc(ctx, url, {
|
|
1668
|
-
timeout: LOAD_DOC_TIMEOUT
|
|
1669
|
-
});
|
|
1670
|
-
(0, import_invariant4.invariant)(handle.docSync(), void 0, {
|
|
1671
|
-
F: __dxlog_file6,
|
|
1672
|
-
L: 122,
|
|
1673
|
-
S: void 0,
|
|
1674
|
-
A: [
|
|
1675
|
-
"handle.docSync()",
|
|
1676
|
-
""
|
|
1677
|
-
]
|
|
1678
|
-
});
|
|
1679
|
-
const newDoc = await (0, import_echo_pipeline2.convertLegacyReferences)(structuredClone(handle.docSync()));
|
|
1680
|
-
const migratedDoc = (0, import_echo_db.migrateDocument)(handle.docSync(), newDoc);
|
|
1681
|
-
const newHandle = context.echoHost.createDoc(migratedDoc, {
|
|
1682
|
-
preserveHistory: true
|
|
1683
|
-
});
|
|
1684
|
-
newRootContent.links[id] = newHandle.url;
|
|
1685
|
-
} catch (err) {
|
|
1686
|
-
import_log5.log.warn("Failed to migrate reference", {
|
|
1687
|
-
id,
|
|
1688
|
-
url,
|
|
1689
|
-
error: err
|
|
1690
|
-
}, {
|
|
1691
|
-
F: __dxlog_file6,
|
|
1692
|
-
L: 128,
|
|
1693
|
-
S: void 0,
|
|
1694
|
-
C: (f, a) => f(...a)
|
|
1695
|
-
});
|
|
1696
|
-
delete newRootContent.links[id];
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
const migratedRoot = (0, import_echo_db.migrateDocument)(rootHandle.docSync(), newRootContent);
|
|
1700
|
-
const newRoot = context.echoHost.createDoc(migratedRoot, {
|
|
1701
|
-
preserveHistory: true
|
|
1702
|
-
});
|
|
1703
|
-
await context.echoHost.flush();
|
|
1704
|
-
return {
|
|
1705
|
-
newRoot: newRoot.url
|
|
1706
|
-
};
|
|
1584
|
+
throw new Error("Migration not available");
|
|
1707
1585
|
}
|
|
1708
1586
|
// TODO(dmaretskyi): This path doesn't seem to fit here. This is not a migration.
|
|
1709
1587
|
case import_services5.CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT: {
|
|
1710
1588
|
(0, import_invariant4.invariant)(context.newAutomergeRoot, void 0, {
|
|
1711
1589
|
F: __dxlog_file6,
|
|
1712
|
-
L:
|
|
1590
|
+
L: 62,
|
|
1713
1591
|
S: void 0,
|
|
1714
1592
|
A: [
|
|
1715
1593
|
"context.newAutomergeRoot",
|
|
@@ -1802,7 +1680,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1802
1680
|
* Request credentials to be notarized.
|
|
1803
1681
|
*/
|
|
1804
1682
|
async notarize({ ctx: opCtx, credentials, timeout = DEFAULT_NOTARIZE_TIMEOUT, retryTimeout = DEFAULT_RETRY_TIMEOUT, successDelay = DEFAULT_SUCCESS_DELAY, edgeRetryJitter }) {
|
|
1805
|
-
(0,
|
|
1683
|
+
(0, import_log5.log)("notarize", {
|
|
1806
1684
|
credentials
|
|
1807
1685
|
}, {
|
|
1808
1686
|
F: __dxlog_file7,
|
|
@@ -1822,7 +1700,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1822
1700
|
const errors = new import_async9.Trigger();
|
|
1823
1701
|
const ctx = this._ctx.derive({
|
|
1824
1702
|
onError: (err) => {
|
|
1825
|
-
|
|
1703
|
+
import_log5.log.warn("Notarization error", {
|
|
1826
1704
|
err
|
|
1827
1705
|
}, {
|
|
1828
1706
|
F: __dxlog_file7,
|
|
@@ -1856,7 +1734,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1856
1734
|
allNotarized,
|
|
1857
1735
|
errors.wait()
|
|
1858
1736
|
]);
|
|
1859
|
-
(0,
|
|
1737
|
+
(0, import_log5.log)("done", void 0, {
|
|
1860
1738
|
F: __dxlog_file7,
|
|
1861
1739
|
L: 187,
|
|
1862
1740
|
S: this,
|
|
@@ -1877,7 +1755,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1877
1755
|
...this._extensions
|
|
1878
1756
|
].find((peer2) => !peersTried.has(peer2));
|
|
1879
1757
|
if (!peer) {
|
|
1880
|
-
|
|
1758
|
+
import_log5.log.info("Exhausted all peers to notarize with", {
|
|
1881
1759
|
retryIn: retryTimeout
|
|
1882
1760
|
}, {
|
|
1883
1761
|
F: __dxlog_file7,
|
|
@@ -1890,7 +1768,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1890
1768
|
return;
|
|
1891
1769
|
}
|
|
1892
1770
|
peersTried.add(peer);
|
|
1893
|
-
(0,
|
|
1771
|
+
(0, import_log5.log)("try notarizing", {
|
|
1894
1772
|
peer: peer.localPeerId,
|
|
1895
1773
|
credentialId: credentials.map((credential) => credential.id)
|
|
1896
1774
|
}, {
|
|
@@ -1902,7 +1780,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1902
1780
|
await peer.rpc.NotarizationService.notarize({
|
|
1903
1781
|
credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
|
|
1904
1782
|
});
|
|
1905
|
-
(0,
|
|
1783
|
+
(0, import_log5.log)("success", void 0, {
|
|
1906
1784
|
F: __dxlog_file7,
|
|
1907
1785
|
L: 221,
|
|
1908
1786
|
S: this,
|
|
@@ -1911,7 +1789,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1911
1789
|
await (0, import_async9.sleep)(successDelay);
|
|
1912
1790
|
} catch (err) {
|
|
1913
1791
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
1914
|
-
|
|
1792
|
+
import_log5.log.info("error notarizing (recoverable)", err, {
|
|
1915
1793
|
F: __dxlog_file7,
|
|
1916
1794
|
L: 226,
|
|
1917
1795
|
S: this,
|
|
@@ -1940,7 +1818,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1940
1818
|
jitter: timeouts.jitter
|
|
1941
1819
|
}
|
|
1942
1820
|
});
|
|
1943
|
-
(0,
|
|
1821
|
+
(0, import_log5.log)("edge notarization success", void 0, {
|
|
1944
1822
|
F: __dxlog_file7,
|
|
1945
1823
|
L: 254,
|
|
1946
1824
|
S: this,
|
|
@@ -1993,7 +1871,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
1993
1871
|
});
|
|
1994
1872
|
const credentials = response.awaitingNotarization.credentials;
|
|
1995
1873
|
if (!credentials.length) {
|
|
1996
|
-
(0,
|
|
1874
|
+
(0, import_log5.log)("edge did not return credentials for notarization", void 0, {
|
|
1997
1875
|
F: __dxlog_file7,
|
|
1998
1876
|
L: 296,
|
|
1999
1877
|
S: this,
|
|
@@ -2001,7 +1879,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
2001
1879
|
});
|
|
2002
1880
|
return;
|
|
2003
1881
|
}
|
|
2004
|
-
(0,
|
|
1882
|
+
(0, import_log5.log)("got edge credentials for notarization", {
|
|
2005
1883
|
count: credentials.length
|
|
2006
1884
|
}, {
|
|
2007
1885
|
F: __dxlog_file7,
|
|
@@ -2014,7 +1892,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
2014
1892
|
return credentialCodec.decode(binary);
|
|
2015
1893
|
});
|
|
2016
1894
|
await this._notarizeCredentials(writer, decodedCredentials);
|
|
2017
|
-
|
|
1895
|
+
import_log5.log.info("notarized edge credentials", {
|
|
2018
1896
|
count: decodedCredentials.length
|
|
2019
1897
|
}, {
|
|
2020
1898
|
F: __dxlog_file7,
|
|
@@ -2066,7 +1944,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
2066
1944
|
createExtension() {
|
|
2067
1945
|
const extension = new NotarizationTeleportExtension({
|
|
2068
1946
|
onOpen: async () => {
|
|
2069
|
-
(0,
|
|
1947
|
+
(0, import_log5.log)("extension opened", {
|
|
2070
1948
|
peer: extension.localPeerId
|
|
2071
1949
|
}, {
|
|
2072
1950
|
F: __dxlog_file7,
|
|
@@ -2078,7 +1956,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
2078
1956
|
this._extensionOpened.emit();
|
|
2079
1957
|
},
|
|
2080
1958
|
onClose: async () => {
|
|
2081
|
-
(0,
|
|
1959
|
+
(0, import_log5.log)("extension closed", {
|
|
2082
1960
|
peer: extension.localPeerId
|
|
2083
1961
|
}, {
|
|
2084
1962
|
F: __dxlog_file7,
|
|
@@ -2094,7 +1972,7 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
2094
1972
|
}
|
|
2095
1973
|
_scheduleTimeout(ctx, errors, timeout) {
|
|
2096
1974
|
(0, import_async9.scheduleTask)(ctx, () => {
|
|
2097
|
-
|
|
1975
|
+
import_log5.log.warn("Notarization timeout", {
|
|
2098
1976
|
timeout,
|
|
2099
1977
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
2100
1978
|
}, {
|
|
@@ -2109,18 +1987,18 @@ var NotarizationPlugin = class extends import_context6.Resource {
|
|
|
2109
1987
|
}
|
|
2110
1988
|
};
|
|
2111
1989
|
_ts_decorate2([
|
|
2112
|
-
|
|
1990
|
+
import_log5.logInfo
|
|
2113
1991
|
], NotarizationPlugin.prototype, "_spaceId", void 0);
|
|
2114
1992
|
var handleEdgeError = (error) => {
|
|
2115
1993
|
if (!(error instanceof import_protocols4.EdgeCallFailedError) || error.errorData) {
|
|
2116
|
-
|
|
1994
|
+
import_log5.log.catch(error, void 0, {
|
|
2117
1995
|
F: __dxlog_file7,
|
|
2118
1996
|
L: 381,
|
|
2119
1997
|
S: void 0,
|
|
2120
1998
|
C: (f, a) => f(...a)
|
|
2121
1999
|
});
|
|
2122
2000
|
} else {
|
|
2123
|
-
|
|
2001
|
+
import_log5.log.info("Edge notarization failure", {
|
|
2124
2002
|
reason: error.reason
|
|
2125
2003
|
}, {
|
|
2126
2004
|
F: __dxlog_file7,
|
|
@@ -2173,7 +2051,7 @@ var DefaultSpaceStateMachine = class {
|
|
|
2173
2051
|
switch (assertion["@type"]) {
|
|
2174
2052
|
case "dxos.halo.credentials.DefaultSpace": {
|
|
2175
2053
|
if (!credential.subject.id.equals(this._params.identityKey)) {
|
|
2176
|
-
|
|
2054
|
+
import_log7.log.warn("Invalid default space credential", {
|
|
2177
2055
|
expectedIdentity: this._params.identityKey,
|
|
2178
2056
|
credential
|
|
2179
2057
|
}, {
|
|
@@ -2185,7 +2063,7 @@ var DefaultSpaceStateMachine = class {
|
|
|
2185
2063
|
return;
|
|
2186
2064
|
}
|
|
2187
2065
|
if (!import_keys7.SpaceId.isValid(assertion.spaceId)) {
|
|
2188
|
-
|
|
2066
|
+
import_log7.log.warn("Invalid default space id", {
|
|
2189
2067
|
id: assertion.spaceId
|
|
2190
2068
|
}, {
|
|
2191
2069
|
F: __dxlog_file8,
|
|
@@ -2308,7 +2186,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2308
2186
|
const rootUrl = space.automergeSpaceState.rootUrl;
|
|
2309
2187
|
const rootHandle = rootUrl ? this._echoHost.automergeRepo.find(rootUrl) : void 0;
|
|
2310
2188
|
const rootDoc = rootHandle?.docSync();
|
|
2311
|
-
const properties = rootDoc && (0,
|
|
2189
|
+
const properties = rootDoc && (0, import_echo_pipeline2.findInlineObjectOfType)(rootDoc, import_client_protocol4.TYPE_PROPERTIES);
|
|
2312
2190
|
return {
|
|
2313
2191
|
key: space.key.toHex(),
|
|
2314
2192
|
state: import_services6.SpaceState[space.state],
|
|
@@ -2328,65 +2206,65 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2328
2206
|
return this._spaces;
|
|
2329
2207
|
}
|
|
2330
2208
|
async _open() {
|
|
2331
|
-
(0,
|
|
2209
|
+
(0, import_log8.log)("open", void 0, {
|
|
2332
2210
|
F: __dxlog_file9,
|
|
2333
|
-
L:
|
|
2211
|
+
L: 192,
|
|
2334
2212
|
S: this,
|
|
2335
2213
|
C: (f, a) => f(...a)
|
|
2336
2214
|
});
|
|
2337
|
-
|
|
2215
|
+
import_log8.log.trace("dxos.echo.data-space-manager.open", import_protocols5.trace.begin({
|
|
2338
2216
|
id: this._instanceId
|
|
2339
2217
|
}), {
|
|
2340
2218
|
F: __dxlog_file9,
|
|
2341
|
-
L:
|
|
2219
|
+
L: 193,
|
|
2342
2220
|
S: this,
|
|
2343
2221
|
C: (f, a) => f(...a)
|
|
2344
2222
|
});
|
|
2345
|
-
(0,
|
|
2223
|
+
(0, import_log8.log)("metadata loaded", {
|
|
2346
2224
|
spaces: this._metadataStore.spaces.length
|
|
2347
2225
|
}, {
|
|
2348
2226
|
F: __dxlog_file9,
|
|
2349
|
-
L:
|
|
2227
|
+
L: 194,
|
|
2350
2228
|
S: this,
|
|
2351
2229
|
C: (f, a) => f(...a)
|
|
2352
2230
|
});
|
|
2353
2231
|
await (0, import_util7.forEachAsync)(this._metadataStore.spaces, async (spaceMetadata) => {
|
|
2354
2232
|
try {
|
|
2355
|
-
(0,
|
|
2233
|
+
(0, import_log8.log)("load space", {
|
|
2356
2234
|
spaceMetadata
|
|
2357
2235
|
}, {
|
|
2358
2236
|
F: __dxlog_file9,
|
|
2359
|
-
L:
|
|
2237
|
+
L: 198,
|
|
2360
2238
|
S: this,
|
|
2361
2239
|
C: (f, a) => f(...a)
|
|
2362
2240
|
});
|
|
2363
2241
|
await this._constructSpace(spaceMetadata);
|
|
2364
2242
|
} catch (err) {
|
|
2365
|
-
|
|
2243
|
+
import_log8.log.error("Error loading space", {
|
|
2366
2244
|
spaceMetadata,
|
|
2367
2245
|
err
|
|
2368
2246
|
}, {
|
|
2369
2247
|
F: __dxlog_file9,
|
|
2370
|
-
L:
|
|
2248
|
+
L: 201,
|
|
2371
2249
|
S: this,
|
|
2372
2250
|
C: (f, a) => f(...a)
|
|
2373
2251
|
});
|
|
2374
2252
|
}
|
|
2375
2253
|
});
|
|
2376
2254
|
this.updated.emit();
|
|
2377
|
-
|
|
2255
|
+
import_log8.log.trace("dxos.echo.data-space-manager.open", import_protocols5.trace.end({
|
|
2378
2256
|
id: this._instanceId
|
|
2379
2257
|
}), {
|
|
2380
2258
|
F: __dxlog_file9,
|
|
2381
|
-
L:
|
|
2259
|
+
L: 207,
|
|
2382
2260
|
S: this,
|
|
2383
2261
|
C: (f, a) => f(...a)
|
|
2384
2262
|
});
|
|
2385
2263
|
}
|
|
2386
2264
|
async _close() {
|
|
2387
|
-
(0,
|
|
2265
|
+
(0, import_log8.log)("close", void 0, {
|
|
2388
2266
|
F: __dxlog_file9,
|
|
2389
|
-
L:
|
|
2267
|
+
L: 212,
|
|
2390
2268
|
S: this,
|
|
2391
2269
|
C: (f, a) => f(...a)
|
|
2392
2270
|
});
|
|
@@ -2401,7 +2279,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2401
2279
|
async createSpace() {
|
|
2402
2280
|
(0, import_invariant7.invariant)(this._lifecycleState === import_context7.LifecycleState.OPEN, "Not open.", {
|
|
2403
2281
|
F: __dxlog_file9,
|
|
2404
|
-
L:
|
|
2282
|
+
L: 224,
|
|
2405
2283
|
S: this,
|
|
2406
2284
|
A: [
|
|
2407
2285
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -2418,11 +2296,11 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2418
2296
|
dataFeedKey,
|
|
2419
2297
|
state: import_services6.SpaceState.SPACE_ACTIVE
|
|
2420
2298
|
};
|
|
2421
|
-
(0,
|
|
2299
|
+
(0, import_log8.log)("creating space...", {
|
|
2422
2300
|
spaceKey
|
|
2423
2301
|
}, {
|
|
2424
2302
|
F: __dxlog_file9,
|
|
2425
|
-
L:
|
|
2303
|
+
L: 236,
|
|
2426
2304
|
S: this,
|
|
2427
2305
|
C: (f, a) => f(...a)
|
|
2428
2306
|
});
|
|
@@ -2434,7 +2312,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2434
2312
|
const memberCredential = credentials[1];
|
|
2435
2313
|
(0, import_invariant7.invariant)((0, import_credentials9.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2436
2314
|
F: __dxlog_file9,
|
|
2437
|
-
L:
|
|
2315
|
+
L: 246,
|
|
2438
2316
|
S: this,
|
|
2439
2317
|
A: [
|
|
2440
2318
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2451,22 +2329,20 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2451
2329
|
return false;
|
|
2452
2330
|
}
|
|
2453
2331
|
switch (space.databaseRoot.getVersion()) {
|
|
2454
|
-
case
|
|
2455
|
-
const [_, properties] = (0,
|
|
2332
|
+
case import_echo_protocol2.SpaceDocVersion.CURRENT: {
|
|
2333
|
+
const [_, properties] = (0, import_echo_pipeline2.findInlineObjectOfType)(space.databaseRoot.docSync(), import_client_protocol4.TYPE_PROPERTIES) ?? [];
|
|
2456
2334
|
return properties?.data?.[DEFAULT_SPACE_KEY] === this._signingContext.identityKey.toHex();
|
|
2457
2335
|
}
|
|
2458
|
-
case
|
|
2459
|
-
|
|
2460
|
-
const [_, properties] = (0, import_echo_pipeline3.findInlineObjectOfType)(convertedDoc, import_echo_protocol3.LEGACY_TYPE_PROPERTIES) ?? [];
|
|
2461
|
-
return properties?.data?.[DEFAULT_SPACE_KEY] === this._signingContext.identityKey.toHex();
|
|
2336
|
+
case import_echo_protocol2.SpaceDocVersion.LEGACY: {
|
|
2337
|
+
throw new Error("Legacy space version is not supported");
|
|
2462
2338
|
}
|
|
2463
2339
|
default:
|
|
2464
|
-
|
|
2340
|
+
import_log8.log.warn("unknown space version", {
|
|
2465
2341
|
version: space.databaseRoot.getVersion(),
|
|
2466
2342
|
spaceId: space.id
|
|
2467
2343
|
}, {
|
|
2468
2344
|
F: __dxlog_file9,
|
|
2469
|
-
L:
|
|
2345
|
+
L: 269,
|
|
2470
2346
|
S: this,
|
|
2471
2347
|
C: (f, a) => f(...a)
|
|
2472
2348
|
});
|
|
@@ -2478,7 +2354,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2478
2354
|
const document = await this._getSpaceRootDocument(space);
|
|
2479
2355
|
const properties = {
|
|
2480
2356
|
system: {
|
|
2481
|
-
type: (0,
|
|
2357
|
+
type: (0, import_echo_protocol2.encodeReference)((0, import_echo_schema.getTypeReference)(import_client_protocol4.PropertiesType))
|
|
2482
2358
|
},
|
|
2483
2359
|
data: {
|
|
2484
2360
|
[DEFAULT_SPACE_KEY]: this._signingContext.identityKey.toHex()
|
|
@@ -2487,7 +2363,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2487
2363
|
keys: []
|
|
2488
2364
|
}
|
|
2489
2365
|
};
|
|
2490
|
-
const propertiesId = (0,
|
|
2366
|
+
const propertiesId = (0, import_echo_schema.createObjectId)();
|
|
2491
2367
|
document.change((doc) => {
|
|
2492
2368
|
(0, import_util7.setDeep)(doc, [
|
|
2493
2369
|
"objects",
|
|
@@ -2501,7 +2377,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2501
2377
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
2502
2378
|
(0, import_invariant7.invariant)(automergeIndex, void 0, {
|
|
2503
2379
|
F: __dxlog_file9,
|
|
2504
|
-
L:
|
|
2380
|
+
L: 302,
|
|
2505
2381
|
S: this,
|
|
2506
2382
|
A: [
|
|
2507
2383
|
"automergeIndex",
|
|
@@ -2514,17 +2390,17 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2514
2390
|
}
|
|
2515
2391
|
// TODO(burdon): Rename join space.
|
|
2516
2392
|
async acceptSpace(opts) {
|
|
2517
|
-
(0,
|
|
2393
|
+
(0, import_log8.log)("accept space", {
|
|
2518
2394
|
opts
|
|
2519
2395
|
}, {
|
|
2520
2396
|
F: __dxlog_file9,
|
|
2521
|
-
L:
|
|
2397
|
+
L: 311,
|
|
2522
2398
|
S: this,
|
|
2523
2399
|
C: (f, a) => f(...a)
|
|
2524
2400
|
});
|
|
2525
2401
|
(0, import_invariant7.invariant)(this._lifecycleState === import_context7.LifecycleState.OPEN, "Not open.", {
|
|
2526
2402
|
F: __dxlog_file9,
|
|
2527
|
-
L:
|
|
2403
|
+
L: 312,
|
|
2528
2404
|
S: this,
|
|
2529
2405
|
A: [
|
|
2530
2406
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -2533,7 +2409,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2533
2409
|
});
|
|
2534
2410
|
(0, import_invariant7.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
2535
2411
|
F: __dxlog_file9,
|
|
2536
|
-
L:
|
|
2412
|
+
L: 313,
|
|
2537
2413
|
S: this,
|
|
2538
2414
|
A: [
|
|
2539
2415
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -2557,7 +2433,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2557
2433
|
const space = this._spaceManager.spaces.get(options.spaceKey);
|
|
2558
2434
|
(0, import_invariant7.invariant)(space, void 0, {
|
|
2559
2435
|
F: __dxlog_file9,
|
|
2560
|
-
L:
|
|
2436
|
+
L: 333,
|
|
2561
2437
|
S: this,
|
|
2562
2438
|
A: [
|
|
2563
2439
|
"space",
|
|
@@ -2570,7 +2446,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2570
2446
|
const credentials = await (0, import_credentials9.createAdmissionCredentials)(this._signingContext.credentialSigner, options.identityKey, space.key, space.genesisFeedKey, options.role, space.spaceState.membershipChainHeads, options.profile, options.delegationCredentialId);
|
|
2571
2447
|
(0, import_invariant7.invariant)(credentials[0].credential, void 0, {
|
|
2572
2448
|
F: __dxlog_file9,
|
|
2573
|
-
L:
|
|
2449
|
+
L: 352,
|
|
2574
2450
|
S: this,
|
|
2575
2451
|
A: [
|
|
2576
2452
|
"credentials[0].credential",
|
|
@@ -2580,7 +2456,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2580
2456
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2581
2457
|
(0, import_invariant7.invariant)((0, import_credentials9.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2582
2458
|
F: __dxlog_file9,
|
|
2583
|
-
L:
|
|
2459
|
+
L: 354,
|
|
2584
2460
|
S: this,
|
|
2585
2461
|
A: [
|
|
2586
2462
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2618,7 +2494,7 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2618
2494
|
const space = this._spaces.get(spaceKey);
|
|
2619
2495
|
(0, import_invariant7.invariant)(space, "Space not found.", {
|
|
2620
2496
|
F: __dxlog_file9,
|
|
2621
|
-
L:
|
|
2497
|
+
L: 391,
|
|
2622
2498
|
S: this,
|
|
2623
2499
|
A: [
|
|
2624
2500
|
"space",
|
|
@@ -2639,11 +2515,11 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2639
2515
|
space.stateUpdate.emit();
|
|
2640
2516
|
}
|
|
2641
2517
|
async _constructSpace(metadata) {
|
|
2642
|
-
(0,
|
|
2518
|
+
(0, import_log8.log)("construct space", {
|
|
2643
2519
|
metadata
|
|
2644
2520
|
}, {
|
|
2645
2521
|
F: __dxlog_file9,
|
|
2646
|
-
L:
|
|
2522
|
+
L: 410,
|
|
2647
2523
|
S: this,
|
|
2648
2524
|
C: (f, a) => f(...a)
|
|
2649
2525
|
});
|
|
@@ -2676,18 +2552,18 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2676
2552
|
if (!session.isOpen) {
|
|
2677
2553
|
return;
|
|
2678
2554
|
}
|
|
2679
|
-
session.addExtension("dxos.mesh.teleport.admission-discovery", new
|
|
2555
|
+
session.addExtension("dxos.mesh.teleport.admission-discovery", new import_echo_pipeline2.CredentialServerExtension(space));
|
|
2680
2556
|
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
2681
2557
|
remotePeerId: session.remotePeerId
|
|
2682
2558
|
}));
|
|
2683
2559
|
session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
|
|
2684
2560
|
await this._connectEchoMeshReplicator(space, session);
|
|
2685
2561
|
} catch (err) {
|
|
2686
|
-
|
|
2562
|
+
import_log8.log.warn("error on authorized connection", {
|
|
2687
2563
|
err
|
|
2688
2564
|
}, {
|
|
2689
2565
|
F: __dxlog_file9,
|
|
2690
|
-
L:
|
|
2566
|
+
L: 452,
|
|
2691
2567
|
S: this,
|
|
2692
2568
|
C: (f, a) => f(...a)
|
|
2693
2569
|
});
|
|
@@ -2695,9 +2571,9 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2695
2571
|
}
|
|
2696
2572
|
}),
|
|
2697
2573
|
onAuthFailure: () => {
|
|
2698
|
-
|
|
2574
|
+
import_log8.log.warn("auth failure", void 0, {
|
|
2699
2575
|
F: __dxlog_file9,
|
|
2700
|
-
L:
|
|
2576
|
+
L: 457,
|
|
2701
2577
|
S: this,
|
|
2702
2578
|
C: (f, a) => f(...a)
|
|
2703
2579
|
});
|
|
@@ -2726,22 +2602,22 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2726
2602
|
signingContext: this._signingContext,
|
|
2727
2603
|
callbacks: {
|
|
2728
2604
|
beforeReady: async () => {
|
|
2729
|
-
(0,
|
|
2605
|
+
(0, import_log8.log)("before space ready", {
|
|
2730
2606
|
space: space.key
|
|
2731
2607
|
}, {
|
|
2732
2608
|
F: __dxlog_file9,
|
|
2733
|
-
L:
|
|
2609
|
+
L: 484,
|
|
2734
2610
|
S: this,
|
|
2735
2611
|
C: (f, a) => f(...a)
|
|
2736
2612
|
});
|
|
2737
2613
|
},
|
|
2738
2614
|
afterReady: async () => {
|
|
2739
|
-
(0,
|
|
2615
|
+
(0, import_log8.log)("after space ready", {
|
|
2740
2616
|
space: space.key,
|
|
2741
2617
|
open: this._lifecycleState === import_context7.LifecycleState.OPEN
|
|
2742
2618
|
}, {
|
|
2743
2619
|
F: __dxlog_file9,
|
|
2744
|
-
L:
|
|
2620
|
+
L: 487,
|
|
2745
2621
|
S: this,
|
|
2746
2622
|
C: (f, a) => f(...a)
|
|
2747
2623
|
});
|
|
@@ -2756,11 +2632,11 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2756
2632
|
}
|
|
2757
2633
|
},
|
|
2758
2634
|
beforeClose: async () => {
|
|
2759
|
-
(0,
|
|
2635
|
+
(0, import_log8.log)("before space close", {
|
|
2760
2636
|
space: space.key
|
|
2761
2637
|
}, {
|
|
2762
2638
|
F: __dxlog_file9,
|
|
2763
|
-
L:
|
|
2639
|
+
L: 495,
|
|
2764
2640
|
S: this,
|
|
2765
2641
|
C: (f, a) => f(...a)
|
|
2766
2642
|
});
|
|
@@ -2777,11 +2653,11 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2777
2653
|
if (setting === import_metadata.EdgeReplicationSetting.ENABLED) {
|
|
2778
2654
|
await this._echoEdgeReplicator?.connectToSpace(dataSpace.id);
|
|
2779
2655
|
} else if (this._echoEdgeReplicator) {
|
|
2780
|
-
(0,
|
|
2656
|
+
(0, import_log8.log)("not connecting EchoEdgeReplicator because of EdgeReplicationSetting", {
|
|
2781
2657
|
spaceId: dataSpace.id
|
|
2782
2658
|
}, {
|
|
2783
2659
|
F: __dxlog_file9,
|
|
2784
|
-
L:
|
|
2660
|
+
L: 509,
|
|
2785
2661
|
S: this,
|
|
2786
2662
|
C: (f, a) => f(...a)
|
|
2787
2663
|
});
|
|
@@ -2807,11 +2683,11 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2807
2683
|
async _connectEchoMeshReplicator(space, session) {
|
|
2808
2684
|
const replicator = this._meshReplicator;
|
|
2809
2685
|
if (!replicator) {
|
|
2810
|
-
|
|
2686
|
+
import_log8.log.warn("p2p automerge replication disabled", {
|
|
2811
2687
|
space: space.key
|
|
2812
2688
|
}, {
|
|
2813
2689
|
F: __dxlog_file9,
|
|
2814
|
-
L:
|
|
2690
|
+
L: 536,
|
|
2815
2691
|
S: this,
|
|
2816
2692
|
C: (f, a) => f(...a)
|
|
2817
2693
|
});
|
|
@@ -2831,20 +2707,20 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2831
2707
|
const peers = presence.getPeersByIdentityKey(member.key);
|
|
2832
2708
|
const sessions = peers.map((p) => p.peerId && spaceProtocol.sessions.get(p.peerId));
|
|
2833
2709
|
const sessionsToClose = sessions.filter((s) => {
|
|
2834
|
-
return (s && member.role === import_credentials10.SpaceMember.Role.REMOVED !== (s.authStatus ===
|
|
2710
|
+
return (s && member.role === import_credentials10.SpaceMember.Role.REMOVED !== (s.authStatus === import_echo_pipeline2.AuthStatus.FAILURE)) ?? false;
|
|
2835
2711
|
});
|
|
2836
2712
|
sessionsToClose.forEach((session) => {
|
|
2837
|
-
void session.close().catch(
|
|
2713
|
+
void session.close().catch(import_log8.log.error);
|
|
2838
2714
|
});
|
|
2839
2715
|
closedSessions += sessionsToClose.length;
|
|
2840
2716
|
}
|
|
2841
|
-
(0,
|
|
2717
|
+
(0, import_log8.log)("processed member role changes", {
|
|
2842
2718
|
roleChangeCount: memberInfo.length,
|
|
2843
2719
|
peersOnline: presence.getPeersOnline().length,
|
|
2844
2720
|
closedSessions
|
|
2845
2721
|
}, {
|
|
2846
2722
|
F: __dxlog_file9,
|
|
2847
|
-
L:
|
|
2723
|
+
L: 562,
|
|
2848
2724
|
S: this,
|
|
2849
2725
|
C: (f, a) => f(...a)
|
|
2850
2726
|
});
|
|
@@ -2855,15 +2731,15 @@ var DataSpaceManager = class extends import_context7.Resource {
|
|
|
2855
2731
|
if (role === import_credentials10.SpaceMember.Role.REMOVED) {
|
|
2856
2732
|
const session = peerState.peerId && space.protocol.sessions.get(peerState.peerId);
|
|
2857
2733
|
if (session != null) {
|
|
2858
|
-
(0,
|
|
2734
|
+
(0, import_log8.log)("closing a session with a removed peer", {
|
|
2859
2735
|
peerId: peerState.peerId
|
|
2860
2736
|
}, {
|
|
2861
2737
|
F: __dxlog_file9,
|
|
2862
|
-
L:
|
|
2738
|
+
L: 576,
|
|
2863
2739
|
S: this,
|
|
2864
2740
|
C: (f, a) => f(...a)
|
|
2865
2741
|
});
|
|
2866
|
-
void session.close().catch(
|
|
2742
|
+
void session.close().catch(import_log8.log.error);
|
|
2867
2743
|
}
|
|
2868
2744
|
}
|
|
2869
2745
|
}
|
|
@@ -2990,7 +2866,7 @@ var SpacesServiceImpl = class {
|
|
|
2990
2866
|
const scheduler = new import_async12.UpdateScheduler(ctx, async () => {
|
|
2991
2867
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
2992
2868
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
2993
|
-
(0,
|
|
2869
|
+
(0, import_log9.log)("update", () => ({
|
|
2994
2870
|
ids: spaces.map((space) => space.id)
|
|
2995
2871
|
}), {
|
|
2996
2872
|
F: __dxlog_file10,
|
|
@@ -3269,7 +3145,7 @@ var Identity = class {
|
|
|
3269
3145
|
this._presence = params.presence;
|
|
3270
3146
|
this.identityKey = params.identityKey;
|
|
3271
3147
|
this.deviceKey = params.deviceKey;
|
|
3272
|
-
|
|
3148
|
+
import_log6.log.trace("dxos.halo.device", {
|
|
3273
3149
|
deviceKey: params.deviceKey
|
|
3274
3150
|
}, {
|
|
3275
3151
|
F: __dxlog_file11,
|
|
@@ -3411,7 +3287,7 @@ var Identity = class {
|
|
|
3411
3287
|
]));
|
|
3412
3288
|
}
|
|
3413
3289
|
async admitDevice({ deviceKey, controlFeedKey, dataFeedKey }) {
|
|
3414
|
-
(0,
|
|
3290
|
+
(0, import_log6.log)("Admitting device:", {
|
|
3415
3291
|
identityKey: this.identityKey,
|
|
3416
3292
|
hostDevice: this.deviceKey,
|
|
3417
3293
|
deviceKey,
|
|
@@ -3498,7 +3374,7 @@ var IdentityManager = class {
|
|
|
3498
3374
|
}
|
|
3499
3375
|
async open(ctx) {
|
|
3500
3376
|
const traceId = import_keys9.PublicKey.random().toHex();
|
|
3501
|
-
|
|
3377
|
+
import_log10.log.trace("dxos.halo.identity-manager.open", import_protocols7.trace.begin({
|
|
3502
3378
|
id: traceId
|
|
3503
3379
|
}), {
|
|
3504
3380
|
F: __dxlog_file12,
|
|
@@ -3507,7 +3383,7 @@ var IdentityManager = class {
|
|
|
3507
3383
|
C: (f, a) => f(...a)
|
|
3508
3384
|
});
|
|
3509
3385
|
const identityRecord = this._metadataStore.getIdentityRecord();
|
|
3510
|
-
(0,
|
|
3386
|
+
(0, import_log10.log)("identity record", {
|
|
3511
3387
|
identityRecord
|
|
3512
3388
|
}, {
|
|
3513
3389
|
F: __dxlog_file12,
|
|
@@ -3519,7 +3395,7 @@ var IdentityManager = class {
|
|
|
3519
3395
|
this._identity = await this._constructIdentity(identityRecord);
|
|
3520
3396
|
await this._identity.open(ctx);
|
|
3521
3397
|
await this._identity.ready();
|
|
3522
|
-
|
|
3398
|
+
import_log10.log.trace("dxos.halo.identity", {
|
|
3523
3399
|
identityKey: identityRecord.identityKey,
|
|
3524
3400
|
displayName: this._identity.profileDocument?.displayName
|
|
3525
3401
|
}, {
|
|
@@ -3530,7 +3406,7 @@ var IdentityManager = class {
|
|
|
3530
3406
|
});
|
|
3531
3407
|
this.stateUpdate.emit();
|
|
3532
3408
|
}
|
|
3533
|
-
|
|
3409
|
+
import_log10.log.trace("dxos.halo.identity-manager.open", import_protocols7.trace.end({
|
|
3534
3410
|
id: traceId
|
|
3535
3411
|
}), {
|
|
3536
3412
|
F: __dxlog_file12,
|
|
@@ -3555,7 +3431,7 @@ var IdentityManager = class {
|
|
|
3555
3431
|
"'Identity already exists.'"
|
|
3556
3432
|
]
|
|
3557
3433
|
});
|
|
3558
|
-
(0,
|
|
3434
|
+
(0, import_log10.log)("creating identity...", void 0, {
|
|
3559
3435
|
F: __dxlog_file12,
|
|
3560
3436
|
L: 146,
|
|
3561
3437
|
S: this,
|
|
@@ -3624,7 +3500,7 @@ var IdentityManager = class {
|
|
|
3624
3500
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
3625
3501
|
this._identity = identity;
|
|
3626
3502
|
await this._identity.ready();
|
|
3627
|
-
|
|
3503
|
+
import_log10.log.trace("dxos.halo.identity", {
|
|
3628
3504
|
identityKey: identityRecord.identityKey,
|
|
3629
3505
|
displayName: this._identity.profileDocument?.displayName
|
|
3630
3506
|
}, {
|
|
@@ -3634,7 +3510,7 @@ var IdentityManager = class {
|
|
|
3634
3510
|
C: (f, a) => f(...a)
|
|
3635
3511
|
});
|
|
3636
3512
|
this.stateUpdate.emit();
|
|
3637
|
-
(0,
|
|
3513
|
+
(0, import_log10.log)("created identity", {
|
|
3638
3514
|
identityKey: identity.identityKey,
|
|
3639
3515
|
deviceKey: identity.deviceKey,
|
|
3640
3516
|
profile: identity.profileDocument
|
|
@@ -3673,7 +3549,7 @@ var IdentityManager = class {
|
|
|
3673
3549
|
* Prepare an identity object as the first step of acceptIdentity flow.
|
|
3674
3550
|
*/
|
|
3675
3551
|
async prepareIdentity(params) {
|
|
3676
|
-
(0,
|
|
3552
|
+
(0, import_log10.log)("accepting identity", {
|
|
3677
3553
|
params
|
|
3678
3554
|
}, {
|
|
3679
3555
|
F: __dxlog_file12,
|
|
@@ -3718,7 +3594,7 @@ var IdentityManager = class {
|
|
|
3718
3594
|
this._identity = identity;
|
|
3719
3595
|
await this._identity.ready();
|
|
3720
3596
|
await this._metadataStore.setIdentityRecord(identityRecord);
|
|
3721
|
-
|
|
3597
|
+
import_log10.log.trace("dxos.halo.identity", {
|
|
3722
3598
|
identityKey: this._identity.identityKey,
|
|
3723
3599
|
displayName: this._identity.profileDocument?.displayName
|
|
3724
3600
|
}, {
|
|
@@ -3732,7 +3608,7 @@ var IdentityManager = class {
|
|
|
3732
3608
|
...profile
|
|
3733
3609
|
});
|
|
3734
3610
|
this.stateUpdate.emit();
|
|
3735
|
-
(0,
|
|
3611
|
+
(0, import_log10.log)("accepted identity", {
|
|
3736
3612
|
identityKey: identity.identityKey,
|
|
3737
3613
|
deviceKey: identity.deviceKey
|
|
3738
3614
|
}, {
|
|
@@ -3860,7 +3736,7 @@ var IdentityManager = class {
|
|
|
3860
3736
|
""
|
|
3861
3737
|
]
|
|
3862
3738
|
});
|
|
3863
|
-
(0,
|
|
3739
|
+
(0, import_log10.log)("constructing identity", {
|
|
3864
3740
|
identityRecord
|
|
3865
3741
|
}, {
|
|
3866
3742
|
F: __dxlog_file12,
|
|
@@ -3924,7 +3800,7 @@ var IdentityManager = class {
|
|
|
3924
3800
|
edgeConnection: this._edgeConnection,
|
|
3925
3801
|
edgeFeatures: this._edgeFeatures
|
|
3926
3802
|
});
|
|
3927
|
-
(0,
|
|
3803
|
+
(0, import_log10.log)("done", {
|
|
3928
3804
|
identityKey: identityRecord.identityKey
|
|
3929
3805
|
}, {
|
|
3930
3806
|
F: __dxlog_file12,
|
|
@@ -3951,7 +3827,7 @@ var IdentityManager = class {
|
|
|
3951
3827
|
}));
|
|
3952
3828
|
},
|
|
3953
3829
|
onAuthFailure: () => {
|
|
3954
|
-
|
|
3830
|
+
import_log10.log.warn("auth failure", void 0, {
|
|
3955
3831
|
F: __dxlog_file12,
|
|
3956
3832
|
L: 434,
|
|
3957
3833
|
S: this,
|
|
@@ -4074,6 +3950,28 @@ var IdentityServiceImpl = class extends import_context9.Resource {
|
|
|
4074
3950
|
nonce
|
|
4075
3951
|
});
|
|
4076
3952
|
}
|
|
3953
|
+
async createAuthCredential() {
|
|
3954
|
+
const identity = this._identityManager.identity;
|
|
3955
|
+
(0, import_invariant10.invariant)(identity, "Identity not initialized.", {
|
|
3956
|
+
F: __dxlog_file13,
|
|
3957
|
+
L: 117,
|
|
3958
|
+
S: this,
|
|
3959
|
+
A: [
|
|
3960
|
+
"identity",
|
|
3961
|
+
"'Identity not initialized.'"
|
|
3962
|
+
]
|
|
3963
|
+
});
|
|
3964
|
+
return await (0, import_credentials16.createCredential)({
|
|
3965
|
+
assertion: {
|
|
3966
|
+
"@type": "dxos.halo.credentials.Auth"
|
|
3967
|
+
},
|
|
3968
|
+
issuer: identity.identityKey,
|
|
3969
|
+
subject: identity.identityKey,
|
|
3970
|
+
chain: identity.deviceCredentialChain,
|
|
3971
|
+
signingKey: identity.deviceKey,
|
|
3972
|
+
signer: this._keyring
|
|
3973
|
+
});
|
|
3974
|
+
}
|
|
4077
3975
|
async _fixIdentityWithoutDefaultSpace(identity) {
|
|
4078
3976
|
let recodedDefaultSpace = false;
|
|
4079
3977
|
let foundDefaultSpace = false;
|
|
@@ -4090,11 +3988,11 @@ var IdentityServiceImpl = class extends import_context9.Resource {
|
|
|
4090
3988
|
}
|
|
4091
3989
|
if (await dataSpaceManager.isDefaultSpace(space)) {
|
|
4092
3990
|
if (foundDefaultSpace) {
|
|
4093
|
-
|
|
3991
|
+
import_log11.log.warn("Multiple default spaces found. Using the first one.", {
|
|
4094
3992
|
duplicate: space.id
|
|
4095
3993
|
}, {
|
|
4096
3994
|
F: __dxlog_file13,
|
|
4097
|
-
L:
|
|
3995
|
+
L: 151,
|
|
4098
3996
|
S: this,
|
|
4099
3997
|
C: (f, a) => f(...a)
|
|
4100
3998
|
});
|
|
@@ -4106,9 +4004,9 @@ var IdentityServiceImpl = class extends import_context9.Resource {
|
|
|
4106
4004
|
recordedDefaultSpaceTrigger.wake();
|
|
4107
4005
|
}
|
|
4108
4006
|
}, (err) => {
|
|
4109
|
-
|
|
4007
|
+
import_log11.log.catch(err, void 0, {
|
|
4110
4008
|
F: __dxlog_file13,
|
|
4111
|
-
L:
|
|
4009
|
+
L: 162,
|
|
4112
4010
|
S: this,
|
|
4113
4011
|
C: (f, a) => f(...a)
|
|
4114
4012
|
});
|
|
@@ -4902,7 +4800,7 @@ var EdgeInvitationHandler = class {
|
|
|
4902
4800
|
}
|
|
4903
4801
|
handle(ctx, guardedState, protocol, deviceProfile) {
|
|
4904
4802
|
if (!this._client) {
|
|
4905
|
-
(0,
|
|
4803
|
+
(0, import_log13.log)("edge disabled", void 0, {
|
|
4906
4804
|
F: __dxlog_file16,
|
|
4907
4805
|
L: 66,
|
|
4908
4806
|
S: this,
|
|
@@ -4914,7 +4812,7 @@ var EdgeInvitationHandler = class {
|
|
|
4914
4812
|
const spaceId = invitation.spaceId;
|
|
4915
4813
|
const canBeHandledByEdge = invitation.authMethod !== import_services12.Invitation.AuthMethod.SHARED_SECRET && invitation.type === import_services12.Invitation.Type.DELEGATED && invitation.kind === import_services12.Invitation.Kind.SPACE && spaceId != null && import_keys11.SpaceId.isValid(spaceId);
|
|
4916
4814
|
if (!canBeHandledByEdge) {
|
|
4917
|
-
(0,
|
|
4815
|
+
(0, import_log13.log)("invitation could not be handled by edge", {
|
|
4918
4816
|
invitation
|
|
4919
4817
|
}, {
|
|
4920
4818
|
F: __dxlog_file16,
|
|
@@ -4937,7 +4835,7 @@ var EdgeInvitationHandler = class {
|
|
|
4937
4835
|
await this._handleSpaceInvitationFlow(ctx, guardedState, admissionRequest.space, spaceId);
|
|
4938
4836
|
} catch (error) {
|
|
4939
4837
|
if (error instanceof import_protocols10.EdgeCallFailedError) {
|
|
4940
|
-
|
|
4838
|
+
import_log13.log.info("join space with edge unsuccessful", {
|
|
4941
4839
|
reason: error.message,
|
|
4942
4840
|
retryable: error.isRetryable,
|
|
4943
4841
|
after: error.retryAfterMs ?? this._calculateNextRetryMs()
|
|
@@ -4951,7 +4849,7 @@ var EdgeInvitationHandler = class {
|
|
|
4951
4849
|
(0, import_async16.scheduleTask)(ctx, tryHandleInvitation, error.retryAfterMs ?? this._calculateNextRetryMs());
|
|
4952
4850
|
}
|
|
4953
4851
|
} else if (requestCount < MAX_RETRIES_PER_INVITATION) {
|
|
4954
|
-
|
|
4852
|
+
import_log13.log.info("failed to handle invitation with edge", {
|
|
4955
4853
|
error
|
|
4956
4854
|
}, {
|
|
4957
4855
|
F: __dxlog_file16,
|
|
@@ -4968,14 +4866,14 @@ var EdgeInvitationHandler = class {
|
|
|
4968
4866
|
}
|
|
4969
4867
|
async _handleSpaceInvitationFlow(ctx, guardedState, admissionRequest, spaceId) {
|
|
4970
4868
|
try {
|
|
4971
|
-
(0,
|
|
4869
|
+
(0, import_log13.log)("edge invitation flow", void 0, {
|
|
4972
4870
|
F: __dxlog_file16,
|
|
4973
4871
|
L: 123,
|
|
4974
4872
|
S: this,
|
|
4975
4873
|
C: (f, a) => f(...a)
|
|
4976
4874
|
});
|
|
4977
4875
|
this._flowLock = await tryAcquireBeforeContextDisposed(ctx, guardedState.mutex);
|
|
4978
|
-
|
|
4876
|
+
import_log13.log.verbose("edge invitation flow acquired the lock", void 0, {
|
|
4979
4877
|
F: __dxlog_file16,
|
|
4980
4878
|
L: 125,
|
|
4981
4879
|
S: this,
|
|
@@ -5098,14 +4996,14 @@ var InvitationGuestExtension = class extends import_teleport2.RpcExtension {
|
|
|
5098
4996
|
async onOpen(context) {
|
|
5099
4997
|
await super.onOpen(context);
|
|
5100
4998
|
try {
|
|
5101
|
-
|
|
4999
|
+
import_log14.log.verbose("guest acquire lock", void 0, {
|
|
5102
5000
|
F: __dxlog_file17,
|
|
5103
5001
|
L: 89,
|
|
5104
5002
|
S: this,
|
|
5105
5003
|
C: (f, a) => f(...a)
|
|
5106
5004
|
});
|
|
5107
5005
|
this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
|
|
5108
|
-
|
|
5006
|
+
import_log14.log.verbose("guest lock acquired", void 0, {
|
|
5109
5007
|
F: __dxlog_file17,
|
|
5110
5008
|
L: 91,
|
|
5111
5009
|
S: this,
|
|
@@ -5114,7 +5012,7 @@ var InvitationGuestExtension = class extends import_teleport2.RpcExtension {
|
|
|
5114
5012
|
await (0, import_context12.cancelWithContext)(this._ctx, this.rpc.InvitationHostService.options({
|
|
5115
5013
|
role: import_invitations3.InvitationOptions.Role.GUEST
|
|
5116
5014
|
}));
|
|
5117
|
-
|
|
5015
|
+
import_log14.log.verbose("options sent", void 0, {
|
|
5118
5016
|
F: __dxlog_file17,
|
|
5119
5017
|
L: 96,
|
|
5120
5018
|
S: this,
|
|
@@ -5123,7 +5021,7 @@ var InvitationGuestExtension = class extends import_teleport2.RpcExtension {
|
|
|
5123
5021
|
await (0, import_context12.cancelWithContext)(this._ctx, this._remoteOptionsTrigger.wait({
|
|
5124
5022
|
timeout: OPTIONS_TIMEOUT
|
|
5125
5023
|
}));
|
|
5126
|
-
|
|
5024
|
+
import_log14.log.verbose("options received", void 0, {
|
|
5127
5025
|
F: __dxlog_file17,
|
|
5128
5026
|
L: 98,
|
|
5129
5027
|
S: this,
|
|
@@ -5157,7 +5055,7 @@ var InvitationGuestExtension = class extends import_teleport2.RpcExtension {
|
|
|
5157
5055
|
if (this._invitationFlowLock != null) {
|
|
5158
5056
|
this._invitationFlowLock.release();
|
|
5159
5057
|
this._invitationFlowLock = null;
|
|
5160
|
-
|
|
5058
|
+
import_log14.log.verbose("invitation flow lock released", void 0, {
|
|
5161
5059
|
F: __dxlog_file17,
|
|
5162
5060
|
L: 131,
|
|
5163
5061
|
S: this,
|
|
@@ -5217,7 +5115,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5217
5115
|
introduce: async (request) => {
|
|
5218
5116
|
const { profile, invitationId } = request;
|
|
5219
5117
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
5220
|
-
|
|
5118
|
+
import_log15.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols12.trace.begin({
|
|
5221
5119
|
id: traceId
|
|
5222
5120
|
}), {
|
|
5223
5121
|
F: __dxlog_file18,
|
|
@@ -5228,7 +5126,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5228
5126
|
const invitation = this._requireActiveInvitation();
|
|
5229
5127
|
this._assertInvitationState(import_services14.Invitation.State.CONNECTED);
|
|
5230
5128
|
if (invitationId !== invitation?.invitationId) {
|
|
5231
|
-
|
|
5129
|
+
import_log15.log.warn("incorrect invitationId", {
|
|
5232
5130
|
expected: invitation.invitationId,
|
|
5233
5131
|
actual: invitationId
|
|
5234
5132
|
}, {
|
|
@@ -5243,7 +5141,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5243
5141
|
authMethod: import_services14.Invitation.AuthMethod.NONE
|
|
5244
5142
|
};
|
|
5245
5143
|
}
|
|
5246
|
-
|
|
5144
|
+
import_log15.log.verbose("guest introduced themselves", {
|
|
5247
5145
|
guestProfile: profile
|
|
5248
5146
|
}, {
|
|
5249
5147
|
F: __dxlog_file18,
|
|
@@ -5254,7 +5152,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5254
5152
|
this.guestProfile = profile;
|
|
5255
5153
|
this._callbacks.onStateUpdate(import_services14.Invitation.State.READY_FOR_AUTHENTICATION);
|
|
5256
5154
|
this._challenge = invitation.authMethod === import_services14.Invitation.AuthMethod.KNOWN_PUBLIC_KEY ? (0, import_crypto3.randomBytes)(32) : void 0;
|
|
5257
|
-
|
|
5155
|
+
import_log15.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols12.trace.end({
|
|
5258
5156
|
id: traceId
|
|
5259
5157
|
}), {
|
|
5260
5158
|
F: __dxlog_file18,
|
|
@@ -5269,7 +5167,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5269
5167
|
},
|
|
5270
5168
|
authenticate: async ({ authCode: code, signedChallenge }) => {
|
|
5271
5169
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
5272
|
-
|
|
5170
|
+
import_log15.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols12.trace.begin({
|
|
5273
5171
|
id: traceId
|
|
5274
5172
|
}), {
|
|
5275
5173
|
F: __dxlog_file18,
|
|
@@ -5278,7 +5176,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5278
5176
|
C: (f, a) => f(...a)
|
|
5279
5177
|
});
|
|
5280
5178
|
const invitation = this._requireActiveInvitation();
|
|
5281
|
-
|
|
5179
|
+
import_log15.log.verbose("received authentication request", {
|
|
5282
5180
|
authCode: code
|
|
5283
5181
|
}, {
|
|
5284
5182
|
F: __dxlog_file18,
|
|
@@ -5294,7 +5192,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5294
5192
|
this._callbacks.onStateUpdate(import_services14.Invitation.State.AUTHENTICATING);
|
|
5295
5193
|
switch (invitation.authMethod) {
|
|
5296
5194
|
case import_services14.Invitation.AuthMethod.NONE: {
|
|
5297
|
-
(0,
|
|
5195
|
+
(0, import_log15.log)("authentication not required", void 0, {
|
|
5298
5196
|
F: __dxlog_file18,
|
|
5299
5197
|
L: 154,
|
|
5300
5198
|
S: this,
|
|
@@ -5330,7 +5228,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5330
5228
|
break;
|
|
5331
5229
|
}
|
|
5332
5230
|
default: {
|
|
5333
|
-
|
|
5231
|
+
import_log15.log.error("invalid authentication method", {
|
|
5334
5232
|
authMethod: invitation.authMethod
|
|
5335
5233
|
}, {
|
|
5336
5234
|
F: __dxlog_file18,
|
|
@@ -5352,7 +5250,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5352
5250
|
status
|
|
5353
5251
|
};
|
|
5354
5252
|
}
|
|
5355
|
-
|
|
5253
|
+
import_log15.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols12.trace.end({
|
|
5356
5254
|
id: traceId,
|
|
5357
5255
|
data: {
|
|
5358
5256
|
status
|
|
@@ -5369,7 +5267,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5369
5267
|
},
|
|
5370
5268
|
admit: async (request) => {
|
|
5371
5269
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
5372
|
-
|
|
5270
|
+
import_log15.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols12.trace.begin({
|
|
5373
5271
|
id: traceId
|
|
5374
5272
|
}), {
|
|
5375
5273
|
F: __dxlog_file18,
|
|
@@ -5386,7 +5284,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5386
5284
|
}
|
|
5387
5285
|
}
|
|
5388
5286
|
const response = await this._callbacks.admit(request);
|
|
5389
|
-
|
|
5287
|
+
import_log15.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols12.trace.end({
|
|
5390
5288
|
id: traceId
|
|
5391
5289
|
}), {
|
|
5392
5290
|
F: __dxlog_file18,
|
|
@@ -5406,14 +5304,14 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5406
5304
|
async onOpen(context) {
|
|
5407
5305
|
await super.onOpen(context);
|
|
5408
5306
|
try {
|
|
5409
|
-
|
|
5307
|
+
import_log15.log.verbose("host acquire lock", void 0, {
|
|
5410
5308
|
F: __dxlog_file18,
|
|
5411
5309
|
L: 239,
|
|
5412
5310
|
S: this,
|
|
5413
5311
|
C: (f, a) => f(...a)
|
|
5414
5312
|
});
|
|
5415
5313
|
this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
|
|
5416
|
-
|
|
5314
|
+
import_log15.log.verbose("host lock acquired", void 0, {
|
|
5417
5315
|
F: __dxlog_file18,
|
|
5418
5316
|
L: 241,
|
|
5419
5317
|
S: this,
|
|
@@ -5423,7 +5321,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5423
5321
|
await this.rpc.InvitationHostService.options({
|
|
5424
5322
|
role: import_invitations4.InvitationOptions.Role.HOST
|
|
5425
5323
|
});
|
|
5426
|
-
|
|
5324
|
+
import_log15.log.verbose("options sent", void 0, {
|
|
5427
5325
|
F: __dxlog_file18,
|
|
5428
5326
|
L: 244,
|
|
5429
5327
|
S: this,
|
|
@@ -5432,7 +5330,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5432
5330
|
await (0, import_context13.cancelWithContext)(this._ctx, this._remoteOptionsTrigger.wait({
|
|
5433
5331
|
timeout: OPTIONS_TIMEOUT2
|
|
5434
5332
|
}));
|
|
5435
|
-
|
|
5333
|
+
import_log15.log.verbose("options received", void 0, {
|
|
5436
5334
|
F: __dxlog_file18,
|
|
5437
5335
|
L: 246,
|
|
5438
5336
|
S: this,
|
|
@@ -5485,7 +5383,7 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5485
5383
|
if (this._invitationFlowLock != null) {
|
|
5486
5384
|
this._invitationFlowLock?.release();
|
|
5487
5385
|
this._invitationFlowLock = null;
|
|
5488
|
-
|
|
5386
|
+
import_log15.log.verbose("invitation flow lock released", void 0, {
|
|
5489
5387
|
F: __dxlog_file18,
|
|
5490
5388
|
L: 299,
|
|
5491
5389
|
S: this,
|
|
@@ -5562,14 +5460,14 @@ var logStateUpdate = (invitation, actor, newState, error) => {
|
|
|
5562
5460
|
errorStack: error?.stack
|
|
5563
5461
|
};
|
|
5564
5462
|
if (isNonTerminalState(newState)) {
|
|
5565
|
-
|
|
5463
|
+
import_log16.log.verbose("dxos.sdk.invitations-handler.state.update", logContext, {
|
|
5566
5464
|
F: __dxlog_file19,
|
|
5567
5465
|
L: 98,
|
|
5568
5466
|
S: void 0,
|
|
5569
5467
|
C: (f, a) => f(...a)
|
|
5570
5468
|
});
|
|
5571
5469
|
} else {
|
|
5572
|
-
|
|
5470
|
+
import_log16.log.info("dxos.sdk.invitations-handler.state.update", logContext, {
|
|
5573
5471
|
F: __dxlog_file19,
|
|
5574
5472
|
L: 100,
|
|
5575
5473
|
S: void 0,
|
|
@@ -5625,7 +5523,7 @@ var InvitationTopology = class {
|
|
|
5625
5523
|
const firstUnknownPeer = candidates.find((peerId) => !this._seenPeers.has(peerId));
|
|
5626
5524
|
this._seenPeers = new import_util11.ComplexSet(import_keys13.PublicKey.hash, allPeers.filter((peerId) => this._seenPeers.has(peerId)));
|
|
5627
5525
|
if (firstUnknownPeer != null) {
|
|
5628
|
-
(0,
|
|
5526
|
+
(0, import_log17.log)("invitation connect", {
|
|
5629
5527
|
ownPeerId,
|
|
5630
5528
|
remotePeerId: firstUnknownPeer
|
|
5631
5529
|
}, {
|
|
@@ -5670,7 +5568,7 @@ var InvitationsHandler = class {
|
|
|
5670
5568
|
this._connectionParams = _connectionParams;
|
|
5671
5569
|
}
|
|
5672
5570
|
handleInvitationFlow(ctx, stream, protocol, invitation) {
|
|
5673
|
-
|
|
5571
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.handleInvitationFlow", {
|
|
5674
5572
|
state: invitation.state,
|
|
5675
5573
|
invitationId: invitation.invitationId,
|
|
5676
5574
|
kind: invitation.kind,
|
|
@@ -5696,7 +5594,7 @@ var InvitationsHandler = class {
|
|
|
5696
5594
|
},
|
|
5697
5595
|
admit: async (admissionRequest) => {
|
|
5698
5596
|
try {
|
|
5699
|
-
|
|
5597
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.host.admit", {
|
|
5700
5598
|
invitationId: invitation.invitationId,
|
|
5701
5599
|
...protocol.toJSON()
|
|
5702
5600
|
}, {
|
|
@@ -5733,7 +5631,7 @@ var InvitationsHandler = class {
|
|
|
5733
5631
|
(0, import_async15.scheduleTask)(connectionCtx, async () => {
|
|
5734
5632
|
const traceId = import_keys10.PublicKey.random().toHex();
|
|
5735
5633
|
try {
|
|
5736
|
-
|
|
5634
|
+
import_log12.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols9.trace.begin({
|
|
5737
5635
|
id: traceId
|
|
5738
5636
|
}), {
|
|
5739
5637
|
F: __dxlog_file21,
|
|
@@ -5741,7 +5639,7 @@ var InvitationsHandler = class {
|
|
|
5741
5639
|
S: this,
|
|
5742
5640
|
C: (f, a) => f(...a)
|
|
5743
5641
|
});
|
|
5744
|
-
|
|
5642
|
+
import_log12.log.verbose("connected", {
|
|
5745
5643
|
...protocol.toJSON()
|
|
5746
5644
|
}, {
|
|
5747
5645
|
F: __dxlog_file21,
|
|
@@ -5752,7 +5650,7 @@ var InvitationsHandler = class {
|
|
|
5752
5650
|
const deviceKey = await extension.completedTrigger.wait({
|
|
5753
5651
|
timeout: invitation.timeout
|
|
5754
5652
|
});
|
|
5755
|
-
|
|
5653
|
+
import_log12.log.verbose("admitted guest", {
|
|
5756
5654
|
guest: deviceKey,
|
|
5757
5655
|
...protocol.toJSON()
|
|
5758
5656
|
}, {
|
|
@@ -5763,7 +5661,7 @@ var InvitationsHandler = class {
|
|
|
5763
5661
|
});
|
|
5764
5662
|
guardedState.set(extension, import_services11.Invitation.State.SUCCESS);
|
|
5765
5663
|
metrics.increment("dxos.invitation.success");
|
|
5766
|
-
|
|
5664
|
+
import_log12.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols9.trace.end({
|
|
5767
5665
|
id: traceId
|
|
5768
5666
|
}), {
|
|
5769
5667
|
F: __dxlog_file21,
|
|
@@ -5780,7 +5678,7 @@ var InvitationsHandler = class {
|
|
|
5780
5678
|
if (err instanceof import_async15.TimeoutError) {
|
|
5781
5679
|
if (stateChanged) {
|
|
5782
5680
|
metrics.increment("dxos.invitation.timeout");
|
|
5783
|
-
|
|
5681
|
+
import_log12.log.verbose("timeout", {
|
|
5784
5682
|
...protocol.toJSON()
|
|
5785
5683
|
}, {
|
|
5786
5684
|
F: __dxlog_file21,
|
|
@@ -5792,7 +5690,7 @@ var InvitationsHandler = class {
|
|
|
5792
5690
|
} else {
|
|
5793
5691
|
if (stateChanged) {
|
|
5794
5692
|
metrics.increment("dxos.invitation.failed");
|
|
5795
|
-
|
|
5693
|
+
import_log12.log.error("failed", err, {
|
|
5796
5694
|
F: __dxlog_file21,
|
|
5797
5695
|
L: 159,
|
|
5798
5696
|
S: this,
|
|
@@ -5800,7 +5698,7 @@ var InvitationsHandler = class {
|
|
|
5800
5698
|
});
|
|
5801
5699
|
}
|
|
5802
5700
|
}
|
|
5803
|
-
|
|
5701
|
+
import_log12.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols9.trace.error({
|
|
5804
5702
|
id: traceId,
|
|
5805
5703
|
error: err
|
|
5806
5704
|
}), {
|
|
@@ -5816,7 +5714,7 @@ var InvitationsHandler = class {
|
|
|
5816
5714
|
onError: (err) => {
|
|
5817
5715
|
const stateChanged = guardedState.set(extension, import_services11.Invitation.State.CONNECTING);
|
|
5818
5716
|
if (err instanceof import_protocols9.InvalidInvitationExtensionRoleError) {
|
|
5819
|
-
(0,
|
|
5717
|
+
(0, import_log12.log)("invalid role", {
|
|
5820
5718
|
...err.context
|
|
5821
5719
|
}, {
|
|
5822
5720
|
F: __dxlog_file21,
|
|
@@ -5829,7 +5727,7 @@ var InvitationsHandler = class {
|
|
|
5829
5727
|
if (err instanceof import_async15.TimeoutError) {
|
|
5830
5728
|
if (stateChanged) {
|
|
5831
5729
|
metrics.increment("dxos.invitation.timeout");
|
|
5832
|
-
|
|
5730
|
+
import_log12.log.verbose("timeout", {
|
|
5833
5731
|
err
|
|
5834
5732
|
}, {
|
|
5835
5733
|
F: __dxlog_file21,
|
|
@@ -5841,7 +5739,7 @@ var InvitationsHandler = class {
|
|
|
5841
5739
|
} else {
|
|
5842
5740
|
if (stateChanged) {
|
|
5843
5741
|
metrics.increment("dxos.invitation.failed");
|
|
5844
|
-
|
|
5742
|
+
import_log12.log.error("failed", err, {
|
|
5845
5743
|
F: __dxlog_file21,
|
|
5846
5744
|
L: 182,
|
|
5847
5745
|
S: this,
|
|
@@ -5855,14 +5753,14 @@ var InvitationsHandler = class {
|
|
|
5855
5753
|
};
|
|
5856
5754
|
if (invitation.lifetime && invitation.created) {
|
|
5857
5755
|
if (invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
|
|
5858
|
-
|
|
5756
|
+
import_log12.log.warn("invitation has already expired", void 0, {
|
|
5859
5757
|
F: __dxlog_file21,
|
|
5860
5758
|
L: 193,
|
|
5861
5759
|
S: this,
|
|
5862
5760
|
C: (f, a) => f(...a)
|
|
5863
5761
|
});
|
|
5864
5762
|
guardedState.set(null, import_services11.Invitation.State.EXPIRED);
|
|
5865
|
-
void ctx.dispose().catch((err) =>
|
|
5763
|
+
void ctx.dispose().catch((err) => import_log12.log.catch(err, void 0, {
|
|
5866
5764
|
F: __dxlog_file21,
|
|
5867
5765
|
L: 195,
|
|
5868
5766
|
S: this,
|
|
@@ -5884,7 +5782,7 @@ var InvitationsHandler = class {
|
|
|
5884
5782
|
});
|
|
5885
5783
|
}
|
|
5886
5784
|
acceptInvitation(ctx, stream, protocol, invitation, otpEnteredTrigger, deviceProfile) {
|
|
5887
|
-
|
|
5785
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.acceptInvitation", {
|
|
5888
5786
|
state: invitation.state,
|
|
5889
5787
|
invitationId: invitation.invitationId,
|
|
5890
5788
|
kind: invitation.kind,
|
|
@@ -5911,7 +5809,7 @@ var InvitationsHandler = class {
|
|
|
5911
5809
|
const guardedState = createGuardedInvitationState(ctx, invitation, stream);
|
|
5912
5810
|
const shouldCancelInvitationFlow = (extension) => {
|
|
5913
5811
|
const isLockedByAnotherConnection = guardedState.mutex.isLocked() && !extension.hasFlowLock();
|
|
5914
|
-
(0,
|
|
5812
|
+
(0, import_log12.log)("should cancel invitation flow", {
|
|
5915
5813
|
isLockedByAnotherConnection,
|
|
5916
5814
|
invitationType: import_services11.Invitation.Type.DELEGATED,
|
|
5917
5815
|
triedPeers: triedPeersIds.size
|
|
@@ -5939,7 +5837,7 @@ var InvitationsHandler = class {
|
|
|
5939
5837
|
return;
|
|
5940
5838
|
}
|
|
5941
5839
|
connectionCtx.onDispose(async () => {
|
|
5942
|
-
|
|
5840
|
+
import_log12.log.verbose("extension disposed", {
|
|
5943
5841
|
admitted,
|
|
5944
5842
|
currentState: guardedState.current.state
|
|
5945
5843
|
}, {
|
|
@@ -5958,7 +5856,7 @@ var InvitationsHandler = class {
|
|
|
5958
5856
|
(0, import_async15.scheduleTask)(connectionCtx, async () => {
|
|
5959
5857
|
const traceId = import_keys10.PublicKey.random().toHex();
|
|
5960
5858
|
try {
|
|
5961
|
-
|
|
5859
|
+
import_log12.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols9.trace.begin({
|
|
5962
5860
|
id: traceId
|
|
5963
5861
|
}), {
|
|
5964
5862
|
F: __dxlog_file21,
|
|
@@ -5970,7 +5868,7 @@ var InvitationsHandler = class {
|
|
|
5970
5868
|
guardedState.set(extension, import_services11.Invitation.State.TIMEOUT);
|
|
5971
5869
|
extensionCtx.close();
|
|
5972
5870
|
}, timeout);
|
|
5973
|
-
|
|
5871
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.guest.connected", {
|
|
5974
5872
|
...protocol.toJSON()
|
|
5975
5873
|
}, {
|
|
5976
5874
|
F: __dxlog_file21,
|
|
@@ -5979,7 +5877,7 @@ var InvitationsHandler = class {
|
|
|
5979
5877
|
C: (f, a) => f(...a)
|
|
5980
5878
|
});
|
|
5981
5879
|
guardedState.set(extension, import_services11.Invitation.State.CONNECTED);
|
|
5982
|
-
|
|
5880
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.guest.introduce", {
|
|
5983
5881
|
invitationId: invitation.invitationId,
|
|
5984
5882
|
...protocol.toJSON()
|
|
5985
5883
|
}, {
|
|
@@ -5992,7 +5890,7 @@ var InvitationsHandler = class {
|
|
|
5992
5890
|
invitationId: invitation.invitationId,
|
|
5993
5891
|
...protocol.createIntroduction()
|
|
5994
5892
|
});
|
|
5995
|
-
|
|
5893
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.guest.introduce-response", {
|
|
5996
5894
|
invitationId: invitation.invitationId,
|
|
5997
5895
|
...protocol.toJSON(),
|
|
5998
5896
|
authMethod: introductionResponse.authMethod
|
|
@@ -6015,7 +5913,7 @@ var InvitationsHandler = class {
|
|
|
6015
5913
|
break;
|
|
6016
5914
|
}
|
|
6017
5915
|
}
|
|
6018
|
-
|
|
5916
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.guest.request-admission", {
|
|
6019
5917
|
invitationId: invitation.invitationId,
|
|
6020
5918
|
...protocol.toJSON()
|
|
6021
5919
|
}, {
|
|
@@ -6028,7 +5926,7 @@ var InvitationsHandler = class {
|
|
|
6028
5926
|
const admissionResponse = await extension.rpc.InvitationHostService.admit(admissionRequest);
|
|
6029
5927
|
admitted = true;
|
|
6030
5928
|
const result = await protocol.accept(admissionResponse, admissionRequest);
|
|
6031
|
-
|
|
5929
|
+
import_log12.log.verbose("dxos.sdk.invitations-handler.guest.admitted-by-host", {
|
|
6032
5930
|
invitationId: invitation.invitationId,
|
|
6033
5931
|
...protocol.toJSON()
|
|
6034
5932
|
}, {
|
|
@@ -6042,7 +5940,7 @@ var InvitationsHandler = class {
|
|
|
6042
5940
|
...result,
|
|
6043
5941
|
state: import_services11.Invitation.State.SUCCESS
|
|
6044
5942
|
});
|
|
6045
|
-
|
|
5943
|
+
import_log12.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols9.trace.end({
|
|
6046
5944
|
id: traceId
|
|
6047
5945
|
}), {
|
|
6048
5946
|
F: __dxlog_file21,
|
|
@@ -6052,7 +5950,7 @@ var InvitationsHandler = class {
|
|
|
6052
5950
|
});
|
|
6053
5951
|
} catch (err) {
|
|
6054
5952
|
if (err instanceof import_async15.TimeoutError) {
|
|
6055
|
-
|
|
5953
|
+
import_log12.log.verbose("timeout", {
|
|
6056
5954
|
...protocol.toJSON()
|
|
6057
5955
|
}, {
|
|
6058
5956
|
F: __dxlog_file21,
|
|
@@ -6062,7 +5960,7 @@ var InvitationsHandler = class {
|
|
|
6062
5960
|
});
|
|
6063
5961
|
guardedState.set(extension, import_services11.Invitation.State.TIMEOUT);
|
|
6064
5962
|
} else {
|
|
6065
|
-
|
|
5963
|
+
import_log12.log.verbose("auth failed", err, {
|
|
6066
5964
|
F: __dxlog_file21,
|
|
6067
5965
|
L: 365,
|
|
6068
5966
|
S: this,
|
|
@@ -6071,7 +5969,7 @@ var InvitationsHandler = class {
|
|
|
6071
5969
|
guardedState.error(extension, err);
|
|
6072
5970
|
}
|
|
6073
5971
|
extensionCtx.close(err);
|
|
6074
|
-
|
|
5972
|
+
import_log12.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols9.trace.error({
|
|
6075
5973
|
id: traceId,
|
|
6076
5974
|
error: err
|
|
6077
5975
|
}), {
|
|
@@ -6088,7 +5986,7 @@ var InvitationsHandler = class {
|
|
|
6088
5986
|
return;
|
|
6089
5987
|
}
|
|
6090
5988
|
if (err instanceof import_async15.TimeoutError) {
|
|
6091
|
-
|
|
5989
|
+
import_log12.log.verbose("timeout", {
|
|
6092
5990
|
...protocol.toJSON()
|
|
6093
5991
|
}, {
|
|
6094
5992
|
F: __dxlog_file21,
|
|
@@ -6098,7 +5996,7 @@ var InvitationsHandler = class {
|
|
|
6098
5996
|
});
|
|
6099
5997
|
guardedState.set(extension, import_services11.Invitation.State.TIMEOUT);
|
|
6100
5998
|
} else {
|
|
6101
|
-
|
|
5999
|
+
import_log12.log.verbose("auth failed", err, {
|
|
6102
6000
|
F: __dxlog_file21,
|
|
6103
6001
|
L: 381,
|
|
6104
6002
|
S: this,
|
|
@@ -6113,7 +6011,7 @@ var InvitationsHandler = class {
|
|
|
6113
6011
|
const edgeInvitationHandler = new EdgeInvitationHandler(this._connectionParams?.edgeInvitations, this._edgeClient, {
|
|
6114
6012
|
onInvitationSuccess: async (admissionResponse, admissionRequest) => {
|
|
6115
6013
|
const result = await protocol.accept(admissionResponse, admissionRequest);
|
|
6116
|
-
|
|
6014
|
+
import_log12.log.info("admitted by edge", {
|
|
6117
6015
|
...protocol.toJSON()
|
|
6118
6016
|
}, {
|
|
6119
6017
|
F: __dxlog_file21,
|
|
@@ -6179,7 +6077,7 @@ var InvitationsHandler = class {
|
|
|
6179
6077
|
}
|
|
6180
6078
|
async _handleGuestOtpAuth(extension, setState, authenticated, options) {
|
|
6181
6079
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
6182
|
-
(0,
|
|
6080
|
+
(0, import_log12.log)("guest waiting for authentication code...", void 0, {
|
|
6183
6081
|
F: __dxlog_file21,
|
|
6184
6082
|
L: 457,
|
|
6185
6083
|
S: this,
|
|
@@ -6187,7 +6085,7 @@ var InvitationsHandler = class {
|
|
|
6187
6085
|
});
|
|
6188
6086
|
setState(import_services11.Invitation.State.READY_FOR_AUTHENTICATION);
|
|
6189
6087
|
const authCode = await authenticated.wait(options);
|
|
6190
|
-
(0,
|
|
6088
|
+
(0, import_log12.log)("sending authentication request", void 0, {
|
|
6191
6089
|
F: __dxlog_file21,
|
|
6192
6090
|
L: 461,
|
|
6193
6091
|
S: this,
|
|
@@ -6204,7 +6102,7 @@ var InvitationsHandler = class {
|
|
|
6204
6102
|
if (attempt === MAX_OTP_ATTEMPTS) {
|
|
6205
6103
|
throw new Error(`Maximum retry attempts: ${MAX_OTP_ATTEMPTS}`);
|
|
6206
6104
|
} else {
|
|
6207
|
-
(0,
|
|
6105
|
+
(0, import_log12.log)("retrying invalid code", {
|
|
6208
6106
|
attempt
|
|
6209
6107
|
}, {
|
|
6210
6108
|
F: __dxlog_file21,
|
|
@@ -6224,7 +6122,7 @@ var InvitationsHandler = class {
|
|
|
6224
6122
|
if (introductionResponse.challenge == null) {
|
|
6225
6123
|
throw new Error("challenge missing in the introduction");
|
|
6226
6124
|
}
|
|
6227
|
-
(0,
|
|
6125
|
+
(0, import_log12.log)("sending authentication request", void 0, {
|
|
6228
6126
|
F: __dxlog_file21,
|
|
6229
6127
|
L: 491,
|
|
6230
6128
|
S: this,
|
|
@@ -6406,7 +6304,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6406
6304
|
""
|
|
6407
6305
|
]
|
|
6408
6306
|
});
|
|
6409
|
-
(0,
|
|
6307
|
+
(0, import_log18.log)("writing guest credentials", {
|
|
6410
6308
|
host: this._signingContext.deviceKey,
|
|
6411
6309
|
guest: request.space.deviceKey
|
|
6412
6310
|
}, {
|
|
@@ -6461,7 +6359,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6461
6359
|
]
|
|
6462
6360
|
});
|
|
6463
6361
|
}
|
|
6464
|
-
(0,
|
|
6362
|
+
(0, import_log18.log)("writing delegate space invitation", {
|
|
6465
6363
|
host: this._signingContext.deviceKey,
|
|
6466
6364
|
id: invitation.invitationId
|
|
6467
6365
|
}, {
|
|
@@ -6522,7 +6420,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6522
6420
|
""
|
|
6523
6421
|
]
|
|
6524
6422
|
});
|
|
6525
|
-
(0,
|
|
6423
|
+
(0, import_log18.log)("cancelling delegated space invitation", {
|
|
6526
6424
|
host: this._signingContext.deviceKey,
|
|
6527
6425
|
id: invitation.invitationId
|
|
6528
6426
|
}, {
|
|
@@ -6657,7 +6555,7 @@ var InvitationsManager = class {
|
|
|
6657
6555
|
try {
|
|
6658
6556
|
await this._persistIfRequired(handler, stream, invitation);
|
|
6659
6557
|
} catch (err) {
|
|
6660
|
-
|
|
6558
|
+
import_log19.log.catch(err, void 0, {
|
|
6661
6559
|
F: __dxlog_file23,
|
|
6662
6560
|
L: 82,
|
|
6663
6561
|
S: this,
|
|
@@ -6678,7 +6576,7 @@ var InvitationsManager = class {
|
|
|
6678
6576
|
}
|
|
6679
6577
|
try {
|
|
6680
6578
|
const persistentInvitations = this._metadataStore.getInvitations();
|
|
6681
|
-
const freshInvitations = persistentInvitations.filter((invitation) => !(0,
|
|
6579
|
+
const freshInvitations = persistentInvitations.filter((invitation) => !(0, import_echo_pipeline3.hasInvitationExpired)(invitation));
|
|
6682
6580
|
const loadTasks = freshInvitations.map((persistentInvitation) => {
|
|
6683
6581
|
(0, import_invariant18.invariant)(!this._createInvitations.get(persistentInvitation.invitationId), "invitation already exists", {
|
|
6684
6582
|
F: __dxlog_file23,
|
|
@@ -6699,7 +6597,7 @@ var InvitationsManager = class {
|
|
|
6699
6597
|
invitations: cInvitations.map((invitation) => invitation.get())
|
|
6700
6598
|
};
|
|
6701
6599
|
} catch (err) {
|
|
6702
|
-
|
|
6600
|
+
import_log19.log.catch(err, void 0, {
|
|
6703
6601
|
F: __dxlog_file23,
|
|
6704
6602
|
L: 110,
|
|
6705
6603
|
S: this,
|
|
@@ -6731,7 +6629,7 @@ var InvitationsManager = class {
|
|
|
6731
6629
|
return invitation;
|
|
6732
6630
|
}
|
|
6733
6631
|
async authenticate({ invitationId, authCode }) {
|
|
6734
|
-
(0,
|
|
6632
|
+
(0, import_log19.log)("authenticating...", void 0, {
|
|
6735
6633
|
F: __dxlog_file23,
|
|
6736
6634
|
L: 140,
|
|
6737
6635
|
S: this,
|
|
@@ -6748,7 +6646,7 @@ var InvitationsManager = class {
|
|
|
6748
6646
|
});
|
|
6749
6647
|
const observable = this._acceptInvitations.get(invitationId);
|
|
6750
6648
|
if (!observable) {
|
|
6751
|
-
|
|
6649
|
+
import_log19.log.warn("invalid invitation", {
|
|
6752
6650
|
invitationId
|
|
6753
6651
|
}, {
|
|
6754
6652
|
F: __dxlog_file23,
|
|
@@ -6761,7 +6659,7 @@ var InvitationsManager = class {
|
|
|
6761
6659
|
}
|
|
6762
6660
|
}
|
|
6763
6661
|
async cancelInvitation({ invitationId }) {
|
|
6764
|
-
(0,
|
|
6662
|
+
(0, import_log19.log)("cancelInvitation...", {
|
|
6765
6663
|
invitationId
|
|
6766
6664
|
}, {
|
|
6767
6665
|
F: __dxlog_file23,
|
|
@@ -6850,7 +6748,7 @@ var InvitationsManager = class {
|
|
|
6850
6748
|
L: 236
|
|
6851
6749
|
});
|
|
6852
6750
|
ctx.onDispose(() => {
|
|
6853
|
-
(0,
|
|
6751
|
+
(0, import_log19.log)("complete", {
|
|
6854
6752
|
...handler.toJSON()
|
|
6855
6753
|
}, {
|
|
6856
6754
|
F: __dxlog_file23,
|
|
@@ -6883,7 +6781,7 @@ var InvitationsManager = class {
|
|
|
6883
6781
|
const ctx = new import_context14.Context({
|
|
6884
6782
|
onError: (err) => {
|
|
6885
6783
|
if (err instanceof import_async20.TimeoutError) {
|
|
6886
|
-
(0,
|
|
6784
|
+
(0, import_log19.log)("timeout", {
|
|
6887
6785
|
...handler.toJSON()
|
|
6888
6786
|
}, {
|
|
6889
6787
|
F: __dxlog_file23,
|
|
@@ -6896,7 +6794,7 @@ var InvitationsManager = class {
|
|
|
6896
6794
|
state: import_services18.Invitation.State.TIMEOUT
|
|
6897
6795
|
});
|
|
6898
6796
|
} else {
|
|
6899
|
-
|
|
6797
|
+
import_log19.log.warn("auth failed", err, {
|
|
6900
6798
|
F: __dxlog_file23,
|
|
6901
6799
|
L: 266,
|
|
6902
6800
|
S: this,
|
|
@@ -6914,7 +6812,7 @@ var InvitationsManager = class {
|
|
|
6914
6812
|
L: 260
|
|
6915
6813
|
});
|
|
6916
6814
|
ctx.onDispose(() => {
|
|
6917
|
-
(0,
|
|
6815
|
+
(0, import_log19.log)("complete", {
|
|
6918
6816
|
...handler.toJSON()
|
|
6919
6817
|
}, {
|
|
6920
6818
|
F: __dxlog_file23,
|
|
@@ -6961,7 +6859,7 @@ var InvitationsManager = class {
|
|
|
6961
6859
|
try {
|
|
6962
6860
|
await this._metadataStore.removeInvitation(invitation.invitationId);
|
|
6963
6861
|
} catch (err) {
|
|
6964
|
-
|
|
6862
|
+
import_log19.log.catch(err, void 0, {
|
|
6965
6863
|
F: __dxlog_file23,
|
|
6966
6864
|
L: 309,
|
|
6967
6865
|
S: this,
|
|
@@ -6992,7 +6890,7 @@ var Lock = class {
|
|
|
6992
6890
|
return this._lockPath;
|
|
6993
6891
|
}
|
|
6994
6892
|
async acquire() {
|
|
6995
|
-
(0,
|
|
6893
|
+
(0, import_log20.log)("acquiring lock...", void 0, {
|
|
6996
6894
|
F: __dxlog_file24,
|
|
6997
6895
|
L: 32,
|
|
6998
6896
|
S: this,
|
|
@@ -7000,7 +6898,7 @@ var Lock = class {
|
|
|
7000
6898
|
});
|
|
7001
6899
|
this._fileHandle = await import_lock_file.LockFile.acquire(this._lockPath);
|
|
7002
6900
|
await this._onAcquire?.();
|
|
7003
|
-
(0,
|
|
6901
|
+
(0, import_log20.log)("acquired lock", void 0, {
|
|
7004
6902
|
F: __dxlog_file24,
|
|
7005
6903
|
L: 37,
|
|
7006
6904
|
S: this,
|
|
@@ -7022,7 +6920,7 @@ var Lock = class {
|
|
|
7022
6920
|
}
|
|
7023
6921
|
};
|
|
7024
6922
|
_ts_decorate7([
|
|
7025
|
-
|
|
6923
|
+
import_log20.logInfo
|
|
7026
6924
|
], Lock.prototype, "lockKey", null);
|
|
7027
6925
|
var isLocked = (lockPath) => import_lock_file.LockFile.isLocked(lockPath);
|
|
7028
6926
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
@@ -7161,7 +7059,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7161
7059
|
// TODO: agents don't have data feed, should be removed
|
|
7162
7060
|
dataFeedKey: import_keys15.PublicKey.random()
|
|
7163
7061
|
});
|
|
7164
|
-
(0,
|
|
7062
|
+
(0, import_log21.log)("agent created", response, {
|
|
7165
7063
|
F: __dxlog_file25,
|
|
7166
7064
|
L: 71,
|
|
7167
7065
|
S: this,
|
|
@@ -7171,7 +7069,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7171
7069
|
}
|
|
7172
7070
|
async _open() {
|
|
7173
7071
|
const isEnabled = this._edgeHttpClient && this._edgeFeatures?.agents;
|
|
7174
|
-
(0,
|
|
7072
|
+
(0, import_log21.log)("edge agent manager open", {
|
|
7175
7073
|
isEnabled
|
|
7176
7074
|
}, {
|
|
7177
7075
|
F: __dxlog_file25,
|
|
@@ -7216,7 +7114,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7216
7114
|
]
|
|
7217
7115
|
});
|
|
7218
7116
|
try {
|
|
7219
|
-
(0,
|
|
7117
|
+
(0, import_log21.log)("fetching agent status", void 0, {
|
|
7220
7118
|
F: __dxlog_file25,
|
|
7221
7119
|
L: 115,
|
|
7222
7120
|
S: this,
|
|
@@ -7233,7 +7131,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7233
7131
|
} catch (err) {
|
|
7234
7132
|
if (err instanceof import_protocols14.EdgeCallFailedError) {
|
|
7235
7133
|
if (!err.isRetryable) {
|
|
7236
|
-
|
|
7134
|
+
import_log21.log.warn("non retryable error on agent status fetch attempt", {
|
|
7237
7135
|
err
|
|
7238
7136
|
}, {
|
|
7239
7137
|
F: __dxlog_file25,
|
|
@@ -7245,7 +7143,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7245
7143
|
}
|
|
7246
7144
|
}
|
|
7247
7145
|
const retryAfterMs = AGENT_STATUS_QUERY_RETRY_INTERVAL + Math.random() * AGENT_STATUS_QUERY_RETRY_JITTER;
|
|
7248
|
-
|
|
7146
|
+
import_log21.log.info("agent status fetching failed", {
|
|
7249
7147
|
err,
|
|
7250
7148
|
retryAfterMs
|
|
7251
7149
|
}, {
|
|
@@ -7274,7 +7172,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7274
7172
|
...space.inner.spaceState.feeds.values()
|
|
7275
7173
|
].some((feed) => feed.assertion.deviceKey.equals(agentDeviceKey));
|
|
7276
7174
|
space.notarizationPlugin.setActiveEdgePollingEnabled(agentFeedNeedsNotarization);
|
|
7277
|
-
|
|
7175
|
+
import_log21.log.info("set active edge polling", {
|
|
7278
7176
|
enabled: agentFeedNeedsNotarization,
|
|
7279
7177
|
spaceId: space.id
|
|
7280
7178
|
}, {
|
|
@@ -7292,7 +7190,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7292
7190
|
if (deviceKey) {
|
|
7293
7191
|
this._ensureAgentIsInSpaces(deviceKey);
|
|
7294
7192
|
}
|
|
7295
|
-
|
|
7193
|
+
import_log21.log.info("agent status update", {
|
|
7296
7194
|
status
|
|
7297
7195
|
}, {
|
|
7298
7196
|
F: __dxlog_file25,
|
|
@@ -7306,8 +7204,27 @@ _ts_decorate9([
|
|
|
7306
7204
|
import_async21.synchronized
|
|
7307
7205
|
], EdgeAgentManager.prototype, "createAgent", null);
|
|
7308
7206
|
var EdgeAgentServiceImpl = class {
|
|
7309
|
-
constructor(_agentManagerProvider) {
|
|
7207
|
+
constructor(_agentManagerProvider, _edgeConnection) {
|
|
7310
7208
|
this._agentManagerProvider = _agentManagerProvider;
|
|
7209
|
+
this._edgeConnection = _edgeConnection;
|
|
7210
|
+
}
|
|
7211
|
+
queryEdgeStatus() {
|
|
7212
|
+
return new import_codec_protobuf12.Stream(({ ctx, next }) => {
|
|
7213
|
+
next({
|
|
7214
|
+
status: import_services20.QueryEdgeStatusResponse.EdgeStatus.NOT_CONNECTED
|
|
7215
|
+
});
|
|
7216
|
+
if (!this._edgeConnection) {
|
|
7217
|
+
return;
|
|
7218
|
+
}
|
|
7219
|
+
ctx.onDispose(
|
|
7220
|
+
// TODO(wittjosiah): EdgeConnection should include a disconnected event as well.
|
|
7221
|
+
this._edgeConnection.onReconnected(() => {
|
|
7222
|
+
next({
|
|
7223
|
+
status: import_services20.QueryEdgeStatusResponse.EdgeStatus.CONNECTED
|
|
7224
|
+
});
|
|
7225
|
+
})
|
|
7226
|
+
);
|
|
7227
|
+
});
|
|
7311
7228
|
}
|
|
7312
7229
|
async createAgent() {
|
|
7313
7230
|
return (await this._agentManagerProvider()).createAgent();
|
|
@@ -7420,7 +7337,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7420
7337
|
signature: Buffer.from(signature).toString("base64")
|
|
7421
7338
|
});
|
|
7422
7339
|
}
|
|
7423
|
-
|
|
7340
|
+
import_log23.log.info("recovering identity", response, {
|
|
7424
7341
|
F: __dxlog_file26,
|
|
7425
7342
|
L: 77,
|
|
7426
7343
|
S: this,
|
|
@@ -7528,7 +7445,7 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7528
7445
|
this._echoEdgeReplicator = void 0;
|
|
7529
7446
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
7530
7447
|
this._instanceId = import_keys16.PublicKey.random().toHex();
|
|
7531
|
-
this.metadataStore = new
|
|
7448
|
+
this.metadataStore = new import_echo_pipeline4.MetadataStore(storage.createDirectory("metadata"));
|
|
7532
7449
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
7533
7450
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
7534
7451
|
this.feedStore = new import_feed_store6.FeedStore({
|
|
@@ -7536,12 +7453,12 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7536
7453
|
root: storage.createDirectory("feeds"),
|
|
7537
7454
|
signer: this.keyring,
|
|
7538
7455
|
hypercore: {
|
|
7539
|
-
valueEncoding:
|
|
7456
|
+
valueEncoding: import_echo_pipeline4.valueEncoding,
|
|
7540
7457
|
stats: true
|
|
7541
7458
|
}
|
|
7542
7459
|
})
|
|
7543
7460
|
});
|
|
7544
|
-
this.spaceManager = new
|
|
7461
|
+
this.spaceManager = new import_echo_pipeline4.SpaceManager({
|
|
7545
7462
|
feedStore: this.feedStore,
|
|
7546
7463
|
networkManager: this.networkManager,
|
|
7547
7464
|
blobStore: this.blobStore,
|
|
@@ -7559,35 +7476,36 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7559
7476
|
edgeFeatures: this._edgeFeatures
|
|
7560
7477
|
});
|
|
7561
7478
|
this.recoveryManager = new EdgeIdentityRecoveryManager(this.keyring, this._edgeHttpClient, () => this.identityManager.identity, this._acceptIdentity.bind(this));
|
|
7562
|
-
this.echoHost = new
|
|
7563
|
-
kv: this.level
|
|
7479
|
+
this.echoHost = new import_echo_pipeline4.EchoHost({
|
|
7480
|
+
kv: this.level,
|
|
7481
|
+
peerIdProvider: () => this.identityManager.identity?.deviceKey?.toHex()
|
|
7564
7482
|
});
|
|
7565
|
-
this._meshReplicator = new
|
|
7483
|
+
this._meshReplicator = new import_echo_pipeline4.MeshEchoReplicator();
|
|
7566
7484
|
this.invitations = new InvitationsHandler(this.networkManager, this._edgeHttpClient, _runtimeParams?.invitationConnectionDefaultParams);
|
|
7567
7485
|
this.invitationsManager = new InvitationsManager(this.invitations, (invitation) => this.getInvitationHandler(invitation), this.metadataStore);
|
|
7568
7486
|
this._handlerFactories.set(import_services21.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? (0, import_debug5.failUndefined)(), this._acceptIdentity.bind(this)));
|
|
7569
7487
|
if (!this._runtimeParams?.disableP2pReplication) {
|
|
7570
|
-
this._meshReplicator = new
|
|
7488
|
+
this._meshReplicator = new import_echo_pipeline4.MeshEchoReplicator();
|
|
7571
7489
|
}
|
|
7572
7490
|
if (this._edgeConnection && this._edgeFeatures?.echoReplicator) {
|
|
7573
|
-
this._echoEdgeReplicator = new
|
|
7491
|
+
this._echoEdgeReplicator = new import_echo_pipeline4.EchoEdgeReplicator({
|
|
7574
7492
|
edgeConnection: this._edgeConnection
|
|
7575
7493
|
});
|
|
7576
7494
|
}
|
|
7577
7495
|
}
|
|
7578
7496
|
async _open(ctx) {
|
|
7579
7497
|
await this._checkStorageVersion();
|
|
7580
|
-
(0,
|
|
7498
|
+
(0, import_log22.log)("opening...", void 0, {
|
|
7581
7499
|
F: __dxlog_file27,
|
|
7582
|
-
L:
|
|
7500
|
+
L: 198,
|
|
7583
7501
|
S: this,
|
|
7584
7502
|
C: (f, a) => f(...a)
|
|
7585
7503
|
});
|
|
7586
|
-
|
|
7504
|
+
import_log22.log.trace("dxos.sdk.service-context.open", import_protocols16.trace.begin({
|
|
7587
7505
|
id: this._instanceId
|
|
7588
7506
|
}), {
|
|
7589
7507
|
F: __dxlog_file27,
|
|
7590
|
-
L:
|
|
7508
|
+
L: 199,
|
|
7591
7509
|
S: this,
|
|
7592
7510
|
C: (f, a) => f(...a)
|
|
7593
7511
|
});
|
|
@@ -7610,33 +7528,33 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7610
7528
|
await this._initialize(ctx);
|
|
7611
7529
|
}
|
|
7612
7530
|
const loadedInvitations = await this.invitationsManager.loadPersistentInvitations();
|
|
7613
|
-
(0,
|
|
7531
|
+
(0, import_log22.log)("loaded persistent invitations", {
|
|
7614
7532
|
count: loadedInvitations.invitations?.length
|
|
7615
7533
|
}, {
|
|
7616
7534
|
F: __dxlog_file27,
|
|
7617
|
-
L:
|
|
7535
|
+
L: 227,
|
|
7618
7536
|
S: this,
|
|
7619
7537
|
C: (f, a) => f(...a)
|
|
7620
7538
|
});
|
|
7621
|
-
|
|
7539
|
+
import_log22.log.trace("dxos.sdk.service-context.open", import_protocols16.trace.end({
|
|
7622
7540
|
id: this._instanceId
|
|
7623
7541
|
}), {
|
|
7624
7542
|
F: __dxlog_file27,
|
|
7625
|
-
L:
|
|
7543
|
+
L: 229,
|
|
7626
7544
|
S: this,
|
|
7627
7545
|
C: (f, a) => f(...a)
|
|
7628
7546
|
});
|
|
7629
|
-
(0,
|
|
7547
|
+
(0, import_log22.log)("opened", void 0, {
|
|
7630
7548
|
F: __dxlog_file27,
|
|
7631
|
-
L:
|
|
7549
|
+
L: 230,
|
|
7632
7550
|
S: this,
|
|
7633
7551
|
C: (f, a) => f(...a)
|
|
7634
7552
|
});
|
|
7635
7553
|
}
|
|
7636
7554
|
async _close(ctx) {
|
|
7637
|
-
(0,
|
|
7555
|
+
(0, import_log22.log)("closing...", void 0, {
|
|
7638
7556
|
F: __dxlog_file27,
|
|
7639
|
-
L:
|
|
7557
|
+
L: 234,
|
|
7640
7558
|
S: this,
|
|
7641
7559
|
C: (f, a) => f(...a)
|
|
7642
7560
|
});
|
|
@@ -7653,9 +7571,9 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7653
7571
|
await this.networkManager.close();
|
|
7654
7572
|
await this.signalManager.close();
|
|
7655
7573
|
await this._edgeConnection?.close();
|
|
7656
|
-
(0,
|
|
7574
|
+
(0, import_log22.log)("closed", void 0, {
|
|
7657
7575
|
F: __dxlog_file27,
|
|
7658
|
-
L:
|
|
7576
|
+
L: 250,
|
|
7659
7577
|
S: this,
|
|
7660
7578
|
C: (f, a) => f(...a)
|
|
7661
7579
|
});
|
|
@@ -7666,7 +7584,7 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7666
7584
|
await identity.joinNetwork();
|
|
7667
7585
|
await this._initialize(new import_context16.Context(void 0, {
|
|
7668
7586
|
F: __dxlog_file27,
|
|
7669
|
-
L:
|
|
7587
|
+
L: 257
|
|
7670
7588
|
}));
|
|
7671
7589
|
return identity;
|
|
7672
7590
|
}
|
|
@@ -7677,7 +7595,7 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7677
7595
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
7678
7596
|
(0, import_invariant21.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
7679
7597
|
F: __dxlog_file27,
|
|
7680
|
-
L:
|
|
7598
|
+
L: 266,
|
|
7681
7599
|
S: this,
|
|
7682
7600
|
A: [
|
|
7683
7601
|
"factory",
|
|
@@ -7703,7 +7621,7 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7703
7621
|
await this.identityManager.acceptIdentity(identity, identityRecord, params.deviceProfile);
|
|
7704
7622
|
await this._initialize(new import_context16.Context(void 0, {
|
|
7705
7623
|
F: __dxlog_file27,
|
|
7706
|
-
L:
|
|
7624
|
+
L: 285
|
|
7707
7625
|
}));
|
|
7708
7626
|
return identity;
|
|
7709
7627
|
}
|
|
@@ -7715,9 +7633,9 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7715
7633
|
}
|
|
7716
7634
|
// Called when identity is created.
|
|
7717
7635
|
async _initialize(ctx) {
|
|
7718
|
-
(0,
|
|
7636
|
+
(0, import_log22.log)("initializing spaces...", void 0, {
|
|
7719
7637
|
F: __dxlog_file27,
|
|
7720
|
-
L:
|
|
7638
|
+
L: 300,
|
|
7721
7639
|
S: this,
|
|
7722
7640
|
C: (f, a) => f(...a)
|
|
7723
7641
|
});
|
|
@@ -7756,7 +7674,7 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7756
7674
|
this._handlerFactories.set(import_services21.Invitation.Kind.SPACE, (invitation) => {
|
|
7757
7675
|
(0, import_invariant21.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
7758
7676
|
F: __dxlog_file27,
|
|
7759
|
-
L:
|
|
7677
|
+
L: 338,
|
|
7760
7678
|
S: this,
|
|
7761
7679
|
A: [
|
|
7762
7680
|
"this.dataSpaceManager",
|
|
@@ -7776,33 +7694,33 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7776
7694
|
return;
|
|
7777
7695
|
}
|
|
7778
7696
|
if (!this.dataSpaceManager) {
|
|
7779
|
-
(0,
|
|
7697
|
+
(0, import_log22.log)("dataSpaceManager not initialized yet, ignoring space admission", {
|
|
7780
7698
|
details: assertion
|
|
7781
7699
|
}, {
|
|
7782
7700
|
F: __dxlog_file27,
|
|
7783
|
-
L:
|
|
7701
|
+
L: 354,
|
|
7784
7702
|
S: this,
|
|
7785
7703
|
C: (f, a) => f(...a)
|
|
7786
7704
|
});
|
|
7787
7705
|
return;
|
|
7788
7706
|
}
|
|
7789
7707
|
if (this.dataSpaceManager.spaces.has(assertion.spaceKey)) {
|
|
7790
|
-
(0,
|
|
7708
|
+
(0, import_log22.log)("space already exists, ignoring space admission", {
|
|
7791
7709
|
details: assertion
|
|
7792
7710
|
}, {
|
|
7793
7711
|
F: __dxlog_file27,
|
|
7794
|
-
L:
|
|
7712
|
+
L: 358,
|
|
7795
7713
|
S: this,
|
|
7796
7714
|
C: (f, a) => f(...a)
|
|
7797
7715
|
});
|
|
7798
7716
|
return;
|
|
7799
7717
|
}
|
|
7800
7718
|
try {
|
|
7801
|
-
(0,
|
|
7719
|
+
(0, import_log22.log)("accepting space recorded in halo", {
|
|
7802
7720
|
details: assertion
|
|
7803
7721
|
}, {
|
|
7804
7722
|
F: __dxlog_file27,
|
|
7805
|
-
L:
|
|
7723
|
+
L: 363,
|
|
7806
7724
|
S: this,
|
|
7807
7725
|
C: (f, a) => f(...a)
|
|
7808
7726
|
});
|
|
@@ -7811,9 +7729,9 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7811
7729
|
genesisFeedKey: assertion.genesisFeedKey
|
|
7812
7730
|
});
|
|
7813
7731
|
} catch (err) {
|
|
7814
|
-
|
|
7732
|
+
import_log22.log.catch(err, void 0, {
|
|
7815
7733
|
F: __dxlog_file27,
|
|
7816
|
-
L:
|
|
7734
|
+
L: 369,
|
|
7817
7735
|
S: this,
|
|
7818
7736
|
C: (f, a) => f(...a)
|
|
7819
7737
|
});
|
|
@@ -7829,12 +7747,12 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7829
7747
|
let edgeIdentity;
|
|
7830
7748
|
const identity = this.identityManager.identity;
|
|
7831
7749
|
if (identity) {
|
|
7832
|
-
|
|
7750
|
+
import_log22.log.info("Setting identity on edge connection", {
|
|
7833
7751
|
identity: identity.identityKey.toHex(),
|
|
7834
7752
|
swarms: this.networkManager.topics
|
|
7835
7753
|
}, {
|
|
7836
7754
|
F: __dxlog_file27,
|
|
7837
|
-
L:
|
|
7755
|
+
L: 383,
|
|
7838
7756
|
S: this,
|
|
7839
7757
|
C: (f, a) => f(...a)
|
|
7840
7758
|
});
|
|
@@ -7848,7 +7766,7 @@ var ServiceContext = class extends import_context16.Resource {
|
|
|
7848
7766
|
});
|
|
7849
7767
|
(0, import_invariant21.invariant)(identity.deviceCredentialChain, void 0, {
|
|
7850
7768
|
F: __dxlog_file27,
|
|
7851
|
-
L:
|
|
7769
|
+
L: 401,
|
|
7852
7770
|
S: this,
|
|
7853
7771
|
A: [
|
|
7854
7772
|
"identity.deviceCredentialChain",
|
|
@@ -7975,7 +7893,7 @@ var exportProfileData = async ({ storage, level }) => {
|
|
|
7975
7893
|
{
|
|
7976
7894
|
const directory = await storage.createDirectory();
|
|
7977
7895
|
const files = await directory.list();
|
|
7978
|
-
|
|
7896
|
+
import_log24.log.info("begin exporting files", {
|
|
7979
7897
|
count: files.length
|
|
7980
7898
|
}, {
|
|
7981
7899
|
F: __dxlog_file28,
|
|
@@ -7993,7 +7911,7 @@ var exportProfileData = async ({ storage, level }) => {
|
|
|
7993
7911
|
value: data
|
|
7994
7912
|
});
|
|
7995
7913
|
}
|
|
7996
|
-
|
|
7914
|
+
import_log24.log.info("done exporting files", {
|
|
7997
7915
|
count: files.length
|
|
7998
7916
|
}, {
|
|
7999
7917
|
F: __dxlog_file28,
|
|
@@ -8003,7 +7921,7 @@ var exportProfileData = async ({ storage, level }) => {
|
|
|
8003
7921
|
});
|
|
8004
7922
|
}
|
|
8005
7923
|
{
|
|
8006
|
-
|
|
7924
|
+
import_log24.log.info("begin exporting kv pairs", void 0, {
|
|
8007
7925
|
F: __dxlog_file28,
|
|
8008
7926
|
L: 45,
|
|
8009
7927
|
S: void 0,
|
|
@@ -8022,7 +7940,7 @@ var exportProfileData = async ({ storage, level }) => {
|
|
|
8022
7940
|
});
|
|
8023
7941
|
count++;
|
|
8024
7942
|
}
|
|
8025
|
-
|
|
7943
|
+
import_log24.log.info("done exporting kv pairs", {
|
|
8026
7944
|
count
|
|
8027
7945
|
}, {
|
|
8028
7946
|
F: __dxlog_file28,
|
|
@@ -8094,7 +8012,7 @@ var importProfileData = async ({ storage, level }, archive) => {
|
|
|
8094
8012
|
if (++count % 1e3 === 0) {
|
|
8095
8013
|
await batch.write();
|
|
8096
8014
|
batch = level.batch();
|
|
8097
|
-
|
|
8015
|
+
import_log24.log.info("importing", {
|
|
8098
8016
|
count,
|
|
8099
8017
|
total: archive.storage.length,
|
|
8100
8018
|
progress: `${(count / archive.storage.length * 100).toFixed()}%`
|
|
@@ -8106,7 +8024,7 @@ var importProfileData = async ({ storage, level }, archive) => {
|
|
|
8106
8024
|
});
|
|
8107
8025
|
}
|
|
8108
8026
|
}
|
|
8109
|
-
|
|
8027
|
+
import_log24.log.info("committing changes..", void 0, {
|
|
8110
8028
|
F: __dxlog_file28,
|
|
8111
8029
|
L: 109,
|
|
8112
8030
|
S: void 0,
|
|
@@ -8285,11 +8203,11 @@ var LoggingServiceImpl = class {
|
|
|
8285
8203
|
};
|
|
8286
8204
|
}
|
|
8287
8205
|
async open() {
|
|
8288
|
-
|
|
8206
|
+
import_log26.log.runtimeConfig.processors.push(this._logProcessor);
|
|
8289
8207
|
}
|
|
8290
8208
|
async close() {
|
|
8291
|
-
const index =
|
|
8292
|
-
|
|
8209
|
+
const index = import_log26.log.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
|
|
8210
|
+
import_log26.log.runtimeConfig.processors.splice(index, 1);
|
|
8293
8211
|
}
|
|
8294
8212
|
async controlMetrics({ reset, record }) {
|
|
8295
8213
|
if (reset) {
|
|
@@ -8350,7 +8268,7 @@ var LoggingServiceImpl = class {
|
|
|
8350
8268
|
}
|
|
8351
8269
|
const record = {
|
|
8352
8270
|
...entry2,
|
|
8353
|
-
context: (0, import_util16.jsonify)((0,
|
|
8271
|
+
context: (0, import_util16.jsonify)((0, import_log26.getContextFromEntry)(entry2)),
|
|
8354
8272
|
timestamp: /* @__PURE__ */ new Date(),
|
|
8355
8273
|
meta: {
|
|
8356
8274
|
// TODO(dmaretskyi): Fix proto.
|
|
@@ -8585,7 +8503,7 @@ var ClientServicesHost = class {
|
|
|
8585
8503
|
"'service host is open'"
|
|
8586
8504
|
]
|
|
8587
8505
|
});
|
|
8588
|
-
(0,
|
|
8506
|
+
(0, import_log25.log)("initializing...", void 0, {
|
|
8589
8507
|
F: __dxlog_file30,
|
|
8590
8508
|
L: 204,
|
|
8591
8509
|
S: this,
|
|
@@ -8607,7 +8525,7 @@ var ClientServicesHost = class {
|
|
|
8607
8525
|
}
|
|
8608
8526
|
}
|
|
8609
8527
|
if (!options.signalManager) {
|
|
8610
|
-
|
|
8528
|
+
import_log25.log.warn("running signaling without telemetry metadata.", void 0, {
|
|
8611
8529
|
F: __dxlog_file30,
|
|
8612
8530
|
L: 215,
|
|
8613
8531
|
S: this,
|
|
@@ -8645,7 +8563,7 @@ var ClientServicesHost = class {
|
|
|
8645
8563
|
peerKey: this._edgeConnection.peerKey
|
|
8646
8564
|
} : void 0
|
|
8647
8565
|
});
|
|
8648
|
-
(0,
|
|
8566
|
+
(0, import_log25.log)("initialized", void 0, {
|
|
8649
8567
|
F: __dxlog_file30,
|
|
8650
8568
|
L: 250,
|
|
8651
8569
|
S: this,
|
|
@@ -8657,7 +8575,7 @@ var ClientServicesHost = class {
|
|
|
8657
8575
|
return;
|
|
8658
8576
|
}
|
|
8659
8577
|
const traceId = import_keys19.PublicKey.random().toHex();
|
|
8660
|
-
|
|
8578
|
+
import_log25.log.trace("dxos.client-services.host.open", import_protocols20.trace.begin({
|
|
8661
8579
|
id: traceId
|
|
8662
8580
|
}), {
|
|
8663
8581
|
F: __dxlog_file30,
|
|
@@ -8702,7 +8620,7 @@ var ClientServicesHost = class {
|
|
|
8702
8620
|
]
|
|
8703
8621
|
});
|
|
8704
8622
|
this._opening = true;
|
|
8705
|
-
(0,
|
|
8623
|
+
(0, import_log25.log)("opening...", {
|
|
8706
8624
|
lockKey: this._resourceLock?.lockKey
|
|
8707
8625
|
}, {
|
|
8708
8626
|
F: __dxlog_file30,
|
|
@@ -8744,7 +8662,7 @@ var ClientServicesHost = class {
|
|
|
8744
8662
|
config: this._config,
|
|
8745
8663
|
context: this._serviceContext
|
|
8746
8664
|
}),
|
|
8747
|
-
EdgeAgentService: new EdgeAgentServiceImpl(agentManagerProvider)
|
|
8665
|
+
EdgeAgentService: new EdgeAgentServiceImpl(agentManagerProvider, this._edgeConnection)
|
|
8748
8666
|
});
|
|
8749
8667
|
await this._serviceContext.open(ctx);
|
|
8750
8668
|
await identityService.open();
|
|
@@ -8763,7 +8681,7 @@ var ClientServicesHost = class {
|
|
|
8763
8681
|
this._open = true;
|
|
8764
8682
|
this._statusUpdate.emit();
|
|
8765
8683
|
const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
|
|
8766
|
-
(0,
|
|
8684
|
+
(0, import_log25.log)("opened", {
|
|
8767
8685
|
deviceKey
|
|
8768
8686
|
}, {
|
|
8769
8687
|
F: __dxlog_file30,
|
|
@@ -8771,7 +8689,7 @@ var ClientServicesHost = class {
|
|
|
8771
8689
|
S: this,
|
|
8772
8690
|
C: (f, a) => f(...a)
|
|
8773
8691
|
});
|
|
8774
|
-
|
|
8692
|
+
import_log25.log.trace("dxos.client-services.host.open", import_protocols20.trace.end({
|
|
8775
8693
|
id: traceId
|
|
8776
8694
|
}), {
|
|
8777
8695
|
F: __dxlog_file30,
|
|
@@ -8785,7 +8703,7 @@ var ClientServicesHost = class {
|
|
|
8785
8703
|
return;
|
|
8786
8704
|
}
|
|
8787
8705
|
const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
|
|
8788
|
-
(0,
|
|
8706
|
+
(0, import_log25.log)("closing...", {
|
|
8789
8707
|
deviceKey
|
|
8790
8708
|
}, {
|
|
8791
8709
|
F: __dxlog_file30,
|
|
@@ -8803,7 +8721,7 @@ var ClientServicesHost = class {
|
|
|
8803
8721
|
await this._level?.close();
|
|
8804
8722
|
this._open = false;
|
|
8805
8723
|
this._statusUpdate.emit();
|
|
8806
|
-
(0,
|
|
8724
|
+
(0, import_log25.log)("closed", {
|
|
8807
8725
|
deviceKey
|
|
8808
8726
|
}, {
|
|
8809
8727
|
F: __dxlog_file30,
|
|
@@ -8814,7 +8732,7 @@ var ClientServicesHost = class {
|
|
|
8814
8732
|
}
|
|
8815
8733
|
async reset() {
|
|
8816
8734
|
const traceId = import_keys19.PublicKey.random().toHex();
|
|
8817
|
-
|
|
8735
|
+
import_log25.log.trace("dxos.sdk.client-services-host.reset", import_protocols20.trace.begin({
|
|
8818
8736
|
id: traceId
|
|
8819
8737
|
}), {
|
|
8820
8738
|
F: __dxlog_file30,
|
|
@@ -8822,7 +8740,7 @@ var ClientServicesHost = class {
|
|
|
8822
8740
|
S: this,
|
|
8823
8741
|
C: (f, a) => f(...a)
|
|
8824
8742
|
});
|
|
8825
|
-
|
|
8743
|
+
import_log25.log.info("resetting...", void 0, {
|
|
8826
8744
|
F: __dxlog_file30,
|
|
8827
8745
|
L: 394,
|
|
8828
8746
|
S: this,
|
|
@@ -8832,13 +8750,13 @@ var ClientServicesHost = class {
|
|
|
8832
8750
|
this._statusUpdate.emit();
|
|
8833
8751
|
await this._serviceContext?.close();
|
|
8834
8752
|
await this._storage.reset();
|
|
8835
|
-
|
|
8753
|
+
import_log25.log.info("reset", void 0, {
|
|
8836
8754
|
F: __dxlog_file30,
|
|
8837
8755
|
L: 401,
|
|
8838
8756
|
S: this,
|
|
8839
8757
|
C: (f, a) => f(...a)
|
|
8840
8758
|
});
|
|
8841
|
-
|
|
8759
|
+
import_log25.log.trace("dxos.sdk.client-services-host.reset", import_protocols20.trace.end({
|
|
8842
8760
|
id: traceId
|
|
8843
8761
|
}), {
|
|
8844
8762
|
F: __dxlog_file30,
|
|
@@ -8920,4 +8838,4 @@ ClientServicesHost = _ts_decorate11([
|
|
|
8920
8838
|
subscribeToSpaces,
|
|
8921
8839
|
subscribeToSwarmInfo
|
|
8922
8840
|
});
|
|
8923
|
-
//# sourceMappingURL=chunk-
|
|
8841
|
+
//# sourceMappingURL=chunk-S24QKMSU.cjs.map
|