@dxos/client-services 0.5.9-main.1cc8373 → 0.5.9-main.1ea2105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/lib/browser/{chunk-W55ZOE2M.mjs → chunk-AHVKY45R.mjs} +444 -805
  2. package/dist/lib/browser/chunk-AHVKY45R.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +2 -13
  4. package/dist/lib/browser/index.mjs.map +1 -1
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +3 -10
  7. package/dist/lib/browser/packlets/testing/index.mjs.map +1 -1
  8. package/dist/lib/node/{chunk-Y4ZFTXGB.cjs → chunk-POJY42WS.cjs} +456 -817
  9. package/dist/lib/node/chunk-POJY42WS.cjs.map +7 -0
  10. package/dist/lib/node/index.cjs +42 -53
  11. package/dist/lib/node/index.cjs.map +1 -1
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/packlets/testing/index.cjs +10 -17
  14. package/dist/lib/node/packlets/testing/index.cjs.map +1 -1
  15. package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
  16. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
  17. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  18. package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -10
  19. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  20. package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -4
  21. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  22. package/dist/types/src/packlets/storage/index.d.ts +0 -1
  23. package/dist/types/src/packlets/storage/index.d.ts.map +1 -1
  24. package/dist/types/src/version.d.ts +1 -1
  25. package/package.json +36 -36
  26. package/src/packlets/invitations/invitations-handler.ts +5 -13
  27. package/src/packlets/invitations/space-invitation-protocol.ts +32 -11
  28. package/src/packlets/services/service-host.ts +4 -12
  29. package/src/packlets/spaces/data-space-manager.ts +2 -55
  30. package/src/packlets/spaces/spaces-service.ts +0 -38
  31. package/src/packlets/storage/index.ts +0 -1
  32. package/src/version.ts +1 -1
  33. package/dist/lib/browser/chunk-W55ZOE2M.mjs.map +0 -7
  34. package/dist/lib/node/chunk-Y4ZFTXGB.cjs.map +0 -7
  35. package/dist/types/src/packlets/identity/contacts-service.d.ts +0 -14
  36. package/dist/types/src/packlets/identity/contacts-service.d.ts.map +0 -1
  37. package/dist/types/src/packlets/storage/profile-archive.d.ts +0 -14
  38. package/dist/types/src/packlets/storage/profile-archive.d.ts.map +0 -1
  39. package/src/packlets/identity/contacts-service.ts +0 -85
  40. package/src/packlets/storage/profile-archive.ts +0 -97
