@dxos/client-services 0.5.9-main.eacfffa → 0.5.9-next.728078d

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.
@@ -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_6HFQ2SQ5_exports = {};
30
- __export(chunk_6HFQ2SQ5_exports, {
29
+ var chunk_XZHIBOD3_exports = {};
30
+ __export(chunk_XZHIBOD3_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  ClientServicesProviderResource: () => ClientServicesProviderResource,
@@ -56,7 +56,11 @@ __export(chunk_6HFQ2SQ5_exports, {
56
56
  createDiagnostics: () => createDiagnostics,
57
57
  createLevel: () => createLevel,
58
58
  createStorageObjects: () => createStorageObjects,
59
+ decodeProfileArchive: () => decodeProfileArchive,
60
+ encodeProfileArchive: () => encodeProfileArchive,
61
+ exportProfileData: () => exportProfileData,
59
62
  getNetworkPeers: () => getNetworkPeers,
63
+ importProfileData: () => importProfileData,
60
64
  isLocked: () => isLocked,
61
65
  subscribeToFeedBlocks: () => subscribeToFeedBlocks,
62
66
  subscribeToFeeds: () => subscribeToFeeds,
@@ -66,7 +70,7 @@ __export(chunk_6HFQ2SQ5_exports, {
66
70
  subscribeToSpaces: () => subscribeToSpaces,
67
71
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
68
72
  });
69
- module.exports = __toCommonJS(chunk_6HFQ2SQ5_exports);
73
+ module.exports = __toCommonJS(chunk_XZHIBOD3_exports);
70
74
  var import_async = require("@dxos/async");
71
75
  var import_codec_protobuf = require("@dxos/codec-protobuf");
72
76
  var import_feed_store = require("@dxos/feed-store");
@@ -289,38 +293,43 @@ var import_util12 = require("@dxos/util");
289
293
  var import_node_path = __toESM(require("node:path"));
290
294
  var import_keys14 = require("@dxos/keys");
291
295
  var import_kv_store = require("@dxos/kv-store");
296
+ var import_automerge_repo = require("@dxos/automerge/automerge-repo");
297
+ var import_invariant19 = require("@dxos/invariant");
298
+ var import_log19 = require("@dxos/log");
299
+ var import_protocols15 = require("@dxos/protocols");
300
+ var import_util13 = require("@dxos/util");
292
301
  var import_async20 = require("@dxos/async");
293
302
  var import_client_protocol7 = require("@dxos/client-protocol");
294
303
  var import_context16 = require("@dxos/context");
295
- var import_invariant19 = require("@dxos/invariant");
304
+ var import_invariant20 = require("@dxos/invariant");
296
305
  var import_keys15 = require("@dxos/keys");
297
- var import_log19 = require("@dxos/log");
306
+ var import_log20 = require("@dxos/log");
298
307
  var import_messaging = require("@dxos/messaging");
299
308
  var import_network_manager2 = require("@dxos/network-manager");
300
- var import_protocols15 = require("@dxos/protocols");
309
+ var import_protocols16 = require("@dxos/protocols");
301
310
  var import_services17 = require("@dxos/protocols/proto/dxos/client/services");
302
311
  var import_tracing9 = require("@dxos/tracing");
303
312
  var import_websocket_rpc = require("@dxos/websocket-rpc");
304
313
  var import_async21 = require("@dxos/async");
305
314
  var import_codec_protobuf12 = require("@dxos/codec-protobuf");
306
- var import_invariant20 = require("@dxos/invariant");
315
+ var import_invariant21 = require("@dxos/invariant");
307
316
  var import_services18 = require("@dxos/protocols/proto/dxos/client/services");
308
317
  var import_config3 = require("@dxos/config");
309
318
  var import_services19 = require("@dxos/protocols/proto/dxos/client/services");
310
319
  var import_tracing10 = require("@dxos/tracing");
311
- var import_util13 = require("@dxos/util");
312
- var import_keys16 = require("@dxos/keys");
313
320
  var import_util14 = require("@dxos/util");
321
+ var import_keys16 = require("@dxos/keys");
322
+ var import_util15 = require("@dxos/util");
314
323
  var import_async22 = require("@dxos/async");
315
324
  var import_codec_protobuf13 = require("@dxos/codec-protobuf");
316
325
  var import_keys17 = require("@dxos/keys");
317
- var import_log20 = require("@dxos/log");
326
+ var import_log21 = require("@dxos/log");
318
327
  var import_services20 = require("@dxos/protocols/proto/dxos/client/services");
319
- var import_util15 = require("@dxos/util");
328
+ var import_util16 = require("@dxos/util");
320
329
  var import_codec_protobuf14 = require("@dxos/codec-protobuf");
321
330
  var import_codec_protobuf15 = require("@dxos/codec-protobuf");
322
331
  var import_services21 = require("@dxos/protocols/proto/dxos/client/services");
323
- var import_util16 = require("@dxos/util");
332
+ var import_util17 = require("@dxos/util");
324
333
  var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
325
334
  return new import_codec_protobuf.Stream(({ next }) => {
326
335
  const subscriptions = new import_async.EventSubscriptions();
@@ -388,7 +397,6 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
388
397
  };
389
398
  });
390
399
  };
391
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devtools/network.ts";
392
400
  var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf2.Stream(({ next, close }) => {
393
401
  const update = () => {
394
402
  try {
@@ -404,10 +412,7 @@ var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf2
404
412
  update();
405
413
  });
406
414
  var subscribeToSignal = ({ signalManager }) => new import_codec_protobuf2.Stream(({ next }) => {
407
- const ctx = new import_context.Context(void 0, {
408
- F: __dxlog_file,
409
- L: 36
410
- });
415
+ const ctx = new import_context.Context();
411
416
  signalManager.onMessage.on(ctx, (message) => {
412
417
  next({
413
418
  message: {
@@ -635,7 +640,7 @@ var DevtoolsServiceImpl = class {
635
640
  });
636
641
  }
637
642
  };
638
- var DXOS_VERSION = "0.5.9-main.eacfffa";
643
+ var DXOS_VERSION = "0.5.9-next.728078d";
639
644
  var getPlatform = () => {
640
645
  if (process.browser) {
641
646
  if (typeof window !== "undefined") {
@@ -663,7 +668,7 @@ var getPlatform = () => {
663
668
  };
664
669
  }
665
670
  };
666
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts";
671
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts";
667
672
  var DEFAULT_TIMEOUT = 1e3;
668
673
  var createDiagnostics = async (clientServices, serviceContext, config) => {
669
674
  const diagnostics = {
@@ -680,7 +685,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
680
685
  await Promise.all([
681
686
  (async () => {
682
687
  (0, import_invariant.invariant)(clientServices.LoggingService, "SystemService is not available.", {
683
- F: __dxlog_file2,
688
+ F: __dxlog_file,
684
689
  L: 110,
685
690
  S: void 0,
686
691
  A: [
@@ -869,7 +874,7 @@ _ts_decorate([
869
874
  ClientRpcServer = _ts_decorate([
870
875
  import_tracing2.trace.resource()
871
876
  ], ClientRpcServer);
872
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
877
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
873
878
  var Credential = import_protocols2.schema.getCodecForType("dxos.halo.credentials.Credential");
874
879
  var createAuthProvider = (signer) => async (nonce) => {
875
880
  const credential = await signer.createCredential({
@@ -884,10 +889,7 @@ var createAuthProvider = (signer) => async (nonce) => {
884
889
  var TrustedKeySetAuthVerifier = class {
885
890
  constructor(_params) {
886
891
  this._params = _params;
887
- this._ctx = new import_context2.Context(void 0, {
888
- F: __dxlog_file3,
889
- L: 45
890
- });
892
+ this._ctx = new import_context2.Context();
891
893
  }
892
894
  async close() {
893
895
  await this._ctx.dispose();
@@ -898,7 +900,7 @@ var TrustedKeySetAuthVerifier = class {
898
900
  (0, import_log.log)("authenticating...", {
899
901
  credential
900
902
  }, {
901
- F: __dxlog_file3,
903
+ F: __dxlog_file2,
902
904
  L: 56,
903
905
  S: this,
904
906
  C: (f, a) => f(...a)
@@ -908,7 +910,7 @@ var TrustedKeySetAuthVerifier = class {
908
910
  (0, import_log.log)("Invalid credential", {
909
911
  result
910
912
  }, {
911
- F: __dxlog_file3,
913
+ F: __dxlog_file2,
912
914
  L: 60,
913
915
  S: this,
914
916
  C: (f, a) => f(...a)
@@ -920,7 +922,7 @@ var TrustedKeySetAuthVerifier = class {
920
922
  nonce,
921
923
  credential
922
924
  }, {
923
- F: __dxlog_file3,
925
+ F: __dxlog_file2,
924
926
  L: 65,
925
927
  S: this,
926
928
  C: (f, a) => f(...a)
@@ -931,7 +933,7 @@ var TrustedKeySetAuthVerifier = class {
931
933
  (0, import_log.log)("key is not currently in trusted set, waiting...", {
932
934
  key: credential.issuer
933
935
  }, {
934
- F: __dxlog_file3,
936
+ F: __dxlog_file2,
935
937
  L: 70,
936
938
  S: this,
937
939
  C: (f, a) => f(...a)
@@ -947,7 +949,7 @@ var TrustedKeySetAuthVerifier = class {
947
949
  (0, import_log.log)("auth success", {
948
950
  key: credential.issuer
949
951
  }, {
950
- F: __dxlog_file3,
952
+ F: __dxlog_file2,
951
953
  L: 81,
952
954
  S: this,
953
955
  C: (f, a) => f(...a)
@@ -957,7 +959,7 @@ var TrustedKeySetAuthVerifier = class {
957
959
  (0, import_log.log)("key is not currently in trusted set, waiting...", {
958
960
  key: credential.issuer
959
961
  }, {
960
- F: __dxlog_file3,
962
+ F: __dxlog_file2,
961
963
  L: 84,
962
964
  S: this,
963
965
  C: (f, a) => f(...a)
@@ -980,7 +982,7 @@ var TrustedKeySetAuthVerifier = class {
980
982
  return deviceSet.has(deviceKey);
981
983
  }
982
984
  };
983
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/default-space-state-machine.ts";
985
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/default-space-state-machine.ts";
984
986
  var DefaultSpaceStateMachine = class {
985
987
  constructor(_params) {
986
988
  this._params = _params;
@@ -997,7 +999,7 @@ var DefaultSpaceStateMachine = class {
997
999
  expectedIdentity: this._params.identityKey,
998
1000
  credential
999
1001
  }, {
1000
- F: __dxlog_file4,
1002
+ F: __dxlog_file3,
1001
1003
  L: 32,
1002
1004
  S: this,
1003
1005
  C: (f, a) => f(...a)
@@ -1008,7 +1010,7 @@ var DefaultSpaceStateMachine = class {
1008
1010
  import_log3.log.warn("Invalid default space id", {
1009
1011
  id: assertion.spaceId
1010
1012
  }, {
1011
- F: __dxlog_file4,
1013
+ F: __dxlog_file3,
1012
1014
  L: 36,
1013
1015
  S: this,
1014
1016
  C: (f, a) => f(...a)
@@ -1031,7 +1033,7 @@ function _ts_decorate2(decorators, target, key, desc) {
1031
1033
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1032
1034
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1033
1035
  }
1034
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
1036
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
1035
1037
  var Identity = class {
1036
1038
  constructor({ space, signer, identityKey, deviceKey, presence }) {
1037
1039
  this.stateUpdate = new import_async6.Event();
@@ -1043,7 +1045,7 @@ var Identity = class {
1043
1045
  import_log2.log.trace("dxos.halo.device", {
1044
1046
  deviceKey
1045
1047
  }, {
1046
- F: __dxlog_file5,
1048
+ F: __dxlog_file4,
1047
1049
  L: 70,
1048
1050
  S: this,
1049
1051
  C: (f, a) => f(...a)
@@ -1122,7 +1124,7 @@ var Identity = class {
1122
1124
  */
1123
1125
  getIdentityCredentialSigner() {
1124
1126
  (0, import_invariant2.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
1125
- F: __dxlog_file5,
1127
+ F: __dxlog_file4,
1126
1128
  L: 159,
1127
1129
  S: this,
1128
1130
  A: [
@@ -1166,7 +1168,7 @@ var Identity = class {
1166
1168
  controlFeedKey,
1167
1169
  dataFeedKey
1168
1170
  }, {
1169
- F: __dxlog_file5,
1171
+ F: __dxlog_file4,
1170
1172
  L: 184,
1171
1173
  S: this,
1172
1174
  C: (f, a) => f(...a)
@@ -1227,7 +1229,7 @@ function _ts_decorate3(decorators, target, key, desc) {
1227
1229
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1228
1230
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1229
1231
  }
1230
- var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
1232
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
1231
1233
  var DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 1e4;
1232
1234
  var DEVICE_PRESENCE_OFFLINE_TIMEOUT = 2e4;
1233
1235
  var IdentityManager = class {
@@ -1251,7 +1253,7 @@ var IdentityManager = class {
1251
1253
  import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.begin({
1252
1254
  id: traceId
1253
1255
  }), {
1254
- F: __dxlog_file6,
1256
+ F: __dxlog_file5,
1255
1257
  L: 104,
1256
1258
  S: this,
1257
1259
  C: (f, a) => f(...a)
@@ -1260,7 +1262,7 @@ var IdentityManager = class {
1260
1262
  (0, import_log4.log)("identity record", {
1261
1263
  identityRecord
1262
1264
  }, {
1263
- F: __dxlog_file6,
1265
+ F: __dxlog_file5,
1264
1266
  L: 107,
1265
1267
  S: this,
1266
1268
  C: (f, a) => f(...a)
@@ -1273,7 +1275,7 @@ var IdentityManager = class {
1273
1275
  identityKey: identityRecord.identityKey,
1274
1276
  displayName: this._identity.profileDocument?.displayName
1275
1277
  }, {
1276
- F: __dxlog_file6,
1278
+ F: __dxlog_file5,
1277
1279
  L: 112,
1278
1280
  S: this,
1279
1281
  C: (f, a) => f(...a)
@@ -1283,21 +1285,18 @@ var IdentityManager = class {
1283
1285
  import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.end({
1284
1286
  id: traceId
1285
1287
  }), {
1286
- F: __dxlog_file6,
1288
+ F: __dxlog_file5,
1287
1289
  L: 119,
1288
1290
  S: this,
1289
1291
  C: (f, a) => f(...a)
1290
1292
  });
1291
1293
  }
1292
1294
  async close() {
1293
- await this._identity?.close(new import_context3.Context(void 0, {
1294
- F: __dxlog_file6,
1295
- L: 123
1296
- }));
1295
+ await this._identity?.close(new import_context3.Context());
1297
1296
  }
1298
1297
  async createIdentity({ displayName, deviceProfile } = {}) {
1299
1298
  (0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
1300
- F: __dxlog_file6,
1299
+ F: __dxlog_file5,
1301
1300
  L: 128,
1302
1301
  S: this,
1303
1302
  A: [
@@ -1306,7 +1305,7 @@ var IdentityManager = class {
1306
1305
  ]
1307
1306
  });
1308
1307
  (0, import_log4.log)("creating identity...", void 0, {
1309
- F: __dxlog_file6,
1308
+ F: __dxlog_file5,
1310
1309
  L: 129,
1311
1310
  S: this,
1312
1311
  C: (f, a) => f(...a)
@@ -1323,14 +1322,11 @@ var IdentityManager = class {
1323
1322
  }
1324
1323
  };
1325
1324
  const identity = await this._constructIdentity(identityRecord);
1326
- await identity.open(new import_context3.Context(void 0, {
1327
- F: __dxlog_file6,
1328
- L: 144
1329
- }));
1325
+ await identity.open(new import_context3.Context());
1330
1326
  {
1331
1327
  const generator = new import_credentials6.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
1332
1328
  (0, import_invariant3.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
1333
- F: __dxlog_file6,
1329
+ F: __dxlog_file5,
1334
1330
  L: 148,
1335
1331
  S: this,
1336
1332
  A: [
@@ -1339,7 +1335,7 @@ var IdentityManager = class {
1339
1335
  ]
1340
1336
  });
1341
1337
  (0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
1342
- F: __dxlog_file6,
1338
+ F: __dxlog_file5,
1343
1339
  L: 149,
1344
1340
  S: this,
1345
1341
  A: [
@@ -1378,7 +1374,7 @@ var IdentityManager = class {
1378
1374
  identityKey: identityRecord.identityKey,
1379
1375
  displayName: this._identity.profileDocument?.displayName
1380
1376
  }, {
1381
- F: __dxlog_file6,
1377
+ F: __dxlog_file5,
1382
1378
  L: 191,
1383
1379
  S: this,
1384
1380
  C: (f, a) => f(...a)
@@ -1389,7 +1385,7 @@ var IdentityManager = class {
1389
1385
  deviceKey: identity.deviceKey,
1390
1386
  profile: identity.profileDocument
1391
1387
  }, {
1392
- F: __dxlog_file6,
1388
+ F: __dxlog_file5,
1393
1389
  L: 197,
1394
1390
  S: this,
1395
1391
  C: (f, a) => f(...a)
@@ -1426,13 +1422,13 @@ var IdentityManager = class {
1426
1422
  (0, import_log4.log)("accepting identity", {
1427
1423
  params
1428
1424
  }, {
1429
- F: __dxlog_file6,
1425
+ F: __dxlog_file5,
1430
1426
  L: 235,
1431
1427
  S: this,
1432
1428
  C: (f, a) => f(...a)
1433
1429
  });
1434
1430
  (0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
1435
- F: __dxlog_file6,
1431
+ F: __dxlog_file5,
1436
1432
  L: 236,
1437
1433
  S: this,
1438
1434
  A: [
@@ -1452,10 +1448,7 @@ var IdentityManager = class {
1452
1448
  }
1453
1449
  };
1454
1450
  const identity = await this._constructIdentity(identityRecord);
1455
- await identity.open(new import_context3.Context(void 0, {
1456
- F: __dxlog_file6,
1457
- L: 251
1458
- }));
1451
+ await identity.open(new import_context3.Context());
1459
1452
  this._identity = identity;
1460
1453
  await this._metadataStore.setIdentityRecord(identityRecord);
1461
1454
  await this._identity.ready();
@@ -1463,7 +1456,7 @@ var IdentityManager = class {
1463
1456
  identityKey: identityRecord.identityKey,
1464
1457
  displayName: this._identity.profileDocument?.displayName
1465
1458
  }, {
1466
- F: __dxlog_file6,
1459
+ F: __dxlog_file5,
1467
1460
  L: 255,
1468
1461
  S: this,
1469
1462
  C: (f, a) => f(...a)
@@ -1477,7 +1470,7 @@ var IdentityManager = class {
1477
1470
  identityKey: identity.identityKey,
1478
1471
  deviceKey: identity.deviceKey
1479
1472
  }, {
1480
- F: __dxlog_file6,
1473
+ F: __dxlog_file5,
1481
1474
  L: 265,
1482
1475
  S: this,
1483
1476
  C: (f, a) => f(...a)
@@ -1489,7 +1482,7 @@ var IdentityManager = class {
1489
1482
  */
1490
1483
  async updateProfile(profile) {
1491
1484
  (0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
1492
- F: __dxlog_file6,
1485
+ F: __dxlog_file5,
1493
1486
  L: 273,
1494
1487
  S: this,
1495
1488
  A: [
@@ -1520,7 +1513,7 @@ var IdentityManager = class {
1520
1513
  }
1521
1514
  async updateDeviceProfile(profile) {
1522
1515
  (0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
1523
- F: __dxlog_file6,
1516
+ F: __dxlog_file5,
1524
1517
  L: 290,
1525
1518
  S: this,
1526
1519
  A: [
@@ -1556,7 +1549,7 @@ var IdentityManager = class {
1556
1549
  }
1557
1550
  async _constructIdentity(identityRecord) {
1558
1551
  (0, import_invariant3.invariant)(!this._identity, void 0, {
1559
- F: __dxlog_file6,
1552
+ F: __dxlog_file5,
1560
1553
  L: 316,
1561
1554
  S: this,
1562
1555
  A: [
@@ -1567,7 +1560,7 @@ var IdentityManager = class {
1567
1560
  (0, import_log4.log)("constructing identity", {
1568
1561
  identityRecord
1569
1562
  }, {
1570
- F: __dxlog_file6,
1563
+ F: __dxlog_file5,
1571
1564
  L: 317,
1572
1565
  S: this,
1573
1566
  C: (f, a) => f(...a)
@@ -1582,7 +1575,7 @@ var IdentityManager = class {
1582
1575
  gossip
1583
1576
  });
1584
1577
  (0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
1585
- F: __dxlog_file6,
1578
+ F: __dxlog_file5,
1586
1579
  L: 330,
1587
1580
  S: this,
1588
1581
  A: [
@@ -1594,7 +1587,7 @@ var IdentityManager = class {
1594
1587
  writable: true
1595
1588
  });
1596
1589
  (0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
1597
- F: __dxlog_file6,
1590
+ F: __dxlog_file5,
1598
1591
  L: 334,
1599
1592
  S: this,
1600
1593
  A: [
@@ -1628,7 +1621,7 @@ var IdentityManager = class {
1628
1621
  (0, import_log4.log)("done", {
1629
1622
  identityKey: identityRecord.identityKey
1630
1623
  }, {
1631
- F: __dxlog_file6,
1624
+ F: __dxlog_file5,
1632
1625
  L: 360,
1633
1626
  S: this,
1634
1627
  C: (f, a) => f(...a)
@@ -1653,7 +1646,7 @@ var IdentityManager = class {
1653
1646
  },
1654
1647
  onAuthFailure: () => {
1655
1648
  import_log4.log.warn("auth failure", void 0, {
1656
- F: __dxlog_file6,
1649
+ F: __dxlog_file5,
1657
1650
  L: 385,
1658
1651
  S: this,
1659
1652
  C: (f, a) => f(...a)
@@ -1675,7 +1668,7 @@ _ts_decorate3([
1675
1668
  IdentityManager = _ts_decorate3([
1676
1669
  import_tracing4.trace.resource()
1677
1670
  ], IdentityManager);
1678
- var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1671
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1679
1672
  var DEFAULT_SPACE_SEARCH_TIMEOUT = 1e4;
1680
1673
  var IdentityServiceImpl = class extends import_context4.Resource {
1681
1674
  constructor(_identityManager, _keyring, _dataSpaceManagerProvider, _createIdentity, _onProfileUpdate) {
@@ -1705,7 +1698,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1705
1698
  const space = await dataSpaceManager.createDefaultSpace();
1706
1699
  const identity = this._identityManager.identity;
1707
1700
  (0, import_invariant4.invariant)(identity, void 0, {
1708
- F: __dxlog_file7,
1701
+ F: __dxlog_file6,
1709
1702
  L: 59,
1710
1703
  S: this,
1711
1704
  A: [
@@ -1739,7 +1732,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1739
1732
  }
1740
1733
  async updateProfile(profile) {
1741
1734
  (0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
1742
- F: __dxlog_file7,
1735
+ F: __dxlog_file6,
1743
1736
  L: 89,
1744
1737
  S: this,
1745
1738
  A: [
@@ -1753,7 +1746,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1753
1746
  }
1754
1747
  async signPresentation({ presentation, nonce }) {
1755
1748
  (0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
1756
- F: __dxlog_file7,
1749
+ F: __dxlog_file6,
1757
1750
  L: 96,
1758
1751
  S: this,
1759
1752
  A: [
@@ -1788,7 +1781,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1788
1781
  import_log5.log.warn("Multiple default spaces found. Using the first one.", {
1789
1782
  duplicate: space.id
1790
1783
  }, {
1791
- F: __dxlog_file7,
1784
+ F: __dxlog_file6,
1792
1785
  L: 127,
1793
1786
  S: this,
1794
1787
  C: (f, a) => f(...a)
@@ -1811,7 +1804,7 @@ var IdentityServiceImpl = class extends import_context4.Resource {
1811
1804
  }
1812
1805
  }
1813
1806
  };
1814
- var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1807
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1815
1808
  var DeviceInvitationProtocol = class {
1816
1809
  constructor(_keyring, _getIdentity, _acceptIdentity) {
1817
1810
  this._keyring = _keyring;
@@ -1837,7 +1830,7 @@ var DeviceInvitationProtocol = class {
1837
1830
  }
1838
1831
  async admit(_, request) {
1839
1832
  (0, import_invariant5.invariant)(request.device, void 0, {
1840
- F: __dxlog_file8,
1833
+ F: __dxlog_file7,
1841
1834
  L: 50,
1842
1835
  S: this,
1843
1836
  A: [
@@ -1883,7 +1876,7 @@ var DeviceInvitationProtocol = class {
1883
1876
  }
1884
1877
  async accept(response, request) {
1885
1878
  (0, import_invariant5.invariant)(response.device, void 0, {
1886
- F: __dxlog_file8,
1879
+ F: __dxlog_file7,
1887
1880
  L: 95,
1888
1881
  S: this,
1889
1882
  A: [
@@ -1893,7 +1886,7 @@ var DeviceInvitationProtocol = class {
1893
1886
  });
1894
1887
  const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
1895
1888
  (0, import_invariant5.invariant)(request.device, void 0, {
1896
- F: __dxlog_file8,
1889
+ F: __dxlog_file7,
1897
1890
  L: 98,
1898
1891
  S: this,
1899
1892
  A: [
@@ -1932,7 +1925,7 @@ var tryAcquireBeforeContextDisposed = async (ctx, mutex) => {
1932
1925
  return guard;
1933
1926
  })());
1934
1927
  };
1935
- var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts";
1928
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts";
1936
1929
  var OPTIONS_TIMEOUT = 1e4;
1937
1930
  var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1938
1931
  constructor(_invitationFlowMutex, _callbacks) {
@@ -1946,10 +1939,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1946
1939
  });
1947
1940
  this._invitationFlowMutex = _invitationFlowMutex;
1948
1941
  this._callbacks = _callbacks;
1949
- this._ctx = new import_context6.Context(void 0, {
1950
- F: __dxlog_file9,
1951
- L: 33
1952
- });
1942
+ this._ctx = new import_context6.Context();
1953
1943
  this._remoteOptionsTrigger = new import_async10.Trigger();
1954
1944
  this._invitationFlowLock = null;
1955
1945
  }
@@ -1961,7 +1951,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1961
1951
  InvitationHostService: {
1962
1952
  options: async (options) => {
1963
1953
  (0, import_invariant7.invariant)(!this._remoteOptions, "Remote options already set.", {
1964
- F: __dxlog_file9,
1954
+ F: __dxlog_file8,
1965
1955
  L: 63,
1966
1956
  S: this,
1967
1957
  A: [
@@ -1988,14 +1978,14 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1988
1978
  await super.onOpen(context);
1989
1979
  try {
1990
1980
  (0, import_log7.log)("guest acquire lock", void 0, {
1991
- F: __dxlog_file9,
1981
+ F: __dxlog_file8,
1992
1982
  L: 84,
1993
1983
  S: this,
1994
1984
  C: (f, a) => f(...a)
1995
1985
  });
1996
1986
  this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
1997
1987
  (0, import_log7.log)("guest lock acquired", void 0, {
1998
- F: __dxlog_file9,
1988
+ F: __dxlog_file8,
1999
1989
  L: 86,
2000
1990
  S: this,
2001
1991
  C: (f, a) => f(...a)
@@ -2004,7 +1994,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2004
1994
  role: import_invitations3.Options.Role.GUEST
2005
1995
  }));
2006
1996
  (0, import_log7.log)("options sent", void 0, {
2007
- F: __dxlog_file9,
1997
+ F: __dxlog_file8,
2008
1998
  L: 88,
2009
1999
  S: this,
2010
2000
  C: (f, a) => f(...a)
@@ -2013,7 +2003,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2013
2003
  timeout: OPTIONS_TIMEOUT
2014
2004
  }));
2015
2005
  (0, import_log7.log)("options received", void 0, {
2016
- F: __dxlog_file9,
2006
+ F: __dxlog_file8,
2017
2007
  L: 90,
2018
2008
  S: this,
2019
2009
  C: (f, a) => f(...a)
@@ -2047,7 +2037,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2047
2037
  this._invitationFlowLock.release();
2048
2038
  this._invitationFlowLock = null;
2049
2039
  (0, import_log7.log)("invitation flow lock released", void 0, {
2050
- F: __dxlog_file9,
2040
+ F: __dxlog_file8,
2051
2041
  L: 123,
2052
2042
  S: this,
2053
2043
  C: (f, a) => f(...a)
@@ -2055,7 +2045,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
2055
2045
  }
2056
2046
  }
2057
2047
  };
2058
- var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts";
2048
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts";
2059
2049
  var OPTIONS_TIMEOUT2 = 1e4;
2060
2050
  var MAX_OTP_ATTEMPTS = 3;
2061
2051
  var InvitationHostExtension = class extends import_teleport2.RpcExtension {
@@ -2070,10 +2060,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2070
2060
  });
2071
2061
  this._invitationFlowMutex = _invitationFlowMutex;
2072
2062
  this._callbacks = _callbacks;
2073
- this._ctx = new import_context8.Context(void 0, {
2074
- F: __dxlog_file10,
2075
- L: 52
2076
- });
2063
+ this._ctx = new import_context8.Context();
2077
2064
  this._remoteOptionsTrigger = new import_async11.Trigger();
2078
2065
  this._challenge = void 0;
2079
2066
  this.guestProfile = void 0;
@@ -2092,7 +2079,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2092
2079
  InvitationHostService: {
2093
2080
  options: async (options) => {
2094
2081
  (0, import_invariant8.invariant)(!this._remoteOptions, "Remote options already set.", {
2095
- F: __dxlog_file10,
2082
+ F: __dxlog_file9,
2096
2083
  L: 101,
2097
2084
  S: this,
2098
2085
  A: [
@@ -2109,7 +2096,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2109
2096
  import_log8.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols7.trace.begin({
2110
2097
  id: traceId
2111
2098
  }), {
2112
- F: __dxlog_file10,
2099
+ F: __dxlog_file9,
2113
2100
  L: 110,
2114
2101
  S: this,
2115
2102
  C: (f, a) => f(...a)
@@ -2121,7 +2108,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2121
2108
  expected: invitation.invitationId,
2122
2109
  actual: invitationId
2123
2110
  }, {
2124
- F: __dxlog_file10,
2111
+ F: __dxlog_file9,
2125
2112
  L: 116,
2126
2113
  S: this,
2127
2114
  C: (f, a) => f(...a)
@@ -2135,7 +2122,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2135
2122
  (0, import_log8.log)("guest introduced themselves", {
2136
2123
  guestProfile: profile
2137
2124
  }, {
2138
- F: __dxlog_file10,
2125
+ F: __dxlog_file9,
2139
2126
  L: 125,
2140
2127
  S: this,
2141
2128
  C: (f, a) => f(...a)
@@ -2146,7 +2133,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2146
2133
  import_log8.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols7.trace.end({
2147
2134
  id: traceId
2148
2135
  }), {
2149
- F: __dxlog_file10,
2136
+ F: __dxlog_file9,
2150
2137
  L: 132,
2151
2138
  S: this,
2152
2139
  C: (f, a) => f(...a)
@@ -2161,7 +2148,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2161
2148
  import_log8.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols7.trace.begin({
2162
2149
  id: traceId
2163
2150
  }), {
2164
- F: __dxlog_file10,
2151
+ F: __dxlog_file9,
2165
2152
  L: 141,
2166
2153
  S: this,
2167
2154
  C: (f, a) => f(...a)
@@ -2170,7 +2157,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2170
2157
  (0, import_log8.log)("received authentication request", {
2171
2158
  authCode: code
2172
2159
  }, {
2173
- F: __dxlog_file10,
2160
+ F: __dxlog_file9,
2174
2161
  L: 144,
2175
2162
  S: this,
2176
2163
  C: (f, a) => f(...a)
@@ -2184,7 +2171,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2184
2171
  switch (invitation.authMethod) {
2185
2172
  case import_services8.Invitation.AuthMethod.NONE: {
2186
2173
  (0, import_log8.log)("authentication not required", void 0, {
2187
- F: __dxlog_file10,
2174
+ F: __dxlog_file9,
2188
2175
  L: 152,
2189
2176
  S: this,
2190
2177
  C: (f, a) => f(...a)
@@ -2222,7 +2209,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2222
2209
  import_log8.log.error("invalid authentication method", {
2223
2210
  authMethod: invitation.authMethod
2224
2211
  }, {
2225
- F: __dxlog_file10,
2212
+ F: __dxlog_file9,
2226
2213
  L: 190,
2227
2214
  S: this,
2228
2215
  C: (f, a) => f(...a)
@@ -2247,7 +2234,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2247
2234
  status
2248
2235
  }
2249
2236
  }), {
2250
- F: __dxlog_file10,
2237
+ F: __dxlog_file9,
2251
2238
  L: 202,
2252
2239
  S: this,
2253
2240
  C: (f, a) => f(...a)
@@ -2261,7 +2248,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2261
2248
  import_log8.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols7.trace.begin({
2262
2249
  id: traceId
2263
2250
  }), {
2264
- F: __dxlog_file10,
2251
+ F: __dxlog_file9,
2265
2252
  L: 208,
2266
2253
  S: this,
2267
2254
  C: (f, a) => f(...a)
@@ -2278,7 +2265,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2278
2265
  import_log8.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols7.trace.end({
2279
2266
  id: traceId
2280
2267
  }), {
2281
- F: __dxlog_file10,
2268
+ F: __dxlog_file9,
2282
2269
  L: 222,
2283
2270
  S: this,
2284
2271
  C: (f, a) => f(...a)
@@ -2296,14 +2283,14 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2296
2283
  await super.onOpen(context);
2297
2284
  try {
2298
2285
  (0, import_log8.log)("host acquire lock", void 0, {
2299
- F: __dxlog_file10,
2286
+ F: __dxlog_file9,
2300
2287
  L: 237,
2301
2288
  S: this,
2302
2289
  C: (f, a) => f(...a)
2303
2290
  });
2304
2291
  this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
2305
2292
  (0, import_log8.log)("host lock acquired", void 0, {
2306
- F: __dxlog_file10,
2293
+ F: __dxlog_file9,
2307
2294
  L: 239,
2308
2295
  S: this,
2309
2296
  C: (f, a) => f(...a)
@@ -2314,7 +2301,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2314
2301
  role: import_invitations4.Options.Role.HOST
2315
2302
  });
2316
2303
  (0, import_log8.log)("options sent", void 0, {
2317
- F: __dxlog_file10,
2304
+ F: __dxlog_file9,
2318
2305
  L: 243,
2319
2306
  S: this,
2320
2307
  C: (f, a) => f(...a)
@@ -2323,7 +2310,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2323
2310
  timeout: OPTIONS_TIMEOUT2
2324
2311
  }));
2325
2312
  (0, import_log8.log)("options received", void 0, {
2326
- F: __dxlog_file10,
2313
+ F: __dxlog_file9,
2327
2314
  L: 245,
2328
2315
  S: this,
2329
2316
  C: (f, a) => f(...a)
@@ -2377,7 +2364,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2377
2364
  this._invitationFlowLock?.release();
2378
2365
  this._invitationFlowLock = null;
2379
2366
  (0, import_log8.log)("invitation flow lock released", void 0, {
2380
- F: __dxlog_file10,
2367
+ F: __dxlog_file9,
2381
2368
  L: 300,
2382
2369
  S: this,
2383
2370
  C: (f, a) => f(...a)
@@ -2386,7 +2373,7 @@ var InvitationHostExtension = class extends import_teleport2.RpcExtension {
2386
2373
  }
2387
2374
  };
2388
2375
  var isAuthenticationRequired = (invitation) => invitation.authMethod !== import_services8.Invitation.AuthMethod.NONE;
2389
- var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
2376
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
2390
2377
  var InvitationTopology = class {
2391
2378
  constructor(_role) {
2392
2379
  this._role = _role;
@@ -2394,7 +2381,7 @@ var InvitationTopology = class {
2394
2381
  }
2395
2382
  init(controller) {
2396
2383
  (0, import_invariant9.invariant)(!this._controller, "Already initialized.", {
2397
- F: __dxlog_file11,
2384
+ F: __dxlog_file10,
2398
2385
  L: 42,
2399
2386
  S: this,
2400
2387
  A: [
@@ -2406,7 +2393,7 @@ var InvitationTopology = class {
2406
2393
  }
2407
2394
  update() {
2408
2395
  (0, import_invariant9.invariant)(this._controller, "Not initialized.", {
2409
- F: __dxlog_file11,
2396
+ F: __dxlog_file10,
2410
2397
  L: 47,
2411
2398
  S: this,
2412
2399
  A: [
@@ -2429,7 +2416,7 @@ var InvitationTopology = class {
2429
2416
  ownPeerId,
2430
2417
  remotePeerId: firstUnknownPeer
2431
2418
  }, {
2432
- F: __dxlog_file11,
2419
+ F: __dxlog_file10,
2433
2420
  L: 69,
2434
2421
  S: this,
2435
2422
  C: (f, a) => f(...a)
@@ -2440,7 +2427,7 @@ var InvitationTopology = class {
2440
2427
  }
2441
2428
  async onOffer(peer) {
2442
2429
  (0, import_invariant9.invariant)(this._controller, "Not initialized.", {
2443
- F: __dxlog_file11,
2430
+ F: __dxlog_file10,
2444
2431
  L: 76,
2445
2432
  S: this,
2446
2433
  A: [
@@ -2457,7 +2444,7 @@ var InvitationTopology = class {
2457
2444
  return `InvitationTopology(${this._role === import_invitations5.Options.Role.GUEST ? "guest" : "host"})`;
2458
2445
  }
2459
2446
  };
2460
- var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2447
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2461
2448
  var MAX_DELEGATED_INVITATION_HOST_TRIES = 3;
2462
2449
  var InvitationsHandler = class {
2463
2450
  /**
@@ -2482,7 +2469,7 @@ var InvitationsHandler = class {
2482
2469
  try {
2483
2470
  const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
2484
2471
  (0, import_invariant6.invariant)(deviceKey, void 0, {
2485
- F: __dxlog_file12,
2472
+ F: __dxlog_file11,
2486
2473
  L: 90,
2487
2474
  S: this,
2488
2475
  A: [
@@ -2511,7 +2498,7 @@ var InvitationsHandler = class {
2511
2498
  import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.begin({
2512
2499
  id: traceId
2513
2500
  }), {
2514
- F: __dxlog_file12,
2501
+ F: __dxlog_file11,
2515
2502
  L: 115,
2516
2503
  S: this,
2517
2504
  C: (f, a) => f(...a)
@@ -2519,7 +2506,7 @@ var InvitationsHandler = class {
2519
2506
  (0, import_log6.log)("connected", {
2520
2507
  ...protocol.toJSON()
2521
2508
  }, {
2522
- F: __dxlog_file12,
2509
+ F: __dxlog_file11,
2523
2510
  L: 116,
2524
2511
  S: this,
2525
2512
  C: (f, a) => f(...a)
@@ -2531,7 +2518,7 @@ var InvitationsHandler = class {
2531
2518
  guest: deviceKey,
2532
2519
  ...protocol.toJSON()
2533
2520
  }, {
2534
- F: __dxlog_file12,
2521
+ F: __dxlog_file11,
2535
2522
  L: 118,
2536
2523
  S: this,
2537
2524
  C: (f, a) => f(...a)
@@ -2540,7 +2527,7 @@ var InvitationsHandler = class {
2540
2527
  import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.end({
2541
2528
  id: traceId
2542
2529
  }), {
2543
- F: __dxlog_file12,
2530
+ F: __dxlog_file11,
2544
2531
  L: 120,
2545
2532
  S: this,
2546
2533
  C: (f, a) => f(...a)
@@ -2555,7 +2542,7 @@ var InvitationsHandler = class {
2555
2542
  (0, import_log6.log)("timeout", {
2556
2543
  ...protocol.toJSON()
2557
2544
  }, {
2558
- F: __dxlog_file12,
2545
+ F: __dxlog_file11,
2559
2546
  L: 129,
2560
2547
  S: this,
2561
2548
  C: (f, a) => f(...a)
@@ -2564,7 +2551,7 @@ var InvitationsHandler = class {
2564
2551
  } else {
2565
2552
  if (guardedState.error(extension, err)) {
2566
2553
  import_log6.log.error("failed", err, {
2567
- F: __dxlog_file12,
2554
+ F: __dxlog_file11,
2568
2555
  L: 133,
2569
2556
  S: this,
2570
2557
  C: (f, a) => f(...a)
@@ -2575,7 +2562,7 @@ var InvitationsHandler = class {
2575
2562
  id: traceId,
2576
2563
  error: err
2577
2564
  }), {
2578
- F: __dxlog_file12,
2565
+ F: __dxlog_file11,
2579
2566
  L: 136,
2580
2567
  S: this,
2581
2568
  C: (f, a) => f(...a)
@@ -2589,7 +2576,7 @@ var InvitationsHandler = class {
2589
2576
  (0, import_log6.log)("invalid role", {
2590
2577
  ...err.context
2591
2578
  }, {
2592
- F: __dxlog_file12,
2579
+ F: __dxlog_file11,
2593
2580
  L: 144,
2594
2581
  S: this,
2595
2582
  C: (f, a) => f(...a)
@@ -2601,7 +2588,7 @@ var InvitationsHandler = class {
2601
2588
  (0, import_log6.log)("timeout", {
2602
2589
  err
2603
2590
  }, {
2604
- F: __dxlog_file12,
2591
+ F: __dxlog_file11,
2605
2592
  L: 149,
2606
2593
  S: this,
2607
2594
  C: (f, a) => f(...a)
@@ -2610,7 +2597,7 @@ var InvitationsHandler = class {
2610
2597
  } else {
2611
2598
  if (guardedState.error(extension, err)) {
2612
2599
  import_log6.log.error("failed", err, {
2613
- F: __dxlog_file12,
2600
+ F: __dxlog_file11,
2614
2601
  L: 153,
2615
2602
  S: this,
2616
2603
  C: (f, a) => f(...a)
@@ -2624,7 +2611,7 @@ var InvitationsHandler = class {
2624
2611
  if (invitation.lifetime && invitation.created) {
2625
2612
  if (invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
2626
2613
  import_log6.log.warn("invitation has already expired", void 0, {
2627
- F: __dxlog_file12,
2614
+ F: __dxlog_file11,
2628
2615
  L: 164,
2629
2616
  S: this,
2630
2617
  C: (f, a) => f(...a)
@@ -2647,7 +2634,7 @@ var InvitationsHandler = class {
2647
2634
  const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
2648
2635
  if (deviceProfile) {
2649
2636
  (0, import_invariant6.invariant)(invitation.kind === import_services6.Invitation.Kind.DEVICE, "deviceProfile provided for non-device invitation", {
2650
- F: __dxlog_file12,
2637
+ F: __dxlog_file11,
2651
2638
  L: 197,
2652
2639
  S: this,
2653
2640
  A: [
@@ -2665,7 +2652,7 @@ var InvitationsHandler = class {
2665
2652
  invitationType: import_services6.Invitation.Type.DELEGATED,
2666
2653
  triedPeers: triedPeersIds.size
2667
2654
  }, {
2668
- F: __dxlog_file12,
2655
+ F: __dxlog_file11,
2669
2656
  L: 205,
2670
2657
  S: this,
2671
2658
  C: (f, a) => f(...a)
@@ -2692,7 +2679,7 @@ var InvitationsHandler = class {
2692
2679
  admitted,
2693
2680
  currentState: guardedState.current.state
2694
2681
  }, {
2695
- F: __dxlog_file12,
2682
+ F: __dxlog_file11,
2696
2683
  L: 233,
2697
2684
  S: this,
2698
2685
  C: (f, a) => f(...a)
@@ -2710,7 +2697,7 @@ var InvitationsHandler = class {
2710
2697
  import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.begin({
2711
2698
  id: traceId
2712
2699
  }), {
2713
- F: __dxlog_file12,
2700
+ F: __dxlog_file11,
2714
2701
  L: 245,
2715
2702
  S: this,
2716
2703
  C: (f, a) => f(...a)
@@ -2722,7 +2709,7 @@ var InvitationsHandler = class {
2722
2709
  (0, import_log6.log)("connected", {
2723
2710
  ...protocol.toJSON()
2724
2711
  }, {
2725
- F: __dxlog_file12,
2712
+ F: __dxlog_file11,
2726
2713
  L: 256,
2727
2714
  S: this,
2728
2715
  C: (f, a) => f(...a)
@@ -2731,7 +2718,7 @@ var InvitationsHandler = class {
2731
2718
  (0, import_log6.log)("introduce", {
2732
2719
  ...protocol.toJSON()
2733
2720
  }, {
2734
- F: __dxlog_file12,
2721
+ F: __dxlog_file11,
2735
2722
  L: 260,
2736
2723
  S: this,
2737
2724
  C: (f, a) => f(...a)
@@ -2744,7 +2731,7 @@ var InvitationsHandler = class {
2744
2731
  ...protocol.toJSON(),
2745
2732
  response: introductionResponse
2746
2733
  }, {
2747
- F: __dxlog_file12,
2734
+ F: __dxlog_file11,
2748
2735
  L: 265,
2749
2736
  S: this,
2750
2737
  C: (f, a) => f(...a)
@@ -2765,7 +2752,7 @@ var InvitationsHandler = class {
2765
2752
  (0, import_log6.log)("request admission", {
2766
2753
  ...protocol.toJSON()
2767
2754
  }, {
2768
- F: __dxlog_file12,
2755
+ F: __dxlog_file11,
2769
2756
  L: 291,
2770
2757
  S: this,
2771
2758
  C: (f, a) => f(...a)
@@ -2777,7 +2764,7 @@ var InvitationsHandler = class {
2777
2764
  (0, import_log6.log)("admitted by host", {
2778
2765
  ...protocol.toJSON()
2779
2766
  }, {
2780
- F: __dxlog_file12,
2767
+ F: __dxlog_file11,
2781
2768
  L: 302,
2782
2769
  S: this,
2783
2770
  C: (f, a) => f(...a)
@@ -2790,7 +2777,7 @@ var InvitationsHandler = class {
2790
2777
  import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.end({
2791
2778
  id: traceId
2792
2779
  }), {
2793
- F: __dxlog_file12,
2780
+ F: __dxlog_file11,
2794
2781
  L: 308,
2795
2782
  S: this,
2796
2783
  C: (f, a) => f(...a)
@@ -2800,7 +2787,7 @@ var InvitationsHandler = class {
2800
2787
  (0, import_log6.log)("timeout", {
2801
2788
  ...protocol.toJSON()
2802
2789
  }, {
2803
- F: __dxlog_file12,
2790
+ F: __dxlog_file11,
2804
2791
  L: 311,
2805
2792
  S: this,
2806
2793
  C: (f, a) => f(...a)
@@ -2808,7 +2795,7 @@ var InvitationsHandler = class {
2808
2795
  guardedState.set(extension, import_services6.Invitation.State.TIMEOUT);
2809
2796
  } else {
2810
2797
  (0, import_log6.log)("auth failed", err, {
2811
- F: __dxlog_file12,
2798
+ F: __dxlog_file11,
2812
2799
  L: 314,
2813
2800
  S: this,
2814
2801
  C: (f, a) => f(...a)
@@ -2820,7 +2807,7 @@ var InvitationsHandler = class {
2820
2807
  id: traceId,
2821
2808
  error: err
2822
2809
  }), {
2823
- F: __dxlog_file12,
2810
+ F: __dxlog_file11,
2824
2811
  L: 318,
2825
2812
  S: this,
2826
2813
  C: (f, a) => f(...a)
@@ -2836,7 +2823,7 @@ var InvitationsHandler = class {
2836
2823
  (0, import_log6.log)("timeout", {
2837
2824
  ...protocol.toJSON()
2838
2825
  }, {
2839
- F: __dxlog_file12,
2826
+ F: __dxlog_file11,
2840
2827
  L: 327,
2841
2828
  S: this,
2842
2829
  C: (f, a) => f(...a)
@@ -2844,7 +2831,7 @@ var InvitationsHandler = class {
2844
2831
  guardedState.set(extension, import_services6.Invitation.State.TIMEOUT);
2845
2832
  } else {
2846
2833
  (0, import_log6.log)("auth failed", err, {
2847
- F: __dxlog_file12,
2834
+ F: __dxlog_file11,
2848
2835
  L: 330,
2849
2836
  S: this,
2850
2837
  C: (f, a) => f(...a)
@@ -2862,7 +2849,7 @@ var InvitationsHandler = class {
2862
2849
  await ctx.dispose();
2863
2850
  } else {
2864
2851
  (0, import_invariant6.invariant)(invitation.swarmKey, void 0, {
2865
- F: __dxlog_file12,
2852
+ F: __dxlog_file11,
2866
2853
  L: 345,
2867
2854
  S: this,
2868
2855
  A: [
@@ -2956,29 +2943,16 @@ var InvitationsHandler = class {
2956
2943
  };
2957
2944
  }
2958
2945
  _logStateUpdate(invitation, actor, newState) {
2959
- if (this._isNotTerminal(newState)) {
2960
- (0, import_log6.log)("invitation state update", {
2961
- actor: actor?.constructor.name,
2962
- newState: stateToString(newState),
2963
- oldState: stateToString(invitation.state)
2964
- }, {
2965
- F: __dxlog_file12,
2966
- L: 439,
2967
- S: this,
2968
- C: (f, a) => f(...a)
2969
- });
2970
- } else {
2971
- import_log6.log.info("invitation state update", {
2972
- actor: actor?.constructor.name,
2973
- newState: stateToString(newState),
2974
- oldState: stateToString(invitation.state)
2975
- }, {
2976
- F: __dxlog_file12,
2977
- L: 445,
2978
- S: this,
2979
- C: (f, a) => f(...a)
2980
- });
2981
- }
2946
+ (0, import_log6.log)("invitation state update", {
2947
+ actor: actor?.constructor.name,
2948
+ newState: stateToString(newState),
2949
+ oldState: stateToString(invitation.state)
2950
+ }, {
2951
+ F: __dxlog_file11,
2952
+ L: 438,
2953
+ S: this,
2954
+ C: (f, a) => f(...a)
2955
+ });
2982
2956
  }
2983
2957
  _isNotTerminal(currentState) {
2984
2958
  return ![
@@ -2992,16 +2966,16 @@ var InvitationsHandler = class {
2992
2966
  async _handleGuestOtpAuth(extension, setState, authenticated, options) {
2993
2967
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
2994
2968
  (0, import_log6.log)("guest waiting for authentication code...", void 0, {
2995
- F: __dxlog_file12,
2996
- L: 470,
2969
+ F: __dxlog_file11,
2970
+ L: 462,
2997
2971
  S: this,
2998
2972
  C: (f, a) => f(...a)
2999
2973
  });
3000
2974
  setState(import_services6.Invitation.State.READY_FOR_AUTHENTICATION);
3001
2975
  const authCode = await authenticated.wait(options);
3002
2976
  (0, import_log6.log)("sending authentication request", void 0, {
3003
- F: __dxlog_file12,
3004
- L: 474,
2977
+ F: __dxlog_file11,
2978
+ L: 466,
3005
2979
  S: this,
3006
2980
  C: (f, a) => f(...a)
3007
2981
  });
@@ -3019,8 +2993,8 @@ var InvitationsHandler = class {
3019
2993
  (0, import_log6.log)("retrying invalid code", {
3020
2994
  attempt
3021
2995
  }, {
3022
- F: __dxlog_file12,
3023
- L: 485,
2996
+ F: __dxlog_file11,
2997
+ L: 477,
3024
2998
  S: this,
3025
2999
  C: (f, a) => f(...a)
3026
3000
  });
@@ -3037,8 +3011,8 @@ var InvitationsHandler = class {
3037
3011
  throw new Error("challenge missing in the introduction");
3038
3012
  }
3039
3013
  (0, import_log6.log)("sending authentication request", void 0, {
3040
- F: __dxlog_file12,
3041
- L: 504,
3014
+ F: __dxlog_file11,
3015
+ L: 496,
3042
3016
  S: this,
3043
3017
  C: (f, a) => f(...a)
3044
3018
  });
@@ -3152,7 +3126,7 @@ var InvitationsServiceImpl = class {
3152
3126
  });
3153
3127
  }
3154
3128
  };
3155
- var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3129
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3156
3130
  var SpaceInvitationProtocol = class {
3157
3131
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
3158
3132
  this._spaceManager = _spaceManager;
@@ -3187,7 +3161,7 @@ var SpaceInvitationProtocol = class {
3187
3161
  }
3188
3162
  async admit(invitation, request, guestProfile) {
3189
3163
  (0, import_invariant10.invariant)(this._spaceKey, void 0, {
3190
- F: __dxlog_file13,
3164
+ F: __dxlog_file12,
3191
3165
  L: 76,
3192
3166
  S: this,
3193
3167
  A: [
@@ -3197,7 +3171,7 @@ var SpaceInvitationProtocol = class {
3197
3171
  });
3198
3172
  const space = this._spaceManager.spaces.get(this._spaceKey);
3199
3173
  (0, import_invariant10.invariant)(space, void 0, {
3200
- F: __dxlog_file13,
3174
+ F: __dxlog_file12,
3201
3175
  L: 78,
3202
3176
  S: this,
3203
3177
  A: [
@@ -3206,7 +3180,7 @@ var SpaceInvitationProtocol = class {
3206
3180
  ]
3207
3181
  });
3208
3182
  (0, import_invariant10.invariant)(request.space, void 0, {
3209
- F: __dxlog_file13,
3183
+ F: __dxlog_file12,
3210
3184
  L: 80,
3211
3185
  S: this,
3212
3186
  A: [
@@ -3222,14 +3196,14 @@ var SpaceInvitationProtocol = class {
3222
3196
  host: this._signingContext.deviceKey,
3223
3197
  guest: deviceKey
3224
3198
  }, {
3225
- F: __dxlog_file13,
3199
+ F: __dxlog_file12,
3226
3200
  L: 87,
3227
3201
  S: this,
3228
3202
  C: (f, a) => f(...a)
3229
3203
  });
3230
3204
  const credentials = await (0, import_credentials9.createAdmissionCredentials)(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, invitation.role ?? import_credentials10.SpaceMember.Role.ADMIN, space.inner.spaceState.membershipChainHeads, guestProfile, invitation.delegationCredentialId);
3231
3205
  (0, import_invariant10.invariant)(credentials[0].credential, void 0, {
3232
- F: __dxlog_file13,
3206
+ F: __dxlog_file12,
3233
3207
  L: 101,
3234
3208
  S: this,
3235
3209
  A: [
@@ -3239,7 +3213,7 @@ var SpaceInvitationProtocol = class {
3239
3213
  });
3240
3214
  const spaceMemberCredential = credentials[0].credential.credential;
3241
3215
  (0, import_invariant10.invariant)((0, import_credentials9.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
3242
- F: __dxlog_file13,
3216
+ F: __dxlog_file12,
3243
3217
  L: 103,
3244
3218
  S: this,
3245
3219
  A: [
@@ -3257,7 +3231,7 @@ var SpaceInvitationProtocol = class {
3257
3231
  }
3258
3232
  async delegate(invitation) {
3259
3233
  (0, import_invariant10.invariant)(this._spaceKey, void 0, {
3260
- F: __dxlog_file13,
3234
+ F: __dxlog_file12,
3261
3235
  L: 116,
3262
3236
  S: this,
3263
3237
  A: [
@@ -3267,7 +3241,7 @@ var SpaceInvitationProtocol = class {
3267
3241
  });
3268
3242
  const space = this._spaceManager.spaces.get(this._spaceKey);
3269
3243
  (0, import_invariant10.invariant)(space, void 0, {
3270
- F: __dxlog_file13,
3244
+ F: __dxlog_file12,
3271
3245
  L: 118,
3272
3246
  S: this,
3273
3247
  A: [
@@ -3277,7 +3251,7 @@ var SpaceInvitationProtocol = class {
3277
3251
  });
3278
3252
  if (invitation.authMethod === import_services10.Invitation.AuthMethod.KNOWN_PUBLIC_KEY) {
3279
3253
  (0, import_invariant10.invariant)(invitation.guestKeypair?.publicKey, void 0, {
3280
- F: __dxlog_file13,
3254
+ F: __dxlog_file12,
3281
3255
  L: 120,
3282
3256
  S: this,
3283
3257
  A: [
@@ -3290,7 +3264,7 @@ var SpaceInvitationProtocol = class {
3290
3264
  host: this._signingContext.deviceKey,
3291
3265
  id: invitation.invitationId
3292
3266
  }, {
3293
- F: __dxlog_file13,
3267
+ F: __dxlog_file12,
3294
3268
  L: 123,
3295
3269
  S: this,
3296
3270
  C: (f, a) => f(...a)
@@ -3305,7 +3279,7 @@ var SpaceInvitationProtocol = class {
3305
3279
  guestKey: invitation.authMethod === import_services10.Invitation.AuthMethod.KNOWN_PUBLIC_KEY ? invitation.guestKeypair.publicKey : void 0
3306
3280
  });
3307
3281
  (0, import_invariant10.invariant)(credential.credential, void 0, {
3308
- F: __dxlog_file13,
3282
+ F: __dxlog_file12,
3309
3283
  L: 143,
3310
3284
  S: this,
3311
3285
  A: [
@@ -3320,7 +3294,7 @@ var SpaceInvitationProtocol = class {
3320
3294
  }
3321
3295
  async cancelDelegation(invitation) {
3322
3296
  (0, import_invariant10.invariant)(this._spaceKey, void 0, {
3323
- F: __dxlog_file13,
3297
+ F: __dxlog_file12,
3324
3298
  L: 149,
3325
3299
  S: this,
3326
3300
  A: [
@@ -3329,7 +3303,7 @@ var SpaceInvitationProtocol = class {
3329
3303
  ]
3330
3304
  });
3331
3305
  (0, import_invariant10.invariant)(invitation.type === import_services10.Invitation.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
3332
- F: __dxlog_file13,
3306
+ F: __dxlog_file12,
3333
3307
  L: 150,
3334
3308
  S: this,
3335
3309
  A: [
@@ -3339,7 +3313,7 @@ var SpaceInvitationProtocol = class {
3339
3313
  });
3340
3314
  const space = this._spaceManager.spaces.get(this._spaceKey);
3341
3315
  (0, import_invariant10.invariant)(space, void 0, {
3342
- F: __dxlog_file13,
3316
+ F: __dxlog_file12,
3343
3317
  L: 152,
3344
3318
  S: this,
3345
3319
  A: [
@@ -3351,14 +3325,14 @@ var SpaceInvitationProtocol = class {
3351
3325
  host: this._signingContext.deviceKey,
3352
3326
  id: invitation.invitationId
3353
3327
  }, {
3354
- F: __dxlog_file13,
3328
+ F: __dxlog_file12,
3355
3329
  L: 154,
3356
3330
  S: this,
3357
3331
  C: (f, a) => f(...a)
3358
3332
  });
3359
3333
  const credential = await (0, import_credentials9.createCancelDelegatedSpaceInvitationCredential)(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
3360
3334
  (0, import_invariant10.invariant)(credential.credential, void 0, {
3361
- F: __dxlog_file13,
3335
+ F: __dxlog_file12,
3362
3336
  L: 161,
3363
3337
  S: this,
3364
3338
  A: [
@@ -3397,7 +3371,7 @@ var SpaceInvitationProtocol = class {
3397
3371
  }
3398
3372
  async accept(response) {
3399
3373
  (0, import_invariant10.invariant)(response.space, void 0, {
3400
- F: __dxlog_file13,
3374
+ F: __dxlog_file12,
3401
3375
  L: 196,
3402
3376
  S: this,
3403
3377
  A: [
@@ -3408,7 +3382,7 @@ var SpaceInvitationProtocol = class {
3408
3382
  const { credential, controlTimeframe, dataTimeframe } = response.space;
3409
3383
  const assertion = (0, import_credentials9.getCredentialAssertion)(credential);
3410
3384
  (0, import_invariant10.invariant)(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
3411
- F: __dxlog_file13,
3385
+ F: __dxlog_file12,
3412
3386
  L: 199,
3413
3387
  S: this,
3414
3388
  A: [
@@ -3417,7 +3391,7 @@ var SpaceInvitationProtocol = class {
3417
3391
  ]
3418
3392
  });
3419
3393
  (0, import_invariant10.invariant)(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
3420
- F: __dxlog_file13,
3394
+ F: __dxlog_file12,
3421
3395
  L: 200,
3422
3396
  S: this,
3423
3397
  A: [
@@ -3440,7 +3414,7 @@ var SpaceInvitationProtocol = class {
3440
3414
  };
3441
3415
  }
3442
3416
  };
3443
- var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3417
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3444
3418
  var InvitationsManager = class {
3445
3419
  constructor(_invitationsHandler, _getHandler, _metadataStore) {
3446
3420
  this._invitationsHandler = _invitationsHandler;
@@ -3483,7 +3457,7 @@ var InvitationsManager = class {
3483
3457
  await this._persistIfRequired(handler, stream, invitation);
3484
3458
  } catch (err) {
3485
3459
  import_log11.log.catch(err, void 0, {
3486
- F: __dxlog_file14,
3460
+ F: __dxlog_file13,
3487
3461
  L: 82,
3488
3462
  S: this,
3489
3463
  C: (f, a) => f(...a)
@@ -3506,7 +3480,7 @@ var InvitationsManager = class {
3506
3480
  const freshInvitations = persistentInvitations.filter((invitation) => !(0, import_echo_pipeline.hasInvitationExpired)(invitation));
3507
3481
  const loadTasks = freshInvitations.map((persistentInvitation) => {
3508
3482
  (0, import_invariant11.invariant)(!this._createInvitations.get(persistentInvitation.invitationId), "invitation already exists", {
3509
- F: __dxlog_file14,
3483
+ F: __dxlog_file13,
3510
3484
  L: 103,
3511
3485
  S: this,
3512
3486
  A: [
@@ -3525,7 +3499,7 @@ var InvitationsManager = class {
3525
3499
  };
3526
3500
  } catch (err) {
3527
3501
  import_log11.log.catch(err, void 0, {
3528
- F: __dxlog_file14,
3502
+ F: __dxlog_file13,
3529
3503
  L: 110,
3530
3504
  S: this,
3531
3505
  C: (f, a) => f(...a)
@@ -3557,13 +3531,13 @@ var InvitationsManager = class {
3557
3531
  }
3558
3532
  async authenticate({ invitationId, authCode }) {
3559
3533
  (0, import_log11.log)("authenticating...", void 0, {
3560
- F: __dxlog_file14,
3534
+ F: __dxlog_file13,
3561
3535
  L: 140,
3562
3536
  S: this,
3563
3537
  C: (f, a) => f(...a)
3564
3538
  });
3565
3539
  (0, import_invariant11.invariant)(invitationId, void 0, {
3566
- F: __dxlog_file14,
3540
+ F: __dxlog_file13,
3567
3541
  L: 141,
3568
3542
  S: this,
3569
3543
  A: [
@@ -3576,7 +3550,7 @@ var InvitationsManager = class {
3576
3550
  import_log11.log.warn("invalid invitation", {
3577
3551
  invitationId
3578
3552
  }, {
3579
- F: __dxlog_file14,
3553
+ F: __dxlog_file13,
3580
3554
  L: 144,
3581
3555
  S: this,
3582
3556
  C: (f, a) => f(...a)
@@ -3589,13 +3563,13 @@ var InvitationsManager = class {
3589
3563
  (0, import_log11.log)("cancelInvitation...", {
3590
3564
  invitationId
3591
3565
  }, {
3592
- F: __dxlog_file14,
3566
+ F: __dxlog_file13,
3593
3567
  L: 151,
3594
3568
  S: this,
3595
3569
  C: (f, a) => f(...a)
3596
3570
  });
3597
3571
  (0, import_invariant11.invariant)(invitationId, void 0, {
3598
- F: __dxlog_file14,
3572
+ F: __dxlog_file13,
3599
3573
  L: 152,
3600
3574
  S: this,
3601
3575
  A: [
@@ -3669,15 +3643,12 @@ var InvitationsManager = class {
3669
3643
  stream.error(err);
3670
3644
  void ctx.dispose();
3671
3645
  }
3672
- }, {
3673
- F: __dxlog_file14,
3674
- L: 234
3675
3646
  });
3676
3647
  ctx.onDispose(() => {
3677
3648
  (0, import_log11.log)("complete", {
3678
3649
  ...handler.toJSON()
3679
3650
  }, {
3680
- F: __dxlog_file14,
3651
+ F: __dxlog_file13,
3681
3652
  L: 241,
3682
3653
  S: this,
3683
3654
  C: (f, a) => f(...a)
@@ -3710,7 +3681,7 @@ var InvitationsManager = class {
3710
3681
  (0, import_log11.log)("timeout", {
3711
3682
  ...handler.toJSON()
3712
3683
  }, {
3713
- F: __dxlog_file14,
3684
+ F: __dxlog_file13,
3714
3685
  L: 261,
3715
3686
  S: this,
3716
3687
  C: (f, a) => f(...a)
@@ -3721,7 +3692,7 @@ var InvitationsManager = class {
3721
3692
  });
3722
3693
  } else {
3723
3694
  import_log11.log.warn("auth failed", err, {
3724
- F: __dxlog_file14,
3695
+ F: __dxlog_file13,
3725
3696
  L: 264,
3726
3697
  S: this,
3727
3698
  C: (f, a) => f(...a)
@@ -3733,15 +3704,12 @@ var InvitationsManager = class {
3733
3704
  }
3734
3705
  void ctx.dispose();
3735
3706
  }
3736
- }, {
3737
- F: __dxlog_file14,
3738
- L: 258
3739
3707
  });
3740
3708
  ctx.onDispose(() => {
3741
3709
  (0, import_log11.log)("complete", {
3742
3710
  ...handler.toJSON()
3743
3711
  }, {
3744
- F: __dxlog_file14,
3712
+ F: __dxlog_file13,
3745
3713
  L: 271,
3746
3714
  S: this,
3747
3715
  C: (f, a) => f(...a)
@@ -3786,7 +3754,7 @@ var InvitationsManager = class {
3786
3754
  await this._metadataStore.removeInvitation(invitation.invitationId);
3787
3755
  } catch (err) {
3788
3756
  import_log11.log.catch(err, void 0, {
3789
- F: __dxlog_file14,
3757
+ F: __dxlog_file13,
3790
3758
  L: 307,
3791
3759
  S: this,
3792
3760
  C: (f, a) => f(...a)
@@ -3839,7 +3807,7 @@ var AutomergeSpaceState = class extends import_context11.Resource {
3839
3807
  await this.onNewEpoch.waitForCondition(() => !!this.lastEpoch);
3840
3808
  }
3841
3809
  };
3842
- var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
3810
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
3843
3811
  var runEpochMigration = async (ctx, context) => {
3844
3812
  switch (context.migration) {
3845
3813
  case import_services13.CreateEpochRequest.Migration.INIT_AUTOMERGE: {
@@ -3863,7 +3831,7 @@ var runEpochMigration = async (ctx, context) => {
3863
3831
  }
3864
3832
  case import_services13.CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT: {
3865
3833
  import_log13.log.info("Fragmenting", void 0, {
3866
- F: __dxlog_file15,
3834
+ F: __dxlog_file14,
3867
3835
  L: 63,
3868
3836
  S: void 0,
3869
3837
  C: (f, a) => f(...a)
@@ -3875,7 +3843,7 @@ var runEpochMigration = async (ctx, context) => {
3875
3843
  const properties = (0, import_echo_db.findInlineObjectOfType)(rootHandle.docSync(), import_echo_schema.TYPE_PROPERTIES);
3876
3844
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
3877
3845
  (0, import_invariant13.invariant)(properties, "Properties not found", {
3878
- F: __dxlog_file15,
3846
+ F: __dxlog_file14,
3879
3847
  L: 73,
3880
3848
  S: void 0,
3881
3849
  A: [
@@ -3891,7 +3859,7 @@ var runEpochMigration = async (ctx, context) => {
3891
3859
  };
3892
3860
  const newRoot = context.repo.create(newSpaceDoc);
3893
3861
  (0, import_invariant13.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3894
- F: __dxlog_file15,
3862
+ F: __dxlog_file14,
3895
3863
  L: 78,
3896
3864
  S: void 0,
3897
3865
  A: [
@@ -3922,7 +3890,7 @@ var runEpochMigration = async (ctx, context) => {
3922
3890
  const rootHandle = context.repo.find(currentRootUrl);
3923
3891
  await (0, import_context12.cancelWithContext)(ctx, (0, import_async15.asyncTimeout)(rootHandle.whenReady(), 1e4));
3924
3892
  (0, import_invariant13.invariant)(rootHandle.docSync(), "Root doc not found", {
3925
- F: __dxlog_file15,
3893
+ F: __dxlog_file14,
3926
3894
  L: 100,
3927
3895
  S: void 0,
3928
3896
  A: [
@@ -3935,7 +3903,7 @@ var runEpochMigration = async (ctx, context) => {
3935
3903
  const handle = context.repo.find(url);
3936
3904
  await (0, import_context12.cancelWithContext)(ctx, (0, import_async15.asyncTimeout)(handle.whenReady(), 1e4));
3937
3905
  (0, import_invariant13.invariant)(handle.docSync(), "Doc not found", {
3938
- F: __dxlog_file15,
3906
+ F: __dxlog_file14,
3939
3907
  L: 107,
3940
3908
  S: void 0,
3941
3909
  A: [
@@ -3957,7 +3925,7 @@ var runEpochMigration = async (ctx, context) => {
3957
3925
  }
3958
3926
  case import_services13.CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT: {
3959
3927
  (0, import_invariant13.invariant)(context.newAutomergeRoot, void 0, {
3960
- F: __dxlog_file15,
3928
+ F: __dxlog_file14,
3961
3929
  L: 124,
3962
3930
  S: void 0,
3963
3931
  A: [
@@ -3973,17 +3941,14 @@ var runEpochMigration = async (ctx, context) => {
3973
3941
  }
3974
3942
  return {};
3975
3943
  };
3976
- var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
3944
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
3977
3945
  var DEFAULT_RETRY_TIMEOUT = 1e3;
3978
3946
  var DEFAULT_SUCCESS_DELAY = 1e3;
3979
3947
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
3980
3948
  var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
3981
3949
  var NotarizationPlugin = class {
3982
3950
  constructor() {
3983
- this._ctx = new import_context13.Context(void 0, {
3984
- F: __dxlog_file16,
3985
- L: 62
3986
- });
3951
+ this._ctx = new import_context13.Context();
3987
3952
  this._extensionOpened = new import_async16.Event();
3988
3953
  this._extensions = /* @__PURE__ */ new Set();
3989
3954
  this._processedCredentials = new import_util9.ComplexSet(import_keys11.PublicKey.hash);
@@ -4004,13 +3969,13 @@ var NotarizationPlugin = class {
4004
3969
  (0, import_log14.log)("notarize", {
4005
3970
  credentials
4006
3971
  }, {
4007
- F: __dxlog_file16,
3972
+ F: __dxlog_file15,
4008
3973
  L: 90,
4009
3974
  S: this,
4010
3975
  C: (f, a) => f(...a)
4011
3976
  });
4012
3977
  (0, import_invariant14.invariant)(credentials.every((credential) => credential.id), "Credentials must have an id", {
4013
- F: __dxlog_file16,
3978
+ F: __dxlog_file15,
4014
3979
  L: 91,
4015
3980
  S: this,
4016
3981
  A: [
@@ -4024,7 +3989,7 @@ var NotarizationPlugin = class {
4024
3989
  import_log14.log.warn("Notarization error", {
4025
3990
  err
4026
3991
  }, {
4027
- F: __dxlog_file16,
3992
+ F: __dxlog_file15,
4028
3993
  L: 99,
4029
3994
  S: this,
4030
3995
  C: (f, a) => f(...a)
@@ -4040,7 +4005,7 @@ var NotarizationPlugin = class {
4040
4005
  timeout,
4041
4006
  peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
4042
4007
  }, {
4043
- F: __dxlog_file16,
4008
+ F: __dxlog_file15,
4044
4009
  L: 111,
4045
4010
  S: this,
4046
4011
  C: (f, a) => f(...a)
@@ -4063,7 +4028,7 @@ var NotarizationPlugin = class {
4063
4028
  import_log14.log.info("Exhausted all peers to notarize with", {
4064
4029
  retryIn: retryTimeout
4065
4030
  }, {
4066
- F: __dxlog_file16,
4031
+ F: __dxlog_file15,
4067
4032
  L: 136,
4068
4033
  S: this,
4069
4034
  C: (f, a) => f(...a)
@@ -4077,7 +4042,7 @@ var NotarizationPlugin = class {
4077
4042
  peer: peer.localPeerId,
4078
4043
  credentialId: credentials.map((credential) => credential.id)
4079
4044
  }, {
4080
- F: __dxlog_file16,
4045
+ F: __dxlog_file15,
4081
4046
  L: 143,
4082
4047
  S: this,
4083
4048
  C: (f, a) => f(...a)
@@ -4086,7 +4051,7 @@ var NotarizationPlugin = class {
4086
4051
  credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
4087
4052
  });
4088
4053
  (0, import_log14.log)("success", void 0, {
4089
- F: __dxlog_file16,
4054
+ F: __dxlog_file15,
4090
4055
  L: 147,
4091
4056
  S: this,
4092
4057
  C: (f, a) => f(...a)
@@ -4095,7 +4060,7 @@ var NotarizationPlugin = class {
4095
4060
  } catch (err) {
4096
4061
  if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
4097
4062
  import_log14.log.info("error notarizing (recoverable)", err, {
4098
- F: __dxlog_file16,
4063
+ F: __dxlog_file15,
4099
4064
  L: 151,
4100
4065
  S: this,
4101
4066
  C: (f, a) => f(...a)
@@ -4113,7 +4078,7 @@ var NotarizationPlugin = class {
4113
4078
  errors.wait()
4114
4079
  ]);
4115
4080
  (0, import_log14.log)("done", void 0, {
4116
- F: __dxlog_file16,
4081
+ F: __dxlog_file15,
4117
4082
  L: 162,
4118
4083
  S: this,
4119
4084
  C: (f, a) => f(...a)
@@ -4135,7 +4100,7 @@ var NotarizationPlugin = class {
4135
4100
  }
4136
4101
  setWriter(writer) {
4137
4102
  (0, import_invariant14.invariant)(!this._writer, "Writer already set.", {
4138
- F: __dxlog_file16,
4103
+ F: __dxlog_file15,
4139
4104
  L: 181,
4140
4105
  S: this,
4141
4106
  A: [
@@ -4160,7 +4125,7 @@ var NotarizationPlugin = class {
4160
4125
  }
4161
4126
  for (const credential of request.credentials ?? []) {
4162
4127
  (0, import_invariant14.invariant)(credential.id, "Credential must have an id", {
4163
- F: __dxlog_file16,
4128
+ F: __dxlog_file15,
4164
4129
  L: 200,
4165
4130
  S: this,
4166
4131
  A: [
@@ -4180,7 +4145,7 @@ var NotarizationPlugin = class {
4180
4145
  (0, import_log14.log)("extension opened", {
4181
4146
  peer: extension.localPeerId
4182
4147
  }, {
4183
- F: __dxlog_file16,
4148
+ F: __dxlog_file15,
4184
4149
  L: 211,
4185
4150
  S: this,
4186
4151
  C: (f, a) => f(...a)
@@ -4192,7 +4157,7 @@ var NotarizationPlugin = class {
4192
4157
  (0, import_log14.log)("extension closed", {
4193
4158
  peer: extension.localPeerId
4194
4159
  }, {
4195
- F: __dxlog_file16,
4160
+ F: __dxlog_file15,
4196
4161
  L: 216,
4197
4162
  S: this,
4198
4163
  C: (f, a) => f(...a)
@@ -4307,13 +4272,10 @@ function _using_ctx() {
4307
4272
  }
4308
4273
  };
4309
4274
  }
4310
- var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4275
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4311
4276
  var DataSpace = class {
4312
4277
  constructor(params) {
4313
- this._ctx = new import_context10.Context(void 0, {
4314
- F: __dxlog_file17,
4315
- L: 84
4316
- });
4278
+ this._ctx = new import_context10.Context();
4317
4279
  this._notarizationPlugin = new NotarizationPlugin();
4318
4280
  this._cache = void 0;
4319
4281
  this._automergeSpaceState = new AutomergeSpaceState((rootUrl) => this._onNewAutomergeRoot(rootUrl));
@@ -4343,7 +4305,7 @@ var DataSpace = class {
4343
4305
  (0, import_log12.log)("new state", {
4344
4306
  state: import_services12.SpaceState[this._state]
4345
4307
  }, {
4346
- F: __dxlog_file17,
4308
+ F: __dxlog_file16,
4347
4309
  L: 146,
4348
4310
  S: this,
4349
4311
  C: (f, a) => f(...a)
@@ -4398,15 +4360,12 @@ var DataSpace = class {
4398
4360
  await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
4399
4361
  await this._automergeSpaceState.open();
4400
4362
  await this._inner.spaceState.addCredentialProcessor(this._automergeSpaceState);
4401
- await this._inner.open(new import_context10.Context(void 0, {
4402
- F: __dxlog_file17,
4403
- L: 215
4404
- }));
4363
+ await this._inner.open(new import_context10.Context());
4405
4364
  this._state = import_services12.SpaceState.CONTROL_ONLY;
4406
4365
  (0, import_log12.log)("new state", {
4407
4366
  state: import_services12.SpaceState[this._state]
4408
4367
  }, {
4409
- F: __dxlog_file17,
4368
+ F: __dxlog_file16,
4410
4369
  L: 217,
4411
4370
  S: this,
4412
4371
  C: (f, a) => f(...a)
@@ -4424,16 +4383,13 @@ var DataSpace = class {
4424
4383
  (0, import_log12.log)("new state", {
4425
4384
  state: import_services12.SpaceState[this._state]
4426
4385
  }, {
4427
- F: __dxlog_file17,
4386
+ F: __dxlog_file16,
4428
4387
  L: 231,
4429
4388
  S: this,
4430
4389
  C: (f, a) => f(...a)
4431
4390
  });
4432
4391
  await this._ctx.dispose();
4433
- this._ctx = new import_context10.Context(void 0, {
4434
- F: __dxlog_file17,
4435
- L: 233
4436
- });
4392
+ this._ctx = new import_context10.Context();
4437
4393
  await this.authVerifier.close();
4438
4394
  await this._inner.close();
4439
4395
  await this._inner.spaceState.removeCredentialProcessor(this._automergeSpaceState);
@@ -4460,7 +4416,7 @@ var DataSpace = class {
4460
4416
  } catch (err) {
4461
4417
  if (err instanceof import_protocols9.CancelledError || err instanceof import_context10.ContextDisposedError) {
4462
4418
  (0, import_log12.log)("data pipeline initialization cancelled", err, {
4463
- F: __dxlog_file17,
4419
+ F: __dxlog_file16,
4464
4420
  L: 265,
4465
4421
  S: this,
4466
4422
  C: (f, a) => f(...a)
@@ -4468,7 +4424,7 @@ var DataSpace = class {
4468
4424
  return;
4469
4425
  }
4470
4426
  import_log12.log.error("Error initializing data pipeline", err, {
4471
- F: __dxlog_file17,
4427
+ F: __dxlog_file16,
4472
4428
  L: 269,
4473
4429
  S: this,
4474
4430
  C: (f, a) => f(...a)
@@ -4477,7 +4433,7 @@ var DataSpace = class {
4477
4433
  (0, import_log12.log)("new state", {
4478
4434
  state: import_services12.SpaceState[this._state]
4479
4435
  }, {
4480
- F: __dxlog_file17,
4436
+ F: __dxlog_file16,
4481
4437
  L: 271,
4482
4438
  S: this,
4483
4439
  C: (f, a) => f(...a)
@@ -4497,7 +4453,7 @@ var DataSpace = class {
4497
4453
  (0, import_log12.log)("new state", {
4498
4454
  state: import_services12.SpaceState[this._state]
4499
4455
  }, {
4500
- F: __dxlog_file17,
4456
+ F: __dxlog_file16,
4501
4457
  L: 287,
4502
4458
  S: this,
4503
4459
  C: (f, a) => f(...a)
@@ -4514,7 +4470,7 @@ var DataSpace = class {
4514
4470
  (0, import_log12.log)("new state", {
4515
4471
  state: import_services12.SpaceState[this._state]
4516
4472
  }, {
4517
- F: __dxlog_file17,
4473
+ F: __dxlog_file16,
4518
4474
  L: 306,
4519
4475
  S: this,
4520
4476
  C: (f, a) => f(...a)
@@ -4530,7 +4486,7 @@ var DataSpace = class {
4530
4486
  this.metrics.controlPipelineReady = /* @__PURE__ */ new Date();
4531
4487
  await this._createWritableFeeds();
4532
4488
  (0, import_log12.log)("writable feeds created", void 0, {
4533
- F: __dxlog_file17,
4489
+ F: __dxlog_file16,
4534
4490
  L: 322,
4535
4491
  S: this,
4536
4492
  C: (f, a) => f(...a)
@@ -4593,7 +4549,7 @@ var DataSpace = class {
4593
4549
  space: this.key,
4594
4550
  rootUrl
4595
4551
  }, {
4596
- F: __dxlog_file17,
4552
+ F: __dxlog_file16,
4597
4553
  L: 388,
4598
4554
  S: this,
4599
4555
  C: (f, a) => f(...a)
@@ -4647,7 +4603,7 @@ var DataSpace = class {
4647
4603
  rootUrl,
4648
4604
  err
4649
4605
  }, {
4650
- F: __dxlog_file17,
4606
+ F: __dxlog_file16,
4651
4607
  L: 431,
4652
4608
  S: this,
4653
4609
  C: (f, a) => f(...a)
@@ -4733,7 +4689,7 @@ var DataSpace = class {
4733
4689
  (0, import_log12.log)("new state", {
4734
4690
  state: import_services12.SpaceState[this._state]
4735
4691
  }, {
4736
- F: __dxlog_file17,
4692
+ F: __dxlog_file16,
4737
4693
  L: 512,
4738
4694
  S: this,
4739
4695
  C: (f, a) => f(...a)
@@ -4863,7 +4819,7 @@ function _ts_decorate5(decorators, target, key, desc) {
4863
4819
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4864
4820
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4865
4821
  }
4866
- var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
4822
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
4867
4823
  var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
4868
4824
  var PRESENCE_OFFLINE_TIMEOUT = 2e4;
4869
4825
  var DEFAULT_SPACE_KEY = "__DEFAULT__";
@@ -4877,10 +4833,7 @@ var DataSpaceManager = class {
4877
4833
  this._echoHost = _echoHost;
4878
4834
  this._invitationsManager = _invitationsManager;
4879
4835
  this._params = _params;
4880
- this._ctx = new import_context14.Context(void 0, {
4881
- F: __dxlog_file18,
4882
- L: 94
4883
- });
4836
+ this._ctx = new import_context14.Context();
4884
4837
  this.updated = new import_async17.Event();
4885
4838
  this._spaces = new import_util10.ComplexMap(import_keys12.PublicKey.hash);
4886
4839
  this._isOpen = false;
@@ -4914,7 +4867,7 @@ var DataSpaceManager = class {
4914
4867
  }
4915
4868
  async open() {
4916
4869
  (0, import_log15.log)("open", void 0, {
4917
- F: __dxlog_file18,
4870
+ F: __dxlog_file17,
4918
4871
  L: 146,
4919
4872
  S: this,
4920
4873
  C: (f, a) => f(...a)
@@ -4922,7 +4875,7 @@ var DataSpaceManager = class {
4922
4875
  import_log15.log.trace("dxos.echo.data-space-manager.open", import_protocols11.trace.begin({
4923
4876
  id: this._instanceId
4924
4877
  }), {
4925
- F: __dxlog_file18,
4878
+ F: __dxlog_file17,
4926
4879
  L: 147,
4927
4880
  S: this,
4928
4881
  C: (f, a) => f(...a)
@@ -4930,7 +4883,7 @@ var DataSpaceManager = class {
4930
4883
  (0, import_log15.log)("metadata loaded", {
4931
4884
  spaces: this._metadataStore.spaces.length
4932
4885
  }, {
4933
- F: __dxlog_file18,
4886
+ F: __dxlog_file17,
4934
4887
  L: 148,
4935
4888
  S: this,
4936
4889
  C: (f, a) => f(...a)
@@ -4940,7 +4893,7 @@ var DataSpaceManager = class {
4940
4893
  (0, import_log15.log)("load space", {
4941
4894
  spaceMetadata
4942
4895
  }, {
4943
- F: __dxlog_file18,
4896
+ F: __dxlog_file17,
4944
4897
  L: 152,
4945
4898
  S: this,
4946
4899
  C: (f, a) => f(...a)
@@ -4951,7 +4904,7 @@ var DataSpaceManager = class {
4951
4904
  spaceMetadata,
4952
4905
  err
4953
4906
  }, {
4954
- F: __dxlog_file18,
4907
+ F: __dxlog_file17,
4955
4908
  L: 155,
4956
4909
  S: this,
4957
4910
  C: (f, a) => f(...a)
@@ -4963,7 +4916,7 @@ var DataSpaceManager = class {
4963
4916
  import_log15.log.trace("dxos.echo.data-space-manager.open", import_protocols11.trace.end({
4964
4917
  id: this._instanceId
4965
4918
  }), {
4966
- F: __dxlog_file18,
4919
+ F: __dxlog_file17,
4967
4920
  L: 162,
4968
4921
  S: this,
4969
4922
  C: (f, a) => f(...a)
@@ -4971,7 +4924,7 @@ var DataSpaceManager = class {
4971
4924
  }
4972
4925
  async close() {
4973
4926
  (0, import_log15.log)("close", void 0, {
4974
- F: __dxlog_file18,
4927
+ F: __dxlog_file17,
4975
4928
  L: 167,
4976
4929
  S: this,
4977
4930
  C: (f, a) => f(...a)
@@ -4988,7 +4941,7 @@ var DataSpaceManager = class {
4988
4941
  */
4989
4942
  async createSpace() {
4990
4943
  (0, import_invariant15.invariant)(this._isOpen, "Not open.", {
4991
- F: __dxlog_file18,
4944
+ F: __dxlog_file17,
4992
4945
  L: 181,
4993
4946
  S: this,
4994
4947
  A: [
@@ -5009,7 +4962,7 @@ var DataSpaceManager = class {
5009
4962
  (0, import_log15.log)("creating space...", {
5010
4963
  spaceKey
5011
4964
  }, {
5012
- F: __dxlog_file18,
4965
+ F: __dxlog_file17,
5013
4966
  L: 193,
5014
4967
  S: this,
5015
4968
  C: (f, a) => f(...a)
@@ -5021,7 +4974,7 @@ var DataSpaceManager = class {
5021
4974
  await this._metadataStore.addSpace(metadata);
5022
4975
  const memberCredential = credentials[1];
5023
4976
  (0, import_invariant15.invariant)((0, import_credentials15.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5024
- F: __dxlog_file18,
4977
+ F: __dxlog_file17,
5025
4978
  L: 203,
5026
4979
  S: this,
5027
4980
  A: [
@@ -5053,7 +5006,7 @@ var DataSpaceManager = class {
5053
5006
  version: space.databaseRoot.getVersion(),
5054
5007
  spaceId: space.id
5055
5008
  }, {
5056
- F: __dxlog_file18,
5009
+ F: __dxlog_file17,
5057
5010
  L: 228,
5058
5011
  S: this,
5059
5012
  C: (f, a) => f(...a)
@@ -5088,7 +5041,7 @@ var DataSpaceManager = class {
5088
5041
  async _getSpaceRootDocument(space) {
5089
5042
  const automergeIndex = space.automergeSpaceState.rootUrl;
5090
5043
  (0, import_invariant15.invariant)(automergeIndex, void 0, {
5091
- F: __dxlog_file18,
5044
+ F: __dxlog_file17,
5092
5045
  L: 261,
5093
5046
  S: this,
5094
5047
  A: [
@@ -5105,13 +5058,13 @@ var DataSpaceManager = class {
5105
5058
  (0, import_log15.log)("accept space", {
5106
5059
  opts
5107
5060
  }, {
5108
- F: __dxlog_file18,
5061
+ F: __dxlog_file17,
5109
5062
  L: 270,
5110
5063
  S: this,
5111
5064
  C: (f, a) => f(...a)
5112
5065
  });
5113
5066
  (0, import_invariant15.invariant)(this._isOpen, "Not open.", {
5114
- F: __dxlog_file18,
5067
+ F: __dxlog_file17,
5115
5068
  L: 271,
5116
5069
  S: this,
5117
5070
  A: [
@@ -5120,7 +5073,7 @@ var DataSpaceManager = class {
5120
5073
  ]
5121
5074
  });
5122
5075
  (0, import_invariant15.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
5123
- F: __dxlog_file18,
5076
+ F: __dxlog_file17,
5124
5077
  L: 272,
5125
5078
  S: this,
5126
5079
  A: [
@@ -5156,7 +5109,7 @@ var DataSpaceManager = class {
5156
5109
  (0, import_log15.log)("construct space", {
5157
5110
  metadata
5158
5111
  }, {
5159
- F: __dxlog_file18,
5112
+ F: __dxlog_file17,
5160
5113
  L: 306,
5161
5114
  S: this,
5162
5115
  C: (f, a) => f(...a)
@@ -5194,7 +5147,7 @@ var DataSpaceManager = class {
5194
5147
  },
5195
5148
  onAuthFailure: () => {
5196
5149
  import_log15.log.warn("auth failure", void 0, {
5197
- F: __dxlog_file18,
5150
+ F: __dxlog_file17,
5198
5151
  L: 343,
5199
5152
  S: this,
5200
5153
  C: (f, a) => f(...a)
@@ -5227,7 +5180,7 @@ var DataSpaceManager = class {
5227
5180
  (0, import_log15.log)("before space ready", {
5228
5181
  space: space.key
5229
5182
  }, {
5230
- F: __dxlog_file18,
5183
+ F: __dxlog_file17,
5231
5184
  L: 370,
5232
5185
  S: this,
5233
5186
  C: (f, a) => f(...a)
@@ -5238,7 +5191,7 @@ var DataSpaceManager = class {
5238
5191
  space: space.key,
5239
5192
  open: this._isOpen
5240
5193
  }, {
5241
- F: __dxlog_file18,
5194
+ F: __dxlog_file17,
5242
5195
  L: 373,
5243
5196
  S: this,
5244
5197
  C: (f, a) => f(...a)
@@ -5257,7 +5210,7 @@ var DataSpaceManager = class {
5257
5210
  (0, import_log15.log)("before space close", {
5258
5211
  space: space.key
5259
5212
  }, {
5260
- F: __dxlog_file18,
5213
+ F: __dxlog_file17,
5261
5214
  L: 381,
5262
5215
  S: this,
5263
5216
  C: (f, a) => f(...a)
@@ -5298,7 +5251,7 @@ var DataSpaceManager = class {
5298
5251
  peersOnline: presence.getPeersOnline().length,
5299
5252
  closedSessions
5300
5253
  }, {
5301
- F: __dxlog_file18,
5254
+ F: __dxlog_file17,
5302
5255
  L: 417,
5303
5256
  S: this,
5304
5257
  C: (f, a) => f(...a)
@@ -5313,7 +5266,7 @@ var DataSpaceManager = class {
5313
5266
  (0, import_log15.log)("closing a session with a removed peer", {
5314
5267
  peerId: peerState.peerId
5315
5268
  }, {
5316
- F: __dxlog_file18,
5269
+ F: __dxlog_file17,
5317
5270
  L: 431,
5318
5271
  S: this,
5319
5272
  C: (f, a) => f(...a)
@@ -5373,7 +5326,7 @@ _ts_decorate5([
5373
5326
  DataSpaceManager = _ts_decorate5([
5374
5327
  (0, import_async17.trackLeaks)("open", "close")
5375
5328
  ], DataSpaceManager);
5376
- var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
5329
+ var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
5377
5330
  var SpacesServiceImpl = class {
5378
5331
  constructor(_identityManager, _spaceManager, _getDataSpaceManager) {
5379
5332
  this._identityManager = _identityManager;
@@ -5417,7 +5370,7 @@ var SpacesServiceImpl = class {
5417
5370
  }
5418
5371
  const credentials = await (0, import_credentials19.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
5419
5372
  (0, import_invariant16.invariant)(credentials[0].credential, void 0, {
5420
- F: __dxlog_file19,
5373
+ F: __dxlog_file18,
5421
5374
  L: 98,
5422
5375
  S: this,
5423
5376
  A: [
@@ -5427,7 +5380,7 @@ var SpacesServiceImpl = class {
5427
5380
  });
5428
5381
  const spaceMemberCredential = credentials[0].credential.credential;
5429
5382
  (0, import_invariant16.invariant)((0, import_credentials19.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5430
- F: __dxlog_file19,
5383
+ F: __dxlog_file18,
5431
5384
  L: 100,
5432
5385
  S: this,
5433
5386
  A: [
@@ -5445,7 +5398,7 @@ var SpacesServiceImpl = class {
5445
5398
  (0, import_log16.log)("update", {
5446
5399
  spaces
5447
5400
  }, {
5448
- F: __dxlog_file19,
5401
+ F: __dxlog_file18,
5449
5402
  L: 111,
5450
5403
  S: this,
5451
5404
  C: (f, a) => f(...a)
@@ -5537,7 +5490,7 @@ var SpacesServiceImpl = class {
5537
5490
  });
5538
5491
  } else {
5539
5492
  (0, import_invariant16.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
5540
- F: __dxlog_file19,
5493
+ F: __dxlog_file18,
5541
5494
  L: 209,
5542
5495
  S: this,
5543
5496
  A: [
@@ -5546,7 +5499,7 @@ var SpacesServiceImpl = class {
5546
5499
  ]
5547
5500
  });
5548
5501
  (0, import_invariant16.invariant)(this._identityManager.identity, "Identity is not available", {
5549
- F: __dxlog_file19,
5502
+ F: __dxlog_file18,
5550
5503
  L: 210,
5551
5504
  S: this,
5552
5505
  A: [
@@ -5556,7 +5509,7 @@ var SpacesServiceImpl = class {
5556
5509
  });
5557
5510
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
5558
5511
  (0, import_invariant16.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
5559
- F: __dxlog_file19,
5512
+ F: __dxlog_file18,
5560
5513
  L: 212,
5561
5514
  S: this,
5562
5515
  A: [
@@ -5656,7 +5609,7 @@ function _ts_decorate6(decorators, target, key, desc) {
5656
5609
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5657
5610
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5658
5611
  }
5659
- var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
5612
+ var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
5660
5613
  var ServiceContext = class extends import_context15.Resource {
5661
5614
  constructor(storage, level, networkManager, signalManager, _runtimeParams) {
5662
5615
  super();
@@ -5700,7 +5653,7 @@ var ServiceContext = class extends import_context15.Resource {
5700
5653
  async _open(ctx) {
5701
5654
  await this._checkStorageVersion();
5702
5655
  (0, import_log17.log)("opening...", void 0, {
5703
- F: __dxlog_file20,
5656
+ F: __dxlog_file19,
5704
5657
  L: 149,
5705
5658
  S: this,
5706
5659
  C: (f, a) => f(...a)
@@ -5708,7 +5661,7 @@ var ServiceContext = class extends import_context15.Resource {
5708
5661
  import_log17.log.trace("dxos.sdk.service-context.open", import_protocols13.trace.begin({
5709
5662
  id: this._instanceId
5710
5663
  }), {
5711
- F: __dxlog_file20,
5664
+ F: __dxlog_file19,
5712
5665
  L: 150,
5713
5666
  S: this,
5714
5667
  C: (f, a) => f(...a)
@@ -5726,7 +5679,7 @@ var ServiceContext = class extends import_context15.Resource {
5726
5679
  (0, import_log17.log)("loaded persistent invitations", {
5727
5680
  count: loadedInvitations.invitations?.length
5728
5681
  }, {
5729
- F: __dxlog_file20,
5682
+ F: __dxlog_file19,
5730
5683
  L: 163,
5731
5684
  S: this,
5732
5685
  C: (f, a) => f(...a)
@@ -5734,13 +5687,13 @@ var ServiceContext = class extends import_context15.Resource {
5734
5687
  import_log17.log.trace("dxos.sdk.service-context.open", import_protocols13.trace.end({
5735
5688
  id: this._instanceId
5736
5689
  }), {
5737
- F: __dxlog_file20,
5690
+ F: __dxlog_file19,
5738
5691
  L: 165,
5739
5692
  S: this,
5740
5693
  C: (f, a) => f(...a)
5741
5694
  });
5742
5695
  (0, import_log17.log)("opened", void 0, {
5743
- F: __dxlog_file20,
5696
+ F: __dxlog_file19,
5744
5697
  L: 166,
5745
5698
  S: this,
5746
5699
  C: (f, a) => f(...a)
@@ -5748,7 +5701,7 @@ var ServiceContext = class extends import_context15.Resource {
5748
5701
  }
5749
5702
  async _close(ctx) {
5750
5703
  (0, import_log17.log)("closing...", void 0, {
5751
- F: __dxlog_file20,
5704
+ F: __dxlog_file19,
5752
5705
  L: 170,
5753
5706
  S: this,
5754
5707
  C: (f, a) => f(...a)
@@ -5765,7 +5718,7 @@ var ServiceContext = class extends import_context15.Resource {
5765
5718
  await this.networkManager.close();
5766
5719
  await this.signalManager.close();
5767
5720
  (0, import_log17.log)("closed", void 0, {
5768
- F: __dxlog_file20,
5721
+ F: __dxlog_file19,
5769
5722
  L: 182,
5770
5723
  S: this,
5771
5724
  C: (f, a) => f(...a)
@@ -5773,16 +5726,13 @@ var ServiceContext = class extends import_context15.Resource {
5773
5726
  }
5774
5727
  async createIdentity(params = {}) {
5775
5728
  const identity = await this.identityManager.createIdentity(params);
5776
- await this._initialize(new import_context15.Context(void 0, {
5777
- F: __dxlog_file20,
5778
- L: 187
5779
- }));
5729
+ await this._initialize(new import_context15.Context());
5780
5730
  return identity;
5781
5731
  }
5782
5732
  getInvitationHandler(invitation) {
5783
5733
  const factory = this._handlerFactories.get(invitation.kind);
5784
5734
  (0, import_invariant17.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
5785
- F: __dxlog_file20,
5735
+ F: __dxlog_file19,
5786
5736
  L: 193,
5787
5737
  S: this,
5788
5738
  A: [
@@ -5802,10 +5752,7 @@ var ServiceContext = class extends import_context15.Resource {
5802
5752
  }
5803
5753
  async _acceptIdentity(params) {
5804
5754
  const identity = await this.identityManager.acceptIdentity(params);
5805
- await this._initialize(new import_context15.Context(void 0, {
5806
- F: __dxlog_file20,
5807
- L: 209
5808
- }));
5755
+ await this._initialize(new import_context15.Context());
5809
5756
  return identity;
5810
5757
  }
5811
5758
  async _checkStorageVersion() {
@@ -5817,7 +5764,7 @@ var ServiceContext = class extends import_context15.Resource {
5817
5764
  // Called when identity is created.
5818
5765
  async _initialize(ctx) {
5819
5766
  (0, import_log17.log)("initializing spaces...", void 0, {
5820
- F: __dxlog_file20,
5767
+ F: __dxlog_file19,
5821
5768
  L: 224,
5822
5769
  S: this,
5823
5770
  C: (f, a) => f(...a)
@@ -5840,7 +5787,7 @@ var ServiceContext = class extends import_context15.Resource {
5840
5787
  await this.dataSpaceManager.open();
5841
5788
  this._handlerFactories.set(import_services16.Invitation.Kind.SPACE, (invitation) => {
5842
5789
  (0, import_invariant17.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
5843
- F: __dxlog_file20,
5790
+ F: __dxlog_file19,
5844
5791
  L: 249,
5845
5792
  S: this,
5846
5793
  A: [
@@ -5864,7 +5811,7 @@ var ServiceContext = class extends import_context15.Resource {
5864
5811
  (0, import_log17.log)("dataSpaceManager not initialized yet, ignoring space admission", {
5865
5812
  details: assertion
5866
5813
  }, {
5867
- F: __dxlog_file20,
5814
+ F: __dxlog_file19,
5868
5815
  L: 265,
5869
5816
  S: this,
5870
5817
  C: (f, a) => f(...a)
@@ -5875,7 +5822,7 @@ var ServiceContext = class extends import_context15.Resource {
5875
5822
  (0, import_log17.log)("space already exists, ignoring space admission", {
5876
5823
  details: assertion
5877
5824
  }, {
5878
- F: __dxlog_file20,
5825
+ F: __dxlog_file19,
5879
5826
  L: 269,
5880
5827
  S: this,
5881
5828
  C: (f, a) => f(...a)
@@ -5886,7 +5833,7 @@ var ServiceContext = class extends import_context15.Resource {
5886
5833
  (0, import_log17.log)("accepting space recorded in halo", {
5887
5834
  details: assertion
5888
5835
  }, {
5889
- F: __dxlog_file20,
5836
+ F: __dxlog_file19,
5890
5837
  L: 274,
5891
5838
  S: this,
5892
5839
  C: (f, a) => f(...a)
@@ -5897,7 +5844,7 @@ var ServiceContext = class extends import_context15.Resource {
5897
5844
  });
5898
5845
  } catch (err) {
5899
5846
  import_log17.log.catch(err, void 0, {
5900
- F: __dxlog_file20,
5847
+ F: __dxlog_file19,
5901
5848
  L: 280,
5902
5849
  S: this,
5903
5850
  C: (f, a) => f(...a)
@@ -5950,7 +5897,7 @@ function _ts_decorate7(decorators, target, key, desc) {
5950
5897
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5951
5898
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5952
5899
  }
5953
- var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
5900
+ var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
5954
5901
  var Lock = class {
5955
5902
  constructor({ lockKey: lockPath, onAcquire, onRelease }) {
5956
5903
  this._lockPath = lockPath;
@@ -5962,7 +5909,7 @@ var Lock = class {
5962
5909
  }
5963
5910
  async acquire() {
5964
5911
  (0, import_log18.log)("acquiring lock...", void 0, {
5965
- F: __dxlog_file21,
5912
+ F: __dxlog_file20,
5966
5913
  L: 32,
5967
5914
  S: this,
5968
5915
  C: (f, a) => f(...a)
@@ -5970,7 +5917,7 @@ var Lock = class {
5970
5917
  this._fileHandle = await import_lock_file.LockFile.acquire(this._lockPath);
5971
5918
  await this._onAcquire?.();
5972
5919
  (0, import_log18.log)("acquired lock", void 0, {
5973
- F: __dxlog_file21,
5920
+ F: __dxlog_file20,
5974
5921
  L: 37,
5975
5922
  S: this,
5976
5923
  C: (f, a) => f(...a)
@@ -5979,7 +5926,7 @@ var Lock = class {
5979
5926
  async release() {
5980
5927
  await this._onRelease?.();
5981
5928
  (0, import_invariant18.invariant)(this._fileHandle, "Lock is not acquired", {
5982
- F: __dxlog_file21,
5929
+ F: __dxlog_file20,
5983
5930
  L: 42,
5984
5931
  S: this,
5985
5932
  A: [
@@ -6051,6 +5998,137 @@ var createLevel = async (config) => {
6051
5998
  await level.open();
6052
5999
  return level;
6053
6000
  };
6001
+ var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/storage/profile-archive.ts";
6002
+ var encodeProfileArchive = (profile) => import_automerge_repo.cbor.encode(profile);
6003
+ var decodeProfileArchive = (data) => import_automerge_repo.cbor.decode(data);
6004
+ var exportProfileData = async ({ storage, level }) => {
6005
+ const archive = {
6006
+ storage: [],
6007
+ meta: {
6008
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
6009
+ }
6010
+ };
6011
+ {
6012
+ const directory = await storage.createDirectory();
6013
+ const files = await directory.list();
6014
+ import_log19.log.info("begin exporting files", {
6015
+ count: files.length
6016
+ }, {
6017
+ F: __dxlog_file21,
6018
+ L: 30,
6019
+ S: void 0,
6020
+ C: (f, a) => f(...a)
6021
+ });
6022
+ for (const filename of files) {
6023
+ const file = await directory.getOrCreateFile(filename);
6024
+ const { size } = await file.stat();
6025
+ const data = await file.read(0, size);
6026
+ archive.storage.push({
6027
+ type: import_protocols15.ProfileArchiveEntryType.FILE,
6028
+ key: filename,
6029
+ value: data
6030
+ });
6031
+ }
6032
+ import_log19.log.info("done exporting files", {
6033
+ count: files.length
6034
+ }, {
6035
+ F: __dxlog_file21,
6036
+ L: 41,
6037
+ S: void 0,
6038
+ C: (f, a) => f(...a)
6039
+ });
6040
+ }
6041
+ {
6042
+ import_log19.log.info("begin exporting kv pairs", void 0, {
6043
+ F: __dxlog_file21,
6044
+ L: 45,
6045
+ S: void 0,
6046
+ C: (f, a) => f(...a)
6047
+ });
6048
+ const iter = await level.iterator({
6049
+ keyEncoding: "binary",
6050
+ valueEncoding: "binary"
6051
+ });
6052
+ let count = 0;
6053
+ for await (const [key, value] of iter) {
6054
+ archive.storage.push({
6055
+ type: import_protocols15.ProfileArchiveEntryType.KEY_VALUE,
6056
+ key,
6057
+ value
6058
+ });
6059
+ count++;
6060
+ }
6061
+ import_log19.log.info("done exporting kv pairs", {
6062
+ count
6063
+ }, {
6064
+ F: __dxlog_file21,
6065
+ L: 56,
6066
+ S: void 0,
6067
+ C: (f, a) => f(...a)
6068
+ });
6069
+ }
6070
+ return archive;
6071
+ };
6072
+ var importProfileData = async ({ storage, level }, archive) => {
6073
+ const batch = level.batch();
6074
+ for (const entry2 of archive.storage) {
6075
+ switch (entry2.type) {
6076
+ case import_protocols15.ProfileArchiveEntryType.FILE: {
6077
+ const directory = await storage.createDirectory();
6078
+ (0, import_invariant19.invariant)(typeof entry2.key === "string", "Invalid key type", {
6079
+ F: __dxlog_file21,
6080
+ L: 78,
6081
+ S: void 0,
6082
+ A: [
6083
+ "typeof entry.key === 'string'",
6084
+ "'Invalid key type'"
6085
+ ]
6086
+ });
6087
+ const file = await directory.getOrCreateFile(entry2.key);
6088
+ (0, import_invariant19.invariant)(entry2.value instanceof Uint8Array, "Invalid value type", {
6089
+ F: __dxlog_file21,
6090
+ L: 80,
6091
+ S: void 0,
6092
+ A: [
6093
+ "entry.value instanceof Uint8Array",
6094
+ "'Invalid value type'"
6095
+ ]
6096
+ });
6097
+ await file.write(0, (0, import_util13.arrayToBuffer)(entry2.value));
6098
+ await file.close();
6099
+ break;
6100
+ }
6101
+ case import_protocols15.ProfileArchiveEntryType.KEY_VALUE: {
6102
+ (0, import_invariant19.invariant)(entry2.key instanceof Uint8Array, "Invalid key type", {
6103
+ F: __dxlog_file21,
6104
+ L: 86,
6105
+ S: void 0,
6106
+ A: [
6107
+ "entry.key instanceof Uint8Array",
6108
+ "'Invalid key type'"
6109
+ ]
6110
+ });
6111
+ (0, import_invariant19.invariant)(entry2.value instanceof Uint8Array, "Invalid value type", {
6112
+ F: __dxlog_file21,
6113
+ L: 87,
6114
+ S: void 0,
6115
+ A: [
6116
+ "entry.value instanceof Uint8Array",
6117
+ "'Invalid value type'"
6118
+ ]
6119
+ });
6120
+ batch.put(entry2.key, entry2.value, {
6121
+ keyEncoding: "binary",
6122
+ valueEncoding: "binary"
6123
+ });
6124
+ break;
6125
+ }
6126
+ default:
6127
+ throw new Error(`Invalid entry type: ${entry2.type}`);
6128
+ }
6129
+ }
6130
+ await batch.write();
6131
+ };
6054
6132
  var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6055
6133
  var DevicesServiceImpl = class {
6056
6134
  constructor(_identityManager) {
@@ -6068,7 +6146,7 @@ var DevicesServiceImpl = class {
6068
6146
  devices: []
6069
6147
  });
6070
6148
  } else {
6071
- (0, import_invariant20.invariant)(this._identityManager.identity?.presence, "presence not present", {
6149
+ (0, import_invariant21.invariant)(this._identityManager.identity?.presence, "presence not present", {
6072
6150
  F: __dxlog_file22,
6073
6151
  L: 32,
6074
6152
  S: this,
@@ -6150,7 +6228,7 @@ var DiagnosticsCollector = class {
6150
6228
  client: clientDiagnostics,
6151
6229
  broadcast: await this.broadcastSender.broadcastDiagnosticsRequest()
6152
6230
  };
6153
- return JSON.parse(JSON.stringify(diagnostics, (0, import_util13.jsonKeyReplacer)(options)));
6231
+ return JSON.parse(JSON.stringify(diagnostics, (0, import_util14.jsonKeyReplacer)(options)));
6154
6232
  }
6155
6233
  };
6156
6234
  var findSystemServiceProvider = () => {
@@ -6160,7 +6238,7 @@ var findSystemServiceProvider = () => {
6160
6238
  };
6161
6239
  var findConfigs = () => {
6162
6240
  const configs = import_tracing10.TRACE_PROCESSOR.findResourcesByAnnotation(import_config3.ConfigResource);
6163
- return configs.map((r) => r.instance.deref()).filter(import_util13.nonNullable);
6241
+ return configs.map((r) => r.instance.deref()).filter(import_util14.nonNullable);
6164
6242
  };
6165
6243
  var LoggingServiceImpl = class {
6166
6244
  constructor() {
@@ -6172,23 +6250,23 @@ var LoggingServiceImpl = class {
6172
6250
  };
6173
6251
  }
6174
6252
  async open() {
6175
- import_log20.log.runtimeConfig.processors.push(this._logProcessor);
6253
+ import_log21.log.runtimeConfig.processors.push(this._logProcessor);
6176
6254
  }
6177
6255
  async close() {
6178
- const index = import_log20.log.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
6179
- import_log20.log.runtimeConfig.processors.splice(index, 1);
6256
+ const index = import_log21.log.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
6257
+ import_log21.log.runtimeConfig.processors.splice(index, 1);
6180
6258
  }
6181
6259
  async controlMetrics({ reset, record }) {
6182
6260
  if (reset) {
6183
- import_util15.tracer.clear();
6261
+ import_util16.tracer.clear();
6184
6262
  }
6185
6263
  if (record === true) {
6186
- import_util15.tracer.start();
6264
+ import_util16.tracer.start();
6187
6265
  } else if (record === false) {
6188
- import_util15.tracer.stop();
6266
+ import_util16.tracer.stop();
6189
6267
  }
6190
6268
  return {
6191
- recording: import_util15.tracer.recording
6269
+ recording: import_util16.tracer.recording
6192
6270
  };
6193
6271
  }
6194
6272
  /**
@@ -6196,10 +6274,10 @@ var LoggingServiceImpl = class {
6196
6274
  */
6197
6275
  queryMetrics({ interval = 5e3 }) {
6198
6276
  const getNumericalValues = (key) => {
6199
- const events = import_util15.tracer.get(key) ?? [];
6277
+ const events = import_util16.tracer.get(key) ?? [];
6200
6278
  return {
6201
6279
  key,
6202
- stats: (0, import_util15.numericalValues)(events, "duration")
6280
+ stats: (0, import_util16.numericalValues)(events, "duration")
6203
6281
  };
6204
6282
  };
6205
6283
  return new import_codec_protobuf13.Stream(({ next }) => {
@@ -6237,7 +6315,7 @@ var LoggingServiceImpl = class {
6237
6315
  }
6238
6316
  const record = {
6239
6317
  ...entry2,
6240
- context: (0, import_util15.jsonify)((0, import_log20.getContextFromEntry)(entry2)),
6318
+ context: (0, import_util16.jsonify)((0, import_log21.getContextFromEntry)(entry2)),
6241
6319
  timestamp: /* @__PURE__ */ new Date(),
6242
6320
  meta: {
6243
6321
  // TODO(dmaretskyi): Fix proto.
@@ -6246,7 +6324,7 @@ var LoggingServiceImpl = class {
6246
6324
  scope: {
6247
6325
  hostSessionId: this._sessionId,
6248
6326
  uptimeSeconds: (Date.now() - this._started) / 1e3,
6249
- name: (0, import_util15.getDebugName)(entry2.meta?.S)
6327
+ name: (0, import_util16.getDebugName)(entry2.meta?.S)
6250
6328
  }
6251
6329
  }
6252
6330
  };
@@ -6327,7 +6405,7 @@ var SystemServiceImpl = class {
6327
6405
  const diagnostics = await this._getDiagnostics();
6328
6406
  return {
6329
6407
  timestamp: /* @__PURE__ */ new Date(),
6330
- diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util16.jsonKeyReplacer)({
6408
+ diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util17.jsonKeyReplacer)({
6331
6409
  truncate: keys === import_services21.GetDiagnosticsRequest.KEY_OPTION.TRUNCATE,
6332
6410
  humanize: keys === import_services21.GetDiagnosticsRequest.KEY_OPTION.HUMANIZE
6333
6411
  })))
@@ -6403,10 +6481,7 @@ var ClientServicesHost = class {
6403
6481
  lockKey,
6404
6482
  onAcquire: () => {
6405
6483
  if (!this._opening) {
6406
- void this.open(new import_context16.Context(void 0, {
6407
- F: __dxlog_file23,
6408
- L: 120
6409
- }));
6484
+ void this.open(new import_context16.Context());
6410
6485
  }
6411
6486
  },
6412
6487
  onRelease: () => this.close()
@@ -6461,7 +6536,7 @@ var ClientServicesHost = class {
6461
6536
  * Can only be called once.
6462
6537
  */
6463
6538
  initialize({ config, ...options }) {
6464
- (0, import_invariant19.invariant)(!this._open, "service host is open", {
6539
+ (0, import_invariant20.invariant)(!this._open, "service host is open", {
6465
6540
  F: __dxlog_file23,
6466
6541
  L: 186,
6467
6542
  S: this,
@@ -6470,14 +6545,14 @@ var ClientServicesHost = class {
6470
6545
  "'service host is open'"
6471
6546
  ]
6472
6547
  });
6473
- (0, import_log19.log)("initializing...", void 0, {
6548
+ (0, import_log20.log)("initializing...", void 0, {
6474
6549
  F: __dxlog_file23,
6475
6550
  L: 187,
6476
6551
  S: this,
6477
6552
  C: (f, a) => f(...a)
6478
6553
  });
6479
6554
  if (config) {
6480
- (0, import_invariant19.invariant)(!this._config, "config already set", {
6555
+ (0, import_invariant20.invariant)(!this._config, "config already set", {
6481
6556
  F: __dxlog_file23,
6482
6557
  L: 190,
6483
6558
  S: this,
@@ -6492,7 +6567,7 @@ var ClientServicesHost = class {
6492
6567
  }
6493
6568
  }
6494
6569
  if (!options.signalManager) {
6495
- import_log19.log.warn("running signaling without telemetry metadata.", void 0, {
6570
+ import_log20.log.warn("running signaling without telemetry metadata.", void 0, {
6496
6571
  F: __dxlog_file23,
6497
6572
  L: 198,
6498
6573
  S: this,
@@ -6503,7 +6578,7 @@ var ClientServicesHost = class {
6503
6578
  iceServers: this._config?.get("runtime.services.ice")
6504
6579
  }), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
6505
6580
  this._signalManager = signalManager;
6506
- (0, import_invariant19.invariant)(!this._networkManager, "network manager already set", {
6581
+ (0, import_invariant20.invariant)(!this._networkManager, "network manager already set", {
6507
6582
  F: __dxlog_file23,
6508
6583
  L: 209,
6509
6584
  S: this,
@@ -6517,7 +6592,7 @@ var ClientServicesHost = class {
6517
6592
  transportFactory,
6518
6593
  signalManager
6519
6594
  });
6520
- (0, import_log19.log)("initialized", void 0, {
6595
+ (0, import_log20.log)("initialized", void 0, {
6521
6596
  F: __dxlog_file23,
6522
6597
  L: 216,
6523
6598
  S: this,
@@ -6529,7 +6604,7 @@ var ClientServicesHost = class {
6529
6604
  return;
6530
6605
  }
6531
6606
  const traceId = import_keys15.PublicKey.random().toHex();
6532
- import_log19.log.trace("dxos.client-services.host.open", import_protocols15.trace.begin({
6607
+ import_log20.log.trace("dxos.client-services.host.open", import_protocols16.trace.begin({
6533
6608
  id: traceId
6534
6609
  }), {
6535
6610
  F: __dxlog_file23,
@@ -6537,7 +6612,7 @@ var ClientServicesHost = class {
6537
6612
  S: this,
6538
6613
  C: (f, a) => f(...a)
6539
6614
  });
6540
- (0, import_invariant19.invariant)(this._config, "config not set", {
6615
+ (0, import_invariant20.invariant)(this._config, "config not set", {
6541
6616
  F: __dxlog_file23,
6542
6617
  L: 229,
6543
6618
  S: this,
@@ -6546,7 +6621,7 @@ var ClientServicesHost = class {
6546
6621
  "'config not set'"
6547
6622
  ]
6548
6623
  });
6549
- (0, import_invariant19.invariant)(this._storage, "storage not set", {
6624
+ (0, import_invariant20.invariant)(this._storage, "storage not set", {
6550
6625
  F: __dxlog_file23,
6551
6626
  L: 230,
6552
6627
  S: this,
@@ -6555,7 +6630,7 @@ var ClientServicesHost = class {
6555
6630
  "'storage not set'"
6556
6631
  ]
6557
6632
  });
6558
- (0, import_invariant19.invariant)(this._signalManager, "signal manager not set", {
6633
+ (0, import_invariant20.invariant)(this._signalManager, "signal manager not set", {
6559
6634
  F: __dxlog_file23,
6560
6635
  L: 231,
6561
6636
  S: this,
@@ -6564,7 +6639,7 @@ var ClientServicesHost = class {
6564
6639
  "'signal manager not set'"
6565
6640
  ]
6566
6641
  });
6567
- (0, import_invariant19.invariant)(this._networkManager, "network manager not set", {
6642
+ (0, import_invariant20.invariant)(this._networkManager, "network manager not set", {
6568
6643
  F: __dxlog_file23,
6569
6644
  L: 232,
6570
6645
  S: this,
@@ -6574,7 +6649,7 @@ var ClientServicesHost = class {
6574
6649
  ]
6575
6650
  });
6576
6651
  this._opening = true;
6577
- (0, import_log19.log)("opening...", {
6652
+ (0, import_log20.log)("opening...", {
6578
6653
  lockKey: this._resourceLock?.lockKey
6579
6654
  }, {
6580
6655
  F: __dxlog_file23,
@@ -6628,7 +6703,7 @@ var ClientServicesHost = class {
6628
6703
  this._open = true;
6629
6704
  this._statusUpdate.emit();
6630
6705
  const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
6631
- (0, import_log19.log)("opened", {
6706
+ (0, import_log20.log)("opened", {
6632
6707
  deviceKey
6633
6708
  }, {
6634
6709
  F: __dxlog_file23,
@@ -6636,7 +6711,7 @@ var ClientServicesHost = class {
6636
6711
  S: this,
6637
6712
  C: (f, a) => f(...a)
6638
6713
  });
6639
- import_log19.log.trace("dxos.client-services.host.open", import_protocols15.trace.end({
6714
+ import_log20.log.trace("dxos.client-services.host.open", import_protocols16.trace.end({
6640
6715
  id: traceId
6641
6716
  }), {
6642
6717
  F: __dxlog_file23,
@@ -6650,7 +6725,7 @@ var ClientServicesHost = class {
6650
6725
  return;
6651
6726
  }
6652
6727
  const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
6653
- (0, import_log19.log)("closing...", {
6728
+ (0, import_log20.log)("closing...", {
6654
6729
  deviceKey
6655
6730
  }, {
6656
6731
  F: __dxlog_file23,
@@ -6668,7 +6743,7 @@ var ClientServicesHost = class {
6668
6743
  await this._level?.close();
6669
6744
  this._open = false;
6670
6745
  this._statusUpdate.emit();
6671
- (0, import_log19.log)("closed", {
6746
+ (0, import_log20.log)("closed", {
6672
6747
  deviceKey
6673
6748
  }, {
6674
6749
  F: __dxlog_file23,
@@ -6679,7 +6754,7 @@ var ClientServicesHost = class {
6679
6754
  }
6680
6755
  async reset() {
6681
6756
  const traceId = import_keys15.PublicKey.random().toHex();
6682
- import_log19.log.trace("dxos.sdk.client-services-host.reset", import_protocols15.trace.begin({
6757
+ import_log20.log.trace("dxos.sdk.client-services-host.reset", import_protocols16.trace.begin({
6683
6758
  id: traceId
6684
6759
  }), {
6685
6760
  F: __dxlog_file23,
@@ -6687,7 +6762,7 @@ var ClientServicesHost = class {
6687
6762
  S: this,
6688
6763
  C: (f, a) => f(...a)
6689
6764
  });
6690
- import_log19.log.info("resetting...", void 0, {
6765
+ import_log20.log.info("resetting...", void 0, {
6691
6766
  F: __dxlog_file23,
6692
6767
  L: 342,
6693
6768
  S: this,
@@ -6695,13 +6770,13 @@ var ClientServicesHost = class {
6695
6770
  });
6696
6771
  await this._serviceContext?.close();
6697
6772
  await this._storage.reset();
6698
- import_log19.log.info("reset", void 0, {
6773
+ import_log20.log.info("reset", void 0, {
6699
6774
  F: __dxlog_file23,
6700
6775
  L: 345,
6701
6776
  S: this,
6702
6777
  C: (f, a) => f(...a)
6703
6778
  });
6704
- import_log19.log.trace("dxos.sdk.client-services-host.reset", import_protocols15.trace.end({
6779
+ import_log20.log.trace("dxos.sdk.client-services-host.reset", import_protocols16.trace.end({
6705
6780
  id: traceId
6706
6781
  }), {
6707
6782
  F: __dxlog_file23,
@@ -6764,7 +6839,11 @@ ClientServicesHost = _ts_decorate8([
6764
6839
  createDiagnostics,
6765
6840
  createLevel,
6766
6841
  createStorageObjects,
6842
+ decodeProfileArchive,
6843
+ encodeProfileArchive,
6844
+ exportProfileData,
6767
6845
  getNetworkPeers,
6846
+ importProfileData,
6768
6847
  isLocked,
6769
6848
  subscribeToFeedBlocks,
6770
6849
  subscribeToFeeds,
@@ -6774,4 +6853,4 @@ ClientServicesHost = _ts_decorate8([
6774
6853
  subscribeToSpaces,
6775
6854
  subscribeToSwarmInfo
6776
6855
  });
6777
- //# sourceMappingURL=chunk-6HFQ2SQ5.cjs.map
6856
+ //# sourceMappingURL=chunk-XZHIBOD3.cjs.map