@dxos/client-services 0.6.9 → 0.6.10-main.bbdfaa4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/lib/browser/{chunk-67XXCVHL.mjs → chunk-DJUFNLVB.mjs} +592 -555
  2. package/dist/lib/browser/chunk-DJUFNLVB.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/testing/index.mjs +7 -8
  6. package/dist/lib/browser/testing/index.mjs.map +3 -3
  7. package/dist/lib/node/{chunk-WTK4Q3EG.cjs → chunk-JZHOBYSS.cjs} +582 -545
  8. package/dist/lib/node/chunk-JZHOBYSS.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +45 -45
  10. package/dist/lib/node/meta.json +1 -1
  11. package/dist/lib/node/testing/index.cjs +13 -14
  12. package/dist/lib/node/testing/index.cjs.map +3 -3
  13. package/dist/types/src/packlets/devtools/feeds.d.ts +3 -1
  14. package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
  15. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  16. package/dist/types/src/packlets/testing/test-builder.d.ts +2 -4
  17. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  18. package/dist/types/src/version.d.ts +1 -1
  19. package/dist/types/src/version.d.ts.map +1 -1
  20. package/package.json +37 -37
  21. package/src/packlets/devtools/devtools.ts +1 -1
  22. package/src/packlets/devtools/feeds.ts +37 -4
  23. package/src/packlets/services/service-context.ts +3 -3
  24. package/src/packlets/services/service-host.ts +4 -5
  25. package/src/packlets/spaces/edge-feed-replicator.ts +2 -2
  26. package/src/packlets/testing/test-builder.ts +3 -10
  27. package/src/version.ts +1 -5
  28. package/dist/lib/browser/chunk-67XXCVHL.mjs.map +0 -7
  29. package/dist/lib/node/chunk-WTK4Q3EG.cjs.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 chunk_WTK4Q3EG_exports = {};