@@ -85,7 +85,6 @@ var subscribeToFeedBlocks = ({ feedStore }, { feedKey, maxBlocks = 10 }) => {
85
85
  import { Stream as Stream2 } from "@dxos/codec-protobuf";
86
86
  import { Context } from "@dxos/context";
87
87
  import { PublicKey as PublicKey2 } from "@dxos/keys";
88
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devtools/network.ts";
89
88
  var subscribeToNetworkStatus = ({ signalManager }) => new Stream2(({ next, close }) => {
90
89
  const update = () => {
91
90
  try {
@@ -101,10 +100,7 @@ var subscribeToNetworkStatus = ({ signalManager }) => new Stream2(({ next, close
101
100
  update();
102
101
  });
103
102
  var subscribeToSignal = ({ signalManager }) => new Stream2(({ next }) => {
104
- const ctx = new Context(void 0, {
105
- F: __dxlog_file,
106
- L: 36
107
- });
103
+ const ctx = new Context();
108
104
  signalManager.onMessage.on(ctx, (message) => {
109
105
  next({
110
106
  message: {
@@ -359,7 +355,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
359
355
  import { TRACE_PROCESSOR } from "@dxos/tracing";
360
356
 
361
357
  // packages/sdk/client-services/src/version.ts
362
- var DXOS_VERSION = "0.5.9-main.1cc8373";
358
+ var DXOS_VERSION = "0.5.9-main.1ea2105";
363
359
 
364
360
  // packages/sdk/client-services/src/packlets/services/platform.ts
365
361
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -392,7 +388,7 @@ var getPlatform = () => {
392
388
  };
393
389
 
394
390
  // packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts
395
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts";
391
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/diagnostics.ts";
396
392
  var DEFAULT_TIMEOUT = 1e3;
397
393
  var createDiagnostics = async (clientServices, serviceContext, config) => {
398
394
  const diagnostics = {
@@ -409,7 +405,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
409
405
  await Promise.all([
410
406
  (async () => {
411
407
  invariant(clientServices.LoggingService, "SystemService is not available.", {
412
- F: __dxlog_file2,
408
+ F: __dxlog_file,
413
409
  L: 110,
414
410
  S: void 0,
415
411
  A: [
@@ -514,7 +510,7 @@ var getStorageDiagnostics = async () => {
514
510
  // packages/sdk/client-services/src/packlets/diagnostics/browser-diagnostics-broadcast.ts
515
511
  import { Trigger } from "@dxos/async";
516
512
  import { log } from "@dxos/log";
517
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/browser-diagnostics-broadcast.ts";
513
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/diagnostics/browser-diagnostics-broadcast.ts";
518
514
  var CHANNEL_NAME = "dxos.diagnostics.broadcast";
519
515
  var MessageType;
520
516
  (function(MessageType2) {
@@ -583,7 +579,7 @@ var createCollectDiagnosticsBroadcastHandler = (systemService) => {
583
579
  }
584
580
  } catch (error) {
585
581
  log.catch(error, void 0, {
586
- F: __dxlog_file3,
582
+ F: __dxlog_file2,
587
583
  L: 77,
588
584
  S: void 0,
589
585
  C: (f, a) => f(...a)
@@ -691,7 +687,7 @@ import { Context as Context2 } from "@dxos/context";
691
687
  import { verifyCredential } from "@dxos/credentials";
692
688
  import { log as log2 } from "@dxos/log";
693
689
  import { schema } from "@dxos/protocols";
694
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
690
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
695
691
  var Credential = schema.getCodecForType("dxos.halo.credentials.Credential");
696
692
  var createAuthProvider = (signer) => async (nonce) => {
697
693
  const credential = await signer.createCredential({
@@ -706,10 +702,7 @@ var createAuthProvider = (signer) => async (nonce) => {
706
702
  var TrustedKeySetAuthVerifier = class {
707
703
  constructor(_params) {
708
704
  this._params = _params;
709
- this._ctx = new Context2(void 0, {
710
- F: __dxlog_file4,
711
- L: 45
712
- });
705
+ this._ctx = new Context2();
713
706
  }
714
707
  async close() {
715
708
  await this._ctx.dispose();
@@ -720,7 +713,7 @@ var TrustedKeySetAuthVerifier = class {
720
713
  log2("authenticating...", {
721
714
  credential
722
715
  }, {
723
- F: __dxlog_file4,
716
+ F: __dxlog_file3,
724
717
  L: 56,
725
718
  S: this,
726
719
  C: (f, a) => f(...a)
@@ -730,7 +723,7 @@ var TrustedKeySetAuthVerifier = class {
730
723
  log2("Invalid credential", {
731
724
  result
732
725
  }, {
733
- F: __dxlog_file4,
726
+ F: __dxlog_file3,
734
727
  L: 60,
735
728
  S: this,
736
729
  C: (f, a) => f(...a)
@@ -742,7 +735,7 @@ var TrustedKeySetAuthVerifier = class {
742
735
  nonce,
743
736
  credential
744
737
  }, {
745
- F: __dxlog_file4,
738
+ F: __dxlog_file3,
746
739
  L: 65,
747
740
  S: this,
748
741
  C: (f, a) => f(...a)
@@ -753,7 +746,7 @@ var TrustedKeySetAuthVerifier = class {
753
746
  log2("key is not currently in trusted set, waiting...", {
754
747
  key: credential.issuer
755
748
  }, {
756
- F: __dxlog_file4,
749
+ F: __dxlog_file3,
757
750
  L: 70,
758
751
  S: this,
759
752
  C: (f, a) => f(...a)
@@ -769,7 +762,7 @@ var TrustedKeySetAuthVerifier = class {
769
762
  log2("auth success", {
770
763
  key: credential.issuer
771
764
  }, {
772
- F: __dxlog_file4,
765
+ F: __dxlog_file3,
773
766
  L: 81,
774
767
  S: this,
775
768
  C: (f, a) => f(...a)
@@ -779,7 +772,7 @@ var TrustedKeySetAuthVerifier = class {
779
772
  log2("key is not currently in trusted set, waiting...", {
780
773
  key: credential.issuer
781
774
  }, {
782
- F: __dxlog_file4,
775
+ F: __dxlog_file3,
783
776
  L: 84,
784
777
  S: this,
785
778
  C: (f, a) => f(...a)
@@ -820,7 +813,7 @@ import { ComplexSet } from "@dxos/util";
820
813
  import { getCredentialAssertion } from "@dxos/credentials";
821
814
  import { SpaceId } from "@dxos/keys";
822
815
  import { log as log3 } from "@dxos/log";
823
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/default-space-state-machine.ts";
816
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/default-space-state-machine.ts";
824
817
  var DefaultSpaceStateMachine = class {
825
818
  constructor(_params) {
826
819
  this._params = _params;
@@ -837,7 +830,7 @@ var DefaultSpaceStateMachine = class {
837
830
  expectedIdentity: this._params.identityKey,
838
831
  credential
839
832
  }, {
840
- F: __dxlog_file5,
833
+ F: __dxlog_file4,
841
834
  L: 32,
842
835
  S: this,
843
836
  C: (f, a) => f(...a)
@@ -848,7 +841,7 @@ var DefaultSpaceStateMachine = class {
848
841
  log3.warn("Invalid default space id", {
849
842
  id: assertion.spaceId
850
843
  }, {
851
- F: __dxlog_file5,
844
+ F: __dxlog_file4,
852
845
  L: 36,
853
846
  S: this,
854
847
  C: (f, a) => f(...a)
@@ -873,7 +866,7 @@ function _ts_decorate2(decorators, target, key, desc) {
873
866
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
874
867
  return c > 3 && r && Object.defineProperty(target, key, r), r;
875
868
  }
876
- var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
869
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
877
870
  var Identity = class {
878
871
  constructor({ space, signer, identityKey, deviceKey, presence }) {
879
872
  this.stateUpdate = new Event();
@@ -885,7 +878,7 @@ var Identity = class {
885
878
  log4.trace("dxos.halo.device", {
886
879
  deviceKey
887
880
  }, {
888
- F: __dxlog_file6,
881
+ F: __dxlog_file5,
889
882
  L: 70,
890
883
  S: this,
891
884
  C: (f, a) => f(...a)
@@ -964,7 +957,7 @@ var Identity = class {
964
957
  */
965
958
  getIdentityCredentialSigner() {
966
959
  invariant2(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
967
- F: __dxlog_file6,
960
+ F: __dxlog_file5,
968
961
  L: 159,
969
962
  S: this,
970
963
  A: [
@@ -1008,7 +1001,7 @@ var Identity = class {
1008
1001
  controlFeedKey,
1009
1002
  dataFeedKey
1010
1003
  }, {
1011
- F: __dxlog_file6,
1004
+ F: __dxlog_file5,
1012
1005
  L: 184,
1013
1006
  S: this,
1014
1007
  C: (f, a) => f(...a)
@@ -1085,7 +1078,7 @@ function _ts_decorate3(decorators, target, key, desc) {
1085
1078
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1086
1079
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1087
1080
  }
1088
- var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
1081
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
1089
1082
  var DEVICE_PRESENCE_ANNOUNCE_INTERVAL = 1e4;
1090
1083
  var DEVICE_PRESENCE_OFFLINE_TIMEOUT = 2e4;
1091
1084
  var IdentityManager = class {
@@ -1109,7 +1102,7 @@ var IdentityManager = class {
1109
1102
  log5.trace("dxos.halo.identity-manager.open", trace3.begin({
1110
1103
  id: traceId
1111
1104
  }), {
1112
- F: __dxlog_file7,
1105
+ F: __dxlog_file6,
1113
1106
  L: 104,
1114
1107
  S: this,
1115
1108
  C: (f, a) => f(...a)
@@ -1118,7 +1111,7 @@ var IdentityManager = class {
1118
1111
  log5("identity record", {
1119
1112
  identityRecord
1120
1113
  }, {
1121
- F: __dxlog_file7,
1114
+ F: __dxlog_file6,
1122
1115
  L: 107,
1123
1116
  S: this,
1124
1117
  C: (f, a) => f(...a)
@@ -1131,7 +1124,7 @@ var IdentityManager = class {
1131
1124
  identityKey: identityRecord.identityKey,
1132
1125
  displayName: this._identity.profileDocument?.displayName
1133
1126
  }, {
1134
- F: __dxlog_file7,
1127
+ F: __dxlog_file6,
1135
1128
  L: 112,
1136
1129
  S: this,
1137
1130
  C: (f, a) => f(...a)
@@ -1141,21 +1134,18 @@ var IdentityManager = class {
1141
1134
  log5.trace("dxos.halo.identity-manager.open", trace3.end({
1142
1135
  id: traceId
1143
1136
  }), {
1144
- F: __dxlog_file7,
1137
+ F: __dxlog_file6,
1145
1138
  L: 119,
1146
1139
  S: this,
1147
1140
  C: (f, a) => f(...a)
1148
1141
  });
1149
1142
  }
1150
1143
  async close() {
1151
- await this._identity?.close(new Context3(void 0, {
1152
- F: __dxlog_file7,
1153
- L: 123
1154
- }));
1144
+ await this._identity?.close(new Context3());
1155
1145
  }
1156
1146
  async createIdentity({ displayName, deviceProfile } = {}) {
1157
1147
  invariant3(!this._identity, "Identity already exists.", {
1158
- F: __dxlog_file7,
1148
+ F: __dxlog_file6,
1159
1149
  L: 128,
1160
1150
  S: this,
1161
1151
  A: [
@@ -1164,7 +1154,7 @@ var IdentityManager = class {
1164
1154
  ]
1165
1155
  });
1166
1156
  log5("creating identity...", void 0, {
1167
- F: __dxlog_file7,
1157
+ F: __dxlog_file6,
1168
1158
  L: 129,
1169
1159
  S: this,
1170
1160
  C: (f, a) => f(...a)
@@ -1181,14 +1171,11 @@ var IdentityManager = class {
1181
1171
  }
1182
1172
  };
1183
1173
  const identity = await this._constructIdentity(identityRecord);
1184
- await identity.open(new Context3(void 0, {
1185
- F: __dxlog_file7,
1186
- L: 144
1187
- }));
1174
+ await identity.open(new Context3());
1188
1175
  {
1189
1176
  const generator = new CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
1190
1177
  invariant3(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
1191
- F: __dxlog_file7,
1178
+ F: __dxlog_file6,
1192
1179
  L: 148,
1193
1180
  S: this,
1194
1181
  A: [
@@ -1197,7 +1184,7 @@ var IdentityManager = class {
1197
1184
  ]
1198
1185
  });
1199
1186
  invariant3(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
1200
- F: __dxlog_file7,
1187
+ F: __dxlog_file6,
1201
1188
  L: 149,
1202
1189
  S: this,
1203
1190
  A: [
@@ -1236,7 +1223,7 @@ var IdentityManager = class {
1236
1223
  identityKey: identityRecord.identityKey,
1237
1224
  displayName: this._identity.profileDocument?.displayName
1238
1225
  }, {
1239
- F: __dxlog_file7,
1226
+ F: __dxlog_file6,
1240
1227
  L: 191,
1241
1228
  S: this,
1242
1229
  C: (f, a) => f(...a)
@@ -1247,7 +1234,7 @@ var IdentityManager = class {
1247
1234
  deviceKey: identity.deviceKey,
1248
1235
  profile: identity.profileDocument
1249
1236
  }, {
1250
- F: __dxlog_file7,
1237
+ F: __dxlog_file6,
1251
1238
  L: 197,
1252
1239
  S: this,
1253
1240
  C: (f, a) => f(...a)
@@ -1284,13 +1271,13 @@ var IdentityManager = class {
1284
1271
  log5("accepting identity", {
1285
1272
  params
1286
1273
  }, {
1287
- F: __dxlog_file7,
1274
+ F: __dxlog_file6,
1288
1275
  L: 235,
1289
1276
  S: this,
1290
1277
  C: (f, a) => f(...a)
1291
1278
  });
1292
1279
  invariant3(!this._identity, "Identity already exists.", {
1293
- F: __dxlog_file7,
1280
+ F: __dxlog_file6,
1294
1281
  L: 236,
1295
1282
  S: this,
1296
1283
  A: [
@@ -1310,10 +1297,7 @@ var IdentityManager = class {
1310
1297
  }
1311
1298
  };
1312
1299
  const identity = await this._constructIdentity(identityRecord);
1313
- await identity.open(new Context3(void 0, {
1314
- F: __dxlog_file7,
1315
- L: 251
1316
- }));
1300
+ await identity.open(new Context3());
1317
1301
  this._identity = identity;
1318
1302
  await this._metadataStore.setIdentityRecord(identityRecord);
1319
1303
  await this._identity.ready();
@@ -1321,7 +1305,7 @@ var IdentityManager = class {
1321
1305
  identityKey: identityRecord.identityKey,
1322
1306
  displayName: this._identity.profileDocument?.displayName
1323
1307
  }, {
1324
- F: __dxlog_file7,
1308
+ F: __dxlog_file6,
1325
1309
  L: 255,
1326
1310
  S: this,
1327
1311
  C: (f, a) => f(...a)
@@ -1335,7 +1319,7 @@ var IdentityManager = class {
1335
1319
  identityKey: identity.identityKey,
1336
1320
  deviceKey: identity.deviceKey
1337
1321
  }, {
1338
- F: __dxlog_file7,
1322
+ F: __dxlog_file6,
1339
1323
  L: 265,
1340
1324
  S: this,
1341
1325
  C: (f, a) => f(...a)
@@ -1347,7 +1331,7 @@ var IdentityManager = class {
1347
1331
  */
1348
1332
  async updateProfile(profile) {
1349
1333
  invariant3(this._identity, "Identity not initialized.", {
1350
- F: __dxlog_file7,
1334
+ F: __dxlog_file6,
1351
1335
  L: 273,
1352
1336
  S: this,
1353
1337
  A: [
@@ -1378,7 +1362,7 @@ var IdentityManager = class {
1378
1362
  }
1379
1363
  async updateDeviceProfile(profile) {
1380
1364
  invariant3(this._identity, "Identity not initialized.", {
1381
- F: __dxlog_file7,
1365
+ F: __dxlog_file6,
1382
1366
  L: 290,
1383
1367
  S: this,
1384
1368
  A: [
@@ -1414,7 +1398,7 @@ var IdentityManager = class {
1414
1398
  }
1415
1399
  async _constructIdentity(identityRecord) {
1416
1400
  invariant3(!this._identity, void 0, {
1417
- F: __dxlog_file7,
1401
+ F: __dxlog_file6,
1418
1402
  L: 316,
1419
1403
  S: this,
1420
1404
  A: [
@@ -1425,7 +1409,7 @@ var IdentityManager = class {
1425
1409
  log5("constructing identity", {
1426
1410
  identityRecord
1427
1411
  }, {
1428
- F: __dxlog_file7,
1412
+ F: __dxlog_file6,
1429
1413
  L: 317,
1430
1414
  S: this,
1431
1415
  C: (f, a) => f(...a)
@@ -1440,7 +1424,7 @@ var IdentityManager = class {
1440
1424
  gossip
1441
1425
  });
1442
1426
  invariant3(identityRecord.haloSpace.controlFeedKey, void 0, {
1443
- F: __dxlog_file7,
1427
+ F: __dxlog_file6,
1444
1428
  L: 330,
1445
1429
  S: this,
1446
1430
  A: [
@@ -1452,7 +1436,7 @@ var IdentityManager = class {
1452
1436
  writable: true
1453
1437
  });
1454
1438
  invariant3(identityRecord.haloSpace.dataFeedKey, void 0, {
1455
- F: __dxlog_file7,
1439
+ F: __dxlog_file6,
1456
1440
  L: 334,
1457
1441
  S: this,
1458
1442
  A: [
@@ -1486,7 +1470,7 @@ var IdentityManager = class {
1486
1470
  log5("done", {
1487
1471
  identityKey: identityRecord.identityKey
1488
1472
  }, {
1489
- F: __dxlog_file7,
1473
+ F: __dxlog_file6,
1490
1474
  L: 360,
1491
1475
  S: this,
1492
1476
  C: (f, a) => f(...a)
@@ -1511,7 +1495,7 @@ var IdentityManager = class {
1511
1495
  },
1512
1496
  onAuthFailure: () => {
1513
1497
  log5.warn("auth failure", void 0, {
1514
- F: __dxlog_file7,
1498
+ F: __dxlog_file6,
1515
1499
  L: 385,
1516
1500
  S: this,
1517
1501
  C: (f, a) => f(...a)
@@ -1544,7 +1528,7 @@ import { invariant as invariant4 } from "@dxos/invariant";
1544
1528
  import { log as log6 } from "@dxos/log";
1545
1529
  import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
1546
1530
  import { safeAwaitAll } from "@dxos/util";
1547
- var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1531
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1548
1532
  var DEFAULT_SPACE_SEARCH_TIMEOUT = 1e4;
1549
1533
  var IdentityServiceImpl = class extends Resource {
1550
1534
  constructor(_identityManager, _keyring, _dataSpaceManagerProvider, _createIdentity, _onProfileUpdate) {
@@ -1574,7 +1558,7 @@ var IdentityServiceImpl = class extends Resource {
1574
1558
  const space = await dataSpaceManager.createDefaultSpace();
1575
1559
  const identity = this._identityManager.identity;
1576
1560
  invariant4(identity, void 0, {
1577
- F: __dxlog_file8,
1561
+ F: __dxlog_file7,
1578
1562
  L: 59,
1579
1563
  S: this,
1580
1564
  A: [
@@ -1608,7 +1592,7 @@ var IdentityServiceImpl = class extends Resource {
1608
1592
  }
1609
1593
  async updateProfile(profile) {
1610
1594
  invariant4(this._identityManager.identity, "Identity not initialized.", {
1611
- F: __dxlog_file8,
1595
+ F: __dxlog_file7,
1612
1596
  L: 89,
1613
1597
  S: this,
1614
1598
  A: [
@@ -1622,7 +1606,7 @@ var IdentityServiceImpl = class extends Resource {
1622
1606
  }
1623
1607
  async signPresentation({ presentation, nonce }) {
1624
1608
  invariant4(this._identityManager.identity, "Identity not initialized.", {
1625
- F: __dxlog_file8,
1609
+ F: __dxlog_file7,
1626
1610
  L: 96,
1627
1611
  S: this,
1628
1612
  A: [
@@ -1657,7 +1641,7 @@ var IdentityServiceImpl = class extends Resource {
1657
1641
  log6.warn("Multiple default spaces found. Using the first one.", {
1658
1642
  duplicate: space.id
1659
1643
  }, {
1660
- F: __dxlog_file8,
1644
+ F: __dxlog_file7,
1661
1645
  L: 127,
1662
1646
  S: this,
1663
1647
  C: (f, a) => f(...a)
@@ -1685,7 +1669,7 @@ var IdentityServiceImpl = class extends Resource {
1685
1669
  import { invariant as invariant5 } from "@dxos/invariant";
1686
1670
  import { AlreadyJoinedError } from "@dxos/protocols";
1687
1671
  import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
1688
- var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1672
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1689
1673
  var DeviceInvitationProtocol = class {
1690
1674
  constructor(_keyring, _getIdentity, _acceptIdentity) {
1691
1675
  this._keyring = _keyring;
@@ -1711,7 +1695,7 @@ var DeviceInvitationProtocol = class {
1711
1695
  }
1712
1696
  async admit(_, request) {
1713
1697
  invariant5(request.device, void 0, {
1714
- F: __dxlog_file9,
1698
+ F: __dxlog_file8,
1715
1699
  L: 50,
1716
1700
  S: this,
1717
1701
  A: [
@@ -1757,7 +1741,7 @@ var DeviceInvitationProtocol = class {
1757
1741
  }
1758
1742
  async accept(response, request) {
1759
1743
  invariant5(response.device, void 0, {
1760
- F: __dxlog_file9,
1744
+ F: __dxlog_file8,
1761
1745
  L: 95,
1762
1746
  S: this,
1763
1747
  A: [
@@ -1767,7 +1751,7 @@ var DeviceInvitationProtocol = class {
1767
1751
  });
1768
1752
  const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
1769
1753
  invariant5(request.device, void 0, {
1770
- F: __dxlog_file9,
1754
+ F: __dxlog_file8,
1771
1755
  L: 98,
1772
1756
  S: this,
1773
1757
  A: [
@@ -1836,7 +1820,7 @@ var tryAcquireBeforeContextDisposed = async (ctx, mutex) => {
1836
1820
  };
1837
1821
 
1838
1822
  // packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts
1839
- var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts";
1823
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts";
1840
1824
  var OPTIONS_TIMEOUT = 1e4;
1841
1825
  var InvitationGuestExtension = class extends RpcExtension {
1842
1826
  constructor(_invitationFlowMutex, _callbacks) {
@@ -1850,10 +1834,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1850
1834
  });
1851
1835
  this._invitationFlowMutex = _invitationFlowMutex;
1852
1836
  this._callbacks = _callbacks;
1853
- this._ctx = new Context4(void 0, {
1854
- F: __dxlog_file10,
1855
- L: 33
1856
- });
1837
+ this._ctx = new Context4();
1857
1838
  this._remoteOptionsTrigger = new Trigger4();
1858
1839
  this._invitationFlowLock = null;
1859
1840
  }
@@ -1865,7 +1846,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1865
1846
  InvitationHostService: {
1866
1847
  options: async (options) => {
1867
1848
  invariant6(!this._remoteOptions, "Remote options already set.", {
1868
- F: __dxlog_file10,
1849
+ F: __dxlog_file9,
1869
1850
  L: 63,
1870
1851
  S: this,
1871
1852
  A: [
@@ -1892,14 +1873,14 @@ var InvitationGuestExtension = class extends RpcExtension {
1892
1873
  await super.onOpen(context);
1893
1874
  try {
1894
1875
  log7("guest acquire lock", void 0, {
1895
- F: __dxlog_file10,
1876
+ F: __dxlog_file9,
1896
1877
  L: 84,
1897
1878
  S: this,
1898
1879
  C: (f, a) => f(...a)
1899
1880
  });
1900
1881
  this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
1901
1882
  log7("guest lock acquired", void 0, {
1902
- F: __dxlog_file10,
1883
+ F: __dxlog_file9,
1903
1884
  L: 86,
1904
1885
  S: this,
1905
1886
  C: (f, a) => f(...a)
@@ -1908,7 +1889,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1908
1889
  role: Options.Role.GUEST
1909
1890
  }));
1910
1891
  log7("options sent", void 0, {
1911
- F: __dxlog_file10,
1892
+ F: __dxlog_file9,
1912
1893
  L: 88,
1913
1894
  S: this,
1914
1895
  C: (f, a) => f(...a)
@@ -1917,7 +1898,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1917
1898
  timeout: OPTIONS_TIMEOUT
1918
1899
  }));
1919
1900
  log7("options received", void 0, {
1920
- F: __dxlog_file10,
1901
+ F: __dxlog_file9,
1921
1902
  L: 90,
1922
1903
  S: this,
1923
1904
  C: (f, a) => f(...a)
@@ -1951,7 +1932,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1951
1932
  this._invitationFlowLock.release();
1952
1933
  this._invitationFlowLock = null;
1953
1934
  log7("invitation flow lock released", void 0, {
1954
- F: __dxlog_file10,
1935
+ F: __dxlog_file9,
1955
1936
  L: 123,
1956
1937
  S: this,
1957
1938
  C: (f, a) => f(...a)
@@ -1971,7 +1952,7 @@ import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleEr
1971
1952
  import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
1972
1953
  import { AuthenticationResponse, Options as Options2 } from "@dxos/protocols/proto/dxos/halo/invitations";
1973
1954
  import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
1974
- var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts";
1955
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts";
1975
1956
  var OPTIONS_TIMEOUT2 = 1e4;
1976
1957
  var MAX_OTP_ATTEMPTS = 3;
1977
1958
  var InvitationHostExtension = class extends RpcExtension2 {
@@ -1986,10 +1967,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
1986
1967
  });
1987
1968
  this._invitationFlowMutex = _invitationFlowMutex;
1988
1969
  this._callbacks = _callbacks;
1989
- this._ctx = new Context5(void 0, {
1990
- F: __dxlog_file11,
1991
- L: 52
1992
- });
1970
+ this._ctx = new Context5();
1993
1971
  this._remoteOptionsTrigger = new Trigger5();
1994
1972
  this._challenge = void 0;
1995
1973
  this.guestProfile = void 0;
@@ -2008,7 +1986,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2008
1986
  InvitationHostService: {
2009
1987
  options: async (options) => {
2010
1988
  invariant7(!this._remoteOptions, "Remote options already set.", {
2011
- F: __dxlog_file11,
1989
+ F: __dxlog_file10,
2012
1990
  L: 101,
2013
1991
  S: this,
2014
1992
  A: [
@@ -2025,7 +2003,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2025
2003
  log8.trace("dxos.sdk.invitation-handler.host.introduce", trace4.begin({
2026
2004
  id: traceId
2027
2005
  }), {
2028
- F: __dxlog_file11,
2006
+ F: __dxlog_file10,
2029
2007
  L: 110,
2030
2008
  S: this,
2031
2009
  C: (f, a) => f(...a)
@@ -2037,7 +2015,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2037
2015
  expected: invitation.invitationId,
2038
2016
  actual: invitationId
2039
2017
  }, {
2040
- F: __dxlog_file11,
2018
+ F: __dxlog_file10,
2041
2019
  L: 116,
2042
2020
  S: this,
2043
2021
  C: (f, a) => f(...a)
@@ -2051,7 +2029,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2051
2029
  log8("guest introduced themselves", {
2052
2030
  guestProfile: profile
2053
2031
  }, {
2054
- F: __dxlog_file11,
2032
+ F: __dxlog_file10,
2055
2033
  L: 125,
2056
2034
  S: this,
2057
2035
  C: (f, a) => f(...a)
@@ -2062,7 +2040,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2062
2040
  log8.trace("dxos.sdk.invitation-handler.host.introduce", trace4.end({
2063
2041
  id: traceId
2064
2042
  }), {
2065
- F: __dxlog_file11,
2043
+ F: __dxlog_file10,
2066
2044
  L: 132,
2067
2045
  S: this,
2068
2046
  C: (f, a) => f(...a)
@@ -2077,7 +2055,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2077
2055
  log8.trace("dxos.sdk.invitation-handler.host.authenticate", trace4.begin({
2078
2056
  id: traceId
2079
2057
  }), {
2080
- F: __dxlog_file11,
2058
+ F: __dxlog_file10,
2081
2059
  L: 141,
2082
2060
  S: this,
2083
2061
  C: (f, a) => f(...a)
@@ -2086,7 +2064,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2086
2064
  log8("received authentication request", {
2087
2065
  authCode: code
2088
2066
  }, {
2089
- F: __dxlog_file11,
2067
+ F: __dxlog_file10,
2090
2068
  L: 144,
2091
2069
  S: this,
2092
2070
  C: (f, a) => f(...a)
@@ -2100,7 +2078,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2100
2078
  switch (invitation.authMethod) {
2101
2079
  case Invitation3.AuthMethod.NONE: {
2102
2080
  log8("authentication not required", void 0, {
2103
- F: __dxlog_file11,
2081
+ F: __dxlog_file10,
2104
2082
  L: 152,
2105
2083
  S: this,
2106
2084
  C: (f, a) => f(...a)
@@ -2138,7 +2116,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2138
2116
  log8.error("invalid authentication method", {
2139
2117
  authMethod: invitation.authMethod
2140
2118
  }, {
2141
- F: __dxlog_file11,
2119
+ F: __dxlog_file10,
2142
2120
  L: 190,
2143
2121
  S: this,
2144
2122
  C: (f, a) => f(...a)
@@ -2163,7 +2141,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2163
2141
  status
2164
2142
  }
2165
2143
  }), {
2166
- F: __dxlog_file11,
2144
+ F: __dxlog_file10,
2167
2145
  L: 202,
2168
2146
  S: this,
2169
2147
  C: (f, a) => f(...a)
@@ -2177,7 +2155,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2177
2155
  log8.trace("dxos.sdk.invitation-handler.host.admit", trace4.begin({
2178
2156
  id: traceId
2179
2157
  }), {
2180
- F: __dxlog_file11,
2158
+ F: __dxlog_file10,
2181
2159
  L: 208,
2182
2160
  S: this,
2183
2161
  C: (f, a) => f(...a)
@@ -2194,7 +2172,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2194
2172
  log8.trace("dxos.sdk.invitation-handler.host.admit", trace4.end({
2195
2173
  id: traceId
2196
2174
  }), {
2197
- F: __dxlog_file11,
2175
+ F: __dxlog_file10,
2198
2176
  L: 222,
2199
2177
  S: this,
2200
2178
  C: (f, a) => f(...a)
@@ -2212,14 +2190,14 @@ var InvitationHostExtension = class extends RpcExtension2 {
2212
2190
  await super.onOpen(context);
2213
2191
  try {
2214
2192
  log8("host acquire lock", void 0, {
2215
- F: __dxlog_file11,
2193
+ F: __dxlog_file10,
2216
2194
  L: 237,
2217
2195
  S: this,
2218
2196
  C: (f, a) => f(...a)
2219
2197
  });
2220
2198
  this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
2221
2199
  log8("host lock acquired", void 0, {
2222
- F: __dxlog_file11,
2200
+ F: __dxlog_file10,
2223
2201
  L: 239,
2224
2202
  S: this,
2225
2203
  C: (f, a) => f(...a)
@@ -2230,7 +2208,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2230
2208
  role: Options2.Role.HOST
2231
2209
  });
2232
2210
  log8("options sent", void 0, {
2233
- F: __dxlog_file11,
2211
+ F: __dxlog_file10,
2234
2212
  L: 243,
2235
2213
  S: this,
2236
2214
  C: (f, a) => f(...a)
@@ -2239,7 +2217,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2239
2217
  timeout: OPTIONS_TIMEOUT2
2240
2218
  }));
2241
2219
  log8("options received", void 0, {
2242
- F: __dxlog_file11,
2220
+ F: __dxlog_file10,
2243
2221
  L: 245,
2244
2222
  S: this,
2245
2223
  C: (f, a) => f(...a)
@@ -2293,7 +2271,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
2293
2271
  this._invitationFlowLock?.release();
2294
2272
  this._invitationFlowLock = null;
2295
2273
  log8("invitation flow lock released", void 0, {
2296
- F: __dxlog_file11,
2274
+ F: __dxlog_file10,
2297
2275
  L: 300,
2298
2276
  S: this,
2299
2277
  C: (f, a) => f(...a)
@@ -2309,7 +2287,7 @@ import { PublicKey as PublicKey6 } from "@dxos/keys";
2309
2287
  import { log as log9 } from "@dxos/log";
2310
2288
  import { Options as Options3 } from "@dxos/protocols/proto/dxos/halo/invitations";
2311
2289
  import { ComplexSet as ComplexSet2 } from "@dxos/util";
2312
- var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
2290
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
2313
2291
  var InvitationTopology = class {
2314
2292
  constructor(_role) {
2315
2293
  this._role = _role;
@@ -2317,7 +2295,7 @@ var InvitationTopology = class {
2317
2295
  }
2318
2296
  init(controller) {
2319
2297
  invariant8(!this._controller, "Already initialized.", {
2320
- F: __dxlog_file12,
2298
+ F: __dxlog_file11,
2321
2299
  L: 42,
2322
2300
  S: this,
2323
2301
  A: [
@@ -2329,7 +2307,7 @@ var InvitationTopology = class {
2329
2307
  }
2330
2308
  update() {
2331
2309
  invariant8(this._controller, "Not initialized.", {
2332
- F: __dxlog_file12,
2310
+ F: __dxlog_file11,
2333
2311
  L: 47,
2334
2312
  S: this,
2335
2313
  A: [
@@ -2352,7 +2330,7 @@ var InvitationTopology = class {
2352
2330
  ownPeerId,
2353
2331
  remotePeerId: firstUnknownPeer
2354
2332
  }, {
2355
- F: __dxlog_file12,
2333
+ F: __dxlog_file11,
2356
2334
  L: 69,
2357
2335
  S: this,
2358
2336
  C: (f, a) => f(...a)
@@ -2363,7 +2341,7 @@ var InvitationTopology = class {
2363
2341
  }
2364
2342
  async onOffer(peer) {
2365
2343
  invariant8(this._controller, "Not initialized.", {
2366
- F: __dxlog_file12,
2344
+ F: __dxlog_file11,
2367
2345
  L: 76,
2368
2346
  S: this,
2369
2347
  A: [
@@ -2382,7 +2360,7 @@ var InvitationTopology = class {
2382
2360
  };
2383
2361
 
2384
2362
  // packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
2385
- var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2363
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2386
2364
  var MAX_DELEGATED_INVITATION_HOST_TRIES = 3;
2387
2365
  var InvitationsHandler = class {
2388
2366
  /**
@@ -2407,7 +2385,7 @@ var InvitationsHandler = class {
2407
2385
  try {
2408
2386
  const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
2409
2387
  invariant9(deviceKey, void 0, {
2410
- F: __dxlog_file13,
2388
+ F: __dxlog_file12,
2411
2389
  L: 90,
2412
2390
  S: this,
2413
2391
  A: [
@@ -2436,7 +2414,7 @@ var InvitationsHandler = class {
2436
2414
  log10.trace("dxos.sdk.invitations-handler.host.onOpen", trace5.begin({
2437
2415
  id: traceId
2438
2416
  }), {
2439
- F: __dxlog_file13,
2417
+ F: __dxlog_file12,
2440
2418
  L: 115,
2441
2419
  S: this,
2442
2420
  C: (f, a) => f(...a)
@@ -2444,7 +2422,7 @@ var InvitationsHandler = class {
2444
2422
  log10("connected", {
2445
2423
  ...protocol.toJSON()
2446
2424
  }, {
2447
- F: __dxlog_file13,
2425
+ F: __dxlog_file12,
2448
2426
  L: 116,
2449
2427
  S: this,
2450
2428
  C: (f, a) => f(...a)
@@ -2456,7 +2434,7 @@ var InvitationsHandler = class {
2456
2434
  guest: deviceKey,
2457
2435
  ...protocol.toJSON()
2458
2436
  }, {
2459
- F: __dxlog_file13,
2437
+ F: __dxlog_file12,
2460
2438
  L: 118,
2461
2439
  S: this,
2462
2440
  C: (f, a) => f(...a)
@@ -2465,7 +2443,7 @@ var InvitationsHandler = class {
2465
2443
  log10.trace("dxos.sdk.invitations-handler.host.onOpen", trace5.end({
2466
2444
  id: traceId
2467
2445
  }), {
2468
- F: __dxlog_file13,
2446
+ F: __dxlog_file12,
2469
2447
  L: 120,
2470
2448
  S: this,
2471
2449
  C: (f, a) => f(...a)
@@ -2480,7 +2458,7 @@ var InvitationsHandler = class {
2480
2458
  log10("timeout", {
2481
2459
  ...protocol.toJSON()
2482
2460
  }, {
2483
- F: __dxlog_file13,
2461
+ F: __dxlog_file12,
2484
2462
  L: 129,
2485
2463
  S: this,
2486
2464
  C: (f, a) => f(...a)
@@ -2489,7 +2467,7 @@ var InvitationsHandler = class {
2489
2467
  } else {
2490
2468
  if (guardedState.error(extension, err)) {
2491
2469
  log10.error("failed", err, {
2492
- F: __dxlog_file13,
2470
+ F: __dxlog_file12,
2493
2471
  L: 133,
2494
2472
  S: this,
2495
2473
  C: (f, a) => f(...a)
@@ -2500,7 +2478,7 @@ var InvitationsHandler = class {
2500
2478
  id: traceId,
2501
2479
  error: err
2502
2480
  }), {
2503
- F: __dxlog_file13,
2481
+ F: __dxlog_file12,
2504
2482
  L: 136,
2505
2483
  S: this,
2506
2484
  C: (f, a) => f(...a)
@@ -2514,7 +2492,7 @@ var InvitationsHandler = class {
2514
2492
  log10("invalid role", {
2515
2493
  ...err.context
2516
2494
  }, {
2517
- F: __dxlog_file13,
2495
+ F: __dxlog_file12,
2518
2496
  L: 144,
2519
2497
  S: this,
2520
2498
  C: (f, a) => f(...a)
@@ -2526,7 +2504,7 @@ var InvitationsHandler = class {
2526
2504
  log10("timeout", {
2527
2505
  err
2528
2506
  }, {
2529
- F: __dxlog_file13,
2507
+ F: __dxlog_file12,
2530
2508
  L: 149,
2531
2509
  S: this,
2532
2510
  C: (f, a) => f(...a)
@@ -2535,7 +2513,7 @@ var InvitationsHandler = class {
2535
2513
  } else {
2536
2514
  if (guardedState.error(extension, err)) {
2537
2515
  log10.error("failed", err, {
2538
- F: __dxlog_file13,
2516
+ F: __dxlog_file12,
2539
2517
  L: 153,
2540
2518
  S: this,
2541
2519
  C: (f, a) => f(...a)
@@ -2549,7 +2527,7 @@ var InvitationsHandler = class {
2549
2527
  if (invitation.lifetime && invitation.created) {
2550
2528
  if (invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
2551
2529
  log10.warn("invitation has already expired", void 0, {
2552
- F: __dxlog_file13,
2530
+ F: __dxlog_file12,
2553
2531
  L: 164,
2554
2532
  S: this,
2555
2533
  C: (f, a) => f(...a)
@@ -2572,7 +2550,7 @@ var InvitationsHandler = class {
2572
2550
  const { timeout = INVITATION_TIMEOUT } = invitation;
2573
2551
  if (deviceProfile) {
2574
2552
  invariant9(invitation.kind === Invitation4.Kind.DEVICE, "deviceProfile provided for non-device invitation", {
2575
- F: __dxlog_file13,
2553
+ F: __dxlog_file12,
2576
2554
  L: 197,
2577
2555
  S: this,
2578
2556
  A: [
@@ -2590,7 +2568,7 @@ var InvitationsHandler = class {
2590
2568
  invitationType: Invitation4.Type.DELEGATED,
2591
2569
  triedPeers: triedPeersIds.size
2592
2570
  }, {
2593
- F: __dxlog_file13,
2571
+ F: __dxlog_file12,
2594
2572
  L: 205,
2595
2573
  S: this,
2596
2574
  C: (f, a) => f(...a)
@@ -2617,7 +2595,7 @@ var InvitationsHandler = class {
2617
2595
  admitted,
2618
2596
  currentState: guardedState.current.state
2619
2597
  }, {
2620
- F: __dxlog_file13,
2598
+ F: __dxlog_file12,
2621
2599
  L: 233,
2622
2600
  S: this,
2623
2601
  C: (f, a) => f(...a)
@@ -2635,7 +2613,7 @@ var InvitationsHandler = class {
2635
2613
  log10.trace("dxos.sdk.invitations-handler.guest.onOpen", trace5.begin({
2636
2614
  id: traceId
2637
2615
  }), {
2638
- F: __dxlog_file13,
2616
+ F: __dxlog_file12,
2639
2617
  L: 245,
2640
2618
  S: this,
2641
2619
  C: (f, a) => f(...a)
@@ -2647,7 +2625,7 @@ var InvitationsHandler = class {
2647
2625
  log10("connected", {
2648
2626
  ...protocol.toJSON()
2649
2627
  }, {
2650
- F: __dxlog_file13,
2628
+ F: __dxlog_file12,
2651
2629
  L: 256,
2652
2630
  S: this,
2653
2631
  C: (f, a) => f(...a)
@@ -2656,7 +2634,7 @@ var InvitationsHandler = class {
2656
2634
  log10("introduce", {
2657
2635
  ...protocol.toJSON()
2658
2636
  }, {
2659
- F: __dxlog_file13,
2637
+ F: __dxlog_file12,
2660
2638
  L: 260,
2661
2639
  S: this,
2662
2640
  C: (f, a) => f(...a)
@@ -2669,7 +2647,7 @@ var InvitationsHandler = class {
2669
2647
  ...protocol.toJSON(),
2670
2648
  response: introductionResponse
2671
2649
  }, {
2672
- F: __dxlog_file13,
2650
+ F: __dxlog_file12,
2673
2651
  L: 265,
2674
2652
  S: this,
2675
2653
  C: (f, a) => f(...a)
@@ -2690,7 +2668,7 @@ var InvitationsHandler = class {
2690
2668
  log10("request admission", {
2691
2669
  ...protocol.toJSON()
2692
2670
  }, {
2693
- F: __dxlog_file13,
2671
+ F: __dxlog_file12,
2694
2672
  L: 291,
2695
2673
  S: this,
2696
2674
  C: (f, a) => f(...a)
@@ -2702,7 +2680,7 @@ var InvitationsHandler = class {
2702
2680
  log10("admitted by host", {
2703
2681
  ...protocol.toJSON()
2704
2682
  }, {
2705
- F: __dxlog_file13,
2683
+ F: __dxlog_file12,
2706
2684
  L: 302,
2707
2685
  S: this,
2708
2686
  C: (f, a) => f(...a)
@@ -2715,7 +2693,7 @@ var InvitationsHandler = class {
2715
2693
  log10.trace("dxos.sdk.invitations-handler.guest.onOpen", trace5.end({
2716
2694
  id: traceId
2717
2695
  }), {
2718
- F: __dxlog_file13,
2696
+ F: __dxlog_file12,
2719
2697
  L: 308,
2720
2698
  S: this,
2721
2699
  C: (f, a) => f(...a)
@@ -2725,7 +2703,7 @@ var InvitationsHandler = class {
2725
2703
  log10("timeout", {
2726
2704
  ...protocol.toJSON()
2727
2705
  }, {
2728
- F: __dxlog_file13,
2706
+ F: __dxlog_file12,
2729
2707
  L: 311,
2730
2708
  S: this,
2731
2709
  C: (f, a) => f(...a)
@@ -2733,7 +2711,7 @@ var InvitationsHandler = class {
2733
2711
  guardedState.set(extension, Invitation4.State.TIMEOUT);
2734
2712
  } else {
2735
2713
  log10("auth failed", err, {
2736
- F: __dxlog_file13,
2714
+ F: __dxlog_file12,
2737
2715
  L: 314,
2738
2716
  S: this,
2739
2717
  C: (f, a) => f(...a)
@@ -2745,7 +2723,7 @@ var InvitationsHandler = class {
2745
2723
  id: traceId,
2746
2724
  error: err
2747
2725
  }), {
2748
- F: __dxlog_file13,
2726
+ F: __dxlog_file12,
2749
2727
  L: 318,
2750
2728
  S: this,
2751
2729
  C: (f, a) => f(...a)
@@ -2761,7 +2739,7 @@ var InvitationsHandler = class {
2761
2739
  log10("timeout", {
2762
2740
  ...protocol.toJSON()
2763
2741
  }, {
2764
- F: __dxlog_file13,
2742
+ F: __dxlog_file12,
2765
2743
  L: 327,
2766
2744
  S: this,
2767
2745
  C: (f, a) => f(...a)
@@ -2769,7 +2747,7 @@ var InvitationsHandler = class {
2769
2747
  guardedState.set(extension, Invitation4.State.TIMEOUT);
2770
2748
  } else {
2771
2749
  log10("auth failed", err, {
2772
- F: __dxlog_file13,
2750
+ F: __dxlog_file12,
2773
2751
  L: 330,
2774
2752
  S: this,
2775
2753
  C: (f, a) => f(...a)
@@ -2787,7 +2765,7 @@ var InvitationsHandler = class {
2787
2765
  await ctx.dispose();
2788
2766
  } else {
2789
2767
  invariant9(invitation.swarmKey, void 0, {
2790
- F: __dxlog_file13,
2768
+ F: __dxlog_file12,
2791
2769
  L: 345,
2792
2770
  S: this,
2793
2771
  A: [
@@ -2881,29 +2859,16 @@ var InvitationsHandler = class {
2881
2859
  };
2882
2860
  }
2883
2861
  _logStateUpdate(invitation, actor, newState) {
2884
- if (this._isNotTerminal(newState)) {
2885
- log10("invitation state update", {
2886
- actor: actor?.constructor.name,
2887
- newState: stateToString(newState),
2888
- oldState: stateToString(invitation.state)
2889
- }, {
2890
- F: __dxlog_file13,
2891
- L: 439,
2892
- S: this,
2893
- C: (f, a) => f(...a)
2894
- });
2895
- } else {
2896
- log10.info("invitation state update", {
2897
- actor: actor?.constructor.name,
2898
- newState: stateToString(newState),
2899
- oldState: stateToString(invitation.state)
2900
- }, {
2901
- F: __dxlog_file13,
2902
- L: 445,
2903
- S: this,
2904
- C: (f, a) => f(...a)
2905
- });
2906
- }
2862
+ log10("invitation state update", {
2863
+ actor: actor?.constructor.name,
2864
+ newState: stateToString(newState),
2865
+ oldState: stateToString(invitation.state)
2866
+ }, {
2867
+ F: __dxlog_file12,
2868
+ L: 438,
2869
+ S: this,
2870
+ C: (f, a) => f(...a)
2871
+ });
2907
2872
  }
2908
2873
  _isNotTerminal(currentState) {
2909
2874
  return ![
@@ -2917,16 +2882,16 @@ var InvitationsHandler = class {
2917
2882
  async _handleGuestOtpAuth(extension, setState, authenticated, options) {
2918
2883
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
2919
2884
  log10("guest waiting for authentication code...", void 0, {
2920
- F: __dxlog_file13,
2921
- L: 470,
2885
+ F: __dxlog_file12,
2886
+ L: 462,
2922
2887
  S: this,
2923
2888
  C: (f, a) => f(...a)
2924
2889
  });
2925
2890
  setState(Invitation4.State.READY_FOR_AUTHENTICATION);
2926
2891
  const authCode = await authenticated.wait(options);
2927
2892
  log10("sending authentication request", void 0, {
2928
- F: __dxlog_file13,
2929
- L: 474,
2893
+ F: __dxlog_file12,
2894
+ L: 466,
2930
2895
  S: this,
2931
2896
  C: (f, a) => f(...a)
2932
2897
  });
@@ -2944,8 +2909,8 @@ var InvitationsHandler = class {
2944
2909
  log10("retrying invalid code", {
2945
2910
  attempt
2946
2911
  }, {
2947
- F: __dxlog_file13,
2948
- L: 485,
2912
+ F: __dxlog_file12,
2913
+ L: 477,
2949
2914
  S: this,
2950
2915
  C: (f, a) => f(...a)
2951
2916
  });
@@ -2962,8 +2927,8 @@ var InvitationsHandler = class {
2962
2927
  throw new Error("challenge missing in the introduction");
2963
2928
  }
2964
2929
  log10("sending authentication request", void 0, {
2965
- F: __dxlog_file13,
2966
- L: 504,
2930
+ F: __dxlog_file12,
2931
+ L: 496,
2967
2932
  S: this,
2968
2933
  C: (f, a) => f(...a)
2969
2934
  });
@@ -3083,14 +3048,14 @@ var InvitationsServiceImpl = class {
3083
3048
  };
3084
3049
 
3085
3050
  // packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts
3086
- import { createCancelDelegatedSpaceInvitationCredential, createDelegatedSpaceInvitationCredential, getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
3051
+ import { createAdmissionCredentials, createCancelDelegatedSpaceInvitationCredential, createDelegatedSpaceInvitationCredential, getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
3087
3052
  import { writeMessages as writeMessages2 } from "@dxos/feed-store";
3088
3053
  import { invariant as invariant10 } from "@dxos/invariant";
3089
3054
  import { log as log11 } from "@dxos/log";
3090
3055
  import { AlreadyJoinedError as AlreadyJoinedError2, AuthorizationError, InvalidInvitationError, SpaceNotFoundError } from "@dxos/protocols";
3091
3056
  import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
3092
3057
  import { SpaceMember as SpaceMember2 } from "@dxos/protocols/proto/dxos/halo/credentials";
3093
- var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3058
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3094
3059
  var SpaceInvitationProtocol = class {
3095
3060
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
3096
3061
  this._spaceManager = _spaceManager;
@@ -3124,43 +3089,79 @@ var SpaceInvitationProtocol = class {
3124
3089
  };
3125
3090
  }
3126
3091
  async admit(invitation, request, guestProfile) {
3127
- invariant10(this._spaceKey && request.space, void 0, {
3128
- F: __dxlog_file14,
3129
- L: 74,
3092
+ invariant10(this._spaceKey, void 0, {
3093
+ F: __dxlog_file13,
3094
+ L: 76,
3095
+ S: this,
3096
+ A: [
3097
+ "this._spaceKey",
3098
+ ""
3099
+ ]
3100
+ });
3101
+ const space = this._spaceManager.spaces.get(this._spaceKey);
3102
+ invariant10(space, void 0, {
3103
+ F: __dxlog_file13,
3104
+ L: 78,
3105
+ S: this,
3106
+ A: [
3107
+ "space",
3108
+ ""
3109
+ ]
3110
+ });
3111
+ invariant10(request.space, void 0, {
3112
+ F: __dxlog_file13,
3113
+ L: 80,
3130
3114
  S: this,
3131
3115
  A: [
3132
- "this._spaceKey && request.space",
3116
+ "request.space",
3133
3117
  ""
3134
3118
  ]
3135
3119
  });
3120
+ const { identityKey, deviceKey } = request.space;
3121
+ if (space.inner.spaceState.getMemberRole(identityKey) !== SpaceMember2.Role.REMOVED) {
3122
+ throw new AlreadyJoinedError2();
3123
+ }
3136
3124
  log11("writing guest credentials", {
3137
3125
  host: this._signingContext.deviceKey,
3138
- guest: request.space.deviceKey
3126
+ guest: deviceKey
3139
3127
  }, {
3140
- F: __dxlog_file14,
3141
- L: 75,
3128
+ F: __dxlog_file13,
3129
+ L: 87,
3142
3130
  S: this,
3143
3131
  C: (f, a) => f(...a)
3144
3132
  });
3145
- const spaceMemberCredential = await this._spaceManager.admitMember({
3146
- spaceKey: this._spaceKey,
3147
- identityKey: request.space.identityKey,
3148
- role: invitation.role ?? SpaceMember2.Role.ADMIN,
3149
- profile: guestProfile,
3150
- delegationCredentialId: invitation.delegationCredentialId
3133
+ const credentials = await createAdmissionCredentials(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, invitation.role ?? SpaceMember2.Role.ADMIN, space.inner.spaceState.membershipChainHeads, guestProfile, invitation.delegationCredentialId);
3134
+ invariant10(credentials[0].credential, void 0, {
3135
+ F: __dxlog_file13,
3136
+ L: 101,
3137
+ S: this,
3138
+ A: [
3139
+ "credentials[0].credential",
3140
+ ""
3141
+ ]
3151
3142
  });
3152
- const space = this._spaceManager.spaces.get(this._spaceKey);
3143
+ const spaceMemberCredential = credentials[0].credential.credential;
3144
+ invariant10(getCredentialAssertion2(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
3145
+ F: __dxlog_file13,
3146
+ L: 103,
3147
+ S: this,
3148
+ A: [
3149
+ "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
3150
+ ""
3151
+ ]
3152
+ });
3153
+ await writeMessages2(space.inner.controlPipeline.writer, credentials);
3153
3154
  return {
3154
3155
  space: {
3155
3156
  credential: spaceMemberCredential,
3156
- controlTimeframe: space?.inner.controlPipeline.state.timeframe
3157
+ controlTimeframe: space.inner.controlPipeline.state.timeframe
3157
3158
  }
3158
3159
  };
3159
3160
  }
3160
3161
  async delegate(invitation) {
3161
3162
  invariant10(this._spaceKey, void 0, {
3162
- F: __dxlog_file14,
3163
- L: 95,
3163
+ F: __dxlog_file13,
3164
+ L: 116,
3164
3165
  S: this,
3165
3166
  A: [
3166
3167
  "this._spaceKey",
@@ -3169,8 +3170,8 @@ var SpaceInvitationProtocol = class {
3169
3170
  });
3170
3171
  const space = this._spaceManager.spaces.get(this._spaceKey);
3171
3172
  invariant10(space, void 0, {
3172
- F: __dxlog_file14,
3173
- L: 97,
3173
+ F: __dxlog_file13,
3174
+ L: 118,
3174
3175
  S: this,
3175
3176
  A: [
3176
3177
  "space",
@@ -3179,8 +3180,8 @@ var SpaceInvitationProtocol = class {
3179
3180
  });
3180
3181
  if (invitation.authMethod === Invitation5.AuthMethod.KNOWN_PUBLIC_KEY) {
3181
3182
  invariant10(invitation.guestKeypair?.publicKey, void 0, {
3182
- F: __dxlog_file14,
3183
- L: 99,
3183
+ F: __dxlog_file13,
3184
+ L: 120,
3184
3185
  S: this,
3185
3186
  A: [
3186
3187
  "invitation.guestKeypair?.publicKey",
@@ -3192,8 +3193,8 @@ var SpaceInvitationProtocol = class {
3192
3193
  host: this._signingContext.deviceKey,
3193
3194
  id: invitation.invitationId
3194
3195
  }, {
3195
- F: __dxlog_file14,
3196
- L: 102,
3196
+ F: __dxlog_file13,
3197
+ L: 123,
3197
3198
  S: this,
3198
3199
  C: (f, a) => f(...a)
3199
3200
  });
@@ -3207,8 +3208,8 @@ var SpaceInvitationProtocol = class {
3207
3208
  guestKey: invitation.authMethod === Invitation5.AuthMethod.KNOWN_PUBLIC_KEY ? invitation.guestKeypair.publicKey : void 0
3208
3209
  });
3209
3210
  invariant10(credential.credential, void 0, {
3210
- F: __dxlog_file14,
3211
- L: 122,
3211
+ F: __dxlog_file13,
3212
+ L: 143,
3212
3213
  S: this,
3213
3214
  A: [
3214
3215
  "credential.credential",
@@ -3222,8 +3223,8 @@ var SpaceInvitationProtocol = class {
3222
3223
  }
3223
3224
  async cancelDelegation(invitation) {
3224
3225
  invariant10(this._spaceKey, void 0, {
3225
- F: __dxlog_file14,
3226
- L: 128,
3226
+ F: __dxlog_file13,
3227
+ L: 149,
3227
3228
  S: this,
3228
3229
  A: [
3229
3230
  "this._spaceKey",
@@ -3231,8 +3232,8 @@ var SpaceInvitationProtocol = class {
3231
3232
  ]
3232
3233
  });
3233
3234
  invariant10(invitation.type === Invitation5.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
3234
- F: __dxlog_file14,
3235
- L: 129,
3235
+ F: __dxlog_file13,
3236
+ L: 150,
3236
3237
  S: this,
3237
3238
  A: [
3238
3239
  "invitation.type === Invitation.Type.DELEGATED && invitation.delegationCredentialId",
@@ -3241,8 +3242,8 @@ var SpaceInvitationProtocol = class {
3241
3242
  });
3242
3243
  const space = this._spaceManager.spaces.get(this._spaceKey);
3243
3244
  invariant10(space, void 0, {
3244
- F: __dxlog_file14,
3245
- L: 131,
3245
+ F: __dxlog_file13,
3246
+ L: 152,
3246
3247
  S: this,
3247
3248
  A: [
3248
3249
  "space",
@@ -3253,15 +3254,15 @@ var SpaceInvitationProtocol = class {
3253
3254
  host: this._signingContext.deviceKey,
3254
3255
  id: invitation.invitationId
3255
3256
  }, {
3256
- F: __dxlog_file14,
3257
- L: 133,
3257
+ F: __dxlog_file13,
3258
+ L: 154,
3258
3259
  S: this,
3259
3260
  C: (f, a) => f(...a)
3260
3261
  });
3261
3262
  const credential = await createCancelDelegatedSpaceInvitationCredential(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
3262
3263
  invariant10(credential.credential, void 0, {
3263
- F: __dxlog_file14,
3264
- L: 140,
3264
+ F: __dxlog_file13,
3265
+ L: 161,
3265
3266
  S: this,
3266
3267
  A: [
3267
3268
  "credential.credential",
@@ -3299,8 +3300,8 @@ var SpaceInvitationProtocol = class {
3299
3300
  }
3300
3301
  async accept(response) {
3301
3302
  invariant10(response.space, void 0, {
3302
- F: __dxlog_file14,
3303
- L: 175,
3303
+ F: __dxlog_file13,
3304
+ L: 196,
3304
3305
  S: this,
3305
3306
  A: [
3306
3307
  "response.space",
@@ -3310,8 +3311,8 @@ var SpaceInvitationProtocol = class {
3310
3311
  const { credential, controlTimeframe, dataTimeframe } = response.space;
3311
3312
  const assertion = getCredentialAssertion2(credential);
3312
3313
  invariant10(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
3313
- F: __dxlog_file14,
3314
- L: 178,
3314
+ F: __dxlog_file13,
3315
+ L: 199,
3315
3316
  S: this,
3316
3317
  A: [
3317
3318
  "assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -3319,8 +3320,8 @@ var SpaceInvitationProtocol = class {
3319
3320
  ]
3320
3321
  });
3321
3322
  invariant10(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
3322
- F: __dxlog_file14,
3323
- L: 179,
3323
+ F: __dxlog_file13,
3324
+ L: 200,
3324
3325
  S: this,
3325
3326
  A: [
3326
3327
  "credential.subject.id.equals(this._signingContext.identityKey)",
@@ -3354,7 +3355,7 @@ import { PublicKey as PublicKey8 } from "@dxos/keys";
3354
3355
  import { log as log12 } from "@dxos/log";
3355
3356
  import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
3356
3357
  import { SpaceMember as SpaceMember3 } from "@dxos/protocols/proto/dxos/halo/credentials";
3357
- var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3358
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3358
3359
  var InvitationsManager = class {
3359
3360
  constructor(_invitationsHandler, _getHandler, _metadataStore) {
3360
3361
  this._invitationsHandler = _invitationsHandler;
@@ -3397,7 +3398,7 @@ var InvitationsManager = class {
3397
3398
  await this._persistIfRequired(handler, stream, invitation);
3398
3399
  } catch (err) {
3399
3400
  log12.catch(err, void 0, {
3400
- F: __dxlog_file15,
3401
+ F: __dxlog_file14,
3401
3402
  L: 82,
3402
3403
  S: this,
3403
3404
  C: (f, a) => f(...a)
@@ -3420,7 +3421,7 @@ var InvitationsManager = class {
3420
3421
  const freshInvitations = persistentInvitations.filter((invitation) => !hasInvitationExpired(invitation));
3421
3422
  const loadTasks = freshInvitations.map((persistentInvitation) => {
3422
3423
  invariant11(!this._createInvitations.get(persistentInvitation.invitationId), "invitation already exists", {
3423
- F: __dxlog_file15,
3424
+ F: __dxlog_file14,
3424
3425
  L: 103,
3425
3426
  S: this,
3426
3427
  A: [
@@ -3439,7 +3440,7 @@ var InvitationsManager = class {
3439
3440
  };
3440
3441
  } catch (err) {
3441
3442
  log12.catch(err, void 0, {
3442
- F: __dxlog_file15,
3443
+ F: __dxlog_file14,
3443
3444
  L: 110,
3444
3445
  S: this,
3445
3446
  C: (f, a) => f(...a)
@@ -3471,13 +3472,13 @@ var InvitationsManager = class {
3471
3472
  }
3472
3473
  async authenticate({ invitationId, authCode }) {
3473
3474
  log12("authenticating...", void 0, {
3474
- F: __dxlog_file15,
3475
+ F: __dxlog_file14,
3475
3476
  L: 140,
3476
3477
  S: this,
3477
3478
  C: (f, a) => f(...a)
3478
3479
  });
3479
3480
  invariant11(invitationId, void 0, {
3480
- F: __dxlog_file15,
3481
+ F: __dxlog_file14,
3481
3482
  L: 141,
3482
3483
  S: this,
3483
3484
  A: [
@@ -3490,7 +3491,7 @@ var InvitationsManager = class {
3490
3491
  log12.warn("invalid invitation", {
3491
3492
  invitationId
3492
3493
  }, {
3493
- F: __dxlog_file15,
3494
+ F: __dxlog_file14,
3494
3495
  L: 144,
3495
3496
  S: this,
3496
3497
  C: (f, a) => f(...a)
@@ -3503,13 +3504,13 @@ var InvitationsManager = class {
3503
3504
  log12("cancelInvitation...", {
3504
3505
  invitationId
3505
3506
  }, {
3506
- F: __dxlog_file15,
3507
+ F: __dxlog_file14,
3507
3508
  L: 151,
3508
3509
  S: this,
3509
3510
  C: (f, a) => f(...a)
3510
3511
  });
3511
3512
  invariant11(invitationId, void 0, {
3512
- F: __dxlog_file15,
3513
+ F: __dxlog_file14,
3513
3514
  L: 152,
3514
3515
  S: this,
3515
3516
  A: [
@@ -3583,15 +3584,12 @@ var InvitationsManager = class {
3583
3584
  stream.error(err);
3584
3585
  void ctx.dispose();
3585
3586
  }
3586
- }, {
3587
- F: __dxlog_file15,
3588
- L: 234
3589
3587
  });
3590
3588
  ctx.onDispose(() => {
3591
3589
  log12("complete", {
3592
3590
  ...handler.toJSON()
3593
3591
  }, {
3594
- F: __dxlog_file15,
3592
+ F: __dxlog_file14,
3595
3593
  L: 241,
3596
3594
  S: this,
3597
3595
  C: (f, a) => f(...a)
@@ -3624,7 +3622,7 @@ var InvitationsManager = class {
3624
3622
  log12("timeout", {
3625
3623
  ...handler.toJSON()
3626
3624
  }, {
3627
- F: __dxlog_file15,
3625
+ F: __dxlog_file14,
3628
3626
  L: 261,
3629
3627
  S: this,
3630
3628
  C: (f, a) => f(...a)
@@ -3635,7 +3633,7 @@ var InvitationsManager = class {
3635
3633
  });
3636
3634
  } else {
3637
3635
  log12.warn("auth failed", err, {
3638
- F: __dxlog_file15,
3636
+ F: __dxlog_file14,
3639
3637
  L: 264,
3640
3638
  S: this,
3641
3639
  C: (f, a) => f(...a)
@@ -3647,15 +3645,12 @@ var InvitationsManager = class {
3647
3645
  }
3648
3646
  void ctx.dispose();
3649
3647
  }
3650
- }, {
3651
- F: __dxlog_file15,
3652
- L: 258
3653
3648
  });
3654
3649
  ctx.onDispose(() => {
3655
3650
  log12("complete", {
3656
3651
  ...handler.toJSON()
3657
3652
  }, {
3658
- F: __dxlog_file15,
3653
+ F: __dxlog_file14,
3659
3654
  L: 271,
3660
3655
  S: this,
3661
3656
  C: (f, a) => f(...a)
@@ -3700,7 +3695,7 @@ var InvitationsManager = class {
3700
3695
  await this._metadataStore.removeInvitation(invitation.invitationId);
3701
3696
  } catch (err) {
3702
3697
  log12.catch(err, void 0, {
3703
- F: __dxlog_file15,
3698
+ F: __dxlog_file14,
3704
3699
  L: 307,
3705
3700
  S: this,
3706
3701
  C: (f, a) => f(...a)
@@ -3787,7 +3782,7 @@ import { invariant as invariant12 } from "@dxos/invariant";
3787
3782
  import { log as log13 } from "@dxos/log";
3788
3783
  import { CreateEpochRequest } from "@dxos/protocols/proto/dxos/client/services";
3789
3784
  import { assignDeep } from "@dxos/util";
3790
- var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
3785
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
3791
3786
  var runEpochMigration = async (ctx, context) => {
3792
3787
  switch (context.migration) {
3793
3788
  case CreateEpochRequest.Migration.INIT_AUTOMERGE: {
@@ -3811,7 +3806,7 @@ var runEpochMigration = async (ctx, context) => {
3811
3806
  }
3812
3807
  case CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT: {
3813
3808
  log13.info("Fragmenting", void 0, {
3814
- F: __dxlog_file16,
3809
+ F: __dxlog_file15,
3815
3810
  L: 63,
3816
3811
  S: void 0,
3817
3812
  C: (f, a) => f(...a)
@@ -3823,7 +3818,7 @@ var runEpochMigration = async (ctx, context) => {
3823
3818
  const properties = findInlineObjectOfType(rootHandle.docSync(), TYPE_PROPERTIES);
3824
3819
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
3825
3820
  invariant12(properties, "Properties not found", {
3826
- F: __dxlog_file16,
3821
+ F: __dxlog_file15,
3827
3822
  L: 73,
3828
3823
  S: void 0,
3829
3824
  A: [
@@ -3839,7 +3834,7 @@ var runEpochMigration = async (ctx, context) => {
3839
3834
  };
3840
3835
  const newRoot = context.repo.create(newSpaceDoc);
3841
3836
  invariant12(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3842
- F: __dxlog_file16,
3837
+ F: __dxlog_file15,
3843
3838
  L: 78,
3844
3839
  S: void 0,
3845
3840
  A: [
@@ -3870,7 +3865,7 @@ var runEpochMigration = async (ctx, context) => {
3870
3865
  const rootHandle = context.repo.find(currentRootUrl);
3871
3866
  await cancelWithContext4(ctx, asyncTimeout2(rootHandle.whenReady(), 1e4));
3872
3867
  invariant12(rootHandle.docSync(), "Root doc not found", {
3873
- F: __dxlog_file16,
3868
+ F: __dxlog_file15,
3874
3869
  L: 100,
3875
3870
  S: void 0,
3876
3871
  A: [
@@ -3883,7 +3878,7 @@ var runEpochMigration = async (ctx, context) => {
3883
3878
  const handle = context.repo.find(url);
3884
3879
  await cancelWithContext4(ctx, asyncTimeout2(handle.whenReady(), 1e4));
3885
3880
  invariant12(handle.docSync(), "Doc not found", {
3886
- F: __dxlog_file16,
3881
+ F: __dxlog_file15,
3887
3882
  L: 107,
3888
3883
  S: void 0,
3889
3884
  A: [
@@ -3905,7 +3900,7 @@ var runEpochMigration = async (ctx, context) => {
3905
3900
  }
3906
3901
  case CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT: {
3907
3902
  invariant12(context.newAutomergeRoot, void 0, {
3908
- F: __dxlog_file16,
3903
+ F: __dxlog_file15,
3909
3904
  L: 124,
3910
3905
  S: void 0,
3911
3906
  A: [
@@ -3931,17 +3926,14 @@ import { log as log14 } from "@dxos/log";
3931
3926
  import { schema as schema4 } from "@dxos/protocols";
3932
3927
  import { RpcExtension as RpcExtension3 } from "@dxos/teleport";
3933
3928
  import { ComplexMap as ComplexMap2, ComplexSet as ComplexSet4, entry } from "@dxos/util";
3934
- var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
3929
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
3935
3930
  var DEFAULT_RETRY_TIMEOUT = 1e3;
3936
3931
  var DEFAULT_SUCCESS_DELAY = 1e3;
3937
3932
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
3938
3933
  var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
3939
3934
  var NotarizationPlugin = class {
3940
3935
  constructor() {
3941
- this._ctx = new Context7(void 0, {
3942
- F: __dxlog_file17,
3943
- L: 62
3944
- });
3936
+ this._ctx = new Context7();
3945
3937
  this._extensionOpened = new Event5();
3946
3938
  this._extensions = /* @__PURE__ */ new Set();
3947
3939
  this._processedCredentials = new ComplexSet4(PublicKey9.hash);
@@ -3962,13 +3954,13 @@ var NotarizationPlugin = class {
3962
3954
  log14("notarize", {
3963
3955
  credentials
3964
3956
  }, {
3965
- F: __dxlog_file17,
3957
+ F: __dxlog_file16,
3966
3958
  L: 90,
3967
3959
  S: this,
3968
3960
  C: (f, a) => f(...a)
3969
3961
  });
3970
3962
  invariant13(credentials.every((credential) => credential.id), "Credentials must have an id", {
3971
- F: __dxlog_file17,
3963
+ F: __dxlog_file16,
3972
3964
  L: 91,
3973
3965
  S: this,
3974
3966
  A: [
@@ -3982,7 +3974,7 @@ var NotarizationPlugin = class {
3982
3974
  log14.warn("Notarization error", {
3983
3975
  err
3984
3976
  }, {
3985
- F: __dxlog_file17,
3977
+ F: __dxlog_file16,
3986
3978
  L: 99,
3987
3979
  S: this,
3988
3980
  C: (f, a) => f(...a)
@@ -3998,7 +3990,7 @@ var NotarizationPlugin = class {
3998
3990
  timeout,
3999
3991
  peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
4000
3992
  }, {
4001
- F: __dxlog_file17,
3993
+ F: __dxlog_file16,
4002
3994
  L: 111,
4003
3995
  S: this,
4004
3996
  C: (f, a) => f(...a)
@@ -4021,7 +4013,7 @@ var NotarizationPlugin = class {
4021
4013
  log14.info("Exhausted all peers to notarize with", {
4022
4014
  retryIn: retryTimeout
4023
4015
  }, {
4024
- F: __dxlog_file17,
4016
+ F: __dxlog_file16,
4025
4017
  L: 136,
4026
4018
  S: this,
4027
4019
  C: (f, a) => f(...a)
@@ -4035,7 +4027,7 @@ var NotarizationPlugin = class {
4035
4027
  peer: peer.localPeerId,
4036
4028
  credentialId: credentials.map((credential) => credential.id)
4037
4029
  }, {
4038
- F: __dxlog_file17,
4030
+ F: __dxlog_file16,
4039
4031
  L: 143,
4040
4032
  S: this,
4041
4033
  C: (f, a) => f(...a)
@@ -4044,7 +4036,7 @@ var NotarizationPlugin = class {
4044
4036
  credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
4045
4037
  });
4046
4038
  log14("success", void 0, {
4047
- F: __dxlog_file17,
4039
+ F: __dxlog_file16,
4048
4040
  L: 147,
4049
4041
  S: this,
4050
4042
  C: (f, a) => f(...a)
@@ -4053,7 +4045,7 @@ var NotarizationPlugin = class {
4053
4045
  } catch (err) {
4054
4046
  if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
4055
4047
  log14.info("error notarizing (recoverable)", err, {
4056
- F: __dxlog_file17,
4048
+ F: __dxlog_file16,
4057
4049
  L: 151,
4058
4050
  S: this,
4059
4051
  C: (f, a) => f(...a)
@@ -4071,7 +4063,7 @@ var NotarizationPlugin = class {
4071
4063
  errors.wait()
4072
4064
  ]);
4073
4065
  log14("done", void 0, {
4074
- F: __dxlog_file17,
4066
+ F: __dxlog_file16,
4075
4067
  L: 162,
4076
4068
  S: this,
4077
4069
  C: (f, a) => f(...a)
@@ -4093,7 +4085,7 @@ var NotarizationPlugin = class {
4093
4085
  }
4094
4086
  setWriter(writer) {
4095
4087
  invariant13(!this._writer, "Writer already set.", {
4096
- F: __dxlog_file17,
4088
+ F: __dxlog_file16,
4097
4089
  L: 181,
4098
4090
  S: this,
4099
4091
  A: [
@@ -4118,7 +4110,7 @@ var NotarizationPlugin = class {
4118
4110
  }
4119
4111
  for (const credential of request.credentials ?? []) {
4120
4112
  invariant13(credential.id, "Credential must have an id", {
4121
- F: __dxlog_file17,
4113
+ F: __dxlog_file16,
4122
4114
  L: 200,
4123
4115
  S: this,
4124
4116
  A: [
@@ -4138,7 +4130,7 @@ var NotarizationPlugin = class {
4138
4130
  log14("extension opened", {
4139
4131
  peer: extension.localPeerId
4140
4132
  }, {
4141
- F: __dxlog_file17,
4133
+ F: __dxlog_file16,
4142
4134
  L: 211,
4143
4135
  S: this,
4144
4136
  C: (f, a) => f(...a)
@@ -4150,7 +4142,7 @@ var NotarizationPlugin = class {
4150
4142
  log14("extension closed", {
4151
4143
  peer: extension.localPeerId
4152
4144
  }, {
4153
- F: __dxlog_file17,
4145
+ F: __dxlog_file16,
4154
4146
  L: 216,
4155
4147
  S: this,
4156
4148
  C: (f, a) => f(...a)
@@ -4267,13 +4259,10 @@ function _using_ctx() {
4267
4259
  }
4268
4260
  };
4269
4261
  }
4270
- var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4262
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4271
4263
  var DataSpace = class {
4272
4264
  constructor(params) {
4273
- this._ctx = new Context8(void 0, {
4274
- F: __dxlog_file18,
4275
- L: 84
4276
- });
4265
+ this._ctx = new Context8();
4277
4266
  this._notarizationPlugin = new NotarizationPlugin();
4278
4267
  this._cache = void 0;
4279
4268
  // TODO(dmaretskyi): Move into Space?
@@ -4307,7 +4296,7 @@ var DataSpace = class {
4307
4296
  log15("new state", {
4308
4297
  state: SpaceState2[this._state]
4309
4298
  }, {
4310
- F: __dxlog_file18,
4299
+ F: __dxlog_file17,
4311
4300
  L: 146,
4312
4301
  S: this,
4313
4302
  C: (f, a) => f(...a)
@@ -4362,15 +4351,12 @@ var DataSpace = class {
4362
4351
  await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
4363
4352
  await this._automergeSpaceState.open();
4364
4353
  await this._inner.spaceState.addCredentialProcessor(this._automergeSpaceState);
4365
- await this._inner.open(new Context8(void 0, {
4366
- F: __dxlog_file18,
4367
- L: 215
4368
- }));
4354
+ await this._inner.open(new Context8());
4369
4355
  this._state = SpaceState2.CONTROL_ONLY;
4370
4356
  log15("new state", {
4371
4357
  state: SpaceState2[this._state]
4372
4358
  }, {
4373
- F: __dxlog_file18,
4359
+ F: __dxlog_file17,
4374
4360
  L: 217,
4375
4361
  S: this,
4376
4362
  C: (f, a) => f(...a)
@@ -4388,16 +4374,13 @@ var DataSpace = class {
4388
4374
  log15("new state", {
4389
4375
  state: SpaceState2[this._state]
4390
4376
  }, {
4391
- F: __dxlog_file18,
4377
+ F: __dxlog_file17,
4392
4378
  L: 231,
4393
4379
  S: this,
4394
4380
  C: (f, a) => f(...a)
4395
4381
  });
4396
4382
  await this._ctx.dispose();
4397
- this._ctx = new Context8(void 0, {
4398
- F: __dxlog_file18,
4399
- L: 233
4400
- });
4383
+ this._ctx = new Context8();
4401
4384
  await this.authVerifier.close();
4402
4385
  await this._inner.close();
4403
4386
  await this._inner.spaceState.removeCredentialProcessor(this._automergeSpaceState);
@@ -4424,7 +4407,7 @@ var DataSpace = class {
4424
4407
  } catch (err) {
4425
4408
  if (err instanceof CancelledError || err instanceof ContextDisposedError3) {
4426
4409
  log15("data pipeline initialization cancelled", err, {
4427
- F: __dxlog_file18,
4410
+ F: __dxlog_file17,
4428
4411
  L: 265,
4429
4412
  S: this,
4430
4413
  C: (f, a) => f(...a)
@@ -4432,7 +4415,7 @@ var DataSpace = class {
4432
4415
  return;
4433
4416
  }
4434
4417
  log15.error("Error initializing data pipeline", err, {
4435
- F: __dxlog_file18,
4418
+ F: __dxlog_file17,
4436
4419
  L: 269,
4437
4420
  S: this,
4438
4421
  C: (f, a) => f(...a)
@@ -4441,7 +4424,7 @@ var DataSpace = class {
4441
4424
  log15("new state", {
4442
4425
  state: SpaceState2[this._state]
4443
4426
  }, {
4444
- F: __dxlog_file18,
4427
+ F: __dxlog_file17,
4445
4428
  L: 271,
4446
4429
  S: this,
4447
4430
  C: (f, a) => f(...a)
@@ -4461,7 +4444,7 @@ var DataSpace = class {
4461
4444
  log15("new state", {
4462
4445
  state: SpaceState2[this._state]
4463
4446
  }, {
4464
- F: __dxlog_file18,
4447
+ F: __dxlog_file17,
4465
4448
  L: 287,
4466
4449
  S: this,
4467
4450
  C: (f, a) => f(...a)
@@ -4478,7 +4461,7 @@ var DataSpace = class {
4478
4461
  log15("new state", {
4479
4462
  state: SpaceState2[this._state]
4480
4463
  }, {
4481
- F: __dxlog_file18,
4464
+ F: __dxlog_file17,
4482
4465
  L: 306,
4483
4466
  S: this,
4484
4467
  C: (f, a) => f(...a)
@@ -4494,7 +4477,7 @@ var DataSpace = class {
4494
4477
  this.metrics.controlPipelineReady = /* @__PURE__ */ new Date();
4495
4478
  await this._createWritableFeeds();
4496
4479
  log15("writable feeds created", void 0, {
4497
- F: __dxlog_file18,
4480
+ F: __dxlog_file17,
4498
4481
  L: 322,
4499
4482
  S: this,
4500
4483
  C: (f, a) => f(...a)
@@ -4557,7 +4540,7 @@ var DataSpace = class {
4557
4540
  space: this.key,
4558
4541
  rootUrl
4559
4542
  }, {
4560
- F: __dxlog_file18,
4543
+ F: __dxlog_file17,
4561
4544
  L: 388,
4562
4545
  S: this,
4563
4546
  C: (f, a) => f(...a)
@@ -4611,7 +4594,7 @@ var DataSpace = class {
4611
4594
  rootUrl,
4612
4595
  err
4613
4596
  }, {
4614
- F: __dxlog_file18,
4597
+ F: __dxlog_file17,
4615
4598
  L: 431,
4616
4599
  S: this,
4617
4600
  C: (f, a) => f(...a)
@@ -4697,7 +4680,7 @@ var DataSpace = class {
4697
4680
  log15("new state", {
4698
4681
  state: SpaceState2[this._state]
4699
4682
  }, {
4700
- F: __dxlog_file18,
4683
+ F: __dxlog_file17,
4701
4684
  L: 512,
4702
4685
  S: this,
4703
4686
  C: (f, a) => f(...a)
@@ -4758,17 +4741,15 @@ DataSpace = _ts_decorate4([
4758
4741
  import { Event as Event7, synchronized as synchronized2, trackLeaks as trackLeaks2 } from "@dxos/async";
4759
4742
  import { PropertiesType } from "@dxos/client-protocol";
4760
4743
  import { Context as Context9, cancelWithContext as cancelWithContext6 } from "@dxos/context";
4761
- import { getCredentialAssertion as getCredentialAssertion3, createAdmissionCredentials } from "@dxos/credentials";
4744
+ import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
4762
4745
  import { convertLegacyReferences as convertLegacyReferences2, findInlineObjectOfType as findInlineObjectOfType2 } from "@dxos/echo-db";
4763
4746
  import { AuthStatus } from "@dxos/echo-pipeline";
4764
- import { CredentialServerExtension } from "@dxos/echo-pipeline";
4765
4747
  import { LEGACY_TYPE_PROPERTIES, SpaceDocVersion as SpaceDocVersion2, encodeReference } from "@dxos/echo-protocol";
4766
4748
  import { TYPE_PROPERTIES as TYPE_PROPERTIES2, generateEchoId, getTypeReference } from "@dxos/echo-schema";
4767
- import { writeMessages as writeMessages3 } from "@dxos/feed-store";
4768
4749
  import { invariant as invariant14 } from "@dxos/invariant";
4769
4750
  import { PublicKey as PublicKey11 } from "@dxos/keys";
4770
4751
  import { log as log16 } from "@dxos/log";
4771
- import { trace as Trace2, AlreadyJoinedError as AlreadyJoinedError3 } from "@dxos/protocols";
4752
+ import { trace as Trace2 } from "@dxos/protocols";
4772
4753
  import { Invitation as Invitation7, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
4773
4754
  import { SpaceMember as SpaceMember6 } from "@dxos/protocols/proto/dxos/halo/credentials";
4774
4755
  import { Gossip as Gossip2, Presence as Presence2 } from "@dxos/teleport-extension-gossip";
@@ -4856,7 +4837,7 @@ function _ts_decorate5(decorators, target, key, desc) {
4856
4837
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4857
4838
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4858
4839
  }
4859
- var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
4840
+ var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
4860
4841
  var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
4861
4842
  var PRESENCE_OFFLINE_TIMEOUT = 2e4;
4862
4843
  var DEFAULT_SPACE_KEY = "__DEFAULT__";
@@ -4870,10 +4851,7 @@ var DataSpaceManager = class {
4870
4851
  this._echoHost = _echoHost;
4871
4852
  this._invitationsManager = _invitationsManager;
4872
4853
  this._params = _params;
4873
- this._ctx = new Context9(void 0, {
4874
- F: __dxlog_file19,
4875
- L: 104
4876
- });
4854
+ this._ctx = new Context9();
4877
4855
  this.updated = new Event7();
4878
4856
  this._spaces = new ComplexMap3(PublicKey11.hash);
4879
4857
  this._isOpen = false;
@@ -4907,24 +4885,24 @@ var DataSpaceManager = class {
4907
4885
  }
4908
4886
  async open() {
4909
4887
  log16("open", void 0, {
4910
- F: __dxlog_file19,
4911
- L: 156,
4888
+ F: __dxlog_file18,
4889
+ L: 146,
4912
4890
  S: this,
4913
4891
  C: (f, a) => f(...a)
4914
4892
  });
4915
4893
  log16.trace("dxos.echo.data-space-manager.open", Trace2.begin({
4916
4894
  id: this._instanceId
4917
4895
  }), {
4918
- F: __dxlog_file19,
4919
- L: 157,
4896
+ F: __dxlog_file18,
4897
+ L: 147,
4920
4898
  S: this,
4921
4899
  C: (f, a) => f(...a)
4922
4900
  });
4923
4901
  log16("metadata loaded", {
4924
4902
  spaces: this._metadataStore.spaces.length
4925
4903
  }, {
4926
- F: __dxlog_file19,
4927
- L: 158,
4904
+ F: __dxlog_file18,
4905
+ L: 148,
4928
4906
  S: this,
4929
4907
  C: (f, a) => f(...a)
4930
4908
  });
@@ -4933,8 +4911,8 @@ var DataSpaceManager = class {
4933
4911
  log16("load space", {
4934
4912
  spaceMetadata
4935
4913
  }, {
4936
- F: __dxlog_file19,
4937
- L: 162,
4914
+ F: __dxlog_file18,
4915
+ L: 152,
4938
4916
  S: this,
4939
4917
  C: (f, a) => f(...a)
4940
4918
  });
@@ -4944,8 +4922,8 @@ var DataSpaceManager = class {
4944
4922
  spaceMetadata,
4945
4923
  err
4946
4924
  }, {
4947
- F: __dxlog_file19,
4948
- L: 165,
4925
+ F: __dxlog_file18,
4926
+ L: 155,
4949
4927
  S: this,
4950
4928
  C: (f, a) => f(...a)
4951
4929
  });
@@ -4956,16 +4934,16 @@ var DataSpaceManager = class {
4956
4934
  log16.trace("dxos.echo.data-space-manager.open", Trace2.end({
4957
4935
  id: this._instanceId
4958
4936
  }), {
4959
- F: __dxlog_file19,
4960
- L: 172,
4937
+ F: __dxlog_file18,
4938
+ L: 162,
4961
4939
  S: this,
4962
4940
  C: (f, a) => f(...a)
4963
4941
  });
4964
4942
  }
4965
4943
  async close() {
4966
4944
  log16("close", void 0, {
4967
- F: __dxlog_file19,
4968
- L: 177,
4945
+ F: __dxlog_file18,
4946
+ L: 167,
4969
4947
  S: this,
4970
4948
  C: (f, a) => f(...a)
4971
4949
  });
@@ -4981,8 +4959,8 @@ var DataSpaceManager = class {
4981
4959
  */
4982
4960
  async createSpace() {
4983
4961
  invariant14(this._isOpen, "Not open.", {
4984
- F: __dxlog_file19,
4985
- L: 191,
4962
+ F: __dxlog_file18,
4963
+ L: 181,
4986
4964
  S: this,
4987
4965
  A: [
4988
4966
  "this._isOpen",
@@ -5002,8 +4980,8 @@ var DataSpaceManager = class {
5002
4980
  log16("creating space...", {
5003
4981
  spaceKey
5004
4982
  }, {
5005
- F: __dxlog_file19,
5006
- L: 203,
4983
+ F: __dxlog_file18,
4984
+ L: 193,
5007
4985
  S: this,
5008
4986
  C: (f, a) => f(...a)
5009
4987
  });
@@ -5014,8 +4992,8 @@ var DataSpaceManager = class {
5014
4992
  await this._metadataStore.addSpace(metadata);
5015
4993
  const memberCredential = credentials[1];
5016
4994
  invariant14(getCredentialAssertion3(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5017
- F: __dxlog_file19,
5018
- L: 213,
4995
+ F: __dxlog_file18,
4996
+ L: 203,
5019
4997
  S: this,
5020
4998
  A: [
5021
4999
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -5046,8 +5024,8 @@ var DataSpaceManager = class {
5046
5024
  version: space.databaseRoot.getVersion(),
5047
5025
  spaceId: space.id
5048
5026
  }, {
5049
- F: __dxlog_file19,
5050
- L: 238,
5027
+ F: __dxlog_file18,
5028
+ L: 228,
5051
5029
  S: this,
5052
5030
  C: (f, a) => f(...a)
5053
5031
  });
@@ -5081,8 +5059,8 @@ var DataSpaceManager = class {
5081
5059
  async _getSpaceRootDocument(space) {
5082
5060
  const automergeIndex = space.automergeSpaceState.rootUrl;
5083
5061
  invariant14(automergeIndex, void 0, {
5084
- F: __dxlog_file19,
5085
- L: 271,
5062
+ F: __dxlog_file18,
5063
+ L: 261,
5086
5064
  S: this,
5087
5065
  A: [
5088
5066
  "automergeIndex",
@@ -5098,14 +5076,14 @@ var DataSpaceManager = class {
5098
5076
  log16("accept space", {
5099
5077
  opts
5100
5078
  }, {
5101
- F: __dxlog_file19,
5102
- L: 280,
5079
+ F: __dxlog_file18,
5080
+ L: 270,
5103
5081
  S: this,
5104
5082
  C: (f, a) => f(...a)
5105
5083
  });
5106
5084
  invariant14(this._isOpen, "Not open.", {
5107
- F: __dxlog_file19,
5108
- L: 281,
5085
+ F: __dxlog_file18,
5086
+ L: 271,
5109
5087
  S: this,
5110
5088
  A: [
5111
5089
  "this._isOpen",
@@ -5113,8 +5091,8 @@ var DataSpaceManager = class {
5113
5091
  ]
5114
5092
  });
5115
5093
  invariant14(!this._spaces.has(opts.spaceKey), "Space already exists.", {
5116
- F: __dxlog_file19,
5117
- L: 282,
5094
+ F: __dxlog_file18,
5095
+ L: 272,
5118
5096
  S: this,
5119
5097
  A: [
5120
5098
  "!this._spaces.has(opts.spaceKey)",
@@ -5134,43 +5112,6 @@ var DataSpaceManager = class {
5134
5112
  this.updated.emit();
5135
5113
  return space;
5136
5114
  }
5137
- async admitMember(options) {
5138
- const space = this._spaceManager.spaces.get(options.spaceKey);
5139
- invariant14(space, void 0, {
5140
- F: __dxlog_file19,
5141
- L: 302,
5142
- S: this,
5143
- A: [
5144
- "space",
5145
- ""
5146
- ]
5147
- });
5148
- if (space.spaceState.getMemberRole(options.identityKey) !== SpaceMember6.Role.REMOVED) {
5149
- throw new AlreadyJoinedError3();
5150
- }
5151
- const credentials = await createAdmissionCredentials(this._signingContext.credentialSigner, options.identityKey, space.key, space.genesisFeedKey, options.role, space.spaceState.membershipChainHeads, options.profile, options.delegationCredentialId);
5152
- invariant14(credentials[0].credential, void 0, {
5153
- F: __dxlog_file19,
5154
- L: 321,
5155
- S: this,
5156
- A: [
5157
- "credentials[0].credential",
5158
- ""
5159
- ]
5160
- });
5161
- const spaceMemberCredential = credentials[0].credential.credential;
5162
- invariant14(getCredentialAssertion3(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5163
- F: __dxlog_file19,
5164
- L: 323,
5165
- S: this,
5166
- A: [
5167
- "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
5168
- ""
5169
- ]
5170
- });
5171
- await writeMessages3(space.controlPipeline.writer, credentials);
5172
- return spaceMemberCredential;
5173
- }
5174
5115
  /**
5175
5116
  * Wait until the space data pipeline is fully initialized.
5176
5117
  * Used by invitation handler.
@@ -5182,24 +5123,12 @@ var DataSpaceManager = class {
5182
5123
  return !!space && space.state === SpaceState3.READY;
5183
5124
  }));
5184
5125
  }
5185
- async requestSpaceAdmissionCredential(spaceKey) {
5186
- return this._spaceManager.requestSpaceAdmissionCredential({
5187
- spaceKey,
5188
- identityKey: this._signingContext.identityKey,
5189
- timeout: 15e3,
5190
- swarmIdentity: {
5191
- peerKey: this._signingContext.deviceKey,
5192
- credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
5193
- credentialAuthenticator: async () => true
5194
- }
5195
- });
5196
- }
5197
5126
  async _constructSpace(metadata) {
5198
5127
  log16("construct space", {
5199
5128
  metadata
5200
5129
  }, {
5201
- F: __dxlog_file19,
5202
- L: 358,
5130
+ F: __dxlog_file18,
5131
+ L: 306,
5203
5132
  S: this,
5204
5133
  C: (f, a) => f(...a)
5205
5134
  });
@@ -5227,7 +5156,6 @@ var DataSpaceManager = class {
5227
5156
  credentialAuthenticator: deferFunction2(() => dataSpace.authVerifier.verifier)
5228
5157
  },
5229
5158
  onAuthorizedConnection: (session) => {
5230
- session.addExtension("dxos.mesh.teleport.admission-discovery", new CredentialServerExtension(space));
5231
5159
  session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
5232
5160
  remotePeerId: session.remotePeerId
5233
5161
  }));
@@ -5237,8 +5165,8 @@ var DataSpaceManager = class {
5237
5165
  },
5238
5166
  onAuthFailure: () => {
5239
5167
  log16.warn("auth failure", void 0, {
5240
- F: __dxlog_file19,
5241
- L: 396,
5168
+ F: __dxlog_file18,
5169
+ L: 343,
5242
5170
  S: this,
5243
5171
  C: (f, a) => f(...a)
5244
5172
  });
@@ -5270,8 +5198,8 @@ var DataSpaceManager = class {
5270
5198
  log16("before space ready", {
5271
5199
  space: space.key
5272
5200
  }, {
5273
- F: __dxlog_file19,
5274
- L: 423,
5201
+ F: __dxlog_file18,
5202
+ L: 370,
5275
5203
  S: this,
5276
5204
  C: (f, a) => f(...a)
5277
5205
  });
@@ -5281,8 +5209,8 @@ var DataSpaceManager = class {
5281
5209
  space: space.key,
5282
5210
  open: this._isOpen
5283
5211
  }, {
5284
- F: __dxlog_file19,
5285
- L: 426,
5212
+ F: __dxlog_file18,
5213
+ L: 373,
5286
5214
  S: this,
5287
5215
  C: (f, a) => f(...a)
5288
5216
  });
@@ -5300,8 +5228,8 @@ var DataSpaceManager = class {
5300
5228
  log16("before space close", {
5301
5229
  space: space.key
5302
5230
  }, {
5303
- F: __dxlog_file19,
5304
- L: 434,
5231
+ F: __dxlog_file18,
5232
+ L: 381,
5305
5233
  S: this,
5306
5234
  C: (f, a) => f(...a)
5307
5235
  });
@@ -5341,8 +5269,8 @@ var DataSpaceManager = class {
5341
5269
  peersOnline: presence.getPeersOnline().length,
5342
5270
  closedSessions
5343
5271
  }, {
5344
- F: __dxlog_file19,
5345
- L: 470,
5272
+ F: __dxlog_file18,
5273
+ L: 417,
5346
5274
  S: this,
5347
5275
  C: (f, a) => f(...a)
5348
5276
  });
@@ -5356,8 +5284,8 @@ var DataSpaceManager = class {
5356
5284
  log16("closing a session with a removed peer", {
5357
5285
  peerId: peerState.peerId
5358
5286
  }, {
5359
- F: __dxlog_file19,
5360
- L: 484,
5287
+ F: __dxlog_file18,
5288
+ L: 431,
5361
5289
  S: this,
5362
5290
  C: (f, a) => f(...a)
5363
5291
  });
@@ -5422,13 +5350,13 @@ import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTas
5422
5350
  import { Stream as Stream10 } from "@dxos/codec-protobuf";
5423
5351
  import { createAdmissionCredentials as createAdmissionCredentials2, getCredentialAssertion as getCredentialAssertion4 } from "@dxos/credentials";
5424
5352
  import { raise as raise2 } from "@dxos/debug";
5425
- import { writeMessages as writeMessages4 } from "@dxos/feed-store";
5353
+ import { writeMessages as writeMessages3 } from "@dxos/feed-store";
5426
5354
  import { invariant as invariant15 } from "@dxos/invariant";
5427
5355
  import { log as log17 } from "@dxos/log";
5428
5356
  import { ApiError, SpaceNotFoundError as SpaceNotFoundError2, encodeError, IdentityNotInitializedError, AuthorizationError as AuthorizationError2 } from "@dxos/protocols";
5429
5357
  import { SpaceMember as SpaceMember7, SpaceState as SpaceState4 } from "@dxos/protocols/proto/dxos/client/services";
5430
5358
  import { trace as trace8 } from "@dxos/tracing";
5431
- var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
5359
+ var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
5432
5360
  var SpacesServiceImpl = class {
5433
5361
  constructor(_identityManager, _spaceManager, _getDataSpaceManager) {
5434
5362
  this._identityManager = _identityManager;
@@ -5472,8 +5400,8 @@ var SpacesServiceImpl = class {
5472
5400
  }
5473
5401
  const credentials = await createAdmissionCredentials2(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
5474
5402
  invariant15(credentials[0].credential, void 0, {
5475
- F: __dxlog_file20,
5476
- L: 102,
5403
+ F: __dxlog_file19,
5404
+ L: 98,
5477
5405
  S: this,
5478
5406
  A: [
5479
5407
  "credentials[0].credential",
@@ -5482,15 +5410,15 @@ var SpacesServiceImpl = class {
5482
5410
  });
5483
5411
  const spaceMemberCredential = credentials[0].credential.credential;
5484
5412
  invariant15(getCredentialAssertion4(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5485
- F: __dxlog_file20,
5486
- L: 104,
5413
+ F: __dxlog_file19,
5414
+ L: 100,
5487
5415
  S: this,
5488
5416
  A: [
5489
5417
  "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
5490
5418
  ""
5491
5419
  ]
5492
5420
  });
5493
- await writeMessages4(space.controlPipeline.writer, credentials);
5421
+ await writeMessages3(space.controlPipeline.writer, credentials);
5494
5422
  }
5495
5423
  querySpaces() {
5496
5424
  return new Stream10(({ next, ctx }) => {
@@ -5500,8 +5428,8 @@ var SpacesServiceImpl = class {
5500
5428
  log17("update", {
5501
5429
  spaces
5502
5430
  }, {
5503
- F: __dxlog_file20,
5504
- L: 115,
5431
+ F: __dxlog_file19,
5432
+ L: 111,
5505
5433
  S: this,
5506
5434
  C: (f, a) => f(...a)
5507
5435
  });
@@ -5592,8 +5520,8 @@ var SpacesServiceImpl = class {
5592
5520
  });
5593
5521
  } else {
5594
5522
  invariant15(!credential.id, "Id on unsigned credentials is not allowed", {
5595
- F: __dxlog_file20,
5596
- L: 213,
5523
+ F: __dxlog_file19,
5524
+ L: 209,
5597
5525
  S: this,
5598
5526
  A: [
5599
5527
  "!credential.id",
@@ -5601,8 +5529,8 @@ var SpacesServiceImpl = class {
5601
5529
  ]
5602
5530
  });
5603
5531
  invariant15(this._identityManager.identity, "Identity is not available", {
5604
- F: __dxlog_file20,
5605
- L: 214,
5532
+ F: __dxlog_file19,
5533
+ L: 210,
5606
5534
  S: this,
5607
5535
  A: [
5608
5536
  "this._identityManager.identity",
@@ -5611,8 +5539,8 @@ var SpacesServiceImpl = class {
5611
5539
  });
5612
5540
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
5613
5541
  invariant15(credential.issuer.equals(signer.getIssuer()), void 0, {
5614
- F: __dxlog_file20,
5615
- L: 216,
5542
+ F: __dxlog_file19,
5543
+ L: 212,
5616
5544
  S: this,
5617
5545
  A: [
5618
5546
  "credential.issuer.equals(signer.getIssuer())",
@@ -5642,59 +5570,6 @@ var SpacesServiceImpl = class {
5642
5570
  epochCredential: credential ?? void 0
5643
5571
  };
5644
5572
  }
5645
- async admitContact(request) {
5646
- const dataSpaceManager = await this._getDataSpaceManager();
5647
- await dataSpaceManager.admitMember({
5648
- spaceKey: request.spaceKey,
5649
- identityKey: request.contact.identityKey,
5650
- role: request.role
5651
- });
5652
- }
5653
- async joinBySpaceKey({ spaceKey }) {
5654
- const dataSpaceManager = await this._getDataSpaceManager();
5655
- const credential = await dataSpaceManager.requestSpaceAdmissionCredential(spaceKey);
5656
- return this._joinByAdmission({
5657
- credential
5658
- });
5659
- }
5660
- async _joinByAdmission({ credential }) {
5661
- const assertion = getCredentialAssertion4(credential);
5662
- invariant15(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
5663
- F: __dxlog_file20,
5664
- L: 250,
5665
- S: this,
5666
- A: [
5667
- "assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
5668
- "'Invalid credential'"
5669
- ]
5670
- });
5671
- const myIdentity = this._identityManager.identity;
5672
- invariant15(myIdentity && credential.subject.id.equals(myIdentity.identityKey), void 0, {
5673
- F: __dxlog_file20,
5674
- L: 252,
5675
- S: this,
5676
- A: [
5677
- "myIdentity && credential.subject.id.equals(myIdentity.identityKey)",
5678
- ""
5679
- ]
5680
- });
5681
- const dataSpaceManager = await this._getDataSpaceManager();
5682
- let dataSpace = dataSpaceManager.spaces.get(assertion.spaceKey);
5683
- if (!dataSpace) {
5684
- dataSpace = await dataSpaceManager.acceptSpace({
5685
- spaceKey: assertion.spaceKey,
5686
- genesisFeedKey: assertion.genesisFeedKey
5687
- });
5688
- await myIdentity.controlPipeline.writer.write({
5689
- credential: {
5690
- credential
5691
- }
5692
- });
5693
- }
5694
- return {
5695
- space: this._serializeSpace(dataSpace)
5696
- };
5697
- }
5698
5573
  _serializeSpace(space) {
5699
5574
  return {
5700
5575
  id: space.id,
@@ -5782,7 +5657,7 @@ function _ts_decorate6(decorators, target, key, desc) {
5782
5657
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5783
5658
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5784
5659
  }
5785
- var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
5660
+ var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
5786
5661
  var ServiceContext = class extends Resource3 {
5787
5662
  constructor(storage, level, networkManager, signalManager, _runtimeParams) {
5788
5663
  super();
@@ -5826,7 +5701,7 @@ var ServiceContext = class extends Resource3 {
5826
5701
  async _open(ctx) {
5827
5702
  await this._checkStorageVersion();
5828
5703
  log18("opening...", void 0, {
5829
- F: __dxlog_file21,
5704
+ F: __dxlog_file20,
5830
5705
  L: 149,
5831
5706
  S: this,
5832
5707
  C: (f, a) => f(...a)
@@ -5834,7 +5709,7 @@ var ServiceContext = class extends Resource3 {
5834
5709
  log18.trace("dxos.sdk.service-context.open", trace9.begin({
5835
5710
  id: this._instanceId
5836
5711
  }), {
5837
- F: __dxlog_file21,
5712
+ F: __dxlog_file20,
5838
5713
  L: 150,
5839
5714
  S: this,
5840
5715
  C: (f, a) => f(...a)
@@ -5852,7 +5727,7 @@ var ServiceContext = class extends Resource3 {
5852
5727
  log18("loaded persistent invitations", {
5853
5728
  count: loadedInvitations.invitations?.length
5854
5729
  }, {
5855
- F: __dxlog_file21,
5730
+ F: __dxlog_file20,
5856
5731
  L: 163,
5857
5732
  S: this,
5858
5733
  C: (f, a) => f(...a)
@@ -5860,13 +5735,13 @@ var ServiceContext = class extends Resource3 {
5860
5735
  log18.trace("dxos.sdk.service-context.open", trace9.end({
5861
5736
  id: this._instanceId
5862
5737
  }), {
5863
- F: __dxlog_file21,
5738
+ F: __dxlog_file20,
5864
5739
  L: 165,
5865
5740
  S: this,
5866
5741
  C: (f, a) => f(...a)
5867
5742
  });
5868
5743
  log18("opened", void 0, {
5869
- F: __dxlog_file21,
5744
+ F: __dxlog_file20,
5870
5745
  L: 166,
5871
5746
  S: this,
5872
5747
  C: (f, a) => f(...a)
@@ -5874,7 +5749,7 @@ var ServiceContext = class extends Resource3 {
5874
5749
  }
5875
5750
  async _close(ctx) {
5876
5751
  log18("closing...", void 0, {
5877
- F: __dxlog_file21,
5752
+ F: __dxlog_file20,
5878
5753
  L: 170,
5879
5754
  S: this,
5880
5755
  C: (f, a) => f(...a)
@@ -5891,7 +5766,7 @@ var ServiceContext = class extends Resource3 {
5891
5766
  await this.networkManager.close();
5892
5767
  await this.signalManager.close();
5893
5768
  log18("closed", void 0, {
5894
- F: __dxlog_file21,
5769
+ F: __dxlog_file20,
5895
5770
  L: 182,
5896
5771
  S: this,
5897
5772
  C: (f, a) => f(...a)
@@ -5899,16 +5774,13 @@ var ServiceContext = class extends Resource3 {
5899
5774
  }
5900
5775
  async createIdentity(params = {}) {
5901
5776
  const identity = await this.identityManager.createIdentity(params);
5902
- await this._initialize(new Context10(void 0, {
5903
- F: __dxlog_file21,
5904
- L: 187
5905
- }));
5777
+ await this._initialize(new Context10());
5906
5778
  return identity;
5907
5779
  }
5908
5780
  getInvitationHandler(invitation) {
5909
5781
  const factory = this._handlerFactories.get(invitation.kind);
5910
5782
  invariant16(factory, `Unknown invitation kind: ${invitation.kind}`, {
5911
- F: __dxlog_file21,
5783
+ F: __dxlog_file20,
5912
5784
  L: 193,
5913
5785
  S: this,
5914
5786
  A: [
@@ -5928,10 +5800,7 @@ var ServiceContext = class extends Resource3 {
5928
5800
  }
5929
5801
  async _acceptIdentity(params) {
5930
5802
  const identity = await this.identityManager.acceptIdentity(params);
5931
- await this._initialize(new Context10(void 0, {
5932
- F: __dxlog_file21,
5933
- L: 209
5934
- }));
5803
+ await this._initialize(new Context10());
5935
5804
  return identity;
5936
5805
  }
5937
5806
  async _checkStorageVersion() {
@@ -5943,7 +5812,7 @@ var ServiceContext = class extends Resource3 {
5943
5812
  // Called when identity is created.
5944
5813
  async _initialize(ctx) {
5945
5814
  log18("initializing spaces...", void 0, {
5946
- F: __dxlog_file21,
5815
+ F: __dxlog_file20,
5947
5816
  L: 224,
5948
5817
  S: this,
5949
5818
  C: (f, a) => f(...a)
@@ -5966,7 +5835,7 @@ var ServiceContext = class extends Resource3 {
5966
5835
  await this.dataSpaceManager.open();
5967
5836
  this._handlerFactories.set(Invitation8.Kind.SPACE, (invitation) => {
5968
5837
  invariant16(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
5969
- F: __dxlog_file21,
5838
+ F: __dxlog_file20,
5970
5839
  L: 249,
5971
5840
  S: this,
5972
5841
  A: [
@@ -5990,7 +5859,7 @@ var ServiceContext = class extends Resource3 {
5990
5859
  log18("dataSpaceManager not initialized yet, ignoring space admission", {
5991
5860
  details: assertion
5992
5861
  }, {
5993
- F: __dxlog_file21,
5862
+ F: __dxlog_file20,
5994
5863
  L: 265,
5995
5864
  S: this,
5996
5865
  C: (f, a) => f(...a)
@@ -6001,7 +5870,7 @@ var ServiceContext = class extends Resource3 {
6001
5870
  log18("space already exists, ignoring space admission", {
6002
5871
  details: assertion
6003
5872
  }, {
6004
- F: __dxlog_file21,
5873
+ F: __dxlog_file20,
6005
5874
  L: 269,
6006
5875
  S: this,
6007
5876
  C: (f, a) => f(...a)
@@ -6012,7 +5881,7 @@ var ServiceContext = class extends Resource3 {
6012
5881
  log18("accepting space recorded in halo", {
6013
5882
  details: assertion
6014
5883
  }, {
6015
- F: __dxlog_file21,
5884
+ F: __dxlog_file20,
6016
5885
  L: 274,
6017
5886
  S: this,
6018
5887
  C: (f, a) => f(...a)
@@ -6023,7 +5892,7 @@ var ServiceContext = class extends Resource3 {
6023
5892
  });
6024
5893
  } catch (err) {
6025
5894
  log18.catch(err, void 0, {
6026
- F: __dxlog_file21,
5895
+ F: __dxlog_file20,
6027
5896
  L: 280,
6028
5897
  S: this,
6029
5898
  C: (f, a) => f(...a)
@@ -6083,7 +5952,7 @@ function _ts_decorate7(decorators, target, key, desc) {
6083
5952
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6084
5953
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6085
5954
  }
6086
- var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
5955
+ var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
6087
5956
  var Message;
6088
5957
  (function(Message2) {
6089
5958
  Message2["ACQUIRING"] = "acquiring";
@@ -6106,28 +5975,28 @@ var Lock = class {
6106
5975
  });
6107
5976
  try {
6108
5977
  log19("aquiring lock...", void 0, {
6109
- F: __dxlog_file22,
5978
+ F: __dxlog_file21,
6110
5979
  L: 42,
6111
5980
  S: this,
6112
5981
  C: (f, a) => f(...a)
6113
5982
  });
6114
5983
  await asyncTimeout3(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
6115
5984
  log19("acquired lock", void 0, {
6116
- F: __dxlog_file22,
5985
+ F: __dxlog_file21,
6117
5986
  L: 44,
6118
5987
  S: this,
6119
5988
  C: (f, a) => f(...a)
6120
5989
  });
6121
5990
  } catch {
6122
5991
  log19("stealing lock...", void 0, {
6123
- F: __dxlog_file22,
5992
+ F: __dxlog_file21,
6124
5993
  L: 46,
6125
5994
  S: this,
6126
5995
  C: (f, a) => f(...a)
6127
5996
  });
6128
5997
  await this._requestLock(true);
6129
5998
  log19("stolen lock", void 0, {
6130
- F: __dxlog_file22,
5999
+ F: __dxlog_file21,
6131
6000
  L: 48,
6132
6001
  S: this,
6133
6002
  C: (f, a) => f(...a)
@@ -6146,7 +6015,7 @@ var Lock = class {
6146
6015
  log19("requesting lock...", {
6147
6016
  steal
6148
6017
  }, {
6149
- F: __dxlog_file22,
6018
+ F: __dxlog_file21,
6150
6019
  L: 63,
6151
6020
  S: this,
6152
6021
  C: (f, a) => f(...a)
@@ -6160,14 +6029,14 @@ var Lock = class {
6160
6029
  this._releaseTrigger = new Trigger9();
6161
6030
  await this._releaseTrigger.wait();
6162
6031
  log19("releasing lock...", void 0, {
6163
- F: __dxlog_file22,
6032
+ F: __dxlog_file21,
6164
6033
  L: 72,
6165
6034
  S: this,
6166
6035
  C: (f, a) => f(...a)
6167
6036
  });
6168
6037
  await this._onRelease?.();
6169
6038
  log19("released lock", void 0, {
6170
- F: __dxlog_file22,
6039
+ F: __dxlog_file21,
6171
6040
  L: 74,
6172
6041
  S: this,
6173
6042
  C: (f, a) => f(...a)
@@ -6179,7 +6048,7 @@ var Lock = class {
6179
6048
  log19("recieved lock", {
6180
6049
  steal
6181
6050
  }, {
6182
- F: __dxlog_file22,
6051
+ F: __dxlog_file21,
6183
6052
  L: 81,
6184
6053
  S: this,
6185
6054
  C: (f, a) => f(...a)
@@ -6267,151 +6136,13 @@ var createLevel = async (config) => {
6267
6136
  return level;
6268
6137
  };
6269
6138
 
6270
- // packages/sdk/client-services/src/packlets/storage/profile-archive.ts
6271
- import { cbor } from "@dxos/automerge/automerge-repo";
6272
- import { invariant as invariant17 } from "@dxos/invariant";
6273
- import { log as log20 } from "@dxos/log";
6274
- import { ProfileArchiveEntryType } from "@dxos/protocols";
6275
- import { arrayToBuffer } from "@dxos/util";
6276
- var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/storage/profile-archive.ts";
6277
- var encodeProfileArchive = (profile) => cbor.encode(profile);
6278
- var decodeProfileArchive = (data) => cbor.decode(data);
6279
- var exportProfileData = async ({ storage, level }) => {
6280
- const archive = {
6281
- storage: [],
6282
- meta: {
6283
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
6284
- }
6285
- };
6286
- {
6287
- const directory = await storage.createDirectory();
6288
- const files = await directory.list();
6289
- log20.info("begin exporting files", {
6290
- count: files.length
6291
- }, {
6292
- F: __dxlog_file23,
6293
- L: 30,
6294
- S: void 0,
6295
- C: (f, a) => f(...a)
6296
- });
6297
- for (const filename of files) {
6298
- const file = await directory.getOrCreateFile(filename);
6299
- const { size } = await file.stat();
6300
- const data = await file.read(0, size);
6301
- archive.storage.push({
6302
- type: ProfileArchiveEntryType.FILE,
6303
- key: filename,
6304
- value: data
6305
- });
6306
- }
6307
- log20.info("done exporting files", {
6308
- count: files.length
6309
- }, {
6310
- F: __dxlog_file23,
6311
- L: 41,
6312
- S: void 0,
6313
- C: (f, a) => f(...a)
6314
- });
6315
- }
6316
- {
6317
- log20.info("begin exporting kv pairs", void 0, {
6318
- F: __dxlog_file23,
6319
- L: 45,
6320
- S: void 0,
6321
- C: (f, a) => f(...a)
6322
- });
6323
- const iter = await level.iterator({
6324
- keyEncoding: "binary",
6325
- valueEncoding: "binary"
6326
- });
6327
- let count = 0;
6328
- for await (const [key, value] of iter) {
6329
- archive.storage.push({
6330
- type: ProfileArchiveEntryType.KEY_VALUE,
6331
- key,
6332
- value
6333
- });
6334
- count++;
6335
- }
6336
- log20.info("done exporting kv pairs", {
6337
- count
6338
- }, {
6339
- F: __dxlog_file23,
6340
- L: 56,
6341
- S: void 0,
6342
- C: (f, a) => f(...a)
6343
- });
6344
- }
6345
- return archive;
6346
- };
6347
- var importProfileData = async ({ storage, level }, archive) => {
6348
- const batch = level.batch();
6349
- for (const entry2 of archive.storage) {
6350
- switch (entry2.type) {
6351
- case ProfileArchiveEntryType.FILE: {
6352
- const directory = await storage.createDirectory();
6353
- invariant17(typeof entry2.key === "string", "Invalid key type", {
6354
- F: __dxlog_file23,
6355
- L: 78,
6356
- S: void 0,
6357
- A: [
6358
- "typeof entry.key === 'string'",
6359
- "'Invalid key type'"
6360
- ]
6361
- });
6362
- const file = await directory.getOrCreateFile(entry2.key);
6363
- invariant17(entry2.value instanceof Uint8Array, "Invalid value type", {
6364
- F: __dxlog_file23,
6365
- L: 80,
6366
- S: void 0,
6367
- A: [
6368
- "entry.value instanceof Uint8Array",
6369
- "'Invalid value type'"
6370
- ]
6371
- });
6372
- await file.write(0, arrayToBuffer(entry2.value));
6373
- await file.close();
6374
- break;
6375
- }
6376
- case ProfileArchiveEntryType.KEY_VALUE: {
6377
- invariant17(entry2.key instanceof Uint8Array, "Invalid key type", {
6378
- F: __dxlog_file23,
6379
- L: 86,
6380
- S: void 0,
6381
- A: [
6382
- "entry.key instanceof Uint8Array",
6383
- "'Invalid key type'"
6384
- ]
6385
- });
6386
- invariant17(entry2.value instanceof Uint8Array, "Invalid value type", {
6387
- F: __dxlog_file23,
6388
- L: 87,
6389
- S: void 0,
6390
- A: [
6391
- "entry.value instanceof Uint8Array",
6392
- "'Invalid value type'"
6393
- ]
6394
- });
6395
- batch.put(entry2.key, entry2.value, {
6396
- keyEncoding: "binary",
6397
- valueEncoding: "binary"
6398
- });
6399
- break;
6400
- }
6401
- default:
6402
- throw new Error(`Invalid entry type: ${entry2.type}`);
6403
- }
6404
- }
6405
- await batch.write();
6406
- };
6407
-
6408
6139
  // packages/sdk/client-services/src/packlets/services/service-host.ts
6409
6140
  import { Event as Event9, synchronized as synchronized3 } from "@dxos/async";
6410
6141
  import { clientServiceBundle } from "@dxos/client-protocol";
6411
6142
  import { Context as Context11 } from "@dxos/context";
6412
- import { invariant as invariant19 } from "@dxos/invariant";
6413
- import { PublicKey as PublicKey17 } from "@dxos/keys";
6414
- import { log as log22 } from "@dxos/log";
6143
+ import { invariant as invariant18 } from "@dxos/invariant";
6144
+ import { PublicKey as PublicKey16 } from "@dxos/keys";
6145
+ import { log as log21 } from "@dxos/log";
6415
6146
  import { WebsocketSignalManager } from "@dxos/messaging";
6416
6147
  import { SwarmNetworkManager, createSimplePeerTransportFactory } from "@dxos/network-manager";
6417
6148
  import { trace as trace10 } from "@dxos/protocols";
@@ -6422,9 +6153,9 @@ import { WebsocketRpcClient } from "@dxos/websocket-rpc";
6422
6153
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
6423
6154
  import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
6424
6155
  import { Stream as Stream11 } from "@dxos/codec-protobuf";
6425
- import { invariant as invariant18 } from "@dxos/invariant";
6156
+ import { invariant as invariant17 } from "@dxos/invariant";
6426
6157
  import { Device as Device2, DeviceKind as DeviceKind2 } from "@dxos/protocols/proto/dxos/client/services";
6427
- var __dxlog_file24 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6158
+ var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6428
6159
  var DevicesServiceImpl = class {
6429
6160
  constructor(_identityManager) {
6430
6161
  this._identityManager = _identityManager;
@@ -6441,8 +6172,8 @@ var DevicesServiceImpl = class {
6441
6172
  devices: []
6442
6173
  });
6443
6174
  } else {
6444
- invariant18(this._identityManager.identity?.presence, "presence not present", {
6445
- F: __dxlog_file24,
6175
+ invariant17(this._identityManager.identity?.presence, "presence not present", {
6176
+ F: __dxlog_file22,
6446
6177
  L: 32,
6447
6178
  S: this,
6448
6179
  A: [
@@ -6548,111 +6279,28 @@ var findConfigs = () => {
6548
6279
  return configs.map((r) => r.instance.deref()).filter(nonNullable);
6549
6280
  };
6550
6281
 
6551
- // packages/sdk/client-services/src/packlets/identity/contacts-service.ts
6552
- import { EventSubscriptions as EventSubscriptions4, scheduleTask as scheduleTask7, UpdateScheduler as UpdateScheduler2 } from "@dxos/async";
6553
- import { Stream as Stream12 } from "@dxos/codec-protobuf";
6554
- import { PublicKey as PublicKey15 } from "@dxos/keys";
6555
- import { ComplexMap as ComplexMap4, ComplexSet as ComplexSet6 } from "@dxos/util";
6556
- var ContactsServiceImpl = class {
6557
- constructor(_identityManager, _spaceManager, _dataSpaceManagerProvider) {
6558
- this._identityManager = _identityManager;
6559
- this._spaceManager = _spaceManager;
6560
- this._dataSpaceManagerProvider = _dataSpaceManagerProvider;
6561
- }
6562
- async getContacts() {
6563
- const identity = this._identityManager.identity;
6564
- if (identity == null) {
6565
- return {
6566
- contacts: []
6567
- };
6568
- }
6569
- const contacts = [
6570
- ...this._spaceManager.spaces.values()
6571
- ].flatMap((s) => [
6572
- ...s.spaceState.members.values()
6573
- ].map((m) => [
6574
- s.key,
6575
- m
6576
- ])).reduce((acc, v) => {
6577
- const [spaceKey, memberInfo] = v;
6578
- if (memberInfo.key.equals(identity.identityKey)) {
6579
- return acc;
6580
- }
6581
- const existing = acc.get(memberInfo.key);
6582
- if (existing != null) {
6583
- existing.profile ??= memberInfo.profile;
6584
- existing.commonSpaces?.push(spaceKey);
6585
- } else {
6586
- acc.set(memberInfo.key, {
6587
- identityKey: memberInfo.key,
6588
- profile: memberInfo.profile,
6589
- commonSpaces: [
6590
- spaceKey
6591
- ]
6592
- });
6593
- }
6594
- return acc;
6595
- }, new ComplexMap4(PublicKey15.hash));
6596
- return {
6597
- contacts: [
6598
- ...contacts.values()
6599
- ]
6600
- };
6601
- }
6602
- queryContacts() {
6603
- const subscribedSpaceKeySet = new ComplexSet6(PublicKey15.hash);
6604
- return new Stream12(({ next, ctx }) => {
6605
- const pushUpdateTask = new UpdateScheduler2(ctx, async () => {
6606
- const contacts = await this.getContacts();
6607
- next(contacts);
6608
- }, {
6609
- maxFrequency: 2
6610
- });
6611
- scheduleTask7(ctx, async () => {
6612
- const subscriptions = new EventSubscriptions4();
6613
- ctx.onDispose(() => subscriptions.clear());
6614
- const subscribeToSpaceAndUpdate = () => {
6615
- const oldSetSize = subscribedSpaceKeySet.size;
6616
- for (const space of this._spaceManager.spaces.values()) {
6617
- if (!subscribedSpaceKeySet.has(space.key)) {
6618
- subscriptions.add(space.stateUpdate.on(ctx, () => pushUpdateTask.trigger()));
6619
- subscribedSpaceKeySet.add(space.key);
6620
- }
6621
- }
6622
- if (oldSetSize !== subscribedSpaceKeySet.size) {
6623
- pushUpdateTask.trigger();
6624
- }
6625
- };
6626
- const unsubscribe = (await this._dataSpaceManagerProvider()).updated.on(ctx, subscribeToSpaceAndUpdate);
6627
- ctx.onDispose(unsubscribe);
6628
- subscribeToSpaceAndUpdate();
6629
- });
6630
- });
6631
- }
6632
- };
6633
-
6634
6282
  // packages/sdk/client-services/src/packlets/logging/logging-service.ts
6635
6283
  import { Event as Event8 } from "@dxos/async";
6636
- import { Stream as Stream13 } from "@dxos/codec-protobuf";
6637
- import { PublicKey as PublicKey16 } from "@dxos/keys";
6638
- import { getContextFromEntry, log as log21 } from "@dxos/log";
6284
+ import { Stream as Stream12 } from "@dxos/codec-protobuf";
6285
+ import { PublicKey as PublicKey15 } from "@dxos/keys";
6286
+ import { getContextFromEntry, log as log20 } from "@dxos/log";
6639
6287
  import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
6640
6288
  import { getDebugName, jsonify, numericalValues, tracer } from "@dxos/util";
6641
6289
  var LoggingServiceImpl = class {
6642
6290
  constructor() {
6643
6291
  this._logs = new Event8();
6644
6292
  this._started = Date.now();
6645
- this._sessionId = PublicKey16.random().toHex();
6293
+ this._sessionId = PublicKey15.random().toHex();
6646
6294
  this._logProcessor = (_config, entry2) => {
6647
6295
  this._logs.emit(entry2);
6648
6296
  };
6649
6297
  }
6650
6298
  async open() {
6651
- log21.runtimeConfig.processors.push(this._logProcessor);
6299
+ log20.runtimeConfig.processors.push(this._logProcessor);
6652
6300
  }
6653
6301
  async close() {
6654
- const index = log21.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
6655
- log21.runtimeConfig.processors.splice(index, 1);
6302
+ const index = log20.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
6303
+ log20.runtimeConfig.processors.splice(index, 1);
6656
6304
  }
6657
6305
  async controlMetrics({ reset, record }) {
6658
6306
  if (reset) {
@@ -6678,7 +6326,7 @@ var LoggingServiceImpl = class {
6678
6326
  stats: numericalValues(events, "duration")
6679
6327
  };
6680
6328
  };
6681
- return new Stream13(({ next }) => {
6329
+ return new Stream12(({ next }) => {
6682
6330
  const update = () => {
6683
6331
  const metrics = {
6684
6332
  timestamp: /* @__PURE__ */ new Date(),
@@ -6700,7 +6348,7 @@ var LoggingServiceImpl = class {
6700
6348
  });
6701
6349
  }
6702
6350
  queryLogs(request) {
6703
- return new Stream13(({ ctx, next }) => {
6351
+ return new Stream12(({ ctx, next }) => {
6704
6352
  const handler = (entry2) => {
6705
6353
  if (LOG_PROCESSING > 0) {
6706
6354
  return;
@@ -6756,14 +6404,14 @@ var shouldLog = (entry2, request) => {
6756
6404
  var LOG_PROCESSING = 0;
6757
6405
 
6758
6406
  // packages/sdk/client-services/src/packlets/network/network-service.ts
6759
- import { Stream as Stream14 } from "@dxos/codec-protobuf";
6407
+ import { Stream as Stream13 } from "@dxos/codec-protobuf";
6760
6408
  var NetworkServiceImpl = class {
6761
6409
  constructor(networkManager, signalManager) {
6762
6410
  this.networkManager = networkManager;
6763
6411
  this.signalManager = signalManager;
6764
6412
  }
6765
6413
  queryStatus() {
6766
- return new Stream14(({ next }) => {
6414
+ return new Stream13(({ next }) => {
6767
6415
  const update = () => {
6768
6416
  next({
6769
6417
  swarm: this.networkManager.connectionState,
@@ -6789,7 +6437,7 @@ var NetworkServiceImpl = class {
6789
6437
  };
6790
6438
 
6791
6439
  // packages/sdk/client-services/src/packlets/system/system-service.ts
6792
- import { Stream as Stream15 } from "@dxos/codec-protobuf";
6440
+ import { Stream as Stream14 } from "@dxos/codec-protobuf";
6793
6441
  import { GetDiagnosticsRequest as GetDiagnosticsRequest2 } from "@dxos/protocols/proto/dxos/client/services";
6794
6442
  import { jsonKeyReplacer as jsonKeyReplacer2 } from "@dxos/util";
6795
6443
  var SystemServiceImpl = class {
@@ -6825,7 +6473,7 @@ var SystemServiceImpl = class {
6825
6473
  }
6826
6474
  // TODO(burdon): Standardize interval option in stream request?
6827
6475
  queryStatus({ interval = 3e3 } = {}) {
6828
- return new Stream15(({ next }) => {
6476
+ return new Stream14(({ next }) => {
6829
6477
  const update = () => {
6830
6478
  next({
6831
6479
  status: this._getCurrentStatus()
@@ -6856,7 +6504,7 @@ function _ts_decorate8(decorators, target, key, desc) {
6856
6504
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6857
6505
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6858
6506
  }
6859
- var __dxlog_file25 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
6507
+ var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
6860
6508
  var ClientServicesHost = class {
6861
6509
  constructor({
6862
6510
  config,
@@ -6889,10 +6537,7 @@ var ClientServicesHost = class {
6889
6537
  lockKey,
6890
6538
  onAcquire: () => {
6891
6539
  if (!this._opening) {
6892
- void this.open(new Context11(void 0, {
6893
- F: __dxlog_file25,
6894
- L: 121
6895
- }));
6540
+ void this.open(new Context11());
6896
6541
  }
6897
6542
  },
6898
6543
  onRelease: () => this.close()
@@ -6947,25 +6592,25 @@ var ClientServicesHost = class {
6947
6592
  * Can only be called once.
6948
6593
  */
6949
6594
  initialize({ config, ...options }) {
6950
- invariant19(!this._open, "service host is open", {
6951
- F: __dxlog_file25,
6952
- L: 187,
6595
+ invariant18(!this._open, "service host is open", {
6596
+ F: __dxlog_file23,
6597
+ L: 186,
6953
6598
  S: this,
6954
6599
  A: [
6955
6600
  "!this._open",
6956
6601
  "'service host is open'"
6957
6602
  ]
6958
6603
  });
6959
- log22("initializing...", void 0, {
6960
- F: __dxlog_file25,
6961
- L: 188,
6604
+ log21("initializing...", void 0, {
6605
+ F: __dxlog_file23,
6606
+ L: 187,
6962
6607
  S: this,
6963
6608
  C: (f, a) => f(...a)
6964
6609
  });
6965
6610
  if (config) {
6966
- invariant19(!this._config, "config already set", {
6967
- F: __dxlog_file25,
6968
- L: 191,
6611
+ invariant18(!this._config, "config already set", {
6612
+ F: __dxlog_file23,
6613
+ L: 190,
6969
6614
  S: this,
6970
6615
  A: [
6971
6616
  "!this._config",
@@ -6978,9 +6623,9 @@ var ClientServicesHost = class {
6978
6623
  }
6979
6624
  }
6980
6625
  if (!options.signalManager) {
6981
- log22.warn("running signaling without telemetry metadata.", void 0, {
6982
- F: __dxlog_file25,
6983
- L: 199,
6626
+ log21.warn("running signaling without telemetry metadata.", void 0, {
6627
+ F: __dxlog_file23,
6628
+ L: 198,
6984
6629
  S: this,
6985
6630
  C: (f, a) => f(...a)
6986
6631
  });
@@ -6989,9 +6634,9 @@ var ClientServicesHost = class {
6989
6634
  iceServers: this._config?.get("runtime.services.ice")
6990
6635
  }), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
6991
6636
  this._signalManager = signalManager;
6992
- invariant19(!this._networkManager, "network manager already set", {
6993
- F: __dxlog_file25,
6994
- L: 210,
6637
+ invariant18(!this._networkManager, "network manager already set", {
6638
+ F: __dxlog_file23,
6639
+ L: 209,
6995
6640
  S: this,
6996
6641
  A: [
6997
6642
  "!this._networkManager",
@@ -7003,9 +6648,9 @@ var ClientServicesHost = class {
7003
6648
  transportFactory,
7004
6649
  signalManager
7005
6650
  });
7006
- log22("initialized", void 0, {
7007
- F: __dxlog_file25,
7008
- L: 217,
6651
+ log21("initialized", void 0, {
6652
+ F: __dxlog_file23,
6653
+ L: 216,
7009
6654
  S: this,
7010
6655
  C: (f, a) => f(...a)
7011
6656
  });
@@ -7014,45 +6659,45 @@ var ClientServicesHost = class {
7014
6659
  if (this._open) {
7015
6660
  return;
7016
6661
  }
7017
- const traceId = PublicKey17.random().toHex();
7018
- log22.trace("dxos.client-services.host.open", trace10.begin({
6662
+ const traceId = PublicKey16.random().toHex();
6663
+ log21.trace("dxos.client-services.host.open", trace10.begin({
7019
6664
  id: traceId
7020
6665
  }), {
7021
- F: __dxlog_file25,
7022
- L: 228,
6666
+ F: __dxlog_file23,
6667
+ L: 227,
7023
6668
  S: this,
7024
6669
  C: (f, a) => f(...a)
7025
6670
  });
7026
- invariant19(this._config, "config not set", {
7027
- F: __dxlog_file25,
7028
- L: 230,
6671
+ invariant18(this._config, "config not set", {
6672
+ F: __dxlog_file23,
6673
+ L: 229,
7029
6674
  S: this,
7030
6675
  A: [
7031
6676
  "this._config",
7032
6677
  "'config not set'"
7033
6678
  ]
7034
6679
  });
7035
- invariant19(this._storage, "storage not set", {
7036
- F: __dxlog_file25,
7037
- L: 231,
6680
+ invariant18(this._storage, "storage not set", {
6681
+ F: __dxlog_file23,
6682
+ L: 230,
7038
6683
  S: this,
7039
6684
  A: [
7040
6685
  "this._storage",
7041
6686
  "'storage not set'"
7042
6687
  ]
7043
6688
  });
7044
- invariant19(this._signalManager, "signal manager not set", {
7045
- F: __dxlog_file25,
7046
- L: 232,
6689
+ invariant18(this._signalManager, "signal manager not set", {
6690
+ F: __dxlog_file23,
6691
+ L: 231,
7047
6692
  S: this,
7048
6693
  A: [
7049
6694
  "this._signalManager",
7050
6695
  "'signal manager not set'"
7051
6696
  ]
7052
6697
  });
7053
- invariant19(this._networkManager, "network manager not set", {
7054
- F: __dxlog_file25,
7055
- L: 233,
6698
+ invariant18(this._networkManager, "network manager not set", {
6699
+ F: __dxlog_file23,
6700
+ L: 232,
7056
6701
  S: this,
7057
6702
  A: [
7058
6703
  "this._networkManager",
@@ -7060,11 +6705,11 @@ var ClientServicesHost = class {
7060
6705
  ]
7061
6706
  });
7062
6707
  this._opening = true;
7063
- log22("opening...", {
6708
+ log21("opening...", {
7064
6709
  lockKey: this._resourceLock?.lockKey
7065
6710
  }, {
7066
- F: __dxlog_file25,
7067
- L: 236,
6711
+ F: __dxlog_file23,
6712
+ L: 235,
7068
6713
  S: this,
7069
6714
  C: (f, a) => f(...a)
7070
6715
  });
@@ -7075,18 +6720,16 @@ var ClientServicesHost = class {
7075
6720
  await this._level.open();
7076
6721
  await this._loggingService.open();
7077
6722
  this._serviceContext = new ServiceContext(this._storage, this._level, this._networkManager, this._signalManager, this._runtimeParams);
7078
- const dataSpaceManagerProvider = async () => {
7079
- await this._serviceContext.initialized.wait();
7080
- return this._serviceContext.dataSpaceManager;
7081
- };
7082
6723
  const identityService = new IdentityServiceImpl(this._serviceContext.identityManager, this._serviceContext.keyring, () => this._serviceContext.dataSpaceManager, (params) => this._createIdentity(params), (profile) => this._serviceContext.broadcastProfileUpdate(profile));
7083
6724
  this._serviceRegistry.setServices({
7084
6725
  SystemService: this._systemService,
7085
6726
  IdentityService: identityService,
7086
- ContactsService: new ContactsServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, dataSpaceManagerProvider),
7087
6727
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitationsManager),
7088
6728
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
7089
- SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, dataSpaceManagerProvider),
6729
+ SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, async () => {
6730
+ await this._serviceContext.initialized.wait();
6731
+ return this._serviceContext.dataSpaceManager;
6732
+ }),
7090
6733
  DataService: this._serviceContext.echoHost.dataService,
7091
6734
  QueryService: this._serviceContext.echoHost.queryService,
7092
6735
  NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
@@ -7116,19 +6759,19 @@ var ClientServicesHost = class {
7116
6759
  this._open = true;
7117
6760
  this._statusUpdate.emit();
7118
6761
  const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
7119
- log22("opened", {
6762
+ log21("opened", {
7120
6763
  deviceKey
7121
6764
  }, {
7122
- F: __dxlog_file25,
7123
- L: 322,
6765
+ F: __dxlog_file23,
6766
+ L: 314,
7124
6767
  S: this,
7125
6768
  C: (f, a) => f(...a)
7126
6769
  });
7127
- log22.trace("dxos.client-services.host.open", trace10.end({
6770
+ log21.trace("dxos.client-services.host.open", trace10.end({
7128
6771
  id: traceId
7129
6772
  }), {
7130
- F: __dxlog_file25,
7131
- L: 323,
6773
+ F: __dxlog_file23,
6774
+ L: 315,
7132
6775
  S: this,
7133
6776
  C: (f, a) => f(...a)
7134
6777
  });
@@ -7138,11 +6781,11 @@ var ClientServicesHost = class {
7138
6781
  return;
7139
6782
  }
7140
6783
  const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
7141
- log22("closing...", {
6784
+ log21("closing...", {
7142
6785
  deviceKey
7143
6786
  }, {
7144
- F: __dxlog_file25,
7145
- L: 334,
6787
+ F: __dxlog_file23,
6788
+ L: 326,
7146
6789
  S: this,
7147
6790
  C: (f, a) => f(...a)
7148
6791
  });
@@ -7156,44 +6799,44 @@ var ClientServicesHost = class {
7156
6799
  await this._level?.close();
7157
6800
  this._open = false;
7158
6801
  this._statusUpdate.emit();
7159
- log22("closed", {
6802
+ log21("closed", {
7160
6803
  deviceKey
7161
6804
  }, {
7162
- F: __dxlog_file25,
7163
- L: 343,
6805
+ F: __dxlog_file23,
6806
+ L: 335,
7164
6807
  S: this,
7165
6808
  C: (f, a) => f(...a)
7166
6809
  });
7167
6810
  }
7168
6811
  async reset() {
7169
- const traceId = PublicKey17.random().toHex();
7170
- log22.trace("dxos.sdk.client-services-host.reset", trace10.begin({
6812
+ const traceId = PublicKey16.random().toHex();
6813
+ log21.trace("dxos.sdk.client-services-host.reset", trace10.begin({
7171
6814
  id: traceId
7172
6815
  }), {
7173
- F: __dxlog_file25,
7174
- L: 348,
6816
+ F: __dxlog_file23,
6817
+ L: 340,
7175
6818
  S: this,
7176
6819
  C: (f, a) => f(...a)
7177
6820
  });
7178
- log22.info("resetting...", void 0, {
7179
- F: __dxlog_file25,
7180
- L: 350,
6821
+ log21.info("resetting...", void 0, {
6822
+ F: __dxlog_file23,
6823
+ L: 342,
7181
6824
  S: this,
7182
6825
  C: (f, a) => f(...a)
7183
6826
  });
7184
6827
  await this._serviceContext?.close();
7185
6828
  await this._storage.reset();
7186
- log22.info("reset", void 0, {
7187
- F: __dxlog_file25,
7188
- L: 353,
6829
+ log21.info("reset", void 0, {
6830
+ F: __dxlog_file23,
6831
+ L: 345,
7189
6832
  S: this,
7190
6833
  C: (f, a) => f(...a)
7191
6834
  });
7192
- log22.trace("dxos.sdk.client-services-host.reset", trace10.end({
6835
+ log21.trace("dxos.sdk.client-services-host.reset", trace10.end({
7193
6836
  id: traceId
7194
6837
  }), {
7195
- F: __dxlog_file25,
7196
- L: 354,
6838
+ F: __dxlog_file23,
6839
+ L: 346,
7197
6840
  S: this,
7198
6841
  C: (f, a) => f(...a)
7199
6842
  });
@@ -7259,12 +6902,8 @@ export {
7259
6902
  isLocked,
7260
6903
  createStorageObjects,
7261
6904
  createLevel,
7262
- encodeProfileArchive,
7263
- decodeProfileArchive,
7264
- exportProfileData,
7265
- importProfileData,
7266
6905
  ClientServicesHost,
7267
6906
  ClientServicesProviderResource,
7268
6907
  DiagnosticsCollector
7269
6908
  };
7270
- //# sourceMappingURL=chunk-W55ZOE2M.mjs.map
6909
+ //# sourceMappingURL=chunk-AHVKY45R.mjs.map