30
- __export(chunk_WTK4Q3EG_exports, {
29
+ var chunk_JZHOBYSS_exports = {};
30
+ __export(chunk_JZHOBYSS_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  DataSpace: () => DataSpace,
@@ -70,11 +70,12 @@ __export(chunk_WTK4Q3EG_exports, {
70
70
  subscribeToSpaces: () => subscribeToSpaces,
71
71
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
72
72
  });
73
- module.exports = __toCommonJS(chunk_WTK4Q3EG_exports);
73
+ module.exports = __toCommonJS(chunk_JZHOBYSS_exports);
74
74
  var import_async = require("@dxos/async");
75
75
  var import_codec_protobuf = require("@dxos/codec-protobuf");
76
76
  var import_feed_store = require("@dxos/feed-store");
77
77
  var import_keys = require("@dxos/keys");
78
+ var import_log = require("@dxos/log");
78
79
  var import_util = require("@dxos/util");
79
80
  var import_codec_protobuf2 = require("@dxos/codec-protobuf");
80
81
  var import_context = require("@dxos/context");
@@ -101,7 +102,7 @@ var import_util2 = require("@dxos/util");
101
102
  var import_async5 = require("@dxos/async");
102
103
  var import_context2 = require("@dxos/context");
103
104
  var import_credentials2 = require("@dxos/credentials");
104
- var import_log = require("@dxos/log");
105
+ var import_log2 = require("@dxos/log");
105
106
  var import_protocols2 = require("@dxos/protocols");
106
107
  var import_async6 = require("@dxos/async");
107
108
  var import_client_protocol2 = require("@dxos/client-protocol");
@@ -109,21 +110,21 @@ var import_credentials3 = require("@dxos/credentials");
109
110
  var import_feed_store2 = require("@dxos/feed-store");
110
111
  var import_invariant2 = require("@dxos/invariant");
111
112
  var import_keys3 = require("@dxos/keys");
112
- var import_log2 = require("@dxos/log");
113
+ var import_log3 = require("@dxos/log");
113
114
  var import_credentials4 = require("@dxos/protocols/proto/dxos/halo/credentials");
114
115
  var import_timeframe = require("@dxos/timeframe");
115
116
  var import_tracing3 = require("@dxos/tracing");
116
117
  var import_util3 = require("@dxos/util");
117
118
  var import_credentials5 = require("@dxos/credentials");
118
119
  var import_keys4 = require("@dxos/keys");
119
- var import_log3 = require("@dxos/log");
120
+ var import_log4 = require("@dxos/log");
120
121
  var import_platform = __toESM(require("platform"));
121
122
  var import_async7 = require("@dxos/async");
122
123
  var import_context3 = require("@dxos/context");
123
124
  var import_credentials6 = require("@dxos/credentials");
124
125
  var import_invariant3 = require("@dxos/invariant");
125
126
  var import_keys5 = require("@dxos/keys");
126
- var import_log4 = require("@dxos/log");
127
+ var import_log5 = require("@dxos/log");
127
128
  var import_protocols3 = require("@dxos/protocols");
128
129
  var import_services4 = require("@dxos/protocols/proto/dxos/client/services");
129
130
  var import_credentials7 = require("@dxos/protocols/proto/dxos/halo/credentials");
@@ -137,7 +138,7 @@ var import_context4 = require("@dxos/context");
137
138
  var import_credentials8 = require("@dxos/credentials");
138
139
  var import_debug = require("@dxos/debug");
139
140
  var import_invariant4 = require("@dxos/invariant");
140
- var import_log5 = require("@dxos/log");
141
+ var import_log6 = require("@dxos/log");
141
142
  var import_services5 = require("@dxos/protocols/proto/dxos/client/services");
142
143
  var import_util5 = require("@dxos/util");
143
144
  var import_invariant5 = require("@dxos/invariant");
@@ -149,7 +150,7 @@ var import_context5 = require("@dxos/context");
149
150
  var import_crypto = require("@dxos/crypto");
150
151
  var import_invariant6 = require("@dxos/invariant");
151
152
  var import_keys6 = require("@dxos/keys");
152
- var import_log6 = require("@dxos/log");
153
+ var import_log7 = require("@dxos/log");
153
154
  var import_network_manager = require("@dxos/network-manager");
154
155
  var import_protocols5 = require("@dxos/protocols");
155
156
  var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
@@ -160,7 +161,7 @@ var import_util6 = require("@dxos/util");
160
161
  var import_async10 = require("@dxos/async");
161
162
  var import_context6 = require("@dxos/context");
162
163
  var import_invariant7 = require("@dxos/invariant");
163
- var import_log7 = require("@dxos/log");
164
+ var import_log8 = require("@dxos/log");
164
165
  var import_protocols6 = require("@dxos/protocols");
165
166
  var import_invitations3 = require("@dxos/protocols/proto/dxos/halo/invitations");
166
167
  var import_teleport = require("@dxos/teleport");
@@ -171,14 +172,14 @@ var import_context8 = require("@dxos/context");
171
172
  var import_crypto2 = require("@dxos/crypto");
172
173
  var import_invariant8 = require("@dxos/invariant");
173
174
  var import_keys7 = require("@dxos/keys");
174
- var import_log8 = require("@dxos/log");
175
+ var import_log9 = require("@dxos/log");
175
176
  var import_protocols7 = require("@dxos/protocols");
176
177
  var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
177
178
  var import_invitations4 = require("@dxos/protocols/proto/dxos/halo/invitations");
178
179
  var import_teleport2 = require("@dxos/teleport");
179
180
  var import_invariant9 = require("@dxos/invariant");
180
181
  var import_keys8 = require("@dxos/keys");
181
- var import_log9 = require("@dxos/log");
182
+ var import_log10 = require("@dxos/log");
182
183
  var import_invitations5 = require("@dxos/protocols/proto/dxos/halo/invitations");
183
184
  var import_util7 = require("@dxos/util");
184
185
  var import_codec_protobuf9 = require("@dxos/codec-protobuf");
@@ -186,7 +187,7 @@ var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
186
187
  var import_credentials9 = require("@dxos/credentials");
187
188
  var import_feed_store3 = require("@dxos/feed-store");
188
189
  var import_invariant10 = require("@dxos/invariant");
189
- var import_log10 = require("@dxos/log");
190
+ var import_log11 = require("@dxos/log");
190
191
  var import_protocols8 = require("@dxos/protocols");
191
192
  var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
192
193
  var import_credentials10 = require("@dxos/protocols/proto/dxos/halo/credentials");
@@ -197,12 +198,12 @@ var import_credentials11 = require("@dxos/credentials");
197
198
  var import_echo_pipeline = require("@dxos/echo-pipeline");
198
199
  var import_invariant11 = require("@dxos/invariant");
199
200
  var import_keys9 = require("@dxos/keys");
200
- var import_log11 = require("@dxos/log");
201
+ var import_log12 = require("@dxos/log");
201
202
  var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
202
203
  var import_credentials12 = require("@dxos/protocols/proto/dxos/halo/credentials");
203
204
  var import_invariant12 = require("@dxos/invariant");
204
205
  var import_lock_file = require("@dxos/lock-file");
205
- var import_log12 = require("@dxos/log");
206
+ var import_log13 = require("@dxos/log");
206
207
  var import_codec_protobuf10 = require("@dxos/codec-protobuf");
207
208
  var import_debug2 = require("@dxos/debug");
208
209
  var import_rpc = require("@dxos/rpc");
@@ -212,7 +213,7 @@ var import_async13 = require("@dxos/async");
212
213
  var import_context10 = require("@dxos/context");
213
214
  var import_invariant13 = require("@dxos/invariant");
214
215
  var import_keys10 = require("@dxos/keys");
215
- var import_log13 = require("@dxos/log");
216
+ var import_log14 = require("@dxos/log");
216
217
  var import_protocols9 = require("@dxos/protocols");
217
218
  var import_buf = require("@dxos/protocols/buf");
218
219
  var import_messenger_pb = require("@dxos/protocols/buf/dxos/edge/messenger_pb");
@@ -225,7 +226,7 @@ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
225
226
  var import_echo_protocol = require("@dxos/echo-protocol");
226
227
  var import_invariant14 = require("@dxos/invariant");
227
228
  var import_keys11 = require("@dxos/keys");
228
- var import_log14 = require("@dxos/log");
229
+ var import_log15 = require("@dxos/log");
229
230
  var import_protocols10 = require("@dxos/protocols");
230
231
  var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
231
232
  var import_credentials13 = require("@dxos/protocols/proto/dxos/halo/credentials");
@@ -239,13 +240,13 @@ var import_echo_db = require("@dxos/echo-db");
239
240
  var import_echo_protocol2 = require("@dxos/echo-protocol");
240
241
  var import_echo_schema = require("@dxos/echo-schema");
241
242
  var import_invariant15 = require("@dxos/invariant");
242
- var import_log15 = require("@dxos/log");
243
+ var import_log16 = require("@dxos/log");
243
244
  var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
244
245
  var import_async16 = require("@dxos/async");
245
246
  var import_context13 = require("@dxos/context");
246
247
  var import_invariant16 = require("@dxos/invariant");
247
248
  var import_keys12 = require("@dxos/keys");
248
- var import_log16 = require("@dxos/log");
249
+ var import_log17 = require("@dxos/log");
249
250
  var import_protocols11 = require("@dxos/protocols");
250
251
  var import_teleport3 = require("@dxos/teleport");
251
252
  var import_util10 = require("@dxos/util");
@@ -260,7 +261,7 @@ var import_echo_schema2 = require("@dxos/echo-schema");
260
261
  var import_feed_store4 = require("@dxos/feed-store");
261
262
  var import_invariant17 = require("@dxos/invariant");
262
263
  var import_keys13 = require("@dxos/keys");
263
- var import_log17 = require("@dxos/log");
264
+ var import_log18 = require("@dxos/log");
264
265
  var import_protocols12 = require("@dxos/protocols");
265
266
  var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
266
267
  var import_credentials16 = require("@dxos/protocols/proto/dxos/halo/credentials");
@@ -277,7 +278,7 @@ var import_credentials19 = require("@dxos/credentials");
277
278
  var import_debug5 = require("@dxos/debug");
278
279
  var import_feed_store5 = require("@dxos/feed-store");
279
280
  var import_invariant18 = require("@dxos/invariant");
280
- var import_log18 = require("@dxos/log");
281
+ var import_log19 = require("@dxos/log");
281
282
  var import_protocols13 = require("@dxos/protocols");
282
283
  var import_services16 = require("@dxos/protocols/proto/dxos/client/services");
283
284
  var import_tracing9 = require("@dxos/tracing");
@@ -291,7 +292,7 @@ var import_feed_store6 = require("@dxos/feed-store");
291
292
  var import_invariant19 = require("@dxos/invariant");
292
293
  var import_keyring = require("@dxos/keyring");
293
294
  var import_keys14 = require("@dxos/keys");
294
- var import_log19 = require("@dxos/log");
295
+ var import_log20 = require("@dxos/log");
295
296
  var import_protocols14 = require("@dxos/protocols");
296
297
  var import_services17 = require("@dxos/protocols/proto/dxos/client/services");
297
298
  var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
@@ -308,7 +309,7 @@ var import_keys15 = require("@dxos/keys");
308
309
  var import_kv_store = require("@dxos/kv-store");
309
310
  var import_automerge_repo = require("@dxos/automerge/automerge-repo");
310
311
  var import_invariant20 = require("@dxos/invariant");
311
- var import_log20 = require("@dxos/log");
312
+ var import_log21 = require("@dxos/log");
312
313
  var import_protocols16 = require("@dxos/protocols");
313
314
  var import_util14 = require("@dxos/util");
314
315
  var import_async20 = require("@dxos/async");
@@ -317,7 +318,7 @@ var import_context16 = require("@dxos/context");
317
318
  var import_edge_client = require("@dxos/edge-client");
318
319
  var import_invariant21 = require("@dxos/invariant");
319
320
  var import_keys16 = require("@dxos/keys");
320
- var import_log21 = require("@dxos/log");
321
+ var import_log22 = require("@dxos/log");
321
322
  var import_messaging = require("@dxos/messaging");
322
323
  var import_network_manager2 = require("@dxos/network-manager");
323
324
  var import_protocols17 = require("@dxos/protocols");
@@ -335,14 +336,15 @@ var import_util15 = require("@dxos/util");
335
336
  var import_async23 = require("@dxos/async");
336
337
  var import_codec_protobuf14 = require("@dxos/codec-protobuf");
337
338
  var import_keys18 = require("@dxos/keys");
338
- var import_log22 = require("@dxos/log");
339
+ var import_log23 = require("@dxos/log");
339
340
  var import_services20 = require("@dxos/protocols/proto/dxos/client/services");
340
341
  var import_util16 = require("@dxos/util");
341
342
  var import_codec_protobuf15 = require("@dxos/codec-protobuf");
342
343
  var import_codec_protobuf16 = require("@dxos/codec-protobuf");
343
344
  var import_services21 = require("@dxos/protocols/proto/dxos/client/services");
344
345
  var import_util17 = require("@dxos/util");
345
- var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
346
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devtools/feeds.ts";
347
+ var subscribeToFeeds = ({ feedStore, spaceManager }, { feedKeys }) => {
346
348
  return new import_codec_protobuf.Stream(({ next }) => {
347
349
  const subscriptions = new import_async.EventSubscriptions();
348
350
  const feedMap = new import_util.ComplexMap(import_keys.PublicKey.hash);
@@ -350,17 +352,23 @@ var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
350
352
  const { feeds } = feedStore;
351
353
  feeds.filter((feed) => !feedKeys?.length || feedKeys.some((feedKey) => feedKey.equals(feed.key))).forEach((feed) => {
352
354
  if (!feedMap.has(feed.key)) {
353
- feedMap.set(feed.key, feed);
355
+ feedMap.set(feed.key, {
356
+ feed
357
+ });
354
358
  feed.on("close", update);
355
359
  subscriptions.add(() => feed.off("close", update));
356
360
  }
361
+ if (!feedMap.get(feed.key)?.owner) {
362
+ feedMap.get(feed.key).owner = findFeedOwner(spaceManager, feed.key);
363
+ }
357
364
  });
358
365
  next({
359
- feeds: Array.from(feedMap.values()).map((feed) => ({
366
+ feeds: Array.from(feedMap.values()).map(({ feed, owner }) => ({
360
367
  feedKey: feed.key,
361
368
  length: feed.properties.length,
362
369
  bytes: feed.core.byteLength,
363
- downloaded: feed.core.bitfield?.data.toBuffer() ?? new Uint8Array()
370
+ downloaded: feed.core.bitfield?.data.toBuffer() ?? new Uint8Array(),
371
+ owner
364
372
  }))
365
373
  });
366
374
  };
@@ -371,6 +379,30 @@ var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
371
379
  };
372
380
  });
373
381
  };
382
+ var findFeedOwner = (spaceManager, feedKey) => {
383
+ const feedInfo = [
384
+ ...spaceManager.spaces.values()
385
+ ].flatMap((space) => [
386
+ ...space.spaceState.feeds.values()
387
+ ]).find((feed) => feed.key.equals(feedKey));
388
+ import_log.log.info("feeds", {
389
+ feedInfo,
390
+ key: feedKey.truncate(),
391
+ allSpaces: spaceManager.spaces.size
392
+ }, {
393
+ F: __dxlog_file,
394
+ L: 75,
395
+ S: void 0,
396
+ C: (f, a) => f(...a)
397
+ });
398
+ if (!feedInfo) {
399
+ return void 0;
400
+ }
401
+ return {
402
+ identity: feedInfo.assertion.identityKey,
403
+ device: feedInfo.assertion.deviceKey
404
+ };
405
+ };
374
406
  var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
375
407
  return new import_codec_protobuf.Stream(({ next }) => {
376
408
  if (!feedKey) {
@@ -383,6 +415,12 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
383
415
  return;
384
416
  }
385
417
  const update = async () => {
418
+ if (!feed.properties.length) {
419
+ next({
420
+ blocks: []
421
+ });
422
+ return;
423
+ }
386
424
  const iterator = new import_feed_store.FeedIterator(feed);
387
425
  await iterator.open();
388
426
  const blocks = [];
@@ -409,7 +447,7 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
409
447
  };
410
448
  });
411
449
  };
412
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devtools/network.ts";
450
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devtools/network.ts";
413
451
  var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf2.Stream(({ next, close }) => {
414
452
  const update = () => {
415
453
  try {
@@ -426,7 +464,7 @@ var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf2
426
464
  });
427
465
  var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf2.Stream(({ next }) => {
428
466
  const ctx = new import_context.Context(void 0, {
429
- F: __dxlog_file,
467
+ F: __dxlog_file2,
430
468
  L: 36
431
469
  });
432
470
  signalManager.onMessage.on(ctx, (message) => {
@@ -620,9 +658,7 @@ var DevtoolsServiceImpl = class {
620
658
  throw new Error();
621
659
  }
622
660
  subscribeToFeeds(request) {
623
- return subscribeToFeeds({
624
- feedStore: this.params.context.feedStore
625
- }, request);
661
+ return subscribeToFeeds(this.params.context, request);
626
662
  }
627
663
  subscribeToFeedBlocks(request) {
628
664
  return subscribeToFeedBlocks({
@@ -665,7 +701,7 @@ var DevtoolsServiceImpl = class {
665
701
  });
666
702
  }
667
703
  };
668
- var DXOS_VERSION = "0.6.9";
704
+ var DXOS_VERSION = "0.6.10-main.bbdfaa4";
669
705
  var getPlatform = () => {
670
706
  if (process.browser) {
671
707
  if (typeof window !== "undefined") {
@@ -693,7 +729,7 @@ var getPlatform = () => {
693
729
  };
694
730
  }
695
731
  };
696
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts";
732
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts";
697
733
  var DEFAULT_TIMEOUT = 1e3;
698
734
  var createDiagnostics = async (clientServices, serviceContext, config) => {
699
735
  const diagnostics = {
@@ -710,7 +746,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
710
746
  await Promise.all([
711
747
  (async () => {
712
748
  (0, import_invariant.invariant)(clientServices.LoggingService, "SystemService is not available.", {
713
- F: __dxlog_file2,
749
+ F: __dxlog_file3,
714
750
  L: 110,
715
751
  S: void 0,
716
752
  A: [
@@ -858,7 +894,7 @@ var findConfigs = () => {
858
894
  const configs = import_tracing2.TRACE_PROCESSOR.findResourcesByAnnotation(import_config.ConfigResource);
859
895
  return configs.map((r) => r.instance.deref()).filter(import_util2.nonNullable);
860
896
  };
861
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
897
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
862
898
  var Credential = import_protocols2.schema.getCodecForType("dxos.halo.credentials.Credential");
863
899
  var createAuthProvider = (signer) => async (nonce) => {
864
900
  const credential = await signer.createCredential({
@@ -874,7 +910,7 @@ var TrustedKeySetAuthVerifier = class {
874
910
  constructor(_params) {
875
911
  this._params = _params;
876
912
  this._ctx = new import_context2.Context(void 0, {
877
- F: __dxlog_file3,
913
+ F: __dxlog_file4,
878
914
  L: 45
879
915
  });
880
916
  }
@@ -884,20 +920,20 @@ var TrustedKeySetAuthVerifier = class {
884
920
  get verifier() {
885
921
  return async (nonce, auth) => {
886
922
  const credential = Credential.decode(auth);
887
- (0, import_log.log)("authenticating...", {
923
+ (0, import_log2.log)("authenticating...", {
888
924
  credential
889
925
  }, {
890
- F: __dxlog_file3,
926
+ F: __dxlog_file4,
891
927
  L: 56,
892
928
  S: this,
893
929
  C: (f, a) => f(...a)
894
930
  });
895
931
  const result = await (0, import_credentials2.verifyCredential)(credential);
896
932
  if (result.kind === "fail") {
897
- (0, import_log.log)("Invalid credential", {
933
+ (0, import_log2.log)("Invalid credential", {
898
934
  result
899
935
  }, {
900
- F: __dxlog_file3,
936
+ F: __dxlog_file4,
901
937
  L: 60,
902
938
  S: this,
903
939
  C: (f, a) => f(...a)
@@ -905,11 +941,11 @@ var TrustedKeySetAuthVerifier = class {
905
941
  return false;
906
942
  }
907
943
  if (!credential.proof.nonce || !Buffer.from(nonce).equals(credential.proof.nonce)) {
908
- (0, import_log.log)("Invalid nonce", {
944
+ (0, import_log2.log)("Invalid nonce", {
909
945
  nonce,
910
946
  credential
911
947
  }, {
912
- F: __dxlog_file3,
948
+ F: __dxlog_file4,
913
949
  L: 65,
914
950
  S: this,
915
951
  C: (f, a) => f(...a)
@@ -917,10 +953,10 @@ var TrustedKeySetAuthVerifier = class {
917
953
  return false;
918
954
  }
919
955
  if (this._isTrustedKey(credential.issuer)) {
920
- (0, import_log.log)("key is not currently in trusted set, waiting...", {
956
+ (0, import_log2.log)("key is not currently in trusted set, waiting...", {
921
957
  key: credential.issuer
922
958
  }, {
923
- F: __dxlog_file3,
959
+ F: __dxlog_file4,
924
960
  L: 70,
925
961
  S: this,
926
962
  C: (f, a) => f(...a)
@@ -933,20 +969,20 @@ var TrustedKeySetAuthVerifier = class {
933
969
  });
934
970
  const clear = this._params.update.on(this._ctx, () => {
935
971
  if (this._isTrustedKey(credential.issuer)) {
936
- (0, import_log.log)("auth success", {
972
+ (0, import_log2.log)("auth success", {
937
973
  key: credential.issuer
938
974
  }, {
939
- F: __dxlog_file3,
975
+ F: __dxlog_file4,
940
976
  L: 81,
941
977
  S: this,
942
978
  C: (f, a) => f(...a)
943
979
  });
944
980
  trigger.wake(true);
945
981
  } else {
946
- (0, import_log.log)("key is not currently in trusted set, waiting...", {
982
+ (0, import_log2.log)("key is not currently in trusted set, waiting...", {
947
983
  key: credential.issuer
948
984
  }, {
949
- F: __dxlog_file3,
985
+ F: __dxlog_file4,
950
986
  L: 84,
951
987
  S: this,
952
988
  C: (f, a) => f(...a)
@@ -969,7 +1005,7 @@ var TrustedKeySetAuthVerifier = class {
969
1005
  return deviceSet.has(deviceKey);
970
1006
  }
971
1007
  };
972
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/default-space-state-machine.ts";
1008
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/default-space-state-machine.ts";
973
1009
  var DefaultSpaceStateMachine = class {
974
1010
  constructor(_params) {
975
1011
  this._params = _params;
@@ -982,11 +1018,11 @@ var DefaultSpaceStateMachine = class {
982
1018
  switch (assertion["@type"]) {
983
1019
  case "dxos.halo.credentials.DefaultSpace": {
984
1020
  if (!credential.subject.id.equals(this._params.identityKey)) {
985
- import_log3.log.warn("Invalid default space credential", {
1021
+ import_log4.log.warn("Invalid default space credential", {
986
1022
  expectedIdentity: this._params.identityKey,
987
1023
  credential
988
1024
  }, {
989
- F: __dxlog_file4,
1025
+ F: __dxlog_file5,
990
1026
  L: 32,
991
1027
  S: this,
992
1028
  C: (f, a) => f(...a)
@@ -994,10 +1030,10 @@ var DefaultSpaceStateMachine = class {
994
1030
  return;
995
1031
  }
996
1032
  if (!import_keys4.SpaceId.isValid(assertion.spaceId)) {
997
- import_log3.log.warn("Invalid default space id", {
1033
+ import_log4.log.warn("Invalid default space id", {
998
1034
  id: assertion.spaceId
999
1035
  }, {
1000
- F: __dxlog_file4,
1036
+ F: __dxlog_file5,
1001
1037
  L: 36,
1002
1038
  S: this,
1003
1039
  C: (f, a) => f(...a)
@@ -1020,7 +1056,7 @@ function _ts_decorate(decorators, target, key, desc) {
1020
1056
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1021
1057
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1022
1058
  }
1023
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
1059
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
1024
1060
  var Identity = class {
1025
1061
  constructor({ space, signer, identityKey, deviceKey, presence }) {
1026
1062
  this.stateUpdate = new import_async6.Event();
@@ -1029,10 +1065,10 @@ var Identity = class {
1029
1065
  this._presence = presence;
1030
1066
  this.identityKey = identityKey;
1031
1067
  this.deviceKey = deviceKey;
1032
- import_log2.log.trace("dxos.halo.device", {
1068
+ import_log3.log.trace("dxos.halo.device", {
1033
1069
  deviceKey
1034
1070
  }, {
1035
- F: __dxlog_file5,
1071
+ F: __dxlog_file6,
1036
1072
  L: 70,
1037
1073
  S: this,
1038
1074
  C: (f, a) => f(...a)
@@ -1111,7 +1147,7 @@ var Identity = class {
1111
1147
  */
1112
1148
  getIdentityCredentialSigner() {
1113
1149
  (0, import_invariant2.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
1114
- F: __dxlog_file5,
1150
+ F: __dxlog_file6,
1115
1151
  L: 159,
1116
1152
  S: this,
1117
1153
  A: [
@@ -1148,14 +1184,14 @@ var Identity = class {
1148
1184
  ]));
1149
1185
  }
1150
1186
  async admitDevice({ deviceKey, controlFeedKey, dataFeedKey }) {
1151
- (0, import_log2.log)("Admitting device:", {
1187
+ (0, import_log3.log)("Admitting device:", {
1152
1188
  identityKey: this.identityKey,
1153
1189
  hostDevice: this.deviceKey,
1154
1190
  deviceKey,
1155
1191
  controlFeedKey,
1156
1192
  dataFeedKey
1157
1193
  }, {
1158
- F: __dxlog_file5,
1194
+ F: __dxlog_file6,
1159
1195
  L: 184,
1160
1196
  S: this,
1161
1197
  C: (f, a) => f(...a)
@@ -1216,7 +1252,7 @@ function _ts_decorate2(decorators, target, key, desc) {
1216
1252
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1217
1253
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1218
1254
  }
1219
- var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
1255
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
1220
1256
  var DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 1e4;
1221
1257
  var DEVICE_PRESENCE_OFFLINE_TIMEOUT = 2e4;
1222
1258
  var IdentityManager = class {
@@ -1238,19 +1274,19 @@ var IdentityManager = class {
1238
1274
  }
1239
1275
  async open(ctx) {
1240
1276
  const traceId = import_keys5.PublicKey.random().toHex();
1241
- import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.begin({
1277
+ import_log5.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.begin({
1242
1278
  id: traceId
1243
1279
  }), {
1244
- F: __dxlog_file6,
1280
+ F: __dxlog_file7,
1245
1281
  L: 107,
1246
1282
  S: this,
1247
1283
  C: (f, a) => f(...a)
1248
1284
  });
1249
1285
  const identityRecord = this._metadataStore.getIdentityRecord();
1250
- (0, import_log4.log)("identity record", {
1286
+ (0, import_log5.log)("identity record", {
1251
1287
  identityRecord
1252
1288
  }, {
1253
- F: __dxlog_file6,
1289
+ F: __dxlog_file7,
1254
1290
  L: 110,
1255
1291
  S: this,
1256
1292
  C: (f, a) => f(...a)
@@ -1259,21 +1295,21 @@ var IdentityManager = class {
1259
1295
  this._identity = await this._constructIdentity(identityRecord);
1260
1296
  await this._identity.open(ctx);
1261
1297
  await this._identity.ready();
1262
- import_log4.log.trace("dxos.halo.identity", {
1298
+ import_log5.log.trace("dxos.halo.identity", {
1263
1299
  identityKey: identityRecord.identityKey,
1264
1300
  displayName: this._identity.profileDocument?.displayName
1265
1301
  }, {
1266
- F: __dxlog_file6,
1302
+ F: __dxlog_file7,
1267
1303
  L: 115,
1268
1304
  S: this,
1269
1305
  C: (f, a) => f(...a)
1270
1306
  });
1271
1307
  this.stateUpdate.emit();
1272
1308
  }
1273
- import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.end({
1309
+ import_log5.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.end({
1274
1310
  id: traceId
1275
1311
  }), {
1276
- F: __dxlog_file6,
1312
+ F: __dxlog_file7,
1277
1313
  L: 122,
1278
1314
  S: this,
1279
1315
  C: (f, a) => f(...a)
@@ -1281,13 +1317,13 @@ var IdentityManager = class {
1281
1317
  }
1282
1318
  async close() {
1283
1319
  await this._identity?.close(new import_context3.Context(void 0, {
1284
- F: __dxlog_file6,
1320
+ F: __dxlog_file7,
1285
1321
  L: 126
1286
1322
  }));
1287
1323
  }
1288
1324
  async createIdentity({ displayName, deviceProfile } = {}) {
1289
1325
  (0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
1290
- F: __dxlog_file6,
1326
+ F: __dxlog_file7,
1291
1327
  L: 131,
1292
1328
  S: this,
1293
1329
  A: [
@@ -1295,8 +1331,8 @@ var IdentityManager = class {
1295
1331
  "'Identity already exists.'"
1296
1332
  ]
1297
1333
  });
1298
- (0, import_log4.log)("creating identity...", void 0, {
1299
- F: __dxlog_file6,
1334
+ (0, import_log5.log)("creating identity...", void 0, {
1335
+ F: __dxlog_file7,
1300
1336
  L: 132,
1301
1337
  S: this,
1302
1338
  C: (f, a) => f(...a)
@@ -1314,13 +1350,13 @@ var IdentityManager = class {
1314
1350
  };
1315
1351
  const identity = await this._constructIdentity(identityRecord);
1316
1352
  await identity.open(new import_context3.Context(void 0, {
1317
- F: __dxlog_file6,
1353
+ F: __dxlog_file7,
1318
1354
  L: 147
1319
1355
  }));
1320
1356
  {
1321
1357
  const generator = new import_credentials6.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
1322
1358
  (0, import_invariant3.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
1323
- F: __dxlog_file6,
1359
+ F: __dxlog_file7,
1324
1360
  L: 151,
1325
1361
  S: this,
1326
1362
  A: [
@@ -1329,7 +1365,7 @@ var IdentityManager = class {
1329
1365
  ]
1330
1366
  });
1331
1367
  (0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
1332
- F: __dxlog_file6,
1368
+ F: __dxlog_file7,
1333
1369
  L: 152,
1334
1370
  S: this,
1335
1371
  A: [
@@ -1364,22 +1400,22 @@ var IdentityManager = class {
1364
1400
  await this._metadataStore.setIdentityRecord(identityRecord);
1365
1401
  this._identity = identity;
1366
1402
  await this._identity.ready();
1367
- import_log4.log.trace("dxos.halo.identity", {
1403
+ import_log5.log.trace("dxos.halo.identity", {
1368
1404
  identityKey: identityRecord.identityKey,
1369
1405
  displayName: this._identity.profileDocument?.displayName
1370
1406
  }, {
1371
- F: __dxlog_file6,
1407
+ F: __dxlog_file7,
1372
1408
  L: 194,
1373
1409
  S: this,
1374
1410
  C: (f, a) => f(...a)
1375
1411
  });
1376
1412
  this.stateUpdate.emit();
1377
- (0, import_log4.log)("created identity", {
1413
+ (0, import_log5.log)("created identity", {
1378
1414
  identityKey: identity.identityKey,
1379
1415
  deviceKey: identity.deviceKey,
1380
1416
  profile: identity.profileDocument
1381
1417
  }, {
1382
- F: __dxlog_file6,
1418
+ F: __dxlog_file7,
1383
1419
  L: 200,
1384
1420
  S: this,
1385
1421
  C: (f, a) => f(...a)
@@ -1413,16 +1449,16 @@ var IdentityManager = class {
1413
1449
  * Accept an existing identity. Expects its device key to be authorized (now or later).
1414
1450
  */
1415
1451
  async acceptIdentity(params) {
1416
- (0, import_log4.log)("accepting identity", {
1452
+ (0, import_log5.log)("accepting identity", {
1417
1453
  params
1418
1454
  }, {
1419
- F: __dxlog_file6,
1455
+ F: __dxlog_file7,
1420
1456
  L: 238,
1421
1457
  S: this,
1422
1458
  C: (f, a) => f(...a)
1423
1459
  });
1424
1460
  (0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
1425
- F: __dxlog_file6,
1461
+ F: __dxlog_file7,
1426
1462
  L: 239,
1427
1463
  S: this,
1428
1464
  A: [
@@ -1443,17 +1479,17 @@ var IdentityManager = class {
1443
1479
  };
1444
1480
  const identity = await this._constructIdentity(identityRecord);
1445
1481
  await identity.open(new import_context3.Context(void 0, {
1446
- F: __dxlog_file6,
1482
+ F: __dxlog_file7,
1447
1483
  L: 254
1448
1484
  }));
1449
1485
  this._identity = identity;
1450
1486
  await this._metadataStore.setIdentityRecord(identityRecord);
1451
1487
  await this._identity.ready();
1452
- import_log4.log.trace("dxos.halo.identity", {
1488
+ import_log5.log.trace("dxos.halo.identity", {
1453
1489
  identityKey: identityRecord.identityKey,
1454
1490
  displayName: this._identity.profileDocument?.displayName
1455
1491
  }, {
1456
- F: __dxlog_file6,
1492
+ F: __dxlog_file7,
1457
1493
  L: 258,
1458
1494
  S: this,
1459
1495
  C: (f, a) => f(...a)
@@ -1463,11 +1499,11 @@ var IdentityManager = class {
1463
1499
  ...params.deviceProfile
1464
1500
  });
1465
1501
  this.stateUpdate.emit();
1466
- (0, import_log4.log)("accepted identity", {
1502
+ (0, import_log5.log)("accepted identity", {
1467
1503
  identityKey: identity.identityKey,
1468
1504
  deviceKey: identity.deviceKey
1469
1505
  }, {
1470
- F: __dxlog_file6,
1506
+ F: __dxlog_file7,
1471
1507
  L: 268,
1472
1508
  S: this,
1473
1509
  C: (f, a) => f(...a)
@@ -1479,7 +1515,7 @@ var IdentityManager = class {
1479
1515
  */
1480
1516
  async updateProfile(profile) {
1481
1517
  (0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
1482
- F: __dxlog_file6,
1518
+ F: __dxlog_file7,
1483
1519
  L: 276,
1484
1520
  S: this,
1485
1521
  A: [
@@ -1510,7 +1546,7 @@ var IdentityManager = class {
1510
1546
  }
1511
1547
  async updateDeviceProfile(profile) {
1512
1548
  (0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
1513
- F: __dxlog_file6,
1549
+ F: __dxlog_file7,
1514
1550
  L: 293,
1515
1551
  S: this,
1516
1552
  A: [
@@ -1546,7 +1582,7 @@ var IdentityManager = class {
1546
1582
  }
1547
1583
  async _constructIdentity(identityRecord) {
1548
1584
  (0, import_invariant3.invariant)(!this._identity, void 0, {
1549
- F: __dxlog_file6,
1585
+ F: __dxlog_file7,
1550
1586
  L: 319,
1551
1587
  S: this,
1552
1588
  A: [
@@ -1554,10 +1590,10 @@ var IdentityManager = class {
1554
1590
  ""
1555
1591
  ]
1556
1592
  });
1557
- (0, import_log4.log)("constructing identity", {
1593
+ (0, import_log5.log)("constructing identity", {
1558
1594
  identityRecord
1559
1595
  }, {
1560
- F: __dxlog_file6,
1596
+ F: __dxlog_file7,
1561
1597
  L: 320,
1562
1598
  S: this,
1563
1599
  C: (f, a) => f(...a)
@@ -1572,7 +1608,7 @@ var IdentityManager = class {
1572
1608
  gossip
1573
1609
  });
1574
1610
  (0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
1575
- F: __dxlog_file6,
1611
+ F: __dxlog_file7,
1576
1612
  L: 333,
1577
1613
  S: this,
1578
1614
  A: [
@@ -1584,7 +1620,7 @@ var IdentityManager = class {
1584
1620
  writable: true
1585
1621
  });
1586
1622
  (0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
1587
- F: __dxlog_file6,
1623
+ F: __dxlog_file7,
1588
1624
  L: 337,
1589
1625
  S: this,
1590
1626
  A: [
@@ -1616,10 +1652,10 @@ var IdentityManager = class {
1616
1652
  identityKey: identityRecord.identityKey,
1617
1653
  deviceKey: identityRecord.deviceKey
1618
1654
  });
1619
- (0, import_log4.log)("done", {
1655
+ (0, import_log5.log)("done", {
1620
1656
  identityKey: identityRecord.identityKey
1621
1657
  }, {
1622
- F: __dxlog_file6,
1658
+ F: __dxlog_file7,
1623
1659
  L: 364,
1624
1660
  S: this,
1625
1661
  C: (f, a) => f(...a)
@@ -1644,8 +1680,8 @@ var IdentityManager = class {
1644
1680
  }));
1645
1681
  },
1646
1682
  onAuthFailure: () => {
1647
- import_log4.log.warn("auth failure", void 0, {
1648
- F: __dxlog_file6,
1683
+ import_log5.log.warn("auth failure", void 0, {
1684
+ F: __dxlog_file7,
1649
1685
  L: 390,
1650
1686
  S: this,
1651
1687
  C: (f, a) => f(...a)
@@ -1667,7 +1703,7 @@ _ts_decorate2([
1667
1703
  IdentityManager = _ts_decorate2([
1668
1704
  import_tracing4.trace.resource()
1669
1705
  ], IdentityManager);
1670
- var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1706
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1671
1707
  var DEFAULT_SPACE_SEARCH_TIMEOUT = 1e4;
1672
1708
  var IdentityServiceImpl = class extends import_context4.Resource {
1673
1709
  constructor(_identityManager, _keyring, _dataSpaceManagerProvider, _createIdentity, _onProfileUpdate) {
@@ -1697,7 +1733,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1697
1733
  const space = await dataSpaceManager.createDefaultSpace();
1698
1734
  const identity = this._identityManager.identity;
1699
1735
  (0, import_invariant4.invariant)(identity, void 0, {
1700
- F: __dxlog_file7,
1736
+ F: __dxlog_file8,
1701
1737
  L: 59,
1702
1738
  S: this,
1703
1739
  A: [
@@ -1731,7 +1767,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1731
1767
  }
1732
1768
  async updateProfile(profile) {
1733
1769
  (0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
1734
- F: __dxlog_file7,
1770
+ F: __dxlog_file8,
1735
1771
  L: 89,
1736
1772
  S: this,
1737
1773
  A: [
@@ -1746,7 +1782,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1746
1782
  // TODO(burdon): Rename createPresentation?
1747
1783
  async signPresentation({ presentation, nonce }) {
1748
1784
  (0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
1749
- F: __dxlog_file7,
1785
+ F: __dxlog_file8,
1750
1786
  L: 97,
1751
1787
  S: this,
1752
1788
  A: [
@@ -1778,10 +1814,10 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1778
1814
  }
1779
1815
  if (await dataSpaceManager.isDefaultSpace(space)) {
1780
1816
  if (foundDefaultSpace) {
1781
- import_log5.log.warn("Multiple default spaces found. Using the first one.", {
1817
+ import_log6.log.warn("Multiple default spaces found. Using the first one.", {
1782
1818
  duplicate: space.id
1783
1819
  }, {
1784
- F: __dxlog_file7,
1820
+ F: __dxlog_file8,
1785
1821
  L: 130,
1786
1822
  S: this,
1787
1823
  C: (f, a) => f(...a)
@@ -1794,8 +1830,8 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1794
1830
  recordedDefaultSpaceTrigger.wake();
1795
1831
  }
1796
1832
  }, (err) => {
1797
- import_log5.log.catch(err, void 0, {
1798
- F: __dxlog_file7,
1833
+ import_log6.log.catch(err, void 0, {
1834
+ F: __dxlog_file8,
1799
1835
  L: 141,
1800
1836
  S: this,
1801
1837
  C: (f, a) => f(...a)
@@ -1811,7 +1847,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1811
1847
  }
1812
1848
  }
1813
1849
  };
1814
- var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1850
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1815
1851
  var DeviceInvitationProtocol = class {
1816
1852
  constructor(_keyring, _getIdentity, _acceptIdentity) {
1817
1853
  this._keyring = _keyring;
@@ -1837,7 +1873,7 @@ var DeviceInvitationProtocol = class {
1837
1873
  }
1838
1874
  async admit(_, request) {
1839
1875
  (0, import_invariant5.invariant)(request.device, void 0, {
1840
- F: __dxlog_file8,
1876
+ F: __dxlog_file9,
1841
1877
  L: 50,
1842
1878
  S: this,
1843
1879
  A: [
@@ -1883,7 +1919,7 @@ var DeviceInvitationProtocol = class {
1883
1919
  }
1884
1920
  async accept(response, request) {
1885
1921
  (0, import_invariant5.invariant)(response.device, void 0, {
1886
- F: __dxlog_file8,
1922
+ F: __dxlog_file9,
1887
1923
  L: 95,
1888
1924
  S: this,
1889
1925
  A: [
@@ -1893,7 +1929,7 @@ var DeviceInvitationProtocol = class {
1893
1929
  });
1894
1930
  const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
1895
1931
  (0, import_invariant5.invariant)(request.device, void 0, {
1896
- F: __dxlog_file8,
1932
+ F: __dxlog_file9,
1897
1933
  L: 98,
1898
1934
  S: this,
1899
1935
  A: [
@@ -1932,7 +1968,7 @@ var tryAcquireBeforeContextDisposed = async (ctx, mutex) => {
1932
1968
  return guard;
1933
1969
  })());
1934
1970
  };
1935
- var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts";
1971
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts";
1936
1972
  var OPTIONS_TIMEOUT = 1e4;
1937
1973
  var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1938
1974
  constructor(_invitationFlowMutex, _callbacks) {
@@ -1947,7 +1983,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1947
1983
  this._invitationFlowMutex = _invitationFlowMutex;
1948
1984
  this._callbacks = _callbacks;
1949
1985
  this._ctx = new import_context6.Context(void 0, {
1950
- F: __dxlog_file9,
1986
+ F: __dxlog_file10,
1951
1987
  L: 33
1952
1988
  });
1953
1989
  this._remoteOptionsTrigger = new import_async10.Trigger();
@@ -1961,7 +1997,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1961
1997
  InvitationHostService: {
1962
1998
  options: async (options) => {
1963
1999
  (0, import_invariant7.invariant)(!this._remoteOptions, "Remote options already set.", {
1964
- F: __dxlog_file9,
2000
+ F: __dxlog_file10,
1965
2001
  L: 63,
1966
2002
  S: this,
1967
2003
  A: [
@@ -1987,15 +2023,15 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1987
2023
  async onOpen(context) {
1988
2024
  await super.onOpen(context);
1989
2025
  try {
1990
- (0, import_log7.log)("guest acquire lock", void 0, {
1991
- F: __dxlog_file9,
2026
+ (0, import_log8.log)("guest acquire lock", void 0, {
2027
+ F: __dxlog_file10,
1992
2028
  L: 84,
1993
2029
  S: this,
1994
2030
  C: (f, a) => f(...a)
1995
2031
  });
1996
2032
  this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
1997
- (0, import_log7.log)("guest lock acquired", void 0, {
1998
- F: __dxlog_file9,
2033
+ (0, import_log8.log)("guest lock acquired", void 0, {
2034
+ F: __dxlog_file10,
1999
2035
  L: 86,
2000
2036
  S: this,
2001
2037
  C: (f, a) => f(...a)
@@ -2003,8 +2039,8 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2003
2039
  await (0, import_context6.cancelWithContext)(this._ctx, this.rpc.InvitationHostService.options({
2004
2040
  role: import_invitations3.InvitationOptions.Role.GUEST
2005
2041
  }));
2006
- (0, import_log7.log)("options sent", void 0, {
2007
- F: __dxlog_file9,
2042
+ (0, import_log8.log)("options sent", void 0, {
2043
+ F: __dxlog_file10,
2008
2044
  L: 91,
2009
2045
  S: this,
2010
2046
  C: (f, a) => f(...a)
@@ -2012,8 +2048,8 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2012
2048
  await (0, import_context6.cancelWithContext)(this._ctx, this._remoteOptionsTrigger.wait({
2013
2049
  timeout: OPTIONS_TIMEOUT
2014
2050
  }));
2015
- (0, import_log7.log)("options received", void 0, {
2016
- F: __dxlog_file9,
2051
+ (0, import_log8.log)("options received", void 0, {
2052
+ F: __dxlog_file10,
2017
2053
  L: 93,
2018
2054
  S: this,
2019
2055
  C: (f, a) => f(...a)
@@ -2046,8 +2082,8 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2046
2082
  if (this._invitationFlowLock != null) {
2047
2083
  this._invitationFlowLock.release();
2048
2084
  this._invitationFlowLock = null;
2049
- (0, import_log7.log)("invitation flow lock released", void 0, {
2050
- F: __dxlog_file9,
2085
+ (0, import_log8.log)("invitation flow lock released", void 0, {
2086
+ F: __dxlog_file10,
2051
2087
  L: 126,
2052
2088
  S: this,
2053
2089
  C: (f, a) => f(...a)
@@ -2055,7 +2091,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2055
2091
  }
2056
2092
  }
2057
2093
  };
2058
- var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts";
2094
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts";
2059
2095
  var OPTIONS_TIMEOUT2 = 1e4;
2060
2096
  var MAX_OTP_ATTEMPTS = 3;
2061
2097
  var InvitationHostExtension = class extends import_teleport2.RpcExtension {
@@ -2071,7 +2107,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2071
2107
  this._invitationFlowMutex = _invitationFlowMutex;
2072
2108
  this._callbacks = _callbacks;
2073
2109
  this._ctx = new import_context8.Context(void 0, {
2074
- F: __dxlog_file10,
2110
+ F: __dxlog_file11,
2075
2111
  L: 52
2076
2112
  });
2077
2113
  this._remoteOptionsTrigger = new import_async11.Trigger();
@@ -2092,7 +2128,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2092
2128
  InvitationHostService: {
2093
2129
  options: async (options) => {
2094
2130
  (0, import_invariant8.invariant)(!this._remoteOptions, "Remote options already set.", {
2095
- F: __dxlog_file10,
2131
+ F: __dxlog_file11,
2096
2132
  L: 101,
2097
2133
  S: this,
2098
2134
  A: [
@@ -2106,10 +2142,10 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2106
2142
  introduce: async (request) => {
2107
2143
  const { profile, invitationId } = request;
2108
2144
  const traceId = import_keys7.PublicKey.random().toHex();
2109
- import_log8.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols7.trace.begin({
2145
+ import_log9.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols7.trace.begin({
2110
2146
  id: traceId
2111
2147
  }), {
2112
- F: __dxlog_file10,
2148
+ F: __dxlog_file11,
2113
2149
  L: 110,
2114
2150
  S: this,
2115
2151
  C: (f, a) => f(...a)
@@ -2117,11 +2153,11 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2117
2153
  const invitation = this._requireActiveInvitation();
2118
2154
  this._assertInvitationState(import_services9.Invitation.State.CONNECTED);
2119
2155
  if (invitationId !== invitation?.invitationId) {
2120
- import_log8.log.warn("incorrect invitationId", {
2156
+ import_log9.log.warn("incorrect invitationId", {
2121
2157
  expected: invitation.invitationId,
2122
2158
  actual: invitationId
2123
2159
  }, {
2124
- F: __dxlog_file10,
2160
+ F: __dxlog_file11,
2125
2161
  L: 116,
2126
2162
  S: this,
2127
2163
  C: (f, a) => f(...a)
@@ -2132,10 +2168,10 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2132
2168
  authMethod: import_services9.Invitation.AuthMethod.NONE
2133
2169
  };
2134
2170
  }
2135
- (0, import_log8.log)("guest introduced themselves", {
2171
+ (0, import_log9.log)("guest introduced themselves", {
2136
2172
  guestProfile: profile
2137
2173
  }, {
2138
- F: __dxlog_file10,
2174
+ F: __dxlog_file11,
2139
2175
  L: 125,
2140
2176
  S: this,
2141
2177
  C: (f, a) => f(...a)
@@ -2143,10 +2179,10 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2143
2179
  this.guestProfile = profile;
2144
2180
  this._callbacks.onStateUpdate(import_services9.Invitation.State.READY_FOR_AUTHENTICATION);
2145
2181
  this._challenge = invitation.authMethod === import_services9.Invitation.AuthMethod.KNOWN_PUBLIC_KEY ? (0, import_crypto2.randomBytes)(32) : void 0;
2146
- import_log8.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols7.trace.end({
2182
+ import_log9.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols7.trace.end({
2147
2183
  id: traceId
2148
2184
  }), {
2149
- F: __dxlog_file10,
2185
+ F: __dxlog_file11,
2150
2186
  L: 132,
2151
2187
  S: this,
2152
2188
  C: (f, a) => f(...a)
@@ -2158,19 +2194,19 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2158
2194
  },
2159
2195
  authenticate: async ({ authCode: code, signedChallenge }) => {
2160
2196
  const traceId = import_keys7.PublicKey.random().toHex();
2161
- import_log8.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols7.trace.begin({
2197
+ import_log9.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols7.trace.begin({
2162
2198
  id: traceId
2163
2199
  }), {
2164
- F: __dxlog_file10,
2200
+ F: __dxlog_file11,
2165
2201
  L: 141,
2166
2202
  S: this,
2167
2203
  C: (f, a) => f(...a)
2168
2204
  });
2169
2205
  const invitation = this._requireActiveInvitation();
2170
- (0, import_log8.log)("received authentication request", {
2206
+ (0, import_log9.log)("received authentication request", {
2171
2207
  authCode: code
2172
2208
  }, {
2173
- F: __dxlog_file10,
2209
+ F: __dxlog_file11,
2174
2210
  L: 144,
2175
2211
  S: this,
2176
2212
  C: (f, a) => f(...a)
@@ -2183,8 +2219,8 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2183
2219
  this._callbacks.onStateUpdate(import_services9.Invitation.State.AUTHENTICATING);
2184
2220
  switch (invitation.authMethod) {
2185
2221
  case import_services9.Invitation.AuthMethod.NONE: {
2186
- (0, import_log8.log)("authentication not required", void 0, {
2187
- F: __dxlog_file10,
2222
+ (0, import_log9.log)("authentication not required", void 0, {
2223
+ F: __dxlog_file11,
2188
2224
  L: 152,
2189
2225
  S: this,
2190
2226
  C: (f, a) => f(...a)
@@ -2219,10 +2255,10 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2219
2255
  break;
2220
2256
  }
2221
2257
  default: {
2222
- import_log8.log.error("invalid authentication method", {
2258
+ import_log9.log.error("invalid authentication method", {
2223
2259
  authMethod: invitation.authMethod
2224
2260
  }, {
2225
- F: __dxlog_file10,
2261
+ F: __dxlog_file11,
2226
2262
  L: 190,
2227
2263
  S: this,
2228
2264
  C: (f, a) => f(...a)
@@ -2241,13 +2277,13 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2241
2277
  status
2242
2278
  };
2243
2279
  }
2244
- import_log8.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols7.trace.end({
2280
+ import_log9.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols7.trace.end({
2245
2281
  id: traceId,
2246
2282
  data: {
2247
2283
  status
2248
2284
  }
2249
2285
  }), {
2250
- F: __dxlog_file10,
2286
+ F: __dxlog_file11,
2251
2287
  L: 202,
2252
2288
  S: this,
2253
2289
  C: (f, a) => f(...a)
@@ -2258,10 +2294,10 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2258
2294
  },
2259
2295
  admit: async (request) => {
2260
2296
  const traceId = import_keys7.PublicKey.random().toHex();
2261
- import_log8.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols7.trace.begin({
2297
+ import_log9.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols7.trace.begin({
2262
2298
  id: traceId
2263
2299
  }), {
2264
- F: __dxlog_file10,
2300
+ F: __dxlog_file11,
2265
2301
  L: 208,
2266
2302
  S: this,
2267
2303
  C: (f, a) => f(...a)
@@ -2275,10 +2311,10 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2275
2311
  }
2276
2312
  }
2277
2313
  const response = await this._callbacks.admit(request);
2278
- import_log8.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols7.trace.end({
2314
+ import_log9.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols7.trace.end({
2279
2315
  id: traceId
2280
2316
  }), {
2281
- F: __dxlog_file10,
2317
+ F: __dxlog_file11,
2282
2318
  L: 222,
2283
2319
  S: this,
2284
2320
  C: (f, a) => f(...a)
@@ -2295,15 +2331,15 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2295
2331
  async onOpen(context) {
2296
2332
  await super.onOpen(context);
2297
2333
  try {
2298
- (0, import_log8.log)("host acquire lock", void 0, {
2299
- F: __dxlog_file10,
2334
+ (0, import_log9.log)("host acquire lock", void 0, {
2335
+ F: __dxlog_file11,
2300
2336
  L: 237,
2301
2337
  S: this,
2302
2338
  C: (f, a) => f(...a)
2303
2339
  });
2304
2340
  this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
2305
- (0, import_log8.log)("host lock acquired", void 0, {
2306
- F: __dxlog_file10,
2341
+ (0, import_log9.log)("host lock acquired", void 0, {
2342
+ F: __dxlog_file11,
2307
2343
  L: 239,
2308
2344
  S: this,
2309
2345
  C: (f, a) => f(...a)
@@ -2313,8 +2349,8 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2313
2349
  await this.rpc.InvitationHostService.options({
2314
2350
  role: import_invitations4.InvitationOptions.Role.HOST
2315
2351
  });
2316
- (0, import_log8.log)("options sent", void 0, {
2317
- F: __dxlog_file10,
2352
+ (0, import_log9.log)("options sent", void 0, {
2353
+ F: __dxlog_file11,
2318
2354
  L: 243,
2319
2355
  S: this,
2320
2356
  C: (f, a) => f(...a)
@@ -2322,8 +2358,8 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2322
2358
  await (0, import_context8.cancelWithContext)(this._ctx, this._remoteOptionsTrigger.wait({
2323
2359
  timeout: OPTIONS_TIMEOUT2
2324
2360
  }));
2325
- (0, import_log8.log)("options received", void 0, {
2326
- F: __dxlog_file10,
2361
+ (0, import_log9.log)("options received", void 0, {
2362
+ F: __dxlog_file11,
2327
2363
  L: 245,
2328
2364
  S: this,
2329
2365
  C: (f, a) => f(...a)
@@ -2376,8 +2412,8 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2376
2412
  if (this._invitationFlowLock != null) {
2377
2413
  this._invitationFlowLock?.release();
2378
2414
  this._invitationFlowLock = null;
2379
- (0, import_log8.log)("invitation flow lock released", void 0, {
2380
- F: __dxlog_file10,
2415
+ (0, import_log9.log)("invitation flow lock released", void 0, {
2416
+ F: __dxlog_file11,
2381
2417
  L: 300,
2382
2418
  S: this,
2383
2419
  C: (f, a) => f(...a)
@@ -2386,7 +2422,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2386
2422
  }
2387
2423
  };
2388
2424
  var isAuthenticationRequired = (invitation) => invitation.authMethod !== import_services9.Invitation.AuthMethod.NONE;
2389
- var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
2425
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
2390
2426
  var InvitationTopology = class {
2391
2427
  constructor(_role) {
2392
2428
  this._role = _role;
@@ -2394,7 +2430,7 @@ var InvitationTopology = class {
2394
2430
  }
2395
2431
  init(controller) {
2396
2432
  (0, import_invariant9.invariant)(!this._controller, "Already initialized.", {
2397
- F: __dxlog_file11,
2433
+ F: __dxlog_file12,
2398
2434
  L: 42,
2399
2435
  S: this,
2400
2436
  A: [
@@ -2406,7 +2442,7 @@ var InvitationTopology = class {
2406
2442
  }
2407
2443
  update() {
2408
2444
  (0, import_invariant9.invariant)(this._controller, "Not initialized.", {
2409
- F: __dxlog_file11,
2445
+ F: __dxlog_file12,
2410
2446
  L: 47,
2411
2447
  S: this,
2412
2448
  A: [
@@ -2425,11 +2461,11 @@ var InvitationTopology = class {
2425
2461
  const firstUnknownPeer = candidates.find((peerId) => !this._seenPeers.has(peerId));
2426
2462
  this._seenPeers = new import_util7.ComplexSet(import_keys8.PublicKey.hash, allPeers.filter((peerId) => this._seenPeers.has(peerId)));
2427
2463
  if (firstUnknownPeer != null) {
2428
- (0, import_log9.log)("invitation connect", {
2464
+ (0, import_log10.log)("invitation connect", {
2429
2465
  ownPeerId,
2430
2466
  remotePeerId: firstUnknownPeer
2431
2467
  }, {
2432
- F: __dxlog_file11,
2468
+ F: __dxlog_file12,
2433
2469
  L: 69,
2434
2470
  S: this,
2435
2471
  C: (f, a) => f(...a)
@@ -2440,7 +2476,7 @@ var InvitationTopology = class {
2440
2476
  }
2441
2477
  async onOffer(peer) {
2442
2478
  (0, import_invariant9.invariant)(this._controller, "Not initialized.", {
2443
- F: __dxlog_file11,
2479
+ F: __dxlog_file12,
2444
2480
  L: 76,
2445
2481
  S: this,
2446
2482
  A: [
@@ -2457,7 +2493,7 @@ var InvitationTopology = class {
2457
2493
  return `InvitationTopology(${this._role === import_invitations5.InvitationOptions.Role.GUEST ? "guest" : "host"})`;
2458
2494
  }
2459
2495
  };
2460
- var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2496
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2461
2497
  var metrics = import_tracing5.trace.metrics;
2462
2498
  var MAX_DELEGATED_INVITATION_HOST_TRIES = 3;
2463
2499
  var InvitationsHandler = class {
@@ -2484,7 +2520,7 @@ var InvitationsHandler = class {
2484
2520
  try {
2485
2521
  const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
2486
2522
  (0, import_invariant6.invariant)(deviceKey, void 0, {
2487
- F: __dxlog_file12,
2523
+ F: __dxlog_file13,
2488
2524
  L: 94,
2489
2525
  S: this,
2490
2526
  A: [
@@ -2510,18 +2546,18 @@ var InvitationsHandler = class {
2510
2546
  (0, import_async9.scheduleTask)(connectionCtx, async () => {
2511
2547
  const traceId = import_keys6.PublicKey.random().toHex();
2512
2548
  try {
2513
- import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.begin({
2549
+ import_log7.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.begin({
2514
2550
  id: traceId
2515
2551
  }), {
2516
- F: __dxlog_file12,
2552
+ F: __dxlog_file13,
2517
2553
  L: 119,
2518
2554
  S: this,
2519
2555
  C: (f, a) => f(...a)
2520
2556
  });
2521
- (0, import_log6.log)("connected", {
2557
+ (0, import_log7.log)("connected", {
2522
2558
  ...protocol.toJSON()
2523
2559
  }, {
2524
- F: __dxlog_file12,
2560
+ F: __dxlog_file13,
2525
2561
  L: 120,
2526
2562
  S: this,
2527
2563
  C: (f, a) => f(...a)
@@ -2529,21 +2565,21 @@ var InvitationsHandler = class {
2529
2565
  const deviceKey = await extension.completedTrigger.wait({
2530
2566
  timeout: invitation.timeout
2531
2567
  });
2532
- (0, import_log6.log)("admitted guest", {
2568
+ (0, import_log7.log)("admitted guest", {
2533
2569
  guest: deviceKey,
2534
2570
  ...protocol.toJSON()
2535
2571
  }, {
2536
- F: __dxlog_file12,
2572
+ F: __dxlog_file13,
2537
2573
  L: 122,
2538
2574
  S: this,
2539
2575
  C: (f, a) => f(...a)
2540
2576
  });
2541
2577
  guardedState.set(extension, import_services7.Invitation.State.SUCCESS);
2542
2578
  metrics.increment("dxos.invitation.success");
2543
- import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.end({
2579
+ import_log7.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.end({
2544
2580
  id: traceId
2545
2581
  }), {
2546
- F: __dxlog_file12,
2582
+ F: __dxlog_file13,
2547
2583
  L: 125,
2548
2584
  S: this,
2549
2585
  C: (f, a) => f(...a)
@@ -2556,10 +2592,10 @@ var InvitationsHandler = class {
2556
2592
  if (err instanceof import_async9.TimeoutError) {
2557
2593
  if (guardedState.set(extension, import_services7.Invitation.State.TIMEOUT)) {
2558
2594
  metrics.increment("dxos.invitation.timeout");
2559
- (0, import_log6.log)("timeout", {
2595
+ (0, import_log7.log)("timeout", {
2560
2596
  ...protocol.toJSON()
2561
2597
  }, {
2562
- F: __dxlog_file12,
2598
+ F: __dxlog_file13,
2563
2599
  L: 135,
2564
2600
  S: this,
2565
2601
  C: (f, a) => f(...a)
@@ -2568,19 +2604,19 @@ var InvitationsHandler = class {
2568
2604
  } else {
2569
2605
  if (guardedState.error(extension, err)) {
2570
2606
  metrics.increment("dxos.invitation.failed");
2571
- import_log6.log.error("failed", err, {
2572
- F: __dxlog_file12,
2607
+ import_log7.log.error("failed", err, {
2608
+ F: __dxlog_file13,
2573
2609
  L: 140,
2574
2610
  S: this,
2575
2611
  C: (f, a) => f(...a)
2576
2612
  });
2577
2613
  }
2578
2614
  }
2579
- import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.error({
2615
+ import_log7.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.error({
2580
2616
  id: traceId,
2581
2617
  error: err
2582
2618
  }), {
2583
- F: __dxlog_file12,
2619
+ F: __dxlog_file13,
2584
2620
  L: 143,
2585
2621
  S: this,
2586
2622
  C: (f, a) => f(...a)
@@ -2591,10 +2627,10 @@ var InvitationsHandler = class {
2591
2627
  },
2592
2628
  onError: (err) => {
2593
2629
  if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
2594
- (0, import_log6.log)("invalid role", {
2630
+ (0, import_log7.log)("invalid role", {
2595
2631
  ...err.context
2596
2632
  }, {
2597
- F: __dxlog_file12,
2633
+ F: __dxlog_file13,
2598
2634
  L: 151,
2599
2635
  S: this,
2600
2636
  C: (f, a) => f(...a)
@@ -2604,10 +2640,10 @@ var InvitationsHandler = class {
2604
2640
  if (err instanceof import_async9.TimeoutError) {
2605
2641
  if (guardedState.set(extension, import_services7.Invitation.State.TIMEOUT)) {
2606
2642
  metrics.increment("dxos.invitation.timeout");
2607
- (0, import_log6.log)("timeout", {
2643
+ (0, import_log7.log)("timeout", {
2608
2644
  err
2609
2645
  }, {
2610
- F: __dxlog_file12,
2646
+ F: __dxlog_file13,
2611
2647
  L: 157,
2612
2648
  S: this,
2613
2649
  C: (f, a) => f(...a)
@@ -2616,8 +2652,8 @@ var InvitationsHandler = class {
2616
2652
  } else {
2617
2653
  if (guardedState.error(extension, err)) {
2618
2654
  metrics.increment("dxos.invitation.failed");
2619
- import_log6.log.error("failed", err, {
2620
- F: __dxlog_file12,
2655
+ import_log7.log.error("failed", err, {
2656
+ F: __dxlog_file13,
2621
2657
  L: 162,
2622
2658
  S: this,
2623
2659
  C: (f, a) => f(...a)
@@ -2630,8 +2666,8 @@ var InvitationsHandler = class {
2630
2666
  };
2631
2667
  if (invitation.lifetime && invitation.created) {
2632
2668
  if (invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
2633
- import_log6.log.warn("invitation has already expired", void 0, {
2634
- F: __dxlog_file12,
2669
+ import_log7.log.warn("invitation has already expired", void 0, {
2670
+ F: __dxlog_file13,
2635
2671
  L: 173,
2636
2672
  S: this,
2637
2673
  C: (f, a) => f(...a)
@@ -2655,7 +2691,7 @@ var InvitationsHandler = class {
2655
2691
  const { timeout = import_client_protocol3.INVITATION_TIMEOUT } = invitation;
2656
2692
  if (deviceProfile) {
2657
2693
  (0, import_invariant6.invariant)(invitation.kind === import_services7.Invitation.Kind.DEVICE, "deviceProfile provided for non-device invitation", {
2658
- F: __dxlog_file12,
2694
+ F: __dxlog_file13,
2659
2695
  L: 207,
2660
2696
  S: this,
2661
2697
  A: [
@@ -2668,12 +2704,12 @@ var InvitationsHandler = class {
2668
2704
  const guardedState = this._createGuardedState(ctx, invitation, stream);
2669
2705
  const shouldCancelInvitationFlow = (extension) => {
2670
2706
  const isLockedByAnotherConnection = guardedState.mutex.isLocked() && !extension.hasFlowLock();
2671
- (0, import_log6.log)("should cancel invitation flow", {
2707
+ (0, import_log7.log)("should cancel invitation flow", {
2672
2708
  isLockedByAnotherConnection,
2673
2709
  invitationType: import_services7.Invitation.Type.DELEGATED,
2674
2710
  triedPeers: triedPeersIds.size
2675
2711
  }, {
2676
- F: __dxlog_file12,
2712
+ F: __dxlog_file13,
2677
2713
  L: 215,
2678
2714
  S: this,
2679
2715
  C: (f, a) => f(...a)
@@ -2696,11 +2732,11 @@ var InvitationsHandler = class {
2696
2732
  return;
2697
2733
  }
2698
2734
  connectionCtx.onDispose(async () => {
2699
- (0, import_log6.log)("extension disposed", {
2735
+ (0, import_log7.log)("extension disposed", {
2700
2736
  admitted,
2701
2737
  currentState: guardedState.current.state
2702
2738
  }, {
2703
- F: __dxlog_file12,
2739
+ F: __dxlog_file13,
2704
2740
  L: 243,
2705
2741
  S: this,
2706
2742
  C: (f, a) => f(...a)
@@ -2715,10 +2751,10 @@ var InvitationsHandler = class {
2715
2751
  (0, import_async9.scheduleTask)(connectionCtx, async () => {
2716
2752
  const traceId = import_keys6.PublicKey.random().toHex();
2717
2753
  try {
2718
- import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.begin({
2754
+ import_log7.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.begin({
2719
2755
  id: traceId
2720
2756
  }), {
2721
- F: __dxlog_file12,
2757
+ F: __dxlog_file13,
2722
2758
  L: 255,
2723
2759
  S: this,
2724
2760
  C: (f, a) => f(...a)
@@ -2727,19 +2763,19 @@ var InvitationsHandler = class {
2727
2763
  guardedState.set(extension, import_services7.Invitation.State.TIMEOUT);
2728
2764
  extensionCtx.close();
2729
2765
  }, timeout);
2730
- (0, import_log6.log)("connected", {
2766
+ (0, import_log7.log)("connected", {
2731
2767
  ...protocol.toJSON()
2732
2768
  }, {
2733
- F: __dxlog_file12,
2769
+ F: __dxlog_file13,
2734
2770
  L: 266,
2735
2771
  S: this,
2736
2772
  C: (f, a) => f(...a)
2737
2773
  });
2738
2774
  guardedState.set(extension, import_services7.Invitation.State.CONNECTED);
2739
- (0, import_log6.log)("introduce", {
2775
+ (0, import_log7.log)("introduce", {
2740
2776
  ...protocol.toJSON()
2741
2777
  }, {
2742
- F: __dxlog_file12,
2778
+ F: __dxlog_file13,
2743
2779
  L: 270,
2744
2780
  S: this,
2745
2781
  C: (f, a) => f(...a)
@@ -2748,11 +2784,11 @@ var InvitationsHandler = class {
2748
2784
  invitationId: invitation.invitationId,
2749
2785
  ...protocol.createIntroduction()
2750
2786
  });
2751
- (0, import_log6.log)("introduce response", {
2787
+ (0, import_log7.log)("introduce response", {
2752
2788
  ...protocol.toJSON(),
2753
2789
  response: introductionResponse
2754
2790
  }, {
2755
- F: __dxlog_file12,
2791
+ F: __dxlog_file13,
2756
2792
  L: 275,
2757
2793
  S: this,
2758
2794
  C: (f, a) => f(...a)
@@ -2770,10 +2806,10 @@ var InvitationsHandler = class {
2770
2806
  break;
2771
2807
  }
2772
2808
  }
2773
- (0, import_log6.log)("request admission", {
2809
+ (0, import_log7.log)("request admission", {
2774
2810
  ...protocol.toJSON()
2775
2811
  }, {
2776
- F: __dxlog_file12,
2812
+ F: __dxlog_file13,
2777
2813
  L: 301,
2778
2814
  S: this,
2779
2815
  C: (f, a) => f(...a)
@@ -2782,10 +2818,10 @@ var InvitationsHandler = class {
2782
2818
  const admissionResponse = await extension.rpc.InvitationHostService.admit(admissionRequest);
2783
2819
  admitted = true;
2784
2820
  const result = await protocol.accept(admissionResponse, admissionRequest);
2785
- (0, import_log6.log)("admitted by host", {
2821
+ (0, import_log7.log)("admitted by host", {
2786
2822
  ...protocol.toJSON()
2787
2823
  }, {
2788
- F: __dxlog_file12,
2824
+ F: __dxlog_file13,
2789
2825
  L: 312,
2790
2826
  S: this,
2791
2827
  C: (f, a) => f(...a)
@@ -2795,28 +2831,28 @@ var InvitationsHandler = class {
2795
2831
  ...result,
2796
2832
  state: import_services7.Invitation.State.SUCCESS
2797
2833
  });
2798
- import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.end({
2834
+ import_log7.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.end({
2799
2835
  id: traceId
2800
2836
  }), {
2801
- F: __dxlog_file12,
2837
+ F: __dxlog_file13,
2802
2838
  L: 318,
2803
2839
  S: this,
2804
2840
  C: (f, a) => f(...a)
2805
2841
  });
2806
2842
  } catch (err) {
2807
2843
  if (err instanceof import_async9.TimeoutError) {
2808
- (0, import_log6.log)("timeout", {
2844
+ (0, import_log7.log)("timeout", {
2809
2845
  ...protocol.toJSON()
2810
2846
  }, {
2811
- F: __dxlog_file12,
2847
+ F: __dxlog_file13,
2812
2848
  L: 321,
2813
2849
  S: this,
2814
2850
  C: (f, a) => f(...a)
2815
2851
  });
2816
2852
  guardedState.set(extension, import_services7.Invitation.State.TIMEOUT);
2817
2853
  } else {
2818
- (0, import_log6.log)("auth failed", err, {
2819
- F: __dxlog_file12,
2854
+ (0, import_log7.log)("auth failed", err, {
2855
+ F: __dxlog_file13,
2820
2856
  L: 324,
2821
2857
  S: this,
2822
2858
  C: (f, a) => f(...a)
@@ -2824,11 +2860,11 @@ var InvitationsHandler = class {
2824
2860
  guardedState.error(extension, err);
2825
2861
  }
2826
2862
  extensionCtx.close(err);
2827
- import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.error({
2863
+ import_log7.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.error({
2828
2864
  id: traceId,
2829
2865
  error: err
2830
2866
  }), {
2831
- F: __dxlog_file12,
2867
+ F: __dxlog_file13,
2832
2868
  L: 328,
2833
2869
  S: this,
2834
2870
  C: (f, a) => f(...a)
@@ -2841,18 +2877,18 @@ var InvitationsHandler = class {
2841
2877
  return;
2842
2878
  }
2843
2879
  if (err instanceof import_async9.TimeoutError) {
2844
- (0, import_log6.log)("timeout", {
2880
+ (0, import_log7.log)("timeout", {
2845
2881
  ...protocol.toJSON()
2846
2882
  }, {
2847
- F: __dxlog_file12,
2883
+ F: __dxlog_file13,
2848
2884
  L: 337,
2849
2885
  S: this,
2850
2886
  C: (f, a) => f(...a)
2851
2887
  });
2852
2888
  guardedState.set(extension, import_services7.Invitation.State.TIMEOUT);
2853
2889
  } else {
2854
- (0, import_log6.log)("auth failed", err, {
2855
- F: __dxlog_file12,
2890
+ (0, import_log7.log)("auth failed", err, {
2891
+ F: __dxlog_file13,
2856
2892
  L: 340,
2857
2893
  S: this,
2858
2894
  C: (f, a) => f(...a)
@@ -2870,7 +2906,7 @@ var InvitationsHandler = class {
2870
2906
  await ctx.dispose();
2871
2907
  } else {
2872
2908
  (0, import_invariant6.invariant)(invitation.swarmKey, void 0, {
2873
- F: __dxlog_file12,
2909
+ F: __dxlog_file13,
2874
2910
  L: 355,
2875
2911
  S: this,
2876
2912
  A: [
@@ -2972,23 +3008,23 @@ var InvitationsHandler = class {
2972
3008
  }
2973
3009
  _logStateUpdate(invitation, actor, newState) {
2974
3010
  if (this._isNotTerminal(newState)) {
2975
- (0, import_log6.log)("invitation state update", {
3011
+ (0, import_log7.log)("invitation state update", {
2976
3012
  actor: actor?.constructor.name,
2977
3013
  newState: stateToString(newState),
2978
3014
  oldState: stateToString(invitation.state)
2979
3015
  }, {
2980
- F: __dxlog_file12,
3016
+ F: __dxlog_file13,
2981
3017
  L: 460,
2982
3018
  S: this,
2983
3019
  C: (f, a) => f(...a)
2984
3020
  });
2985
3021
  } else {
2986
- import_log6.log.info("invitation state update", {
3022
+ import_log7.log.info("invitation state update", {
2987
3023
  actor: actor?.constructor.name,
2988
3024
  newState: stateToString(newState),
2989
3025
  oldState: stateToString(invitation.state)
2990
3026
  }, {
2991
- F: __dxlog_file12,
3027
+ F: __dxlog_file13,
2992
3028
  L: 466,
2993
3029
  S: this,
2994
3030
  C: (f, a) => f(...a)
@@ -3006,16 +3042,16 @@ var InvitationsHandler = class {
3006
3042
  }
3007
3043
  async _handleGuestOtpAuth(extension, setState, authenticated, options) {
3008
3044
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
3009
- (0, import_log6.log)("guest waiting for authentication code...", void 0, {
3010
- F: __dxlog_file12,
3045
+ (0, import_log7.log)("guest waiting for authentication code...", void 0, {
3046
+ F: __dxlog_file13,
3011
3047
  L: 491,
3012
3048
  S: this,
3013
3049
  C: (f, a) => f(...a)
3014
3050
  });
3015
3051
  setState(import_services7.Invitation.State.READY_FOR_AUTHENTICATION);
3016
3052
  const authCode = await authenticated.wait(options);
3017
- (0, import_log6.log)("sending authentication request", void 0, {
3018
- F: __dxlog_file12,
3053
+ (0, import_log7.log)("sending authentication request", void 0, {
3054
+ F: __dxlog_file13,
3019
3055
  L: 495,
3020
3056
  S: this,
3021
3057
  C: (f, a) => f(...a)
@@ -3031,10 +3067,10 @@ var InvitationsHandler = class {
3031
3067
  if (attempt === MAX_OTP_ATTEMPTS) {
3032
3068
  throw new Error(`Maximum retry attempts: ${MAX_OTP_ATTEMPTS}`);
3033
3069
  } else {
3034
- (0, import_log6.log)("retrying invalid code", {
3070
+ (0, import_log7.log)("retrying invalid code", {
3035
3071
  attempt
3036
3072
  }, {
3037
- F: __dxlog_file12,
3073
+ F: __dxlog_file13,
3038
3074
  L: 506,
3039
3075
  S: this,
3040
3076
  C: (f, a) => f(...a)
@@ -3051,8 +3087,8 @@ var InvitationsHandler = class {
3051
3087
  if (introductionResponse.challenge == null) {
3052
3088
  throw new Error("challenge missing in the introduction");
3053
3089
  }
3054
- (0, import_log6.log)("sending authentication request", void 0, {
3055
- F: __dxlog_file12,
3090
+ (0, import_log7.log)("sending authentication request", void 0, {
3091
+ F: __dxlog_file13,
3056
3092
  L: 525,
3057
3093
  S: this,
3058
3094
  C: (f, a) => f(...a)
@@ -3167,7 +3203,7 @@ var InvitationsServiceImpl = class {
3167
3203
  });
3168
3204
  }
3169
3205
  };
3170
- var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3206
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3171
3207
  var SpaceInvitationProtocol = class {
3172
3208
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
3173
3209
  this._spaceManager = _spaceManager;
@@ -3202,7 +3238,7 @@ var SpaceInvitationProtocol = class {
3202
3238
  }
3203
3239
  async admit(invitation, request, guestProfile) {
3204
3240
  (0, import_invariant10.invariant)(this._spaceKey && request.space, void 0, {
3205
- F: __dxlog_file13,
3241
+ F: __dxlog_file14,
3206
3242
  L: 74,
3207
3243
  S: this,
3208
3244
  A: [
@@ -3210,11 +3246,11 @@ var SpaceInvitationProtocol = class {
3210
3246
  ""
3211
3247
  ]
3212
3248
  });
3213
- (0, import_log10.log)("writing guest credentials", {
3249
+ (0, import_log11.log)("writing guest credentials", {
3214
3250
  host: this._signingContext.deviceKey,
3215
3251
  guest: request.space.deviceKey
3216
3252
  }, {
3217
- F: __dxlog_file13,
3253
+ F: __dxlog_file14,
3218
3254
  L: 75,
3219
3255
  S: this,
3220
3256
  C: (f, a) => f(...a)
@@ -3236,7 +3272,7 @@ var SpaceInvitationProtocol = class {
3236
3272
  }
3237
3273
  async delegate(invitation) {
3238
3274
  (0, import_invariant10.invariant)(this._spaceKey, void 0, {
3239
- F: __dxlog_file13,
3275
+ F: __dxlog_file14,
3240
3276
  L: 95,
3241
3277
  S: this,
3242
3278
  A: [
@@ -3246,7 +3282,7 @@ var SpaceInvitationProtocol = class {
3246
3282
  });
3247
3283
  const space = this._spaceManager.spaces.get(this._spaceKey);
3248
3284
  (0, import_invariant10.invariant)(space, void 0, {
3249
- F: __dxlog_file13,
3285
+ F: __dxlog_file14,
3250
3286
  L: 97,
3251
3287
  S: this,
3252
3288
  A: [
@@ -3256,7 +3292,7 @@ var SpaceInvitationProtocol = class {
3256
3292
  });
3257
3293
  if (invitation.authMethod === import_services11.Invitation.AuthMethod.KNOWN_PUBLIC_KEY) {
3258
3294
  (0, import_invariant10.invariant)(invitation.guestKeypair?.publicKey, void 0, {
3259
- F: __dxlog_file13,
3295
+ F: __dxlog_file14,
3260
3296
  L: 99,
3261
3297
  S: this,
3262
3298
  A: [
@@ -3265,11 +3301,11 @@ var SpaceInvitationProtocol = class {
3265
3301
  ]
3266
3302
  });
3267
3303
  }
3268
- (0, import_log10.log)("writing delegate space invitation", {
3304
+ (0, import_log11.log)("writing delegate space invitation", {
3269
3305
  host: this._signingContext.deviceKey,
3270
3306
  id: invitation.invitationId
3271
3307
  }, {
3272
- F: __dxlog_file13,
3308
+ F: __dxlog_file14,
3273
3309
  L: 102,
3274
3310
  S: this,
3275
3311
  C: (f, a) => f(...a)
@@ -3284,7 +3320,7 @@ var SpaceInvitationProtocol = class {
3284
3320
  guestKey: invitation.authMethod === import_services11.Invitation.AuthMethod.KNOWN_PUBLIC_KEY ? invitation.guestKeypair.publicKey : void 0
3285
3321
  });
3286
3322
  (0, import_invariant10.invariant)(credential.credential, void 0, {
3287
- F: __dxlog_file13,
3323
+ F: __dxlog_file14,
3288
3324
  L: 122,
3289
3325
  S: this,
3290
3326
  A: [
@@ -3299,7 +3335,7 @@ var SpaceInvitationProtocol = class {
3299
3335
  }
3300
3336
  async cancelDelegation(invitation) {
3301
3337
  (0, import_invariant10.invariant)(this._spaceKey, void 0, {
3302
- F: __dxlog_file13,
3338
+ F: __dxlog_file14,
3303
3339
  L: 128,
3304
3340
  S: this,
3305
3341
  A: [
@@ -3308,7 +3344,7 @@ var SpaceInvitationProtocol = class {
3308
3344
  ]
3309
3345
  });
3310
3346
  (0, import_invariant10.invariant)(invitation.type === import_services11.Invitation.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
3311
- F: __dxlog_file13,
3347
+ F: __dxlog_file14,
3312
3348
  L: 129,
3313
3349
  S: this,
3314
3350
  A: [
@@ -3318,7 +3354,7 @@ var SpaceInvitationProtocol = class {
3318
3354
  });
3319
3355
  const space = this._spaceManager.spaces.get(this._spaceKey);
3320
3356
  (0, import_invariant10.invariant)(space, void 0, {
3321
- F: __dxlog_file13,
3357
+ F: __dxlog_file14,
3322
3358
  L: 131,
3323
3359
  S: this,
3324
3360
  A: [
@@ -3326,18 +3362,18 @@ var SpaceInvitationProtocol = class {
3326
3362
  ""
3327
3363
  ]
3328
3364
  });
3329
- (0, import_log10.log)("cancelling delegated space invitation", {
3365
+ (0, import_log11.log)("cancelling delegated space invitation", {
3330
3366
  host: this._signingContext.deviceKey,
3331
3367
  id: invitation.invitationId
3332
3368
  }, {
3333
- F: __dxlog_file13,
3369
+ F: __dxlog_file14,
3334
3370
  L: 133,
3335
3371
  S: this,
3336
3372
  C: (f, a) => f(...a)
3337
3373
  });
3338
3374
  const credential = await (0, import_credentials9.createCancelDelegatedSpaceInvitationCredential)(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
3339
3375
  (0, import_invariant10.invariant)(credential.credential, void 0, {
3340
- F: __dxlog_file13,
3376
+ F: __dxlog_file14,
3341
3377
  L: 140,
3342
3378
  S: this,
3343
3379
  A: [
@@ -3376,7 +3412,7 @@ var SpaceInvitationProtocol = class {
3376
3412
  }
3377
3413
  async accept(response) {
3378
3414
  (0, import_invariant10.invariant)(response.space, void 0, {
3379
- F: __dxlog_file13,
3415
+ F: __dxlog_file14,
3380
3416
  L: 175,
3381
3417
  S: this,
3382
3418
  A: [
@@ -3387,7 +3423,7 @@ var SpaceInvitationProtocol = class {
3387
3423
  const { credential, controlTimeframe, dataTimeframe } = response.space;
3388
3424
  const assertion = (0, import_credentials9.getCredentialAssertion)(credential);
3389
3425
  (0, import_invariant10.invariant)(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
3390
- F: __dxlog_file13,
3426
+ F: __dxlog_file14,
3391
3427
  L: 178,
3392
3428
  S: this,
3393
3429
  A: [
@@ -3396,7 +3432,7 @@ var SpaceInvitationProtocol = class {
3396
3432
  ]
3397
3433
  });
3398
3434
  (0, import_invariant10.invariant)(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
3399
- F: __dxlog_file13,
3435
+ F: __dxlog_file14,
3400
3436
  L: 179,
3401
3437
  S: this,
3402
3438
  A: [
@@ -3419,7 +3455,7 @@ var SpaceInvitationProtocol = class {
3419
3455
  };
3420
3456
  }
3421
3457
  };
3422
- var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3458
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3423
3459
  var InvitationsManager = class {
3424
3460
  constructor(_invitationsHandler, _getHandler, _metadataStore) {
3425
3461
  this._invitationsHandler = _invitationsHandler;
@@ -3461,8 +3497,8 @@ var InvitationsManager = class {
3461
3497
  try {
3462
3498
  await this._persistIfRequired(handler, stream, invitation);
3463
3499
  } catch (err) {
3464
- import_log11.log.catch(err, void 0, {
3465
- F: __dxlog_file14,
3500
+ import_log12.log.catch(err, void 0, {
3501
+ F: __dxlog_file15,
3466
3502
  L: 82,
3467
3503
  S: this,
3468
3504
  C: (f, a) => f(...a)
@@ -3485,7 +3521,7 @@ var InvitationsManager = class {
3485
3521
  const freshInvitations = persistentInvitations.filter((invitation) => !(0, import_echo_pipeline.hasInvitationExpired)(invitation));
3486
3522
  const loadTasks = freshInvitations.map((persistentInvitation) => {
3487
3523
  (0, import_invariant11.invariant)(!this._createInvitations.get(persistentInvitation.invitationId), "invitation already exists", {
3488
- F: __dxlog_file14,
3524
+ F: __dxlog_file15,
3489
3525
  L: 103,
3490
3526
  S: this,
3491
3527
  A: [
@@ -3503,8 +3539,8 @@ var InvitationsManager = class {
3503
3539
  invitations: cInvitations.map((invitation) => invitation.get())
3504
3540
  };
3505
3541
  } catch (err) {
3506
- import_log11.log.catch(err, void 0, {
3507
- F: __dxlog_file14,
3542
+ import_log12.log.catch(err, void 0, {
3543
+ F: __dxlog_file15,
3508
3544
  L: 110,
3509
3545
  S: this,
3510
3546
  C: (f, a) => f(...a)
@@ -3535,14 +3571,14 @@ var InvitationsManager = class {
3535
3571
  return invitation;
3536
3572
  }
3537
3573
  async authenticate({ invitationId, authCode }) {
3538
- (0, import_log11.log)("authenticating...", void 0, {
3539
- F: __dxlog_file14,
3574
+ (0, import_log12.log)("authenticating...", void 0, {
3575
+ F: __dxlog_file15,
3540
3576
  L: 140,
3541
3577
  S: this,
3542
3578
  C: (f, a) => f(...a)
3543
3579
  });
3544
3580
  (0, import_invariant11.invariant)(invitationId, void 0, {
3545
- F: __dxlog_file14,
3581
+ F: __dxlog_file15,
3546
3582
  L: 141,
3547
3583
  S: this,
3548
3584
  A: [
@@ -3552,10 +3588,10 @@ var InvitationsManager = class {
3552
3588
  });
3553
3589
  const observable = this._acceptInvitations.get(invitationId);
3554
3590
  if (!observable) {
3555
- import_log11.log.warn("invalid invitation", {
3591
+ import_log12.log.warn("invalid invitation", {
3556
3592
  invitationId
3557
3593
  }, {
3558
- F: __dxlog_file14,
3594
+ F: __dxlog_file15,
3559
3595
  L: 144,
3560
3596
  S: this,
3561
3597
  C: (f, a) => f(...a)
@@ -3565,16 +3601,16 @@ var InvitationsManager = class {
3565
3601
  }
3566
3602
  }
3567
3603
  async cancelInvitation({ invitationId }) {
3568
- (0, import_log11.log)("cancelInvitation...", {
3604
+ (0, import_log12.log)("cancelInvitation...", {
3569
3605
  invitationId
3570
3606
  }, {
3571
- F: __dxlog_file14,
3607
+ F: __dxlog_file15,
3572
3608
  L: 151,
3573
3609
  S: this,
3574
3610
  C: (f, a) => f(...a)
3575
3611
  });
3576
3612
  (0, import_invariant11.invariant)(invitationId, void 0, {
3577
- F: __dxlog_file14,
3613
+ F: __dxlog_file15,
3578
3614
  L: 152,
3579
3615
  S: this,
3580
3616
  A: [
@@ -3649,14 +3685,14 @@ var InvitationsManager = class {
3649
3685
  void ctx.dispose();
3650
3686
  }
3651
3687
  }, {
3652
- F: __dxlog_file14,
3688
+ F: __dxlog_file15,
3653
3689
  L: 234
3654
3690
  });
3655
3691
  ctx.onDispose(() => {
3656
- (0, import_log11.log)("complete", {
3692
+ (0, import_log12.log)("complete", {
3657
3693
  ...handler.toJSON()
3658
3694
  }, {
3659
- F: __dxlog_file14,
3695
+ F: __dxlog_file15,
3660
3696
  L: 241,
3661
3697
  S: this,
3662
3698
  C: (f, a) => f(...a)
@@ -3686,10 +3722,10 @@ var InvitationsManager = class {
3686
3722
  const ctx = new import_context9.Context({
3687
3723
  onError: (err) => {
3688
3724
  if (err instanceof import_async12.TimeoutError) {
3689
- (0, import_log11.log)("timeout", {
3725
+ (0, import_log12.log)("timeout", {
3690
3726
  ...handler.toJSON()
3691
3727
  }, {
3692
- F: __dxlog_file14,
3728
+ F: __dxlog_file15,
3693
3729
  L: 261,
3694
3730
  S: this,
3695
3731
  C: (f, a) => f(...a)
@@ -3699,8 +3735,8 @@ var InvitationsManager = class {
3699
3735
  state: import_services12.Invitation.State.TIMEOUT
3700
3736
  });
3701
3737
  } else {
3702
- import_log11.log.warn("auth failed", err, {
3703
- F: __dxlog_file14,
3738
+ import_log12.log.warn("auth failed", err, {
3739
+ F: __dxlog_file15,
3704
3740
  L: 264,
3705
3741
  S: this,
3706
3742
  C: (f, a) => f(...a)
@@ -3713,14 +3749,14 @@ var InvitationsManager = class {
3713
3749
  void ctx.dispose();
3714
3750
  }
3715
3751
  }, {
3716
- F: __dxlog_file14,
3752
+ F: __dxlog_file15,
3717
3753
  L: 258
3718
3754
  });
3719
3755
  ctx.onDispose(() => {
3720
- (0, import_log11.log)("complete", {
3756
+ (0, import_log12.log)("complete", {
3721
3757
  ...handler.toJSON()
3722
3758
  }, {
3723
- F: __dxlog_file14,
3759
+ F: __dxlog_file15,
3724
3760
  L: 271,
3725
3761
  S: this,
3726
3762
  C: (f, a) => f(...a)
@@ -3764,8 +3800,8 @@ var InvitationsManager = class {
3764
3800
  try {
3765
3801
  await this._metadataStore.removeInvitation(invitation.invitationId);
3766
3802
  } catch (err) {
3767
- import_log11.log.catch(err, void 0, {
3768
- F: __dxlog_file14,
3803
+ import_log12.log.catch(err, void 0, {
3804
+ F: __dxlog_file15,
3769
3805
  L: 307,
3770
3806
  S: this,
3771
3807
  C: (f, a) => f(...a)
@@ -3788,7 +3824,7 @@ function _ts_decorate3(decorators, target, key, desc) {
3788
3824
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3789
3825
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3790
3826
  }
3791
- var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
3827
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
3792
3828
  var Lock = class {
3793
3829
  constructor({ lockKey: lockPath, onAcquire, onRelease }) {
3794
3830
  this._lockPath = lockPath;
@@ -3799,16 +3835,16 @@ var Lock = class {
3799
3835
  return this._lockPath;
3800
3836
  }
3801
3837
  async acquire() {
3802
- (0, import_log12.log)("acquiring lock...", void 0, {
3803
- F: __dxlog_file15,
3838
+ (0, import_log13.log)("acquiring lock...", void 0, {
3839
+ F: __dxlog_file16,
3804
3840
  L: 32,
3805
3841
  S: this,
3806
3842
  C: (f, a) => f(...a)
3807
3843
  });
3808
3844
  this._fileHandle = await import_lock_file.LockFile.acquire(this._lockPath);
3809
3845
  await this._onAcquire?.();
3810
- (0, import_log12.log)("acquired lock", void 0, {
3811
- F: __dxlog_file15,
3846
+ (0, import_log13.log)("acquired lock", void 0, {
3847
+ F: __dxlog_file16,
3812
3848
  L: 37,
3813
3849
  S: this,
3814
3850
  C: (f, a) => f(...a)
@@ -3817,7 +3853,7 @@ var Lock = class {
3817
3853
  async release() {
3818
3854
  await this._onRelease?.();
3819
3855
  (0, import_invariant12.invariant)(this._fileHandle, "Lock is not acquired", {
3820
- F: __dxlog_file15,
3856
+ F: __dxlog_file16,
3821
3857
  L: 42,
3822
3858
  S: this,
3823
3859
  A: [
@@ -3829,7 +3865,7 @@ var Lock = class {
3829
3865
  }
3830
3866
  };
3831
3867
  _ts_decorate3([
3832
- import_log12.logInfo
3868
+ import_log13.logInfo
3833
3869
  ], Lock.prototype, "lockKey", null);
3834
3870
  var isLocked = (lockPath) => import_lock_file.LockFile.isLocked(lockPath);
3835
3871
  function _ts_decorate4(decorators, target, key, desc) {
@@ -3970,7 +4006,7 @@ function _using_ctx() {
3970
4006
  }
3971
4007
  };
3972
4008
  }
3973
- var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/edge-feed-replicator.ts";
4009
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/edge-feed-replicator.ts";
3974
4010
  var EdgeFeedReplicator = class extends import_context10.Resource {
3975
4011
  constructor({ messenger, spaceId }) {
3976
4012
  super();
@@ -3993,11 +4029,11 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
3993
4029
  }
3994
4030
  const [spaceId] = rest;
3995
4031
  if (spaceId !== this._spaceId) {
3996
- (0, import_log13.log)("spaceID mismatch", {
4032
+ (0, import_log14.log)("spaceID mismatch", {
3997
4033
  spaceId,
3998
4034
  _spaceId: this._spaceId
3999
4035
  }, {
4000
- F: __dxlog_file16,
4036
+ F: __dxlog_file17,
4001
4037
  L: 62,
4002
4038
  S: this,
4003
4039
  C: (f, a) => f(...a)
@@ -4005,11 +4041,11 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4005
4041
  return;
4006
4042
  }
4007
4043
  const payload = (0, import_cbor_x.decode)(message.payload.value);
4008
- import_log13.log.info("recv", {
4044
+ import_log14.log.info("recv", {
4009
4045
  from: message.source,
4010
4046
  payload
4011
4047
  }, {
4012
- F: __dxlog_file16,
4048
+ F: __dxlog_file17,
4013
4049
  L: 67,
4014
4050
  S: this,
4015
4051
  C: (f, a) => f(...a)
@@ -4030,10 +4066,10 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4030
4066
  this._remoteLength.clear();
4031
4067
  }
4032
4068
  async addFeed(feed) {
4033
- import_log13.log.info("addFeed", {
4069
+ import_log14.log.info("addFeed", {
4034
4070
  key: feed.key
4035
4071
  }, {
4036
- F: __dxlog_file16,
4072
+ F: __dxlog_file17,
4037
4073
  L: 89,
4038
4074
  S: this,
4039
4075
  C: (f, a) => f(...a)
@@ -4048,7 +4084,7 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4048
4084
  }
4049
4085
  async _replicateFeed(feed) {
4050
4086
  (0, import_invariant13.invariant)(this._connectionCtx, void 0, {
4051
- F: __dxlog_file16,
4087
+ F: __dxlog_file17,
4052
4088
  L: 102,
4053
4089
  S: this,
4054
4090
  A: [
@@ -4065,16 +4101,16 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4065
4101
  });
4066
4102
  }
4067
4103
  async _sendMessage(message) {
4068
- import_log13.log.info("sending message", {
4104
+ import_log14.log.info("sending message", {
4069
4105
  message
4070
4106
  }, {
4071
- F: __dxlog_file16,
4107
+ F: __dxlog_file17,
4072
4108
  L: 115,
4073
4109
  S: this,
4074
4110
  C: (f, a) => f(...a)
4075
4111
  });
4076
4112
  (0, import_invariant13.invariant)(message.feedKey, void 0, {
4077
- F: __dxlog_file16,
4113
+ F: __dxlog_file17,
4078
4114
  L: 117,
4079
4115
  S: this,
4080
4116
  A: [
@@ -4085,8 +4121,8 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4085
4121
  const payloadValue = (0, import_util8.bufferToArray)((0, import_cbor_x.encode)(message));
4086
4122
  await this._messenger.send(import_buf.buf.create(import_messenger_pb.MessageSchema, {
4087
4123
  source: {
4088
- identityKey: this._messenger.identityKey.toHex(),
4089
- peerKey: this._messenger.deviceKey.toHex()
4124
+ identityKey: this._messenger.identityKey,
4125
+ peerKey: this._messenger.peerKey
4090
4126
  },
4091
4127
  serviceId: `${import_protocols9.EdgeService.FEED_REPLICATOR}:${this._spaceId}`,
4092
4128
  payload: {
@@ -4095,10 +4131,10 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4095
4131
  }));
4096
4132
  }
4097
4133
  _onMessage(message) {
4098
- import_log13.log.info("received message", {
4134
+ import_log14.log.info("received message", {
4099
4135
  message
4100
4136
  }, {
4101
- F: __dxlog_file16,
4137
+ F: __dxlog_file17,
4102
4138
  L: 133,
4103
4139
  S: this,
4104
4140
  C: (f, a) => f(...a)
@@ -4111,10 +4147,10 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4111
4147
  const feedKey = import_keys10.PublicKey.fromHex(message.feedKey);
4112
4148
  const feed = this._feeds.get(feedKey);
4113
4149
  if (!feed) {
4114
- import_log13.log.warn("Feed not found", {
4150
+ import_log14.log.warn("Feed not found", {
4115
4151
  feedKey
4116
4152
  }, {
4117
- F: __dxlog_file16,
4153
+ F: __dxlog_file17,
4118
4154
  L: 141,
4119
4155
  S: this,
4120
4156
  C: (f, a) => f(...a)
@@ -4146,10 +4182,10 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4146
4182
  const feedKey = import_keys10.PublicKey.fromHex(message.feedKey);
4147
4183
  const feed = this._feeds.get(feedKey);
4148
4184
  if (!feed) {
4149
- import_log13.log.warn("Feed not found", {
4185
+ import_log14.log.warn("Feed not found", {
4150
4186
  feedKey
4151
4187
  }, {
4152
- F: __dxlog_file16,
4188
+ F: __dxlog_file17,
4153
4189
  L: 166,
4154
4190
  S: this,
4155
4191
  C: (f, a) => f(...a)
@@ -4160,10 +4196,10 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4160
4196
  break;
4161
4197
  }
4162
4198
  default: {
4163
- import_log13.log.warn("Unknown message", {
4199
+ import_log14.log.warn("Unknown message", {
4164
4200
  ...message
4165
4201
  }, {
4166
- F: __dxlog_file16,
4202
+ F: __dxlog_file17,
4167
4203
  L: 175,
4168
4204
  S: this,
4169
4205
  C: (f, a) => f(...a)
@@ -4173,12 +4209,12 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4173
4209
  });
4174
4210
  }
4175
4211
  async _pushBlocks(feed, from, to) {
4176
- import_log13.log.info("pushing blocks", {
4212
+ import_log14.log.info("pushing blocks", {
4177
4213
  feed: feed.key.toHex(),
4178
4214
  from,
4179
4215
  to
4180
4216
  }, {
4181
- F: __dxlog_file16,
4217
+ F: __dxlog_file17,
4182
4218
  L: 182,
4183
4219
  S: this,
4184
4220
  C: (f, a) => f(...a)
@@ -4188,7 +4224,7 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4188
4224
  valueEncoding: "binary"
4189
4225
  });
4190
4226
  (0, import_invariant13.invariant)(data instanceof Uint8Array, void 0, {
4191
- F: __dxlog_file16,
4227
+ F: __dxlog_file17,
4192
4228
  L: 187,
4193
4229
  S: this,
4194
4230
  A: [
@@ -4212,11 +4248,11 @@ var EdgeFeedReplicator = class extends import_context10.Resource {
4212
4248
  this._remoteLength.set(feed.key, to);
4213
4249
  }
4214
4250
  async _integrateBlocks(feed, blocks) {
4215
- import_log13.log.info("integrating blocks", {
4251
+ import_log14.log.info("integrating blocks", {
4216
4252
  feed: feed.key.toHex(),
4217
4253
  blocks: blocks.length
4218
4254
  }, {
4219
- F: __dxlog_file16,
4255
+ F: __dxlog_file17,
4220
4256
  L: 208,
4221
4257
  S: this,
4222
4258
  C: (f, a) => f(...a)
@@ -4300,7 +4336,7 @@ var AutomergeSpaceState = class extends import_context12.Resource {
4300
4336
  await this.onNewEpoch.waitForCondition(() => !!this.lastEpoch);
4301
4337
  }
4302
4338
  };
4303
- var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
4339
+ var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
4304
4340
  var LOAD_DOC_TIMEOUT = 1e4;
4305
4341
  var runEpochMigration = async (ctx, context) => {
4306
4342
  switch (context.migration) {
@@ -4325,8 +4361,8 @@ var runEpochMigration = async (ctx, context) => {
4325
4361
  };
4326
4362
  }
4327
4363
  case import_services14.CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT: {
4328
- import_log15.log.info("Fragmenting", void 0, {
4329
- F: __dxlog_file17,
4364
+ import_log16.log.info("Fragmenting", void 0, {
4365
+ F: __dxlog_file18,
4330
4366
  L: 64,
4331
4367
  S: void 0,
4332
4368
  C: (f, a) => f(...a)
@@ -4339,7 +4375,7 @@ var runEpochMigration = async (ctx, context) => {
4339
4375
  const properties = (0, import_echo_db.findInlineObjectOfType)(rootHandle.docSync(), import_echo_schema.TYPE_PROPERTIES);
4340
4376
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
4341
4377
  (0, import_invariant15.invariant)(properties, "Properties not found", {
4342
- F: __dxlog_file17,
4378
+ F: __dxlog_file18,
4343
4379
  L: 75,
4344
4380
  S: void 0,
4345
4381
  A: [
@@ -4354,7 +4390,7 @@ var runEpochMigration = async (ctx, context) => {
4354
4390
  ])
4355
4391
  });
4356
4392
  (0, import_invariant15.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
4357
- F: __dxlog_file17,
4393
+ F: __dxlog_file18,
4358
4394
  L: 82,
4359
4395
  S: void 0,
4360
4396
  A: [
@@ -4395,7 +4431,7 @@ var runEpochMigration = async (ctx, context) => {
4395
4431
  timeout: LOAD_DOC_TIMEOUT
4396
4432
  });
4397
4433
  (0, import_invariant15.invariant)(rootHandle.docSync(), "Root doc not found", {
4398
- F: __dxlog_file17,
4434
+ F: __dxlog_file18,
4399
4435
  L: 115,
4400
4436
  S: void 0,
4401
4437
  A: [
@@ -4410,7 +4446,7 @@ var runEpochMigration = async (ctx, context) => {
4410
4446
  timeout: LOAD_DOC_TIMEOUT
4411
4447
  });
4412
4448
  (0, import_invariant15.invariant)(handle.docSync(), void 0, {
4413
- F: __dxlog_file17,
4449
+ F: __dxlog_file18,
4414
4450
  L: 122,
4415
4451
  S: void 0,
4416
4452
  A: [
@@ -4425,12 +4461,12 @@ var runEpochMigration = async (ctx, context) => {
4425
4461
  });
4426
4462
  newRootContent.links[id] = newHandle.url;
4427
4463
  } catch (err) {
4428
- import_log15.log.warn("Failed to migrate reference", {
4464
+ import_log16.log.warn("Failed to migrate reference", {
4429
4465
  id,
4430
4466
  url,
4431
4467
  error: err
4432
4468
  }, {
4433
- F: __dxlog_file17,
4469
+ F: __dxlog_file18,
4434
4470
  L: 128,
4435
4471
  S: void 0,
4436
4472
  C: (f, a) => f(...a)
@@ -4449,7 +4485,7 @@ var runEpochMigration = async (ctx, context) => {
4449
4485
  }
4450
4486
  case import_services14.CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT: {
4451
4487
  (0, import_invariant15.invariant)(context.newAutomergeRoot, void 0, {
4452
- F: __dxlog_file17,
4488
+ F: __dxlog_file18,
4453
4489
  L: 143,
4454
4490
  S: void 0,
4455
4491
  A: [
@@ -4465,7 +4501,7 @@ var runEpochMigration = async (ctx, context) => {
4465
4501
  }
4466
4502
  return {};
4467
4503
  };
4468
- var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
4504
+ var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
4469
4505
  var DEFAULT_RETRY_TIMEOUT = 1e3;
4470
4506
  var DEFAULT_SUCCESS_DELAY = 1e3;
4471
4507
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
@@ -4473,7 +4509,7 @@ var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
4473
4509
  var NotarizationPlugin = class {
4474
4510
  constructor() {
4475
4511
  this._ctx = new import_context13.Context(void 0, {
4476
- F: __dxlog_file18,
4512
+ F: __dxlog_file19,
4477
4513
  L: 62
4478
4514
  });
4479
4515
  this._extensionOpened = new import_async16.Event();
@@ -4493,16 +4529,16 @@ var NotarizationPlugin = class {
4493
4529
  * Request credentials to be notarized.
4494
4530
  */
4495
4531
  async notarize({ ctx: opCtx, credentials, timeout = DEFAULT_NOTARIZE_TIMEOUT, retryTimeout = DEFAULT_RETRY_TIMEOUT, successDelay = DEFAULT_SUCCESS_DELAY }) {
4496
- (0, import_log16.log)("notarize", {
4532
+ (0, import_log17.log)("notarize", {
4497
4533
  credentials
4498
4534
  }, {
4499
- F: __dxlog_file18,
4535
+ F: __dxlog_file19,
4500
4536
  L: 90,
4501
4537
  S: this,
4502
4538
  C: (f, a) => f(...a)
4503
4539
  });
4504
4540
  (0, import_invariant16.invariant)(credentials.every((credential) => credential.id), "Credentials must have an id", {
4505
- F: __dxlog_file18,
4541
+ F: __dxlog_file19,
4506
4542
  L: 91,
4507
4543
  S: this,
4508
4544
  A: [
@@ -4513,10 +4549,10 @@ var NotarizationPlugin = class {
4513
4549
  const errors = new import_async16.Trigger();
4514
4550
  const ctx = this._ctx.derive({
4515
4551
  onError: (err) => {
4516
- import_log16.log.warn("Notarization error", {
4552
+ import_log17.log.warn("Notarization error", {
4517
4553
  err
4518
4554
  }, {
4519
- F: __dxlog_file18,
4555
+ F: __dxlog_file19,
4520
4556
  L: 99,
4521
4557
  S: this,
4522
4558
  C: (f, a) => f(...a)
@@ -4528,11 +4564,11 @@ var NotarizationPlugin = class {
4528
4564
  opCtx?.onDispose(() => ctx.dispose());
4529
4565
  if (timeout !== 0) {
4530
4566
  (0, import_async16.scheduleTask)(ctx, () => {
4531
- import_log16.log.warn("Notarization timeout", {
4567
+ import_log17.log.warn("Notarization timeout", {
4532
4568
  timeout,
4533
4569
  peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
4534
4570
  }, {
4535
- F: __dxlog_file18,
4571
+ F: __dxlog_file19,
4536
4572
  L: 111,
4537
4573
  S: this,
4538
4574
  C: (f, a) => f(...a)
@@ -4552,10 +4588,10 @@ var NotarizationPlugin = class {
4552
4588
  ...this._extensions
4553
4589
  ].find((peer2) => !peersTried.has(peer2));
4554
4590
  if (!peer) {
4555
- import_log16.log.info("Exhausted all peers to notarize with", {
4591
+ import_log17.log.info("Exhausted all peers to notarize with", {
4556
4592
  retryIn: retryTimeout
4557
4593
  }, {
4558
- F: __dxlog_file18,
4594
+ F: __dxlog_file19,
4559
4595
  L: 136,
4560
4596
  S: this,
4561
4597
  C: (f, a) => f(...a)
@@ -4565,11 +4601,11 @@ var NotarizationPlugin = class {
4565
4601
  return;
4566
4602
  }
4567
4603
  peersTried.add(peer);
4568
- (0, import_log16.log)("try notarizing", {
4604
+ (0, import_log17.log)("try notarizing", {
4569
4605
  peer: peer.localPeerId,
4570
4606
  credentialId: credentials.map((credential) => credential.id)
4571
4607
  }, {
4572
- F: __dxlog_file18,
4608
+ F: __dxlog_file19,
4573
4609
  L: 143,
4574
4610
  S: this,
4575
4611
  C: (f, a) => f(...a)
@@ -4577,8 +4613,8 @@ var NotarizationPlugin = class {
4577
4613
  await peer.rpc.NotarizationService.notarize({
4578
4614
  credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
4579
4615
  });
4580
- (0, import_log16.log)("success", void 0, {
4581
- F: __dxlog_file18,
4616
+ (0, import_log17.log)("success", void 0, {
4617
+ F: __dxlog_file19,
4582
4618
  L: 147,
4583
4619
  S: this,
4584
4620
  C: (f, a) => f(...a)
@@ -4586,8 +4622,8 @@ var NotarizationPlugin = class {
4586
4622
  await (0, import_async16.sleep)(successDelay);
4587
4623
  } catch (err) {
4588
4624
  if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
4589
- import_log16.log.info("error notarizing (recoverable)", err, {
4590
- F: __dxlog_file18,
4625
+ import_log17.log.info("error notarizing (recoverable)", err, {
4626
+ F: __dxlog_file19,
4591
4627
  L: 151,
4592
4628
  S: this,
4593
4629
  C: (f, a) => f(...a)
@@ -4604,8 +4640,8 @@ var NotarizationPlugin = class {
4604
4640
  allNotarized,
4605
4641
  errors.wait()
4606
4642
  ]);
4607
- (0, import_log16.log)("done", void 0, {
4608
- F: __dxlog_file18,
4643
+ (0, import_log17.log)("done", void 0, {
4644
+ F: __dxlog_file19,
4609
4645
  L: 162,
4610
4646
  S: this,
4611
4647
  C: (f, a) => f(...a)
@@ -4627,7 +4663,7 @@ var NotarizationPlugin = class {
4627
4663
  }
4628
4664
  setWriter(writer) {
4629
4665
  (0, import_invariant16.invariant)(!this._writer, "Writer already set.", {
4630
- F: __dxlog_file18,
4666
+ F: __dxlog_file19,
4631
4667
  L: 181,
4632
4668
  S: this,
4633
4669
  A: [
@@ -4652,7 +4688,7 @@ var NotarizationPlugin = class {
4652
4688
  }
4653
4689
  for (const credential of request.credentials ?? []) {
4654
4690
  (0, import_invariant16.invariant)(credential.id, "Credential must have an id", {
4655
- F: __dxlog_file18,
4691
+ F: __dxlog_file19,
4656
4692
  L: 200,
4657
4693
  S: this,
4658
4694
  A: [
@@ -4669,10 +4705,10 @@ var NotarizationPlugin = class {
4669
4705
  createExtension() {
4670
4706
  const extension = new NotarizationTeleportExtension({
4671
4707
  onOpen: async () => {
4672
- (0, import_log16.log)("extension opened", {
4708
+ (0, import_log17.log)("extension opened", {
4673
4709
  peer: extension.localPeerId
4674
4710
  }, {
4675
- F: __dxlog_file18,
4711
+ F: __dxlog_file19,
4676
4712
  L: 211,
4677
4713
  S: this,
4678
4714
  C: (f, a) => f(...a)
@@ -4681,10 +4717,10 @@ var NotarizationPlugin = class {
4681
4717
  this._extensionOpened.emit();
4682
4718
  },
4683
4719
  onClose: async () => {
4684
- (0, import_log16.log)("extension closed", {
4720
+ (0, import_log17.log)("extension closed", {
4685
4721
  peer: extension.localPeerId
4686
4722
  }, {
4687
- F: __dxlog_file18,
4723
+ F: __dxlog_file19,
4688
4724
  L: 216,
4689
4725
  S: this,
4690
4726
  C: (f, a) => f(...a)
@@ -4799,11 +4835,11 @@ function _using_ctx2() {
4799
4835
  }
4800
4836
  };
4801
4837
  }
4802
- var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4838
+ var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4803
4839
  var DataSpace = class {
4804
4840
  constructor(params) {
4805
4841
  this._ctx = new import_context11.Context(void 0, {
4806
- F: __dxlog_file19,
4842
+ F: __dxlog_file20,
4807
4843
  L: 89
4808
4844
  });
4809
4845
  this._notarizationPlugin = new NotarizationPlugin();
@@ -4844,10 +4880,10 @@ var DataSpace = class {
4844
4880
  });
4845
4881
  }
4846
4882
  this._state = params.initialState;
4847
- (0, import_log14.log)("new state", {
4883
+ (0, import_log15.log)("new state", {
4848
4884
  state: import_services13.SpaceState[this._state]
4849
4885
  }, {
4850
- F: __dxlog_file19,
4886
+ F: __dxlog_file20,
4851
4887
  L: 159,
4852
4888
  S: this,
4853
4889
  C: (f, a) => f(...a)
@@ -4906,15 +4942,15 @@ var DataSpace = class {
4906
4942
  this.inner.protocol.feedAdded.append(this._onFeedAdded);
4907
4943
  }
4908
4944
  await this._inner.open(new import_context11.Context(void 0, {
4909
- F: __dxlog_file19,
4945
+ F: __dxlog_file20,
4910
4946
  L: 233
4911
4947
  }));
4912
4948
  await this._edgeFeedReplicator?.open();
4913
4949
  this._state = import_services13.SpaceState.SPACE_CONTROL_ONLY;
4914
- (0, import_log14.log)("new state", {
4950
+ (0, import_log15.log)("new state", {
4915
4951
  state: import_services13.SpaceState[this._state]
4916
4952
  }, {
4917
- F: __dxlog_file19,
4953
+ F: __dxlog_file20,
4918
4954
  L: 238,
4919
4955
  S: this,
4920
4956
  C: (f, a) => f(...a)
@@ -4931,17 +4967,17 @@ var DataSpace = class {
4931
4967
  await this._callbacks.beforeClose?.();
4932
4968
  await this.preClose.callSerial();
4933
4969
  this._state = import_services13.SpaceState.SPACE_CLOSED;
4934
- (0, import_log14.log)("new state", {
4970
+ (0, import_log15.log)("new state", {
4935
4971
  state: import_services13.SpaceState[this._state]
4936
4972
  }, {
4937
- F: __dxlog_file19,
4973
+ F: __dxlog_file20,
4938
4974
  L: 257,
4939
4975
  S: this,
4940
4976
  C: (f, a) => f(...a)
4941
4977
  });
4942
4978
  await this._ctx.dispose();
4943
4979
  this._ctx = new import_context11.Context(void 0, {
4944
- F: __dxlog_file19,
4980
+ F: __dxlog_file20,
4945
4981
  L: 259
4946
4982
  });
4947
4983
  if (this._edgeFeedReplicator) {
@@ -4973,25 +5009,25 @@ var DataSpace = class {
4973
5009
  await this.initializeDataPipeline();
4974
5010
  } catch (err) {
4975
5011
  if (err instanceof import_protocols10.CancelledError || err instanceof import_context11.ContextDisposedError) {
4976
- (0, import_log14.log)("data pipeline initialization cancelled", err, {
4977
- F: __dxlog_file19,
5012
+ (0, import_log15.log)("data pipeline initialization cancelled", err, {
5013
+ F: __dxlog_file20,
4978
5014
  L: 297,
4979
5015
  S: this,
4980
5016
  C: (f, a) => f(...a)
4981
5017
  });
4982
5018
  return;
4983
5019
  }
4984
- import_log14.log.error("Error initializing data pipeline", err, {
4985
- F: __dxlog_file19,
5020
+ import_log15.log.error("Error initializing data pipeline", err, {
5021
+ F: __dxlog_file20,
4986
5022
  L: 301,
4987
5023
  S: this,
4988
5024
  C: (f, a) => f(...a)
4989
5025
  });
4990
5026
  this._state = import_services13.SpaceState.SPACE_ERROR;
4991
- (0, import_log14.log)("new state", {
5027
+ (0, import_log15.log)("new state", {
4992
5028
  state: import_services13.SpaceState[this._state]
4993
5029
  }, {
4994
- F: __dxlog_file19,
5030
+ F: __dxlog_file20,
4995
5031
  L: 303,
4996
5032
  S: this,
4997
5033
  C: (f, a) => f(...a)
@@ -5008,10 +5044,10 @@ var DataSpace = class {
5008
5044
  throw new import_protocols10.SystemError("Invalid operation");
5009
5045
  }
5010
5046
  this._state = import_services13.SpaceState.SPACE_INITIALIZING;
5011
- (0, import_log14.log)("new state", {
5047
+ (0, import_log15.log)("new state", {
5012
5048
  state: import_services13.SpaceState[this._state]
5013
5049
  }, {
5014
- F: __dxlog_file19,
5050
+ F: __dxlog_file20,
5015
5051
  L: 319,
5016
5052
  S: this,
5017
5053
  C: (f, a) => f(...a)
@@ -5025,10 +5061,10 @@ var DataSpace = class {
5025
5061
  async _enterReadyState() {
5026
5062
  await this._callbacks.beforeReady?.();
5027
5063
  this._state = import_services13.SpaceState.SPACE_READY;
5028
- (0, import_log14.log)("new state", {
5064
+ (0, import_log15.log)("new state", {
5029
5065
  state: import_services13.SpaceState[this._state]
5030
5066
  }, {
5031
- F: __dxlog_file19,
5067
+ F: __dxlog_file20,
5032
5068
  L: 338,
5033
5069
  S: this,
5034
5070
  C: (f, a) => f(...a)
@@ -5043,8 +5079,8 @@ var DataSpace = class {
5043
5079
  });
5044
5080
  this.metrics.controlPipelineReady = /* @__PURE__ */ new Date();
5045
5081
  await this._createWritableFeeds();
5046
- (0, import_log14.log)("writable feeds created", void 0, {
5047
- F: __dxlog_file19,
5082
+ (0, import_log15.log)("writable feeds created", void 0, {
5083
+ F: __dxlog_file20,
5048
5084
  L: 354,
5049
5085
  S: this,
5050
5086
  C: (f, a) => f(...a)
@@ -5103,11 +5139,11 @@ var DataSpace = class {
5103
5139
  }
5104
5140
  }
5105
5141
  _onNewAutomergeRoot(rootUrl) {
5106
- (0, import_log14.log)("loading automerge root doc for space", {
5142
+ (0, import_log15.log)("loading automerge root doc for space", {
5107
5143
  space: this.key,
5108
5144
  rootUrl
5109
5145
  }, {
5110
- F: __dxlog_file19,
5146
+ F: __dxlog_file20,
5111
5147
  L: 420,
5112
5148
  S: this,
5113
5149
  C: (f, a) => f(...a)
@@ -5154,12 +5190,12 @@ var DataSpace = class {
5154
5190
  if (err instanceof import_context11.ContextDisposedError) {
5155
5191
  return;
5156
5192
  }
5157
- import_log14.log.warn("error loading automerge root doc", {
5193
+ import_log15.log.warn("error loading automerge root doc", {
5158
5194
  space: this.key,
5159
5195
  rootUrl,
5160
5196
  err
5161
5197
  }, {
5162
- F: __dxlog_file19,
5198
+ F: __dxlog_file20,
5163
5199
  L: 463,
5164
5200
  S: this,
5165
5201
  C: (f, a) => f(...a)
@@ -5246,10 +5282,10 @@ var DataSpace = class {
5246
5282
  await this._close();
5247
5283
  }
5248
5284
  this._state = import_services13.SpaceState.SPACE_INACTIVE;
5249
- (0, import_log14.log)("new state", {
5285
+ (0, import_log15.log)("new state", {
5250
5286
  state: import_services13.SpaceState[this._state]
5251
5287
  }, {
5252
- F: __dxlog_file19,
5288
+ F: __dxlog_file20,
5253
5289
  L: 545,
5254
5290
  S: this,
5255
5291
  C: (f, a) => f(...a)
@@ -5379,7 +5415,7 @@ function _ts_decorate6(decorators, target, key, desc) {
5379
5415
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5380
5416
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5381
5417
  }
5382
- var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
5418
+ var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
5383
5419
  var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
5384
5420
  var PRESENCE_OFFLINE_TIMEOUT = 2e4;
5385
5421
  var DEFAULT_SPACE_KEY = "__DEFAULT__";
@@ -5434,45 +5470,45 @@ var DataSpaceManager = class extends import_context14.Resource {
5434
5470
  return this._spaces;
5435
5471
  }
5436
5472
  async _open() {
5437
- (0, import_log17.log)("open", void 0, {
5438
- F: __dxlog_file20,
5473
+ (0, import_log18.log)("open", void 0, {
5474
+ F: __dxlog_file21,
5439
5475
  L: 192,
5440
5476
  S: this,
5441
5477
  C: (f, a) => f(...a)
5442
5478
  });
5443
- import_log17.log.trace("dxos.echo.data-space-manager.open", import_protocols12.trace.begin({
5479
+ import_log18.log.trace("dxos.echo.data-space-manager.open", import_protocols12.trace.begin({
5444
5480
  id: this._instanceId
5445
5481
  }), {
5446
- F: __dxlog_file20,
5482
+ F: __dxlog_file21,
5447
5483
  L: 193,
5448
5484
  S: this,
5449
5485
  C: (f, a) => f(...a)
5450
5486
  });
5451
- (0, import_log17.log)("metadata loaded", {
5487
+ (0, import_log18.log)("metadata loaded", {
5452
5488
  spaces: this._metadataStore.spaces.length
5453
5489
  }, {
5454
- F: __dxlog_file20,
5490
+ F: __dxlog_file21,
5455
5491
  L: 194,
5456
5492
  S: this,
5457
5493
  C: (f, a) => f(...a)
5458
5494
  });
5459
5495
  await (0, import_util11.forEachAsync)(this._metadataStore.spaces, async (spaceMetadata) => {
5460
5496
  try {
5461
- (0, import_log17.log)("load space", {
5497
+ (0, import_log18.log)("load space", {
5462
5498
  spaceMetadata
5463
5499
  }, {
5464
- F: __dxlog_file20,
5500
+ F: __dxlog_file21,
5465
5501
  L: 198,
5466
5502
  S: this,
5467
5503
  C: (f, a) => f(...a)
5468
5504
  });
5469
5505
  await this._constructSpace(spaceMetadata);
5470
5506
  } catch (err) {
5471
- import_log17.log.error("Error loading space", {
5507
+ import_log18.log.error("Error loading space", {
5472
5508
  spaceMetadata,
5473
5509
  err
5474
5510
  }, {
5475
- F: __dxlog_file20,
5511
+ F: __dxlog_file21,
5476
5512
  L: 201,
5477
5513
  S: this,
5478
5514
  C: (f, a) => f(...a)
@@ -5480,18 +5516,18 @@ var DataSpaceManager = class extends import_context14.Resource {
5480
5516
  }
5481
5517
  });
5482
5518
  this.updated.emit();
5483
- import_log17.log.trace("dxos.echo.data-space-manager.open", import_protocols12.trace.end({
5519
+ import_log18.log.trace("dxos.echo.data-space-manager.open", import_protocols12.trace.end({
5484
5520
  id: this._instanceId
5485
5521
  }), {
5486
- F: __dxlog_file20,
5522
+ F: __dxlog_file21,
5487
5523
  L: 207,
5488
5524
  S: this,
5489
5525
  C: (f, a) => f(...a)
5490
5526
  });
5491
5527
  }
5492
5528
  async _close() {
5493
- (0, import_log17.log)("close", void 0, {
5494
- F: __dxlog_file20,
5529
+ (0, import_log18.log)("close", void 0, {
5530
+ F: __dxlog_file21,
5495
5531
  L: 212,
5496
5532
  S: this,
5497
5533
  C: (f, a) => f(...a)
@@ -5506,7 +5542,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5506
5542
  */
5507
5543
  async createSpace() {
5508
5544
  (0, import_invariant17.invariant)(this._lifecycleState === import_context14.LifecycleState.OPEN, "Not open.", {
5509
- F: __dxlog_file20,
5545
+ F: __dxlog_file21,
5510
5546
  L: 224,
5511
5547
  S: this,
5512
5548
  A: [
@@ -5524,10 +5560,10 @@ var DataSpaceManager = class extends import_context14.Resource {
5524
5560
  dataFeedKey,
5525
5561
  state: import_services15.SpaceState.SPACE_ACTIVE
5526
5562
  };
5527
- (0, import_log17.log)("creating space...", {
5563
+ (0, import_log18.log)("creating space...", {
5528
5564
  spaceKey
5529
5565
  }, {
5530
- F: __dxlog_file20,
5566
+ F: __dxlog_file21,
5531
5567
  L: 236,
5532
5568
  S: this,
5533
5569
  C: (f, a) => f(...a)
@@ -5539,7 +5575,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5539
5575
  await this._metadataStore.addSpace(metadata);
5540
5576
  const memberCredential = credentials[1];
5541
5577
  (0, import_invariant17.invariant)((0, import_credentials15.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5542
- F: __dxlog_file20,
5578
+ F: __dxlog_file21,
5543
5579
  L: 246,
5544
5580
  S: this,
5545
5581
  A: [
@@ -5567,11 +5603,11 @@ var DataSpaceManager = class extends import_context14.Resource {
5567
5603
  return properties?.data?.[DEFAULT_SPACE_KEY] === this._signingContext.identityKey.toHex();
5568
5604
  }
5569
5605
  default:
5570
- import_log17.log.warn("unknown space version", {
5606
+ import_log18.log.warn("unknown space version", {
5571
5607
  version: space.databaseRoot.getVersion(),
5572
5608
  spaceId: space.id
5573
5609
  }, {
5574
- F: __dxlog_file20,
5610
+ F: __dxlog_file21,
5575
5611
  L: 271,
5576
5612
  S: this,
5577
5613
  C: (f, a) => f(...a)
@@ -5606,7 +5642,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5606
5642
  async _getSpaceRootDocument(space) {
5607
5643
  const automergeIndex = space.automergeSpaceState.rootUrl;
5608
5644
  (0, import_invariant17.invariant)(automergeIndex, void 0, {
5609
- F: __dxlog_file20,
5645
+ F: __dxlog_file21,
5610
5646
  L: 304,
5611
5647
  S: this,
5612
5648
  A: [
@@ -5620,16 +5656,16 @@ var DataSpaceManager = class extends import_context14.Resource {
5620
5656
  }
5621
5657
  // TODO(burdon): Rename join space.
5622
5658
  async acceptSpace(opts) {
5623
- (0, import_log17.log)("accept space", {
5659
+ (0, import_log18.log)("accept space", {
5624
5660
  opts
5625
5661
  }, {
5626
- F: __dxlog_file20,
5662
+ F: __dxlog_file21,
5627
5663
  L: 313,
5628
5664
  S: this,
5629
5665
  C: (f, a) => f(...a)
5630
5666
  });
5631
5667
  (0, import_invariant17.invariant)(this._lifecycleState === import_context14.LifecycleState.OPEN, "Not open.", {
5632
- F: __dxlog_file20,
5668
+ F: __dxlog_file21,
5633
5669
  L: 314,
5634
5670
  S: this,
5635
5671
  A: [
@@ -5638,7 +5674,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5638
5674
  ]
5639
5675
  });
5640
5676
  (0, import_invariant17.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
5641
- F: __dxlog_file20,
5677
+ F: __dxlog_file21,
5642
5678
  L: 315,
5643
5679
  S: this,
5644
5680
  A: [
@@ -5662,7 +5698,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5662
5698
  async admitMember(options) {
5663
5699
  const space = this._spaceManager.spaces.get(options.spaceKey);
5664
5700
  (0, import_invariant17.invariant)(space, void 0, {
5665
- F: __dxlog_file20,
5701
+ F: __dxlog_file21,
5666
5702
  L: 335,
5667
5703
  S: this,
5668
5704
  A: [
@@ -5675,7 +5711,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5675
5711
  }
5676
5712
  const credentials = await (0, import_credentials15.createAdmissionCredentials)(this._signingContext.credentialSigner, options.identityKey, space.key, space.genesisFeedKey, options.role, space.spaceState.membershipChainHeads, options.profile, options.delegationCredentialId);
5677
5713
  (0, import_invariant17.invariant)(credentials[0].credential, void 0, {
5678
- F: __dxlog_file20,
5714
+ F: __dxlog_file21,
5679
5715
  L: 354,
5680
5716
  S: this,
5681
5717
  A: [
@@ -5685,7 +5721,7 @@ var DataSpaceManager = class extends import_context14.Resource {
5685
5721
  });
5686
5722
  const spaceMemberCredential = credentials[0].credential.credential;
5687
5723
  (0, import_invariant17.invariant)((0, import_credentials15.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5688
- F: __dxlog_file20,
5724
+ F: __dxlog_file21,
5689
5725
  L: 356,
5690
5726
  S: this,
5691
5727
  A: [
@@ -5721,10 +5757,10 @@ var DataSpaceManager = class extends import_context14.Resource {
5721
5757
  });
5722
5758
  }
5723
5759
  async _constructSpace(metadata) {
5724
- (0, import_log17.log)("construct space", {
5760
+ (0, import_log18.log)("construct space", {
5725
5761
  metadata
5726
5762
  }, {
5727
- F: __dxlog_file20,
5763
+ F: __dxlog_file21,
5728
5764
  L: 392,
5729
5765
  S: this,
5730
5766
  C: (f, a) => f(...a)
@@ -5765,10 +5801,10 @@ var DataSpaceManager = class extends import_context14.Resource {
5765
5801
  session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
5766
5802
  await this._connectEchoMeshReplicator(space, session);
5767
5803
  } catch (err) {
5768
- import_log17.log.warn("error on authorized connection", {
5804
+ import_log18.log.warn("error on authorized connection", {
5769
5805
  err
5770
5806
  }, {
5771
- F: __dxlog_file20,
5807
+ F: __dxlog_file21,
5772
5808
  L: 434,
5773
5809
  S: this,
5774
5810
  C: (f, a) => f(...a)
@@ -5777,8 +5813,8 @@ var DataSpaceManager = class extends import_context14.Resource {
5777
5813
  }
5778
5814
  }),
5779
5815
  onAuthFailure: () => {
5780
- import_log17.log.warn("auth failure", void 0, {
5781
- F: __dxlog_file20,
5816
+ import_log18.log.warn("auth failure", void 0, {
5817
+ F: __dxlog_file21,
5782
5818
  L: 439,
5783
5819
  S: this,
5784
5820
  C: (f, a) => f(...a)
@@ -5808,21 +5844,21 @@ var DataSpaceManager = class extends import_context14.Resource {
5808
5844
  signingContext: this._signingContext,
5809
5845
  callbacks: {
5810
5846
  beforeReady: async () => {
5811
- (0, import_log17.log)("before space ready", {
5847
+ (0, import_log18.log)("before space ready", {
5812
5848
  space: space.key
5813
5849
  }, {
5814
- F: __dxlog_file20,
5850
+ F: __dxlog_file21,
5815
5851
  L: 466,
5816
5852
  S: this,
5817
5853
  C: (f, a) => f(...a)
5818
5854
  });
5819
5855
  },
5820
5856
  afterReady: async () => {
5821
- (0, import_log17.log)("after space ready", {
5857
+ (0, import_log18.log)("after space ready", {
5822
5858
  space: space.key,
5823
5859
  open: this._lifecycleState === import_context14.LifecycleState.OPEN
5824
5860
  }, {
5825
- F: __dxlog_file20,
5861
+ F: __dxlog_file21,
5826
5862
  L: 469,
5827
5863
  S: this,
5828
5864
  C: (f, a) => f(...a)
@@ -5838,10 +5874,10 @@ var DataSpaceManager = class extends import_context14.Resource {
5838
5874
  }
5839
5875
  },
5840
5876
  beforeClose: async () => {
5841
- (0, import_log17.log)("before space close", {
5877
+ (0, import_log18.log)("before space close", {
5842
5878
  space: space.key
5843
5879
  }, {
5844
- F: __dxlog_file20,
5880
+ F: __dxlog_file21,
5845
5881
  L: 477,
5846
5882
  S: this,
5847
5883
  C: (f, a) => f(...a)
@@ -5872,10 +5908,10 @@ var DataSpaceManager = class extends import_context14.Resource {
5872
5908
  async _connectEchoMeshReplicator(space, session) {
5873
5909
  const replicator = this._meshReplicator;
5874
5910
  if (!replicator) {
5875
- import_log17.log.warn("p2p automerge replication disabled", {
5911
+ import_log18.log.warn("p2p automerge replication disabled", {
5876
5912
  space: space.key
5877
5913
  }, {
5878
- F: __dxlog_file20,
5914
+ F: __dxlog_file21,
5879
5915
  L: 508,
5880
5916
  S: this,
5881
5917
  C: (f, a) => f(...a)
@@ -5899,16 +5935,16 @@ var DataSpaceManager = class extends import_context14.Resource {
5899
5935
  return (s && member.role === import_credentials16.SpaceMember.Role.REMOVED !== (s.authStatus === import_echo_pipeline3.AuthStatus.FAILURE)) ?? false;
5900
5936
  });
5901
5937
  sessionsToClose.forEach((session) => {
5902
- void session.close().catch(import_log17.log.error);
5938
+ void session.close().catch(import_log18.log.error);
5903
5939
  });
5904
5940
  closedSessions += sessionsToClose.length;
5905
5941
  }
5906
- (0, import_log17.log)("processed member role changes", {
5942
+ (0, import_log18.log)("processed member role changes", {
5907
5943
  roleChangeCount: memberInfo.length,
5908
5944
  peersOnline: presence.getPeersOnline().length,
5909
5945
  closedSessions
5910
5946
  }, {
5911
- F: __dxlog_file20,
5947
+ F: __dxlog_file21,
5912
5948
  L: 534,
5913
5949
  S: this,
5914
5950
  C: (f, a) => f(...a)
@@ -5920,15 +5956,15 @@ var DataSpaceManager = class extends import_context14.Resource {
5920
5956
  if (role === import_credentials16.SpaceMember.Role.REMOVED) {
5921
5957
  const session = peerState.peerId && space.protocol.sessions.get(peerState.peerId);
5922
5958
  if (session != null) {
5923
- (0, import_log17.log)("closing a session with a removed peer", {
5959
+ (0, import_log18.log)("closing a session with a removed peer", {
5924
5960
  peerId: peerState.peerId
5925
5961
  }, {
5926
- F: __dxlog_file20,
5962
+ F: __dxlog_file21,
5927
5963
  L: 548,
5928
5964
  S: this,
5929
5965
  C: (f, a) => f(...a)
5930
5966
  });
5931
- void session.close().catch(import_log17.log.error);
5967
+ void session.close().catch(import_log18.log.error);
5932
5968
  }
5933
5969
  }
5934
5970
  }
@@ -5983,7 +6019,7 @@ _ts_decorate6([
5983
6019
  DataSpaceManager = _ts_decorate6([
5984
6020
  (0, import_async17.trackLeaks)("open", "close")
5985
6021
  ], DataSpaceManager);
5986
- var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
6022
+ var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
5987
6023
  var SpacesServiceImpl = class {
5988
6024
  constructor(_identityManager, _spaceManager, _getDataSpaceManager) {
5989
6025
  this._identityManager = _identityManager;
@@ -6027,7 +6063,7 @@ var SpacesServiceImpl = class {
6027
6063
  }
6028
6064
  const credentials = await (0, import_credentials19.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
6029
6065
  (0, import_invariant18.invariant)(credentials[0].credential, void 0, {
6030
- F: __dxlog_file21,
6066
+ F: __dxlog_file22,
6031
6067
  L: 102,
6032
6068
  S: this,
6033
6069
  A: [
@@ -6037,7 +6073,7 @@ var SpacesServiceImpl = class {
6037
6073
  });
6038
6074
  const spaceMemberCredential = credentials[0].credential.credential;
6039
6075
  (0, import_invariant18.invariant)((0, import_credentials19.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
6040
- F: __dxlog_file21,
6076
+ F: __dxlog_file22,
6041
6077
  L: 104,
6042
6078
  S: this,
6043
6079
  A: [
@@ -6052,10 +6088,10 @@ var SpacesServiceImpl = class {
6052
6088
  const scheduler = new import_async18.UpdateScheduler(ctx, async () => {
6053
6089
  const dataSpaceManager = await this._getDataSpaceManager();
6054
6090
  const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
6055
- (0, import_log18.log)("update", () => ({
6091
+ (0, import_log19.log)("update", () => ({
6056
6092
  ids: spaces.map((space) => space.id)
6057
6093
  }), {
6058
- F: __dxlog_file21,
6094
+ F: __dxlog_file22,
6059
6095
  L: 115,
6060
6096
  S: this,
6061
6097
  C: (f, a) => f(...a)
@@ -6147,7 +6183,7 @@ var SpacesServiceImpl = class {
6147
6183
  });
6148
6184
  } else {
6149
6185
  (0, import_invariant18.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
6150
- F: __dxlog_file21,
6186
+ F: __dxlog_file22,
6151
6187
  L: 213,
6152
6188
  S: this,
6153
6189
  A: [
@@ -6156,7 +6192,7 @@ var SpacesServiceImpl = class {
6156
6192
  ]
6157
6193
  });
6158
6194
  (0, import_invariant18.invariant)(this._identityManager.identity, "Identity is not available", {
6159
- F: __dxlog_file21,
6195
+ F: __dxlog_file22,
6160
6196
  L: 214,
6161
6197
  S: this,
6162
6198
  A: [
@@ -6166,7 +6202,7 @@ var SpacesServiceImpl = class {
6166
6202
  });
6167
6203
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
6168
6204
  (0, import_invariant18.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
6169
- F: __dxlog_file21,
6205
+ F: __dxlog_file22,
6170
6206
  L: 216,
6171
6207
  S: this,
6172
6208
  A: [
@@ -6216,7 +6252,7 @@ var SpacesServiceImpl = class {
6216
6252
  async _joinByAdmission({ credential }) {
6217
6253
  const assertion = (0, import_credentials19.getCredentialAssertion)(credential);
6218
6254
  (0, import_invariant18.invariant)(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
6219
- F: __dxlog_file21,
6255
+ F: __dxlog_file22,
6220
6256
  L: 250,
6221
6257
  S: this,
6222
6258
  A: [
@@ -6226,7 +6262,7 @@ var SpacesServiceImpl = class {
6226
6262
  });
6227
6263
  const myIdentity = this._identityManager.identity;
6228
6264
  (0, import_invariant18.invariant)(myIdentity && credential.subject.id.equals(myIdentity.identityKey), void 0, {
6229
- F: __dxlog_file21,
6265
+ F: __dxlog_file22,
6230
6266
  L: 252,
6231
6267
  S: this,
6232
6268
  A: [
@@ -6321,7 +6357,7 @@ function _ts_decorate7(decorators, target, key, desc) {
6321
6357
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6322
6358
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6323
6359
  }
6324
- var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
6360
+ var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
6325
6361
  var ServiceContext = class extends import_context15.Resource {
6326
6362
  constructor(storage, level, networkManager, signalManager, _edgeConnection, _runtimeParams, _edgeFeatures) {
6327
6363
  super();
@@ -6360,19 +6396,19 @@ var ServiceContext = class extends import_context15.Resource {
6360
6396
  this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams, {
6361
6397
  onIdentityConstruction: (identity) => {
6362
6398
  if (this._edgeConnection) {
6363
- import_log19.log.info("Setting identity on edge connection", {
6399
+ import_log20.log.info("Setting identity on edge connection", {
6364
6400
  identity: identity.identityKey.toHex(),
6365
- oldIdentity: this._edgeConnection.identityKey.toHex(),
6401
+ oldIdentity: this._edgeConnection.identityKey,
6366
6402
  swarms: this.networkManager.topics
6367
6403
  }, {
6368
- F: __dxlog_file22,
6404
+ F: __dxlog_file23,
6369
6405
  L: 128,
6370
6406
  S: this,
6371
6407
  C: (f, a) => f(...a)
6372
6408
  });
6373
6409
  this._edgeConnection.setIdentity({
6374
- deviceKey: identity.deviceKey,
6375
- identityKey: identity.identityKey
6410
+ peerKey: identity.deviceKey.toHex(),
6411
+ identityKey: identity.identityKey.toHex()
6376
6412
  });
6377
6413
  this.networkManager.setPeerInfo({
6378
6414
  identityKey: identity.identityKey.toHex(),
@@ -6399,16 +6435,16 @@ var ServiceContext = class extends import_context15.Resource {
6399
6435
  }
6400
6436
  async _open(ctx) {
6401
6437
  await this._checkStorageVersion();
6402
- (0, import_log19.log)("opening...", void 0, {
6403
- F: __dxlog_file22,
6438
+ (0, import_log20.log)("opening...", void 0, {
6439
+ F: __dxlog_file23,
6404
6440
  L: 186,
6405
6441
  S: this,
6406
6442
  C: (f, a) => f(...a)
6407
6443
  });
6408
- import_log19.log.trace("dxos.sdk.service-context.open", import_protocols14.trace.begin({
6444
+ import_log20.log.trace("dxos.sdk.service-context.open", import_protocols14.trace.begin({
6409
6445
  id: this._instanceId
6410
6446
  }), {
6411
- F: __dxlog_file22,
6447
+ F: __dxlog_file23,
6412
6448
  L: 187,
6413
6449
  S: this,
6414
6450
  C: (f, a) => f(...a)
@@ -6430,32 +6466,32 @@ var ServiceContext = class extends import_context15.Resource {
6430
6466
  await this._initialize(ctx);
6431
6467
  }
6432
6468
  const loadedInvitations = await this.invitationsManager.loadPersistentInvitations();
6433
- (0, import_log19.log)("loaded persistent invitations", {
6469
+ (0, import_log20.log)("loaded persistent invitations", {
6434
6470
  count: loadedInvitations.invitations?.length
6435
6471
  }, {
6436
- F: __dxlog_file22,
6472
+ F: __dxlog_file23,
6437
6473
  L: 210,
6438
6474
  S: this,
6439
6475
  C: (f, a) => f(...a)
6440
6476
  });
6441
- import_log19.log.trace("dxos.sdk.service-context.open", import_protocols14.trace.end({
6477
+ import_log20.log.trace("dxos.sdk.service-context.open", import_protocols14.trace.end({
6442
6478
  id: this._instanceId
6443
6479
  }), {
6444
- F: __dxlog_file22,
6480
+ F: __dxlog_file23,
6445
6481
  L: 212,
6446
6482
  S: this,
6447
6483
  C: (f, a) => f(...a)
6448
6484
  });
6449
- (0, import_log19.log)("opened", void 0, {
6450
- F: __dxlog_file22,
6485
+ (0, import_log20.log)("opened", void 0, {
6486
+ F: __dxlog_file23,
6451
6487
  L: 213,
6452
6488
  S: this,
6453
6489
  C: (f, a) => f(...a)
6454
6490
  });
6455
6491
  }
6456
6492
  async _close(ctx) {
6457
- (0, import_log19.log)("closing...", void 0, {
6458
- F: __dxlog_file22,
6493
+ (0, import_log20.log)("closing...", void 0, {
6494
+ F: __dxlog_file23,
6459
6495
  L: 217,
6460
6496
  S: this,
6461
6497
  C: (f, a) => f(...a)
@@ -6472,8 +6508,8 @@ var ServiceContext = class extends import_context15.Resource {
6472
6508
  await this.networkManager.close();
6473
6509
  await this.signalManager.close();
6474
6510
  await this._edgeConnection?.close();
6475
- (0, import_log19.log)("closed", void 0, {
6476
- F: __dxlog_file22,
6511
+ (0, import_log20.log)("closed", void 0, {
6512
+ F: __dxlog_file23,
6477
6513
  L: 232,
6478
6514
  S: this,
6479
6515
  C: (f, a) => f(...a)
@@ -6482,7 +6518,7 @@ var ServiceContext = class extends import_context15.Resource {
6482
6518
  async createIdentity(params = {}) {
6483
6519
  const identity = await this.identityManager.createIdentity(params);
6484
6520
  await this._initialize(new import_context15.Context(void 0, {
6485
- F: __dxlog_file22,
6521
+ F: __dxlog_file23,
6486
6522
  L: 237
6487
6523
  }));
6488
6524
  return identity;
@@ -6490,7 +6526,7 @@ var ServiceContext = class extends import_context15.Resource {
6490
6526
  getInvitationHandler(invitation) {
6491
6527
  const factory = this._handlerFactories.get(invitation.kind);
6492
6528
  (0, import_invariant19.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
6493
- F: __dxlog_file22,
6529
+ F: __dxlog_file23,
6494
6530
  L: 243,
6495
6531
  S: this,
6496
6532
  A: [
@@ -6511,7 +6547,7 @@ var ServiceContext = class extends import_context15.Resource {
6511
6547
  async _acceptIdentity(params) {
6512
6548
  const identity = await this.identityManager.acceptIdentity(params);
6513
6549
  await this._initialize(new import_context15.Context(void 0, {
6514
- F: __dxlog_file22,
6550
+ F: __dxlog_file23,
6515
6551
  L: 259
6516
6552
  }));
6517
6553
  return identity;
@@ -6524,8 +6560,8 @@ var ServiceContext = class extends import_context15.Resource {
6524
6560
  }
6525
6561
  // Called when identity is created.
6526
6562
  async _initialize(ctx) {
6527
- (0, import_log19.log)("initializing spaces...", void 0, {
6528
- F: __dxlog_file22,
6563
+ (0, import_log20.log)("initializing spaces...", void 0, {
6564
+ F: __dxlog_file23,
6529
6565
  L: 274,
6530
6566
  S: this,
6531
6567
  C: (f, a) => f(...a)
@@ -6561,7 +6597,7 @@ var ServiceContext = class extends import_context15.Resource {
6561
6597
  await this.dataSpaceManager.open();
6562
6598
  this._handlerFactories.set(import_services17.Invitation.Kind.SPACE, (invitation) => {
6563
6599
  (0, import_invariant19.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
6564
- F: __dxlog_file22,
6600
+ F: __dxlog_file23,
6565
6601
  L: 303,
6566
6602
  S: this,
6567
6603
  A: [
@@ -6582,10 +6618,10 @@ var ServiceContext = class extends import_context15.Resource {
6582
6618
  return;
6583
6619
  }
6584
6620
  if (!this.dataSpaceManager) {
6585
- (0, import_log19.log)("dataSpaceManager not initialized yet, ignoring space admission", {
6621
+ (0, import_log20.log)("dataSpaceManager not initialized yet, ignoring space admission", {
6586
6622
  details: assertion
6587
6623
  }, {
6588
- F: __dxlog_file22,
6624
+ F: __dxlog_file23,
6589
6625
  L: 319,
6590
6626
  S: this,
6591
6627
  C: (f, a) => f(...a)
@@ -6593,10 +6629,10 @@ var ServiceContext = class extends import_context15.Resource {
6593
6629
  return;
6594
6630
  }
6595
6631
  if (this.dataSpaceManager.spaces.has(assertion.spaceKey)) {
6596
- (0, import_log19.log)("space already exists, ignoring space admission", {
6632
+ (0, import_log20.log)("space already exists, ignoring space admission", {
6597
6633
  details: assertion
6598
6634
  }, {
6599
- F: __dxlog_file22,
6635
+ F: __dxlog_file23,
6600
6636
  L: 323,
6601
6637
  S: this,
6602
6638
  C: (f, a) => f(...a)
@@ -6604,10 +6640,10 @@ var ServiceContext = class extends import_context15.Resource {
6604
6640
  return;
6605
6641
  }
6606
6642
  try {
6607
- (0, import_log19.log)("accepting space recorded in halo", {
6643
+ (0, import_log20.log)("accepting space recorded in halo", {
6608
6644
  details: assertion
6609
6645
  }, {
6610
- F: __dxlog_file22,
6646
+ F: __dxlog_file23,
6611
6647
  L: 328,
6612
6648
  S: this,
6613
6649
  C: (f, a) => f(...a)
@@ -6617,8 +6653,8 @@ var ServiceContext = class extends import_context15.Resource {
6617
6653
  genesisFeedKey: assertion.genesisFeedKey
6618
6654
  });
6619
6655
  } catch (err) {
6620
- import_log19.log.catch(err, void 0, {
6621
- F: __dxlog_file22,
6656
+ import_log20.log.catch(err, void 0, {
6657
+ F: __dxlog_file23,
6622
6658
  L: 334,
6623
6659
  S: this,
6624
6660
  C: (f, a) => f(...a)
@@ -6718,7 +6754,7 @@ var createLevel = async (config) => {
6718
6754
  await level.open();
6719
6755
  return level;
6720
6756
  };
6721
- var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/storage/profile-archive.ts";
6757
+ var __dxlog_file24 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/storage/profile-archive.ts";
6722
6758
  var encodeProfileArchive = (profile) => import_automerge_repo.cbor.encode(profile);
6723
6759
  var decodeProfileArchive = (data) => import_automerge_repo.cbor.decode(data);
6724
6760
  var exportProfileData = async ({ storage, level }) => {
@@ -6731,10 +6767,10 @@ var exportProfileData = async ({ storage, level }) => {
6731
6767
  {
6732
6768
  const directory = await storage.createDirectory();
6733
6769
  const files = await directory.list();
6734
- import_log20.log.info("begin exporting files", {
6770
+ import_log21.log.info("begin exporting files", {
6735
6771
  count: files.length
6736
6772
  }, {
6737
- F: __dxlog_file23,
6773
+ F: __dxlog_file24,
6738
6774
  L: 30,
6739
6775
  S: void 0,
6740
6776
  C: (f, a) => f(...a)
@@ -6749,18 +6785,18 @@ var exportProfileData = async ({ storage, level }) => {
6749
6785
  value: data
6750
6786
  });
6751
6787
  }
6752
- import_log20.log.info("done exporting files", {
6788
+ import_log21.log.info("done exporting files", {
6753
6789
  count: files.length
6754
6790
  }, {
6755
- F: __dxlog_file23,
6791
+ F: __dxlog_file24,
6756
6792
  L: 41,
6757
6793
  S: void 0,
6758
6794
  C: (f, a) => f(...a)
6759
6795
  });
6760
6796
  }
6761
6797
  {
6762
- import_log20.log.info("begin exporting kv pairs", void 0, {
6763
- F: __dxlog_file23,
6798
+ import_log21.log.info("begin exporting kv pairs", void 0, {
6799
+ F: __dxlog_file24,
6764
6800
  L: 45,
6765
6801
  S: void 0,
6766
6802
  C: (f, a) => f(...a)
@@ -6778,10 +6814,10 @@ var exportProfileData = async ({ storage, level }) => {
6778
6814
  });
6779
6815
  count++;
6780
6816
  }
6781
- import_log20.log.info("done exporting kv pairs", {
6817
+ import_log21.log.info("done exporting kv pairs", {
6782
6818
  count
6783
6819
  }, {
6784
- F: __dxlog_file23,
6820
+ F: __dxlog_file24,
6785
6821
  L: 56,
6786
6822
  S: void 0,
6787
6823
  C: (f, a) => f(...a)
@@ -6797,7 +6833,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6797
6833
  case import_protocols16.ProfileArchiveEntryType.FILE: {
6798
6834
  const directory = await storage.createDirectory();
6799
6835
  (0, import_invariant20.invariant)(typeof entry2.key === "string", "Invalid key type", {
6800
- F: __dxlog_file23,
6836
+ F: __dxlog_file24,
6801
6837
  L: 79,
6802
6838
  S: void 0,
6803
6839
  A: [
@@ -6807,7 +6843,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6807
6843
  });
6808
6844
  const file = await directory.getOrCreateFile(entry2.key);
6809
6845
  (0, import_invariant20.invariant)(entry2.value instanceof Uint8Array, "Invalid value type", {
6810
- F: __dxlog_file23,
6846
+ F: __dxlog_file24,
6811
6847
  L: 81,
6812
6848
  S: void 0,
6813
6849
  A: [
@@ -6821,7 +6857,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6821
6857
  }
6822
6858
  case import_protocols16.ProfileArchiveEntryType.KEY_VALUE: {
6823
6859
  (0, import_invariant20.invariant)(entry2.key instanceof Uint8Array, "Invalid key type", {
6824
- F: __dxlog_file23,
6860
+ F: __dxlog_file24,
6825
6861
  L: 87,
6826
6862
  S: void 0,
6827
6863
  A: [
@@ -6830,7 +6866,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6830
6866
  ]
6831
6867
  });
6832
6868
  (0, import_invariant20.invariant)(entry2.value instanceof Uint8Array, "Invalid value type", {
6833
- F: __dxlog_file23,
6869
+ F: __dxlog_file24,
6834
6870
  L: 88,
6835
6871
  S: void 0,
6836
6872
  A: [
@@ -6850,27 +6886,27 @@ var importProfileData = async ({ storage, level }, archive) => {
6850
6886
  if (++count % 1e3 === 0) {
6851
6887
  await batch.write();
6852
6888
  batch = level.batch();
6853
- import_log20.log.info("importing", {
6889
+ import_log21.log.info("importing", {
6854
6890
  count,
6855
6891
  total: archive.storage.length,
6856
6892
  progress: `${(count / archive.storage.length * 100).toFixed()}%`
6857
6893
  }, {
6858
- F: __dxlog_file23,
6894
+ F: __dxlog_file24,
6859
6895
  L: 101,
6860
6896
  S: void 0,
6861
6897
  C: (f, a) => f(...a)
6862
6898
  });
6863
6899
  }
6864
6900
  }
6865
- import_log20.log.info("committing changes..", void 0, {
6866
- F: __dxlog_file23,
6901
+ import_log21.log.info("committing changes..", void 0, {
6902
+ F: __dxlog_file24,
6867
6903
  L: 109,
6868
6904
  S: void 0,
6869
6905
  C: (f, a) => f(...a)
6870
6906
  });
6871
6907
  await batch.write();
6872
6908
  };
6873
- var __dxlog_file24 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6909
+ var __dxlog_file25 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6874
6910
  var DevicesServiceImpl = class {
6875
6911
  constructor(_identityManager) {
6876
6912
  this._identityManager = _identityManager;
@@ -6888,7 +6924,7 @@ var DevicesServiceImpl = class {
6888
6924
  });
6889
6925
  } else {
6890
6926
  (0, import_invariant22.invariant)(this._identityManager.identity?.presence, "presence not present", {
6891
- F: __dxlog_file24,
6927
+ F: __dxlog_file25,
6892
6928
  L: 32,
6893
6929
  S: this,
6894
6930
  A: [
@@ -7033,11 +7069,11 @@ var LoggingServiceImpl = class {
7033
7069
  };
7034
7070
  }
7035
7071
  async open() {
7036
- import_log22.log.runtimeConfig.processors.push(this._logProcessor);
7072
+ import_log23.log.runtimeConfig.processors.push(this._logProcessor);
7037
7073
  }
7038
7074
  async close() {
7039
- const index = import_log22.log.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
7040
- import_log22.log.runtimeConfig.processors.splice(index, 1);
7075
+ const index = import_log23.log.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
7076
+ import_log23.log.runtimeConfig.processors.splice(index, 1);
7041
7077
  }
7042
7078
  async controlMetrics({ reset, record }) {
7043
7079
  if (reset) {
@@ -7098,7 +7134,7 @@ var LoggingServiceImpl = class {
7098
7134
  }
7099
7135
  const record = {
7100
7136
  ...entry2,
7101
- context: (0, import_util16.jsonify)((0, import_log22.getContextFromEntry)(entry2)),
7137
+ context: (0, import_util16.jsonify)((0, import_log23.getContextFromEntry)(entry2)),
7102
7138
  timestamp: /* @__PURE__ */ new Date(),
7103
7139
  meta: {
7104
7140
  // TODO(dmaretskyi): Fix proto.
@@ -7231,7 +7267,7 @@ function _ts_decorate8(decorators, target, key, desc) {
7231
7267
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7232
7268
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7233
7269
  }
7234
- var __dxlog_file25 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
7270
+ var __dxlog_file26 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
7235
7271
  var ClientServicesHost = class {
7236
7272
  constructor({
7237
7273
  config,
@@ -7269,7 +7305,7 @@ var ClientServicesHost = class {
7269
7305
  onAcquire: () => {
7270
7306
  if (!this._opening) {
7271
7307
  void this.open(new import_context16.Context(void 0, {
7272
- F: __dxlog_file25,
7308
+ F: __dxlog_file26,
7273
7309
  L: 132
7274
7310
  }));
7275
7311
  }
@@ -7327,7 +7363,7 @@ var ClientServicesHost = class {
7327
7363
  */
7328
7364
  initialize({ config, ...options }) {
7329
7365
  (0, import_invariant21.invariant)(!this._open, "service host is open", {
7330
- F: __dxlog_file25,
7366
+ F: __dxlog_file26,
7331
7367
  L: 198,
7332
7368
  S: this,
7333
7369
  A: [
@@ -7335,15 +7371,15 @@ var ClientServicesHost = class {
7335
7371
  "'service host is open'"
7336
7372
  ]
7337
7373
  });
7338
- (0, import_log21.log)("initializing...", void 0, {
7339
- F: __dxlog_file25,
7374
+ (0, import_log22.log)("initializing...", void 0, {
7375
+ F: __dxlog_file26,
7340
7376
  L: 199,
7341
7377
  S: this,
7342
7378
  C: (f, a) => f(...a)
7343
7379
  });
7344
7380
  if (config) {
7345
7381
  (0, import_invariant21.invariant)(!this._config, "config already set", {
7346
- F: __dxlog_file25,
7382
+ F: __dxlog_file26,
7347
7383
  L: 202,
7348
7384
  S: this,
7349
7385
  A: [
@@ -7357,8 +7393,8 @@ var ClientServicesHost = class {
7357
7393
  }
7358
7394
  }
7359
7395
  if (!options.signalManager) {
7360
- import_log21.log.warn("running signaling without telemetry metadata.", void 0, {
7361
- F: __dxlog_file25,
7396
+ import_log22.log.warn("running signaling without telemetry metadata.", void 0, {
7397
+ F: __dxlog_file26,
7362
7398
  L: 210,
7363
7399
  S: this,
7364
7400
  C: (f, a) => f(...a)
@@ -7366,7 +7402,8 @@ var ClientServicesHost = class {
7366
7402
  }
7367
7403
  const edgeEndpoint = config?.get("runtime.services.edge.url");
7368
7404
  if (edgeEndpoint) {
7369
- this._edgeConnection = new import_edge_client.EdgeClient(import_keys16.PublicKey.random(), import_keys16.PublicKey.random(), {
7405
+ const randomKey = import_keys16.PublicKey.random().toHex();
7406
+ this._edgeConnection = new import_edge_client.EdgeClient(randomKey, randomKey, {
7370
7407
  socketEndpoint: edgeEndpoint
7371
7408
  });
7372
7409
  }
@@ -7377,8 +7414,8 @@ var ClientServicesHost = class {
7377
7414
  }) : new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
7378
7415
  this._signalManager = signalManager;
7379
7416
  (0, import_invariant21.invariant)(!this._networkManager, "network manager already set", {
7380
- F: __dxlog_file25,
7381
- L: 233,
7417
+ F: __dxlog_file26,
7418
+ L: 232,
7382
7419
  S: this,
7383
7420
  A: [
7384
7421
  "!this._networkManager",
@@ -7390,13 +7427,13 @@ var ClientServicesHost = class {
7390
7427
  transportFactory,
7391
7428
  signalManager,
7392
7429
  peerInfo: this._edgeConnection ? {
7393
- identityKey: this._edgeConnection.identityKey.toHex(),
7394
- peerKey: this._edgeConnection.deviceKey.toHex()
7430
+ identityKey: this._edgeConnection.identityKey,
7431
+ peerKey: this._edgeConnection.peerKey
7395
7432
  } : void 0
7396
7433
  });
7397
- (0, import_log21.log)("initialized", void 0, {
7398
- F: __dxlog_file25,
7399
- L: 246,
7434
+ (0, import_log22.log)("initialized", void 0, {
7435
+ F: __dxlog_file26,
7436
+ L: 245,
7400
7437
  S: this,
7401
7438
  C: (f, a) => f(...a)
7402
7439
  });
@@ -7406,17 +7443,17 @@ var ClientServicesHost = class {
7406
7443
  return;
7407
7444
  }
7408
7445
  const traceId = import_keys16.PublicKey.random().toHex();
7409
- import_log21.log.trace("dxos.client-services.host.open", import_protocols17.trace.begin({
7446
+ import_log22.log.trace("dxos.client-services.host.open", import_protocols17.trace.begin({
7410
7447
  id: traceId
7411
7448
  }), {
7412
- F: __dxlog_file25,
7413
- L: 257,
7449
+ F: __dxlog_file26,
7450
+ L: 256,
7414
7451
  S: this,
7415
7452
  C: (f, a) => f(...a)
7416
7453
  });
7417
7454
  (0, import_invariant21.invariant)(this._config, "config not set", {
7418
- F: __dxlog_file25,
7419
- L: 259,
7455
+ F: __dxlog_file26,
7456
+ L: 258,
7420
7457
  S: this,
7421
7458
  A: [
7422
7459
  "this._config",
@@ -7424,8 +7461,8 @@ var ClientServicesHost = class {
7424
7461
  ]
7425
7462
  });
7426
7463
  (0, import_invariant21.invariant)(this._storage, "storage not set", {
7427
- F: __dxlog_file25,
7428
- L: 260,
7464
+ F: __dxlog_file26,
7465
+ L: 259,
7429
7466
  S: this,
7430
7467
  A: [
7431
7468
  "this._storage",
@@ -7433,8 +7470,8 @@ var ClientServicesHost = class {
7433
7470
  ]
7434
7471
  });
7435
7472
  (0, import_invariant21.invariant)(this._signalManager, "signal manager not set", {
7436
- F: __dxlog_file25,
7437
- L: 261,
7473
+ F: __dxlog_file26,
7474
+ L: 260,
7438
7475
  S: this,
7439
7476
  A: [
7440
7477
  "this._signalManager",
@@ -7442,8 +7479,8 @@ var ClientServicesHost = class {
7442
7479
  ]
7443
7480
  });
7444
7481
  (0, import_invariant21.invariant)(this._networkManager, "network manager not set", {
7445
- F: __dxlog_file25,
7446
- L: 262,
7482
+ F: __dxlog_file26,
7483
+ L: 261,
7447
7484
  S: this,
7448
7485
  A: [
7449
7486
  "this._networkManager",
@@ -7451,11 +7488,11 @@ var ClientServicesHost = class {
7451
7488
  ]
7452
7489
  });
7453
7490
  this._opening = true;
7454
- (0, import_log21.log)("opening...", {
7491
+ (0, import_log22.log)("opening...", {
7455
7492
  lockKey: this._resourceLock?.lockKey
7456
7493
  }, {
7457
- F: __dxlog_file25,
7458
- L: 265,
7494
+ F: __dxlog_file26,
7495
+ L: 264,
7459
7496
  S: this,
7460
7497
  C: (f, a) => f(...a)
7461
7498
  });
@@ -7507,19 +7544,19 @@ var ClientServicesHost = class {
7507
7544
  this._open = true;
7508
7545
  this._statusUpdate.emit();
7509
7546
  const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
7510
- (0, import_log21.log)("opened", {
7547
+ (0, import_log22.log)("opened", {
7511
7548
  deviceKey
7512
7549
  }, {
7513
- F: __dxlog_file25,
7514
- L: 353,
7550
+ F: __dxlog_file26,
7551
+ L: 352,
7515
7552
  S: this,
7516
7553
  C: (f, a) => f(...a)
7517
7554
  });
7518
- import_log21.log.trace("dxos.client-services.host.open", import_protocols17.trace.end({
7555
+ import_log22.log.trace("dxos.client-services.host.open", import_protocols17.trace.end({
7519
7556
  id: traceId
7520
7557
  }), {
7521
- F: __dxlog_file25,
7522
- L: 354,
7558
+ F: __dxlog_file26,
7559
+ L: 353,
7523
7560
  S: this,
7524
7561
  C: (f, a) => f(...a)
7525
7562
  });
@@ -7529,11 +7566,11 @@ var ClientServicesHost = class {
7529
7566
  return;
7530
7567
  }
7531
7568
  const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
7532
- (0, import_log21.log)("closing...", {
7569
+ (0, import_log22.log)("closing...", {
7533
7570
  deviceKey
7534
7571
  }, {
7535
- F: __dxlog_file25,
7536
- L: 365,
7572
+ F: __dxlog_file26,
7573
+ L: 364,
7537
7574
  S: this,
7538
7575
  C: (f, a) => f(...a)
7539
7576
  });
@@ -7547,44 +7584,44 @@ var ClientServicesHost = class {
7547
7584
  await this._level?.close();
7548
7585
  this._open = false;
7549
7586
  this._statusUpdate.emit();
7550
- (0, import_log21.log)("closed", {
7587
+ (0, import_log22.log)("closed", {
7551
7588
  deviceKey
7552
7589
  }, {
7553
- F: __dxlog_file25,
7554
- L: 374,
7590
+ F: __dxlog_file26,
7591
+ L: 373,
7555
7592
  S: this,
7556
7593
  C: (f, a) => f(...a)
7557
7594
  });
7558
7595
  }
7559
7596
  async reset() {
7560
7597
  const traceId = import_keys16.PublicKey.random().toHex();
7561
- import_log21.log.trace("dxos.sdk.client-services-host.reset", import_protocols17.trace.begin({
7598
+ import_log22.log.trace("dxos.sdk.client-services-host.reset", import_protocols17.trace.begin({
7562
7599
  id: traceId
7563
7600
  }), {
7564
- F: __dxlog_file25,
7565
- L: 379,
7601
+ F: __dxlog_file26,
7602
+ L: 378,
7566
7603
  S: this,
7567
7604
  C: (f, a) => f(...a)
7568
7605
  });
7569
- import_log21.log.info("resetting...", void 0, {
7570
- F: __dxlog_file25,
7571
- L: 381,
7606
+ import_log22.log.info("resetting...", void 0, {
7607
+ F: __dxlog_file26,
7608
+ L: 380,
7572
7609
  S: this,
7573
7610
  C: (f, a) => f(...a)
7574
7611
  });
7575
7612
  await this._serviceContext?.close();
7576
7613
  await this._storage.reset();
7577
- import_log21.log.info("reset", void 0, {
7578
- F: __dxlog_file25,
7579
- L: 384,
7614
+ import_log22.log.info("reset", void 0, {
7615
+ F: __dxlog_file26,
7616
+ L: 383,
7580
7617
  S: this,
7581
7618
  C: (f, a) => f(...a)
7582
7619
  });
7583
- import_log21.log.trace("dxos.sdk.client-services-host.reset", import_protocols17.trace.end({
7620
+ import_log22.log.trace("dxos.sdk.client-services-host.reset", import_protocols17.trace.end({
7584
7621
  id: traceId
7585
7622
  }), {
7586
- F: __dxlog_file25,
7587
- L: 385,
7623
+ F: __dxlog_file26,
7624
+ L: 384,
7588
7625
  S: this,
7589
7626
  C: (f, a) => f(...a)
7590
7627
  });
@@ -7657,4 +7694,4 @@ ClientServicesHost = _ts_decorate8([
7657
7694
  subscribeToSpaces,
7658
7695
  subscribeToSwarmInfo
7659
7696
  });
7660
- //# sourceMappingURL=chunk-WTK4Q3EG.cjs.map
7697
+ //# sourceMappingURL=chunk-JZHOBYSS.cjs.map