@dxos/client-services 0.5.9-main.51854a6 → 0.5.9-main.5282b05

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 (32) hide show
  1. package/dist/lib/browser/{chunk-LFGNDWPO.mjs → chunk-24JXJ6S3.mjs} +404 -610
  2. package/dist/lib/browser/chunk-24JXJ6S3.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +2 -5
  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-SSRPYM2G.cjs → chunk-CECVX7DV.cjs} +411 -615
  9. package/dist/lib/node/chunk-CECVX7DV.cjs.map +7 -0
  10. package/dist/lib/node/index.cjs +42 -45
  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/space-invitation-protocol.d.ts.map +1 -1
  16. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  17. package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -10
  18. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  19. package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -4
  20. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  21. package/dist/types/src/version.d.ts +1 -1
  22. package/package.json +36 -36
  23. package/src/packlets/invitations/space-invitation-protocol.ts +32 -11
  24. package/src/packlets/services/service-host.ts +4 -12
  25. package/src/packlets/spaces/data-space-manager.ts +2 -55
  26. package/src/packlets/spaces/spaces-service.ts +0 -38
  27. package/src/version.ts +1 -1
  28. package/dist/lib/browser/chunk-LFGNDWPO.mjs.map +0 -7
  29. package/dist/lib/node/chunk-SSRPYM2G.cjs.map +0 -7
  30. package/dist/types/src/packlets/identity/contacts-service.d.ts +0 -14
  31. package/dist/types/src/packlets/identity/contacts-service.d.ts.map +0 -1
  32. package/src/packlets/identity/contacts-service.ts +0 -85
@@ -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.51854a6";
358
+ var DXOS_VERSION = "0.5.9-main.5282b05";
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: [
@@ -2887,7 +2865,7 @@ var InvitationsHandler = class {
2887
2865
  newState: stateToString(newState),
2888
2866
  oldState: stateToString(invitation.state)
2889
2867
  }, {
2890
- F: __dxlog_file13,
2868
+ F: __dxlog_file12,
2891
2869
  L: 439,
2892
2870
  S: this,
2893
2871
  C: (f, a) => f(...a)
@@ -2898,7 +2876,7 @@ var InvitationsHandler = class {
2898
2876
  newState: stateToString(newState),
2899
2877
  oldState: stateToString(invitation.state)
2900
2878
  }, {
2901
- F: __dxlog_file13,
2879
+ F: __dxlog_file12,
2902
2880
  L: 445,
2903
2881
  S: this,
2904
2882
  C: (f, a) => f(...a)
@@ -2917,7 +2895,7 @@ var InvitationsHandler = class {
2917
2895
  async _handleGuestOtpAuth(extension, setState, authenticated, options) {
2918
2896
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
2919
2897
  log10("guest waiting for authentication code...", void 0, {
2920
- F: __dxlog_file13,
2898
+ F: __dxlog_file12,
2921
2899
  L: 470,
2922
2900
  S: this,
2923
2901
  C: (f, a) => f(...a)
@@ -2925,7 +2903,7 @@ var InvitationsHandler = class {
2925
2903
  setState(Invitation4.State.READY_FOR_AUTHENTICATION);
2926
2904
  const authCode = await authenticated.wait(options);
2927
2905
  log10("sending authentication request", void 0, {
2928
- F: __dxlog_file13,
2906
+ F: __dxlog_file12,
2929
2907
  L: 474,
2930
2908
  S: this,
2931
2909
  C: (f, a) => f(...a)
@@ -2944,7 +2922,7 @@ var InvitationsHandler = class {
2944
2922
  log10("retrying invalid code", {
2945
2923
  attempt
2946
2924
  }, {
2947
- F: __dxlog_file13,
2925
+ F: __dxlog_file12,
2948
2926
  L: 485,
2949
2927
  S: this,
2950
2928
  C: (f, a) => f(...a)
@@ -2962,7 +2940,7 @@ var InvitationsHandler = class {
2962
2940
  throw new Error("challenge missing in the introduction");
2963
2941
  }
2964
2942
  log10("sending authentication request", void 0, {
2965
- F: __dxlog_file13,
2943
+ F: __dxlog_file12,
2966
2944
  L: 504,
2967
2945
  S: this,
2968
2946
  C: (f, a) => f(...a)
@@ -3083,14 +3061,14 @@ var InvitationsServiceImpl = class {
3083
3061
  };
3084
3062
 
3085
3063
  // packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts
3086
- import { createCancelDelegatedSpaceInvitationCredential, createDelegatedSpaceInvitationCredential, getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
3064
+ import { createAdmissionCredentials, createCancelDelegatedSpaceInvitationCredential, createDelegatedSpaceInvitationCredential, getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
3087
3065
  import { writeMessages as writeMessages2 } from "@dxos/feed-store";
3088
3066
  import { invariant as invariant10 } from "@dxos/invariant";
3089
3067
  import { log as log11 } from "@dxos/log";
3090
3068
  import { AlreadyJoinedError as AlreadyJoinedError2, AuthorizationError, InvalidInvitationError, SpaceNotFoundError } from "@dxos/protocols";
3091
3069
  import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
3092
3070
  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";
3071
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
3094
3072
  var SpaceInvitationProtocol = class {
3095
3073
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
3096
3074
  this._spaceManager = _spaceManager;
@@ -3124,43 +3102,79 @@ var SpaceInvitationProtocol = class {
3124
3102
  };
3125
3103
  }
3126
3104
  async admit(invitation, request, guestProfile) {
3127
- invariant10(this._spaceKey && request.space, void 0, {
3128
- F: __dxlog_file14,
3129
- L: 74,
3105
+ invariant10(this._spaceKey, void 0, {
3106
+ F: __dxlog_file13,
3107
+ L: 76,
3130
3108
  S: this,
3131
3109
  A: [
3132
- "this._spaceKey && request.space",
3110
+ "this._spaceKey",
3133
3111
  ""
3134
3112
  ]
3135
3113
  });
3114
+ const space = this._spaceManager.spaces.get(this._spaceKey);
3115
+ invariant10(space, void 0, {
3116
+ F: __dxlog_file13,
3117
+ L: 78,
3118
+ S: this,
3119
+ A: [
3120
+ "space",
3121
+ ""
3122
+ ]
3123
+ });
3124
+ invariant10(request.space, void 0, {
3125
+ F: __dxlog_file13,
3126
+ L: 80,
3127
+ S: this,
3128
+ A: [
3129
+ "request.space",
3130
+ ""
3131
+ ]
3132
+ });
3133
+ const { identityKey, deviceKey } = request.space;
3134
+ if (space.inner.spaceState.getMemberRole(identityKey) !== SpaceMember2.Role.REMOVED) {
3135
+ throw new AlreadyJoinedError2();
3136
+ }
3136
3137
  log11("writing guest credentials", {
3137
3138
  host: this._signingContext.deviceKey,
3138
- guest: request.space.deviceKey
3139
+ guest: deviceKey
3139
3140
  }, {
3140
- F: __dxlog_file14,
3141
- L: 75,
3141
+ F: __dxlog_file13,
3142
+ L: 87,
3142
3143
  S: this,
3143
3144
  C: (f, a) => f(...a)
3144
3145
  });
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
3146
+ 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);
3147
+ invariant10(credentials[0].credential, void 0, {
3148
+ F: __dxlog_file13,
3149
+ L: 101,
3150
+ S: this,
3151
+ A: [
3152
+ "credentials[0].credential",
3153
+ ""
3154
+ ]
3151
3155
  });
3152
- const space = this._spaceManager.spaces.get(this._spaceKey);
3156
+ const spaceMemberCredential = credentials[0].credential.credential;
3157
+ invariant10(getCredentialAssertion2(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
3158
+ F: __dxlog_file13,
3159
+ L: 103,
3160
+ S: this,
3161
+ A: [
3162
+ "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
3163
+ ""
3164
+ ]
3165
+ });
3166
+ await writeMessages2(space.inner.controlPipeline.writer, credentials);
3153
3167
  return {
3154
3168
  space: {
3155
3169
  credential: spaceMemberCredential,
3156
- controlTimeframe: space?.inner.controlPipeline.state.timeframe
3170
+ controlTimeframe: space.inner.controlPipeline.state.timeframe
3157
3171
  }
3158
3172
  };
3159
3173
  }
3160
3174
  async delegate(invitation) {
3161
3175
  invariant10(this._spaceKey, void 0, {
3162
- F: __dxlog_file14,
3163
- L: 95,
3176
+ F: __dxlog_file13,
3177
+ L: 116,
3164
3178
  S: this,
3165
3179
  A: [
3166
3180
  "this._spaceKey",
@@ -3169,8 +3183,8 @@ var SpaceInvitationProtocol = class {
3169
3183
  });
3170
3184
  const space = this._spaceManager.spaces.get(this._spaceKey);
3171
3185
  invariant10(space, void 0, {
3172
- F: __dxlog_file14,
3173
- L: 97,
3186
+ F: __dxlog_file13,
3187
+ L: 118,
3174
3188
  S: this,
3175
3189
  A: [
3176
3190
  "space",
@@ -3179,8 +3193,8 @@ var SpaceInvitationProtocol = class {
3179
3193
  });
3180
3194
  if (invitation.authMethod === Invitation5.AuthMethod.KNOWN_PUBLIC_KEY) {
3181
3195
  invariant10(invitation.guestKeypair?.publicKey, void 0, {
3182
- F: __dxlog_file14,
3183
- L: 99,
3196
+ F: __dxlog_file13,
3197
+ L: 120,
3184
3198
  S: this,
3185
3199
  A: [
3186
3200
  "invitation.guestKeypair?.publicKey",
@@ -3192,8 +3206,8 @@ var SpaceInvitationProtocol = class {
3192
3206
  host: this._signingContext.deviceKey,
3193
3207
  id: invitation.invitationId
3194
3208
  }, {
3195
- F: __dxlog_file14,
3196
- L: 102,
3209
+ F: __dxlog_file13,
3210
+ L: 123,
3197
3211
  S: this,
3198
3212
  C: (f, a) => f(...a)
3199
3213
  });
@@ -3207,8 +3221,8 @@ var SpaceInvitationProtocol = class {
3207
3221
  guestKey: invitation.authMethod === Invitation5.AuthMethod.KNOWN_PUBLIC_KEY ? invitation.guestKeypair.publicKey : void 0
3208
3222
  });
3209
3223
  invariant10(credential.credential, void 0, {
3210
- F: __dxlog_file14,
3211
- L: 122,
3224
+ F: __dxlog_file13,
3225
+ L: 143,
3212
3226
  S: this,
3213
3227
  A: [
3214
3228
  "credential.credential",
@@ -3222,8 +3236,8 @@ var SpaceInvitationProtocol = class {
3222
3236
  }
3223
3237
  async cancelDelegation(invitation) {
3224
3238
  invariant10(this._spaceKey, void 0, {
3225
- F: __dxlog_file14,
3226
- L: 128,
3239
+ F: __dxlog_file13,
3240
+ L: 149,
3227
3241
  S: this,
3228
3242
  A: [
3229
3243
  "this._spaceKey",
@@ -3231,8 +3245,8 @@ var SpaceInvitationProtocol = class {
3231
3245
  ]
3232
3246
  });
3233
3247
  invariant10(invitation.type === Invitation5.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
3234
- F: __dxlog_file14,
3235
- L: 129,
3248
+ F: __dxlog_file13,
3249
+ L: 150,
3236
3250
  S: this,
3237
3251
  A: [
3238
3252
  "invitation.type === Invitation.Type.DELEGATED && invitation.delegationCredentialId",
@@ -3241,8 +3255,8 @@ var SpaceInvitationProtocol = class {
3241
3255
  });
3242
3256
  const space = this._spaceManager.spaces.get(this._spaceKey);
3243
3257
  invariant10(space, void 0, {
3244
- F: __dxlog_file14,
3245
- L: 131,
3258
+ F: __dxlog_file13,
3259
+ L: 152,
3246
3260
  S: this,
3247
3261
  A: [
3248
3262
  "space",
@@ -3253,15 +3267,15 @@ var SpaceInvitationProtocol = class {
3253
3267
  host: this._signingContext.deviceKey,
3254
3268
  id: invitation.invitationId
3255
3269
  }, {
3256
- F: __dxlog_file14,
3257
- L: 133,
3270
+ F: __dxlog_file13,
3271
+ L: 154,
3258
3272
  S: this,
3259
3273
  C: (f, a) => f(...a)
3260
3274
  });
3261
3275
  const credential = await createCancelDelegatedSpaceInvitationCredential(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
3262
3276
  invariant10(credential.credential, void 0, {
3263
- F: __dxlog_file14,
3264
- L: 140,
3277
+ F: __dxlog_file13,
3278
+ L: 161,
3265
3279
  S: this,
3266
3280
  A: [
3267
3281
  "credential.credential",
@@ -3299,8 +3313,8 @@ var SpaceInvitationProtocol = class {
3299
3313
  }
3300
3314
  async accept(response) {
3301
3315
  invariant10(response.space, void 0, {
3302
- F: __dxlog_file14,
3303
- L: 175,
3316
+ F: __dxlog_file13,
3317
+ L: 196,
3304
3318
  S: this,
3305
3319
  A: [
3306
3320
  "response.space",
@@ -3310,8 +3324,8 @@ var SpaceInvitationProtocol = class {
3310
3324
  const { credential, controlTimeframe, dataTimeframe } = response.space;
3311
3325
  const assertion = getCredentialAssertion2(credential);
3312
3326
  invariant10(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
3313
- F: __dxlog_file14,
3314
- L: 178,
3327
+ F: __dxlog_file13,
3328
+ L: 199,
3315
3329
  S: this,
3316
3330
  A: [
3317
3331
  "assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -3319,8 +3333,8 @@ var SpaceInvitationProtocol = class {
3319
3333
  ]
3320
3334
  });
3321
3335
  invariant10(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
3322
- F: __dxlog_file14,
3323
- L: 179,
3336
+ F: __dxlog_file13,
3337
+ L: 200,
3324
3338
  S: this,
3325
3339
  A: [
3326
3340
  "credential.subject.id.equals(this._signingContext.identityKey)",
@@ -3354,7 +3368,7 @@ import { PublicKey as PublicKey8 } from "@dxos/keys";
3354
3368
  import { log as log12 } from "@dxos/log";
3355
3369
  import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
3356
3370
  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";
3371
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
3358
3372
  var InvitationsManager = class {
3359
3373
  constructor(_invitationsHandler, _getHandler, _metadataStore) {
3360
3374
  this._invitationsHandler = _invitationsHandler;
@@ -3397,7 +3411,7 @@ var InvitationsManager = class {
3397
3411
  await this._persistIfRequired(handler, stream, invitation);
3398
3412
  } catch (err) {
3399
3413
  log12.catch(err, void 0, {
3400
- F: __dxlog_file15,
3414
+ F: __dxlog_file14,
3401
3415
  L: 82,
3402
3416
  S: this,
3403
3417
  C: (f, a) => f(...a)
@@ -3420,7 +3434,7 @@ var InvitationsManager = class {
3420
3434
  const freshInvitations = persistentInvitations.filter((invitation) => !hasInvitationExpired(invitation));
3421
3435
  const loadTasks = freshInvitations.map((persistentInvitation) => {
3422
3436
  invariant11(!this._createInvitations.get(persistentInvitation.invitationId), "invitation already exists", {
3423
- F: __dxlog_file15,
3437
+ F: __dxlog_file14,
3424
3438
  L: 103,
3425
3439
  S: this,
3426
3440
  A: [
@@ -3439,7 +3453,7 @@ var InvitationsManager = class {
3439
3453
  };
3440
3454
  } catch (err) {
3441
3455
  log12.catch(err, void 0, {
3442
- F: __dxlog_file15,
3456
+ F: __dxlog_file14,
3443
3457
  L: 110,
3444
3458
  S: this,
3445
3459
  C: (f, a) => f(...a)
@@ -3471,13 +3485,13 @@ var InvitationsManager = class {
3471
3485
  }
3472
3486
  async authenticate({ invitationId, authCode }) {
3473
3487
  log12("authenticating...", void 0, {
3474
- F: __dxlog_file15,
3488
+ F: __dxlog_file14,
3475
3489
  L: 140,
3476
3490
  S: this,
3477
3491
  C: (f, a) => f(...a)
3478
3492
  });
3479
3493
  invariant11(invitationId, void 0, {
3480
- F: __dxlog_file15,
3494
+ F: __dxlog_file14,
3481
3495
  L: 141,
3482
3496
  S: this,
3483
3497
  A: [
@@ -3490,7 +3504,7 @@ var InvitationsManager = class {
3490
3504
  log12.warn("invalid invitation", {
3491
3505
  invitationId
3492
3506
  }, {
3493
- F: __dxlog_file15,
3507
+ F: __dxlog_file14,
3494
3508
  L: 144,
3495
3509
  S: this,
3496
3510
  C: (f, a) => f(...a)
@@ -3503,13 +3517,13 @@ var InvitationsManager = class {
3503
3517
  log12("cancelInvitation...", {
3504
3518
  invitationId
3505
3519
  }, {
3506
- F: __dxlog_file15,
3520
+ F: __dxlog_file14,
3507
3521
  L: 151,
3508
3522
  S: this,
3509
3523
  C: (f, a) => f(...a)
3510
3524
  });
3511
3525
  invariant11(invitationId, void 0, {
3512
- F: __dxlog_file15,
3526
+ F: __dxlog_file14,
3513
3527
  L: 152,
3514
3528
  S: this,
3515
3529
  A: [
@@ -3583,15 +3597,12 @@ var InvitationsManager = class {
3583
3597
  stream.error(err);
3584
3598
  void ctx.dispose();
3585
3599
  }
3586
- }, {
3587
- F: __dxlog_file15,
3588
- L: 234
3589
3600
  });
3590
3601
  ctx.onDispose(() => {
3591
3602
  log12("complete", {
3592
3603
  ...handler.toJSON()
3593
3604
  }, {
3594
- F: __dxlog_file15,
3605
+ F: __dxlog_file14,
3595
3606
  L: 241,
3596
3607
  S: this,
3597
3608
  C: (f, a) => f(...a)
@@ -3624,7 +3635,7 @@ var InvitationsManager = class {
3624
3635
  log12("timeout", {
3625
3636
  ...handler.toJSON()
3626
3637
  }, {
3627
- F: __dxlog_file15,
3638
+ F: __dxlog_file14,
3628
3639
  L: 261,
3629
3640
  S: this,
3630
3641
  C: (f, a) => f(...a)
@@ -3635,7 +3646,7 @@ var InvitationsManager = class {
3635
3646
  });
3636
3647
  } else {
3637
3648
  log12.warn("auth failed", err, {
3638
- F: __dxlog_file15,
3649
+ F: __dxlog_file14,
3639
3650
  L: 264,
3640
3651
  S: this,
3641
3652
  C: (f, a) => f(...a)
@@ -3647,15 +3658,12 @@ var InvitationsManager = class {
3647
3658
  }
3648
3659
  void ctx.dispose();
3649
3660
  }
3650
- }, {
3651
- F: __dxlog_file15,
3652
- L: 258
3653
3661
  });
3654
3662
  ctx.onDispose(() => {
3655
3663
  log12("complete", {
3656
3664
  ...handler.toJSON()
3657
3665
  }, {
3658
- F: __dxlog_file15,
3666
+ F: __dxlog_file14,
3659
3667
  L: 271,
3660
3668
  S: this,
3661
3669
  C: (f, a) => f(...a)
@@ -3700,7 +3708,7 @@ var InvitationsManager = class {
3700
3708
  await this._metadataStore.removeInvitation(invitation.invitationId);
3701
3709
  } catch (err) {
3702
3710
  log12.catch(err, void 0, {
3703
- F: __dxlog_file15,
3711
+ F: __dxlog_file14,
3704
3712
  L: 307,
3705
3713
  S: this,
3706
3714
  C: (f, a) => f(...a)
@@ -3787,7 +3795,7 @@ import { invariant as invariant12 } from "@dxos/invariant";
3787
3795
  import { log as log13 } from "@dxos/log";
3788
3796
  import { CreateEpochRequest } from "@dxos/protocols/proto/dxos/client/services";
3789
3797
  import { assignDeep } from "@dxos/util";
3790
- var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
3798
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
3791
3799
  var runEpochMigration = async (ctx, context) => {
3792
3800
  switch (context.migration) {
3793
3801
  case CreateEpochRequest.Migration.INIT_AUTOMERGE: {
@@ -3811,7 +3819,7 @@ var runEpochMigration = async (ctx, context) => {
3811
3819
  }
3812
3820
  case CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT: {
3813
3821
  log13.info("Fragmenting", void 0, {
3814
- F: __dxlog_file16,
3822
+ F: __dxlog_file15,
3815
3823
  L: 63,
3816
3824
  S: void 0,
3817
3825
  C: (f, a) => f(...a)
@@ -3823,7 +3831,7 @@ var runEpochMigration = async (ctx, context) => {
3823
3831
  const properties = findInlineObjectOfType(rootHandle.docSync(), TYPE_PROPERTIES);
3824
3832
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
3825
3833
  invariant12(properties, "Properties not found", {
3826
- F: __dxlog_file16,
3834
+ F: __dxlog_file15,
3827
3835
  L: 73,
3828
3836
  S: void 0,
3829
3837
  A: [
@@ -3839,7 +3847,7 @@ var runEpochMigration = async (ctx, context) => {
3839
3847
  };
3840
3848
  const newRoot = context.repo.create(newSpaceDoc);
3841
3849
  invariant12(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3842
- F: __dxlog_file16,
3850
+ F: __dxlog_file15,
3843
3851
  L: 78,
3844
3852
  S: void 0,
3845
3853
  A: [
@@ -3870,7 +3878,7 @@ var runEpochMigration = async (ctx, context) => {
3870
3878
  const rootHandle = context.repo.find(currentRootUrl);
3871
3879
  await cancelWithContext4(ctx, asyncTimeout2(rootHandle.whenReady(), 1e4));
3872
3880
  invariant12(rootHandle.docSync(), "Root doc not found", {
3873
- F: __dxlog_file16,
3881
+ F: __dxlog_file15,
3874
3882
  L: 100,
3875
3883
  S: void 0,
3876
3884
  A: [
@@ -3883,7 +3891,7 @@ var runEpochMigration = async (ctx, context) => {
3883
3891
  const handle = context.repo.find(url);
3884
3892
  await cancelWithContext4(ctx, asyncTimeout2(handle.whenReady(), 1e4));
3885
3893
  invariant12(handle.docSync(), "Doc not found", {
3886
- F: __dxlog_file16,
3894
+ F: __dxlog_file15,
3887
3895
  L: 107,
3888
3896
  S: void 0,
3889
3897
  A: [
@@ -3905,7 +3913,7 @@ var runEpochMigration = async (ctx, context) => {
3905
3913
  }
3906
3914
  case CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT: {
3907
3915
  invariant12(context.newAutomergeRoot, void 0, {
3908
- F: __dxlog_file16,
3916
+ F: __dxlog_file15,
3909
3917
  L: 124,
3910
3918
  S: void 0,
3911
3919
  A: [
@@ -3931,17 +3939,14 @@ import { log as log14 } from "@dxos/log";
3931
3939
  import { schema as schema4 } from "@dxos/protocols";
3932
3940
  import { RpcExtension as RpcExtension3 } from "@dxos/teleport";
3933
3941
  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";
3942
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
3935
3943
  var DEFAULT_RETRY_TIMEOUT = 1e3;
3936
3944
  var DEFAULT_SUCCESS_DELAY = 1e3;
3937
3945
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
3938
3946
  var WRITER_NOT_SET_ERROR_CODE = "WRITER_NOT_SET";
3939
3947
  var NotarizationPlugin = class {
3940
3948
  constructor() {
3941
- this._ctx = new Context7(void 0, {
3942
- F: __dxlog_file17,
3943
- L: 62
3944
- });
3949
+ this._ctx = new Context7();
3945
3950
  this._extensionOpened = new Event5();
3946
3951
  this._extensions = /* @__PURE__ */ new Set();
3947
3952
  this._processedCredentials = new ComplexSet4(PublicKey9.hash);
@@ -3962,13 +3967,13 @@ var NotarizationPlugin = class {
3962
3967
  log14("notarize", {
3963
3968
  credentials
3964
3969
  }, {
3965
- F: __dxlog_file17,
3970
+ F: __dxlog_file16,
3966
3971
  L: 90,
3967
3972
  S: this,
3968
3973
  C: (f, a) => f(...a)
3969
3974
  });
3970
3975
  invariant13(credentials.every((credential) => credential.id), "Credentials must have an id", {
3971
- F: __dxlog_file17,
3976
+ F: __dxlog_file16,
3972
3977
  L: 91,
3973
3978
  S: this,
3974
3979
  A: [
@@ -3982,7 +3987,7 @@ var NotarizationPlugin = class {
3982
3987
  log14.warn("Notarization error", {
3983
3988
  err
3984
3989
  }, {
3985
- F: __dxlog_file17,
3990
+ F: __dxlog_file16,
3986
3991
  L: 99,
3987
3992
  S: this,
3988
3993
  C: (f, a) => f(...a)
@@ -3998,7 +4003,7 @@ var NotarizationPlugin = class {
3998
4003
  timeout,
3999
4004
  peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
4000
4005
  }, {
4001
- F: __dxlog_file17,
4006
+ F: __dxlog_file16,
4002
4007
  L: 111,
4003
4008
  S: this,
4004
4009
  C: (f, a) => f(...a)
@@ -4021,7 +4026,7 @@ var NotarizationPlugin = class {
4021
4026
  log14.info("Exhausted all peers to notarize with", {
4022
4027
  retryIn: retryTimeout
4023
4028
  }, {
4024
- F: __dxlog_file17,
4029
+ F: __dxlog_file16,
4025
4030
  L: 136,
4026
4031
  S: this,
4027
4032
  C: (f, a) => f(...a)
@@ -4035,7 +4040,7 @@ var NotarizationPlugin = class {
4035
4040
  peer: peer.localPeerId,
4036
4041
  credentialId: credentials.map((credential) => credential.id)
4037
4042
  }, {
4038
- F: __dxlog_file17,
4043
+ F: __dxlog_file16,
4039
4044
  L: 143,
4040
4045
  S: this,
4041
4046
  C: (f, a) => f(...a)
@@ -4044,7 +4049,7 @@ var NotarizationPlugin = class {
4044
4049
  credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
4045
4050
  });
4046
4051
  log14("success", void 0, {
4047
- F: __dxlog_file17,
4052
+ F: __dxlog_file16,
4048
4053
  L: 147,
4049
4054
  S: this,
4050
4055
  C: (f, a) => f(...a)
@@ -4053,7 +4058,7 @@ var NotarizationPlugin = class {
4053
4058
  } catch (err) {
4054
4059
  if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
4055
4060
  log14.info("error notarizing (recoverable)", err, {
4056
- F: __dxlog_file17,
4061
+ F: __dxlog_file16,
4057
4062
  L: 151,
4058
4063
  S: this,
4059
4064
  C: (f, a) => f(...a)
@@ -4071,7 +4076,7 @@ var NotarizationPlugin = class {
4071
4076
  errors.wait()
4072
4077
  ]);
4073
4078
  log14("done", void 0, {
4074
- F: __dxlog_file17,
4079
+ F: __dxlog_file16,
4075
4080
  L: 162,
4076
4081
  S: this,
4077
4082
  C: (f, a) => f(...a)
@@ -4093,7 +4098,7 @@ var NotarizationPlugin = class {
4093
4098
  }
4094
4099
  setWriter(writer) {
4095
4100
  invariant13(!this._writer, "Writer already set.", {
4096
- F: __dxlog_file17,
4101
+ F: __dxlog_file16,
4097
4102
  L: 181,
4098
4103
  S: this,
4099
4104
  A: [
@@ -4118,7 +4123,7 @@ var NotarizationPlugin = class {
4118
4123
  }
4119
4124
  for (const credential of request.credentials ?? []) {
4120
4125
  invariant13(credential.id, "Credential must have an id", {
4121
- F: __dxlog_file17,
4126
+ F: __dxlog_file16,
4122
4127
  L: 200,
4123
4128
  S: this,
4124
4129
  A: [
@@ -4138,7 +4143,7 @@ var NotarizationPlugin = class {
4138
4143
  log14("extension opened", {
4139
4144
  peer: extension.localPeerId
4140
4145
  }, {
4141
- F: __dxlog_file17,
4146
+ F: __dxlog_file16,
4142
4147
  L: 211,
4143
4148
  S: this,
4144
4149
  C: (f, a) => f(...a)
@@ -4150,7 +4155,7 @@ var NotarizationPlugin = class {
4150
4155
  log14("extension closed", {
4151
4156
  peer: extension.localPeerId
4152
4157
  }, {
4153
- F: __dxlog_file17,
4158
+ F: __dxlog_file16,
4154
4159
  L: 216,
4155
4160
  S: this,
4156
4161
  C: (f, a) => f(...a)
@@ -4267,13 +4272,10 @@ function _using_ctx() {
4267
4272
  }
4268
4273
  };
4269
4274
  }
4270
- var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4275
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
4271
4276
  var DataSpace = class {
4272
4277
  constructor(params) {
4273
- this._ctx = new Context8(void 0, {
4274
- F: __dxlog_file18,
4275
- L: 84
4276
- });
4278
+ this._ctx = new Context8();
4277
4279
  this._notarizationPlugin = new NotarizationPlugin();
4278
4280
  this._cache = void 0;
4279
4281
  // TODO(dmaretskyi): Move into Space?
@@ -4307,7 +4309,7 @@ var DataSpace = class {
4307
4309
  log15("new state", {
4308
4310
  state: SpaceState2[this._state]
4309
4311
  }, {
4310
- F: __dxlog_file18,
4312
+ F: __dxlog_file17,
4311
4313
  L: 146,
4312
4314
  S: this,
4313
4315
  C: (f, a) => f(...a)
@@ -4362,15 +4364,12 @@ var DataSpace = class {
4362
4364
  await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
4363
4365
  await this._automergeSpaceState.open();
4364
4366
  await this._inner.spaceState.addCredentialProcessor(this._automergeSpaceState);
4365
- await this._inner.open(new Context8(void 0, {
4366
- F: __dxlog_file18,
4367
- L: 215
4368
- }));
4367
+ await this._inner.open(new Context8());
4369
4368
  this._state = SpaceState2.CONTROL_ONLY;
4370
4369
  log15("new state", {
4371
4370
  state: SpaceState2[this._state]
4372
4371
  }, {
4373
- F: __dxlog_file18,
4372
+ F: __dxlog_file17,
4374
4373
  L: 217,
4375
4374
  S: this,
4376
4375
  C: (f, a) => f(...a)
@@ -4388,16 +4387,13 @@ var DataSpace = class {
4388
4387
  log15("new state", {
4389
4388
  state: SpaceState2[this._state]
4390
4389
  }, {
4391
- F: __dxlog_file18,
4390
+ F: __dxlog_file17,
4392
4391
  L: 231,
4393
4392
  S: this,
4394
4393
  C: (f, a) => f(...a)
4395
4394
  });
4396
4395
  await this._ctx.dispose();
4397
- this._ctx = new Context8(void 0, {
4398
- F: __dxlog_file18,
4399
- L: 233
4400
- });
4396
+ this._ctx = new Context8();
4401
4397
  await this.authVerifier.close();
4402
4398
  await this._inner.close();
4403
4399
  await this._inner.spaceState.removeCredentialProcessor(this._automergeSpaceState);
@@ -4424,7 +4420,7 @@ var DataSpace = class {
4424
4420
  } catch (err) {
4425
4421
  if (err instanceof CancelledError || err instanceof ContextDisposedError3) {
4426
4422
  log15("data pipeline initialization cancelled", err, {
4427
- F: __dxlog_file18,
4423
+ F: __dxlog_file17,
4428
4424
  L: 265,
4429
4425
  S: this,
4430
4426
  C: (f, a) => f(...a)
@@ -4432,7 +4428,7 @@ var DataSpace = class {
4432
4428
  return;
4433
4429
  }
4434
4430
  log15.error("Error initializing data pipeline", err, {
4435
- F: __dxlog_file18,
4431
+ F: __dxlog_file17,
4436
4432
  L: 269,
4437
4433
  S: this,
4438
4434
  C: (f, a) => f(...a)
@@ -4441,7 +4437,7 @@ var DataSpace = class {
4441
4437
  log15("new state", {
4442
4438
  state: SpaceState2[this._state]
4443
4439
  }, {
4444
- F: __dxlog_file18,
4440
+ F: __dxlog_file17,
4445
4441
  L: 271,
4446
4442
  S: this,
4447
4443
  C: (f, a) => f(...a)
@@ -4461,7 +4457,7 @@ var DataSpace = class {
4461
4457
  log15("new state", {
4462
4458
  state: SpaceState2[this._state]
4463
4459
  }, {
4464
- F: __dxlog_file18,
4460
+ F: __dxlog_file17,
4465
4461
  L: 287,
4466
4462
  S: this,
4467
4463
  C: (f, a) => f(...a)
@@ -4478,7 +4474,7 @@ var DataSpace = class {
4478
4474
  log15("new state", {
4479
4475
  state: SpaceState2[this._state]
4480
4476
  }, {
4481
- F: __dxlog_file18,
4477
+ F: __dxlog_file17,
4482
4478
  L: 306,
4483
4479
  S: this,
4484
4480
  C: (f, a) => f(...a)
@@ -4494,7 +4490,7 @@ var DataSpace = class {
4494
4490
  this.metrics.controlPipelineReady = /* @__PURE__ */ new Date();
4495
4491
  await this._createWritableFeeds();
4496
4492
  log15("writable feeds created", void 0, {
4497
- F: __dxlog_file18,
4493
+ F: __dxlog_file17,
4498
4494
  L: 322,
4499
4495
  S: this,
4500
4496
  C: (f, a) => f(...a)
@@ -4557,7 +4553,7 @@ var DataSpace = class {
4557
4553
  space: this.key,
4558
4554
  rootUrl
4559
4555
  }, {
4560
- F: __dxlog_file18,
4556
+ F: __dxlog_file17,
4561
4557
  L: 388,
4562
4558
  S: this,
4563
4559
  C: (f, a) => f(...a)
@@ -4611,7 +4607,7 @@ var DataSpace = class {
4611
4607
  rootUrl,
4612
4608
  err
4613
4609
  }, {
4614
- F: __dxlog_file18,
4610
+ F: __dxlog_file17,
4615
4611
  L: 431,
4616
4612
  S: this,
4617
4613
  C: (f, a) => f(...a)
@@ -4697,7 +4693,7 @@ var DataSpace = class {
4697
4693
  log15("new state", {
4698
4694
  state: SpaceState2[this._state]
4699
4695
  }, {
4700
- F: __dxlog_file18,
4696
+ F: __dxlog_file17,
4701
4697
  L: 512,
4702
4698
  S: this,
4703
4699
  C: (f, a) => f(...a)
@@ -4758,17 +4754,15 @@ DataSpace = _ts_decorate4([
4758
4754
  import { Event as Event7, synchronized as synchronized2, trackLeaks as trackLeaks2 } from "@dxos/async";
4759
4755
  import { PropertiesType } from "@dxos/client-protocol";
4760
4756
  import { Context as Context9, cancelWithContext as cancelWithContext6 } from "@dxos/context";
4761
- import { getCredentialAssertion as getCredentialAssertion3, createAdmissionCredentials } from "@dxos/credentials";
4757
+ import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
4762
4758
  import { convertLegacyReferences as convertLegacyReferences2, findInlineObjectOfType as findInlineObjectOfType2 } from "@dxos/echo-db";
4763
4759
  import { AuthStatus } from "@dxos/echo-pipeline";
4764
- import { CredentialServerExtension } from "@dxos/echo-pipeline";
4765
4760
  import { LEGACY_TYPE_PROPERTIES, SpaceDocVersion as SpaceDocVersion2, encodeReference } from "@dxos/echo-protocol";
4766
4761
  import { TYPE_PROPERTIES as TYPE_PROPERTIES2, generateEchoId, getTypeReference } from "@dxos/echo-schema";
4767
- import { writeMessages as writeMessages3 } from "@dxos/feed-store";
4768
4762
  import { invariant as invariant14 } from "@dxos/invariant";
4769
4763
  import { PublicKey as PublicKey11 } from "@dxos/keys";
4770
4764
  import { log as log16 } from "@dxos/log";
4771
- import { trace as Trace2, AlreadyJoinedError as AlreadyJoinedError3 } from "@dxos/protocols";
4765
+ import { trace as Trace2 } from "@dxos/protocols";
4772
4766
  import { Invitation as Invitation7, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
4773
4767
  import { SpaceMember as SpaceMember6 } from "@dxos/protocols/proto/dxos/halo/credentials";
4774
4768
  import { Gossip as Gossip2, Presence as Presence2 } from "@dxos/teleport-extension-gossip";
@@ -4856,7 +4850,7 @@ function _ts_decorate5(decorators, target, key, desc) {
4856
4850
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4857
4851
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4858
4852
  }
4859
- var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
4853
+ var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
4860
4854
  var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
4861
4855
  var PRESENCE_OFFLINE_TIMEOUT = 2e4;
4862
4856
  var DEFAULT_SPACE_KEY = "__DEFAULT__";
@@ -4870,10 +4864,7 @@ var DataSpaceManager = class {
4870
4864
  this._echoHost = _echoHost;
4871
4865
  this._invitationsManager = _invitationsManager;
4872
4866
  this._params = _params;
4873
- this._ctx = new Context9(void 0, {
4874
- F: __dxlog_file19,
4875
- L: 104
4876
- });
4867
+ this._ctx = new Context9();
4877
4868
  this.updated = new Event7();
4878
4869
  this._spaces = new ComplexMap3(PublicKey11.hash);
4879
4870
  this._isOpen = false;
@@ -4907,24 +4898,24 @@ var DataSpaceManager = class {
4907
4898
  }
4908
4899
  async open() {
4909
4900
  log16("open", void 0, {
4910
- F: __dxlog_file19,
4911
- L: 156,
4901
+ F: __dxlog_file18,
4902
+ L: 146,
4912
4903
  S: this,
4913
4904
  C: (f, a) => f(...a)
4914
4905
  });
4915
4906
  log16.trace("dxos.echo.data-space-manager.open", Trace2.begin({
4916
4907
  id: this._instanceId
4917
4908
  }), {
4918
- F: __dxlog_file19,
4919
- L: 157,
4909
+ F: __dxlog_file18,
4910
+ L: 147,
4920
4911
  S: this,
4921
4912
  C: (f, a) => f(...a)
4922
4913
  });
4923
4914
  log16("metadata loaded", {
4924
4915
  spaces: this._metadataStore.spaces.length
4925
4916
  }, {
4926
- F: __dxlog_file19,
4927
- L: 158,
4917
+ F: __dxlog_file18,
4918
+ L: 148,
4928
4919
  S: this,
4929
4920
  C: (f, a) => f(...a)
4930
4921
  });
@@ -4933,8 +4924,8 @@ var DataSpaceManager = class {
4933
4924
  log16("load space", {
4934
4925
  spaceMetadata
4935
4926
  }, {
4936
- F: __dxlog_file19,
4937
- L: 162,
4927
+ F: __dxlog_file18,
4928
+ L: 152,
4938
4929
  S: this,
4939
4930
  C: (f, a) => f(...a)
4940
4931
  });
@@ -4944,8 +4935,8 @@ var DataSpaceManager = class {
4944
4935
  spaceMetadata,
4945
4936
  err
4946
4937
  }, {
4947
- F: __dxlog_file19,
4948
- L: 165,
4938
+ F: __dxlog_file18,
4939
+ L: 155,
4949
4940
  S: this,
4950
4941
  C: (f, a) => f(...a)
4951
4942
  });
@@ -4956,16 +4947,16 @@ var DataSpaceManager = class {
4956
4947
  log16.trace("dxos.echo.data-space-manager.open", Trace2.end({
4957
4948
  id: this._instanceId
4958
4949
  }), {
4959
- F: __dxlog_file19,
4960
- L: 172,
4950
+ F: __dxlog_file18,
4951
+ L: 162,
4961
4952
  S: this,
4962
4953
  C: (f, a) => f(...a)
4963
4954
  });
4964
4955
  }
4965
4956
  async close() {
4966
4957
  log16("close", void 0, {
4967
- F: __dxlog_file19,
4968
- L: 177,
4958
+ F: __dxlog_file18,
4959
+ L: 167,
4969
4960
  S: this,
4970
4961
  C: (f, a) => f(...a)
4971
4962
  });
@@ -4981,8 +4972,8 @@ var DataSpaceManager = class {
4981
4972
  */
4982
4973
  async createSpace() {
4983
4974
  invariant14(this._isOpen, "Not open.", {
4984
- F: __dxlog_file19,
4985
- L: 191,
4975
+ F: __dxlog_file18,
4976
+ L: 181,
4986
4977
  S: this,
4987
4978
  A: [
4988
4979
  "this._isOpen",
@@ -5002,8 +4993,8 @@ var DataSpaceManager = class {
5002
4993
  log16("creating space...", {
5003
4994
  spaceKey
5004
4995
  }, {
5005
- F: __dxlog_file19,
5006
- L: 203,
4996
+ F: __dxlog_file18,
4997
+ L: 193,
5007
4998
  S: this,
5008
4999
  C: (f, a) => f(...a)
5009
5000
  });
@@ -5014,8 +5005,8 @@ var DataSpaceManager = class {
5014
5005
  await this._metadataStore.addSpace(metadata);
5015
5006
  const memberCredential = credentials[1];
5016
5007
  invariant14(getCredentialAssertion3(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5017
- F: __dxlog_file19,
5018
- L: 213,
5008
+ F: __dxlog_file18,
5009
+ L: 203,
5019
5010
  S: this,
5020
5011
  A: [
5021
5012
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -5046,8 +5037,8 @@ var DataSpaceManager = class {
5046
5037
  version: space.databaseRoot.getVersion(),
5047
5038
  spaceId: space.id
5048
5039
  }, {
5049
- F: __dxlog_file19,
5050
- L: 238,
5040
+ F: __dxlog_file18,
5041
+ L: 228,
5051
5042
  S: this,
5052
5043
  C: (f, a) => f(...a)
5053
5044
  });
@@ -5081,8 +5072,8 @@ var DataSpaceManager = class {
5081
5072
  async _getSpaceRootDocument(space) {
5082
5073
  const automergeIndex = space.automergeSpaceState.rootUrl;
5083
5074
  invariant14(automergeIndex, void 0, {
5084
- F: __dxlog_file19,
5085
- L: 271,
5075
+ F: __dxlog_file18,
5076
+ L: 261,
5086
5077
  S: this,
5087
5078
  A: [
5088
5079
  "automergeIndex",
@@ -5098,14 +5089,14 @@ var DataSpaceManager = class {
5098
5089
  log16("accept space", {
5099
5090
  opts
5100
5091
  }, {
5101
- F: __dxlog_file19,
5102
- L: 280,
5092
+ F: __dxlog_file18,
5093
+ L: 270,
5103
5094
  S: this,
5104
5095
  C: (f, a) => f(...a)
5105
5096
  });
5106
5097
  invariant14(this._isOpen, "Not open.", {
5107
- F: __dxlog_file19,
5108
- L: 281,
5098
+ F: __dxlog_file18,
5099
+ L: 271,
5109
5100
  S: this,
5110
5101
  A: [
5111
5102
  "this._isOpen",
@@ -5113,8 +5104,8 @@ var DataSpaceManager = class {
5113
5104
  ]
5114
5105
  });
5115
5106
  invariant14(!this._spaces.has(opts.spaceKey), "Space already exists.", {
5116
- F: __dxlog_file19,
5117
- L: 282,
5107
+ F: __dxlog_file18,
5108
+ L: 272,
5118
5109
  S: this,
5119
5110
  A: [
5120
5111
  "!this._spaces.has(opts.spaceKey)",
@@ -5134,43 +5125,6 @@ var DataSpaceManager = class {
5134
5125
  this.updated.emit();
5135
5126
  return space;
5136
5127
  }
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
5128
  /**
5175
5129
  * Wait until the space data pipeline is fully initialized.
5176
5130
  * Used by invitation handler.
@@ -5182,24 +5136,12 @@ var DataSpaceManager = class {
5182
5136
  return !!space && space.state === SpaceState3.READY;
5183
5137
  }));
5184
5138
  }
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
5139
  async _constructSpace(metadata) {
5198
5140
  log16("construct space", {
5199
5141
  metadata
5200
5142
  }, {
5201
- F: __dxlog_file19,
5202
- L: 358,
5143
+ F: __dxlog_file18,
5144
+ L: 306,
5203
5145
  S: this,
5204
5146
  C: (f, a) => f(...a)
5205
5147
  });
@@ -5227,7 +5169,6 @@ var DataSpaceManager = class {
5227
5169
  credentialAuthenticator: deferFunction2(() => dataSpace.authVerifier.verifier)
5228
5170
  },
5229
5171
  onAuthorizedConnection: (session) => {
5230
- session.addExtension("dxos.mesh.teleport.admission-discovery", new CredentialServerExtension(space));
5231
5172
  session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
5232
5173
  remotePeerId: session.remotePeerId
5233
5174
  }));
@@ -5237,8 +5178,8 @@ var DataSpaceManager = class {
5237
5178
  },
5238
5179
  onAuthFailure: () => {
5239
5180
  log16.warn("auth failure", void 0, {
5240
- F: __dxlog_file19,
5241
- L: 396,
5181
+ F: __dxlog_file18,
5182
+ L: 343,
5242
5183
  S: this,
5243
5184
  C: (f, a) => f(...a)
5244
5185
  });
@@ -5270,8 +5211,8 @@ var DataSpaceManager = class {
5270
5211
  log16("before space ready", {
5271
5212
  space: space.key
5272
5213
  }, {
5273
- F: __dxlog_file19,
5274
- L: 423,
5214
+ F: __dxlog_file18,
5215
+ L: 370,
5275
5216
  S: this,
5276
5217
  C: (f, a) => f(...a)
5277
5218
  });
@@ -5281,8 +5222,8 @@ var DataSpaceManager = class {
5281
5222
  space: space.key,
5282
5223
  open: this._isOpen
5283
5224
  }, {
5284
- F: __dxlog_file19,
5285
- L: 426,
5225
+ F: __dxlog_file18,
5226
+ L: 373,
5286
5227
  S: this,
5287
5228
  C: (f, a) => f(...a)
5288
5229
  });
@@ -5300,8 +5241,8 @@ var DataSpaceManager = class {
5300
5241
  log16("before space close", {
5301
5242
  space: space.key
5302
5243
  }, {
5303
- F: __dxlog_file19,
5304
- L: 434,
5244
+ F: __dxlog_file18,
5245
+ L: 381,
5305
5246
  S: this,
5306
5247
  C: (f, a) => f(...a)
5307
5248
  });
@@ -5341,8 +5282,8 @@ var DataSpaceManager = class {
5341
5282
  peersOnline: presence.getPeersOnline().length,
5342
5283
  closedSessions
5343
5284
  }, {
5344
- F: __dxlog_file19,
5345
- L: 470,
5285
+ F: __dxlog_file18,
5286
+ L: 417,
5346
5287
  S: this,
5347
5288
  C: (f, a) => f(...a)
5348
5289
  });
@@ -5356,8 +5297,8 @@ var DataSpaceManager = class {
5356
5297
  log16("closing a session with a removed peer", {
5357
5298
  peerId: peerState.peerId
5358
5299
  }, {
5359
- F: __dxlog_file19,
5360
- L: 484,
5300
+ F: __dxlog_file18,
5301
+ L: 431,
5361
5302
  S: this,
5362
5303
  C: (f, a) => f(...a)
5363
5304
  });
@@ -5422,13 +5363,13 @@ import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTas
5422
5363
  import { Stream as Stream10 } from "@dxos/codec-protobuf";
5423
5364
  import { createAdmissionCredentials as createAdmissionCredentials2, getCredentialAssertion as getCredentialAssertion4 } from "@dxos/credentials";
5424
5365
  import { raise as raise2 } from "@dxos/debug";
5425
- import { writeMessages as writeMessages4 } from "@dxos/feed-store";
5366
+ import { writeMessages as writeMessages3 } from "@dxos/feed-store";
5426
5367
  import { invariant as invariant15 } from "@dxos/invariant";
5427
5368
  import { log as log17 } from "@dxos/log";
5428
5369
  import { ApiError, SpaceNotFoundError as SpaceNotFoundError2, encodeError, IdentityNotInitializedError, AuthorizationError as AuthorizationError2 } from "@dxos/protocols";
5429
5370
  import { SpaceMember as SpaceMember7, SpaceState as SpaceState4 } from "@dxos/protocols/proto/dxos/client/services";
5430
5371
  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";
5372
+ var __dxlog_file19 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
5432
5373
  var SpacesServiceImpl = class {
5433
5374
  constructor(_identityManager, _spaceManager, _getDataSpaceManager) {
5434
5375
  this._identityManager = _identityManager;
@@ -5472,8 +5413,8 @@ var SpacesServiceImpl = class {
5472
5413
  }
5473
5414
  const credentials = await createAdmissionCredentials2(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
5474
5415
  invariant15(credentials[0].credential, void 0, {
5475
- F: __dxlog_file20,
5476
- L: 102,
5416
+ F: __dxlog_file19,
5417
+ L: 98,
5477
5418
  S: this,
5478
5419
  A: [
5479
5420
  "credentials[0].credential",
@@ -5482,15 +5423,15 @@ var SpacesServiceImpl = class {
5482
5423
  });
5483
5424
  const spaceMemberCredential = credentials[0].credential.credential;
5484
5425
  invariant15(getCredentialAssertion4(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
5485
- F: __dxlog_file20,
5486
- L: 104,
5426
+ F: __dxlog_file19,
5427
+ L: 100,
5487
5428
  S: this,
5488
5429
  A: [
5489
5430
  "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
5490
5431
  ""
5491
5432
  ]
5492
5433
  });
5493
- await writeMessages4(space.controlPipeline.writer, credentials);
5434
+ await writeMessages3(space.controlPipeline.writer, credentials);
5494
5435
  }
5495
5436
  querySpaces() {
5496
5437
  return new Stream10(({ next, ctx }) => {
@@ -5500,8 +5441,8 @@ var SpacesServiceImpl = class {
5500
5441
  log17("update", {
5501
5442
  spaces
5502
5443
  }, {
5503
- F: __dxlog_file20,
5504
- L: 115,
5444
+ F: __dxlog_file19,
5445
+ L: 111,
5505
5446
  S: this,
5506
5447
  C: (f, a) => f(...a)
5507
5448
  });
@@ -5592,8 +5533,8 @@ var SpacesServiceImpl = class {
5592
5533
  });
5593
5534
  } else {
5594
5535
  invariant15(!credential.id, "Id on unsigned credentials is not allowed", {
5595
- F: __dxlog_file20,
5596
- L: 213,
5536
+ F: __dxlog_file19,
5537
+ L: 209,
5597
5538
  S: this,
5598
5539
  A: [
5599
5540
  "!credential.id",
@@ -5601,8 +5542,8 @@ var SpacesServiceImpl = class {
5601
5542
  ]
5602
5543
  });
5603
5544
  invariant15(this._identityManager.identity, "Identity is not available", {
5604
- F: __dxlog_file20,
5605
- L: 214,
5545
+ F: __dxlog_file19,
5546
+ L: 210,
5606
5547
  S: this,
5607
5548
  A: [
5608
5549
  "this._identityManager.identity",
@@ -5611,8 +5552,8 @@ var SpacesServiceImpl = class {
5611
5552
  });
5612
5553
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
5613
5554
  invariant15(credential.issuer.equals(signer.getIssuer()), void 0, {
5614
- F: __dxlog_file20,
5615
- L: 216,
5555
+ F: __dxlog_file19,
5556
+ L: 212,
5616
5557
  S: this,
5617
5558
  A: [
5618
5559
  "credential.issuer.equals(signer.getIssuer())",
@@ -5642,59 +5583,6 @@ var SpacesServiceImpl = class {
5642
5583
  epochCredential: credential ?? void 0
5643
5584
  };
5644
5585
  }
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
5586
  _serializeSpace(space) {
5699
5587
  return {
5700
5588
  id: space.id,
@@ -5782,7 +5670,7 @@ function _ts_decorate6(decorators, target, key, desc) {
5782
5670
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5783
5671
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5784
5672
  }
5785
- var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
5673
+ var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
5786
5674
  var ServiceContext = class extends Resource3 {
5787
5675
  constructor(storage, level, networkManager, signalManager, _runtimeParams) {
5788
5676
  super();
@@ -5826,7 +5714,7 @@ var ServiceContext = class extends Resource3 {
5826
5714
  async _open(ctx) {
5827
5715
  await this._checkStorageVersion();
5828
5716
  log18("opening...", void 0, {
5829
- F: __dxlog_file21,
5717
+ F: __dxlog_file20,
5830
5718
  L: 149,
5831
5719
  S: this,
5832
5720
  C: (f, a) => f(...a)
@@ -5834,7 +5722,7 @@ var ServiceContext = class extends Resource3 {
5834
5722
  log18.trace("dxos.sdk.service-context.open", trace9.begin({
5835
5723
  id: this._instanceId
5836
5724
  }), {
5837
- F: __dxlog_file21,
5725
+ F: __dxlog_file20,
5838
5726
  L: 150,
5839
5727
  S: this,
5840
5728
  C: (f, a) => f(...a)
@@ -5852,7 +5740,7 @@ var ServiceContext = class extends Resource3 {
5852
5740
  log18("loaded persistent invitations", {
5853
5741
  count: loadedInvitations.invitations?.length
5854
5742
  }, {
5855
- F: __dxlog_file21,
5743
+ F: __dxlog_file20,
5856
5744
  L: 163,
5857
5745
  S: this,
5858
5746
  C: (f, a) => f(...a)
@@ -5860,13 +5748,13 @@ var ServiceContext = class extends Resource3 {
5860
5748
  log18.trace("dxos.sdk.service-context.open", trace9.end({
5861
5749
  id: this._instanceId
5862
5750
  }), {
5863
- F: __dxlog_file21,
5751
+ F: __dxlog_file20,
5864
5752
  L: 165,
5865
5753
  S: this,
5866
5754
  C: (f, a) => f(...a)
5867
5755
  });
5868
5756
  log18("opened", void 0, {
5869
- F: __dxlog_file21,
5757
+ F: __dxlog_file20,
5870
5758
  L: 166,
5871
5759
  S: this,
5872
5760
  C: (f, a) => f(...a)
@@ -5874,7 +5762,7 @@ var ServiceContext = class extends Resource3 {
5874
5762
  }
5875
5763
  async _close(ctx) {
5876
5764
  log18("closing...", void 0, {
5877
- F: __dxlog_file21,
5765
+ F: __dxlog_file20,
5878
5766
  L: 170,
5879
5767
  S: this,
5880
5768
  C: (f, a) => f(...a)
@@ -5891,7 +5779,7 @@ var ServiceContext = class extends Resource3 {
5891
5779
  await this.networkManager.close();
5892
5780
  await this.signalManager.close();
5893
5781
  log18("closed", void 0, {
5894
- F: __dxlog_file21,
5782
+ F: __dxlog_file20,
5895
5783
  L: 182,
5896
5784
  S: this,
5897
5785
  C: (f, a) => f(...a)
@@ -5899,16 +5787,13 @@ var ServiceContext = class extends Resource3 {
5899
5787
  }
5900
5788
  async createIdentity(params = {}) {
5901
5789
  const identity = await this.identityManager.createIdentity(params);
5902
- await this._initialize(new Context10(void 0, {
5903
- F: __dxlog_file21,
5904
- L: 187
5905
- }));
5790
+ await this._initialize(new Context10());
5906
5791
  return identity;
5907
5792
  }
5908
5793
  getInvitationHandler(invitation) {
5909
5794
  const factory = this._handlerFactories.get(invitation.kind);
5910
5795
  invariant16(factory, `Unknown invitation kind: ${invitation.kind}`, {
5911
- F: __dxlog_file21,
5796
+ F: __dxlog_file20,
5912
5797
  L: 193,
5913
5798
  S: this,
5914
5799
  A: [
@@ -5928,10 +5813,7 @@ var ServiceContext = class extends Resource3 {
5928
5813
  }
5929
5814
  async _acceptIdentity(params) {
5930
5815
  const identity = await this.identityManager.acceptIdentity(params);
5931
- await this._initialize(new Context10(void 0, {
5932
- F: __dxlog_file21,
5933
- L: 209
5934
- }));
5816
+ await this._initialize(new Context10());
5935
5817
  return identity;
5936
5818
  }
5937
5819
  async _checkStorageVersion() {
@@ -5943,7 +5825,7 @@ var ServiceContext = class extends Resource3 {
5943
5825
  // Called when identity is created.
5944
5826
  async _initialize(ctx) {
5945
5827
  log18("initializing spaces...", void 0, {
5946
- F: __dxlog_file21,
5828
+ F: __dxlog_file20,
5947
5829
  L: 224,
5948
5830
  S: this,
5949
5831
  C: (f, a) => f(...a)
@@ -5966,7 +5848,7 @@ var ServiceContext = class extends Resource3 {
5966
5848
  await this.dataSpaceManager.open();
5967
5849
  this._handlerFactories.set(Invitation8.Kind.SPACE, (invitation) => {
5968
5850
  invariant16(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
5969
- F: __dxlog_file21,
5851
+ F: __dxlog_file20,
5970
5852
  L: 249,
5971
5853
  S: this,
5972
5854
  A: [
@@ -5990,7 +5872,7 @@ var ServiceContext = class extends Resource3 {
5990
5872
  log18("dataSpaceManager not initialized yet, ignoring space admission", {
5991
5873
  details: assertion
5992
5874
  }, {
5993
- F: __dxlog_file21,
5875
+ F: __dxlog_file20,
5994
5876
  L: 265,
5995
5877
  S: this,
5996
5878
  C: (f, a) => f(...a)
@@ -6001,7 +5883,7 @@ var ServiceContext = class extends Resource3 {
6001
5883
  log18("space already exists, ignoring space admission", {
6002
5884
  details: assertion
6003
5885
  }, {
6004
- F: __dxlog_file21,
5886
+ F: __dxlog_file20,
6005
5887
  L: 269,
6006
5888
  S: this,
6007
5889
  C: (f, a) => f(...a)
@@ -6012,7 +5894,7 @@ var ServiceContext = class extends Resource3 {
6012
5894
  log18("accepting space recorded in halo", {
6013
5895
  details: assertion
6014
5896
  }, {
6015
- F: __dxlog_file21,
5897
+ F: __dxlog_file20,
6016
5898
  L: 274,
6017
5899
  S: this,
6018
5900
  C: (f, a) => f(...a)
@@ -6023,7 +5905,7 @@ var ServiceContext = class extends Resource3 {
6023
5905
  });
6024
5906
  } catch (err) {
6025
5907
  log18.catch(err, void 0, {
6026
- F: __dxlog_file21,
5908
+ F: __dxlog_file20,
6027
5909
  L: 280,
6028
5910
  S: this,
6029
5911
  C: (f, a) => f(...a)
@@ -6083,7 +5965,7 @@ function _ts_decorate7(decorators, target, key, desc) {
6083
5965
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6084
5966
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6085
5967
  }
6086
- var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
5968
+ var __dxlog_file21 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
6087
5969
  var Message;
6088
5970
  (function(Message2) {
6089
5971
  Message2["ACQUIRING"] = "acquiring";
@@ -6106,28 +5988,28 @@ var Lock = class {
6106
5988
  });
6107
5989
  try {
6108
5990
  log19("aquiring lock...", void 0, {
6109
- F: __dxlog_file22,
5991
+ F: __dxlog_file21,
6110
5992
  L: 42,
6111
5993
  S: this,
6112
5994
  C: (f, a) => f(...a)
6113
5995
  });
6114
5996
  await asyncTimeout3(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
6115
5997
  log19("acquired lock", void 0, {
6116
- F: __dxlog_file22,
5998
+ F: __dxlog_file21,
6117
5999
  L: 44,
6118
6000
  S: this,
6119
6001
  C: (f, a) => f(...a)
6120
6002
  });
6121
6003
  } catch {
6122
6004
  log19("stealing lock...", void 0, {
6123
- F: __dxlog_file22,
6005
+ F: __dxlog_file21,
6124
6006
  L: 46,
6125
6007
  S: this,
6126
6008
  C: (f, a) => f(...a)
6127
6009
  });
6128
6010
  await this._requestLock(true);
6129
6011
  log19("stolen lock", void 0, {
6130
- F: __dxlog_file22,
6012
+ F: __dxlog_file21,
6131
6013
  L: 48,
6132
6014
  S: this,
6133
6015
  C: (f, a) => f(...a)
@@ -6146,7 +6028,7 @@ var Lock = class {
6146
6028
  log19("requesting lock...", {
6147
6029
  steal
6148
6030
  }, {
6149
- F: __dxlog_file22,
6031
+ F: __dxlog_file21,
6150
6032
  L: 63,
6151
6033
  S: this,
6152
6034
  C: (f, a) => f(...a)
@@ -6160,14 +6042,14 @@ var Lock = class {
6160
6042
  this._releaseTrigger = new Trigger9();
6161
6043
  await this._releaseTrigger.wait();
6162
6044
  log19("releasing lock...", void 0, {
6163
- F: __dxlog_file22,
6045
+ F: __dxlog_file21,
6164
6046
  L: 72,
6165
6047
  S: this,
6166
6048
  C: (f, a) => f(...a)
6167
6049
  });
6168
6050
  await this._onRelease?.();
6169
6051
  log19("released lock", void 0, {
6170
- F: __dxlog_file22,
6052
+ F: __dxlog_file21,
6171
6053
  L: 74,
6172
6054
  S: this,
6173
6055
  C: (f, a) => f(...a)
@@ -6179,7 +6061,7 @@ var Lock = class {
6179
6061
  log19("recieved lock", {
6180
6062
  steal
6181
6063
  }, {
6182
- F: __dxlog_file22,
6064
+ F: __dxlog_file21,
6183
6065
  L: 81,
6184
6066
  S: this,
6185
6067
  C: (f, a) => f(...a)
@@ -6272,7 +6154,7 @@ import { Event as Event9, synchronized as synchronized3 } from "@dxos/async";
6272
6154
  import { clientServiceBundle } from "@dxos/client-protocol";
6273
6155
  import { Context as Context11 } from "@dxos/context";
6274
6156
  import { invariant as invariant18 } from "@dxos/invariant";
6275
- import { PublicKey as PublicKey17 } from "@dxos/keys";
6157
+ import { PublicKey as PublicKey16 } from "@dxos/keys";
6276
6158
  import { log as log21 } from "@dxos/log";
6277
6159
  import { WebsocketSignalManager } from "@dxos/messaging";
6278
6160
  import { SwarmNetworkManager, createSimplePeerTransportFactory } from "@dxos/network-manager";
@@ -6286,7 +6168,7 @@ import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
6286
6168
  import { Stream as Stream11 } from "@dxos/codec-protobuf";
6287
6169
  import { invariant as invariant17 } from "@dxos/invariant";
6288
6170
  import { Device as Device2, DeviceKind as DeviceKind2 } from "@dxos/protocols/proto/dxos/client/services";
6289
- var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6171
+ var __dxlog_file22 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
6290
6172
  var DevicesServiceImpl = class {
6291
6173
  constructor(_identityManager) {
6292
6174
  this._identityManager = _identityManager;
@@ -6304,7 +6186,7 @@ var DevicesServiceImpl = class {
6304
6186
  });
6305
6187
  } else {
6306
6188
  invariant17(this._identityManager.identity?.presence, "presence not present", {
6307
- F: __dxlog_file23,
6189
+ F: __dxlog_file22,
6308
6190
  L: 32,
6309
6191
  S: this,
6310
6192
  A: [
@@ -6410,93 +6292,10 @@ var findConfigs = () => {
6410
6292
  return configs.map((r) => r.instance.deref()).filter(nonNullable);
6411
6293
  };
6412
6294
 
6413
- // packages/sdk/client-services/src/packlets/identity/contacts-service.ts
6414
- import { EventSubscriptions as EventSubscriptions4, scheduleTask as scheduleTask7, UpdateScheduler as UpdateScheduler2 } from "@dxos/async";
6415
- import { Stream as Stream12 } from "@dxos/codec-protobuf";
6416
- import { PublicKey as PublicKey15 } from "@dxos/keys";
6417
- import { ComplexMap as ComplexMap4, ComplexSet as ComplexSet6 } from "@dxos/util";
6418
- var ContactsServiceImpl = class {
6419
- constructor(_identityManager, _spaceManager, _dataSpaceManagerProvider) {
6420
- this._identityManager = _identityManager;
6421
- this._spaceManager = _spaceManager;
6422
- this._dataSpaceManagerProvider = _dataSpaceManagerProvider;
6423
- }
6424
- async getContacts() {
6425
- const identity = this._identityManager.identity;
6426
- if (identity == null) {
6427
- return {
6428
- contacts: []
6429
- };
6430
- }
6431
- const contacts = [
6432
- ...this._spaceManager.spaces.values()
6433
- ].flatMap((s) => [
6434
- ...s.spaceState.members.values()
6435
- ].map((m) => [
6436
- s.key,
6437
- m
6438
- ])).reduce((acc, v) => {
6439
- const [spaceKey, memberInfo] = v;
6440
- if (memberInfo.key.equals(identity.identityKey)) {
6441
- return acc;
6442
- }
6443
- const existing = acc.get(memberInfo.key);
6444
- if (existing != null) {
6445
- existing.profile ??= memberInfo.profile;
6446
- existing.commonSpaces?.push(spaceKey);
6447
- } else {
6448
- acc.set(memberInfo.key, {
6449
- identityKey: memberInfo.key,
6450
- profile: memberInfo.profile,
6451
- commonSpaces: [
6452
- spaceKey
6453
- ]
6454
- });
6455
- }
6456
- return acc;
6457
- }, new ComplexMap4(PublicKey15.hash));
6458
- return {
6459
- contacts: [
6460
- ...contacts.values()
6461
- ]
6462
- };
6463
- }
6464
- queryContacts() {
6465
- const subscribedSpaceKeySet = new ComplexSet6(PublicKey15.hash);
6466
- return new Stream12(({ next, ctx }) => {
6467
- const pushUpdateTask = new UpdateScheduler2(ctx, async () => {
6468
- const contacts = await this.getContacts();
6469
- next(contacts);
6470
- }, {
6471
- maxFrequency: 2
6472
- });
6473
- scheduleTask7(ctx, async () => {
6474
- const subscriptions = new EventSubscriptions4();
6475
- ctx.onDispose(() => subscriptions.clear());
6476
- const subscribeToSpaceAndUpdate = () => {
6477
- const oldSetSize = subscribedSpaceKeySet.size;
6478
- for (const space of this._spaceManager.spaces.values()) {
6479
- if (!subscribedSpaceKeySet.has(space.key)) {
6480
- subscriptions.add(space.stateUpdate.on(ctx, () => pushUpdateTask.trigger()));
6481
- subscribedSpaceKeySet.add(space.key);
6482
- }
6483
- }
6484
- if (oldSetSize !== subscribedSpaceKeySet.size) {
6485
- pushUpdateTask.trigger();
6486
- }
6487
- };
6488
- const unsubscribe = (await this._dataSpaceManagerProvider()).updated.on(ctx, subscribeToSpaceAndUpdate);
6489
- ctx.onDispose(unsubscribe);
6490
- subscribeToSpaceAndUpdate();
6491
- });
6492
- });
6493
- }
6494
- };
6495
-
6496
6295
  // packages/sdk/client-services/src/packlets/logging/logging-service.ts
6497
6296
  import { Event as Event8 } from "@dxos/async";
6498
- import { Stream as Stream13 } from "@dxos/codec-protobuf";
6499
- import { PublicKey as PublicKey16 } from "@dxos/keys";
6297
+ import { Stream as Stream12 } from "@dxos/codec-protobuf";
6298
+ import { PublicKey as PublicKey15 } from "@dxos/keys";
6500
6299
  import { getContextFromEntry, log as log20 } from "@dxos/log";
6501
6300
  import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
6502
6301
  import { getDebugName, jsonify, numericalValues, tracer } from "@dxos/util";
@@ -6504,7 +6303,7 @@ var LoggingServiceImpl = class {
6504
6303
  constructor() {
6505
6304
  this._logs = new Event8();
6506
6305
  this._started = Date.now();
6507
- this._sessionId = PublicKey16.random().toHex();
6306
+ this._sessionId = PublicKey15.random().toHex();
6508
6307
  this._logProcessor = (_config, entry2) => {
6509
6308
  this._logs.emit(entry2);
6510
6309
  };
@@ -6540,7 +6339,7 @@ var LoggingServiceImpl = class {
6540
6339
  stats: numericalValues(events, "duration")
6541
6340
  };
6542
6341
  };
6543
- return new Stream13(({ next }) => {
6342
+ return new Stream12(({ next }) => {
6544
6343
  const update = () => {
6545
6344
  const metrics = {
6546
6345
  timestamp: /* @__PURE__ */ new Date(),
@@ -6562,7 +6361,7 @@ var LoggingServiceImpl = class {
6562
6361
  });
6563
6362
  }
6564
6363
  queryLogs(request) {
6565
- return new Stream13(({ ctx, next }) => {
6364
+ return new Stream12(({ ctx, next }) => {
6566
6365
  const handler = (entry2) => {
6567
6366
  if (LOG_PROCESSING > 0) {
6568
6367
  return;
@@ -6618,14 +6417,14 @@ var shouldLog = (entry2, request) => {
6618
6417
  var LOG_PROCESSING = 0;
6619
6418
 
6620
6419
  // packages/sdk/client-services/src/packlets/network/network-service.ts
6621
- import { Stream as Stream14 } from "@dxos/codec-protobuf";
6420
+ import { Stream as Stream13 } from "@dxos/codec-protobuf";
6622
6421
  var NetworkServiceImpl = class {
6623
6422
  constructor(networkManager, signalManager) {
6624
6423
  this.networkManager = networkManager;
6625
6424
  this.signalManager = signalManager;
6626
6425
  }
6627
6426
  queryStatus() {
6628
- return new Stream14(({ next }) => {
6427
+ return new Stream13(({ next }) => {
6629
6428
  const update = () => {
6630
6429
  next({
6631
6430
  swarm: this.networkManager.connectionState,
@@ -6651,7 +6450,7 @@ var NetworkServiceImpl = class {
6651
6450
  };
6652
6451
 
6653
6452
  // packages/sdk/client-services/src/packlets/system/system-service.ts
6654
- import { Stream as Stream15 } from "@dxos/codec-protobuf";
6453
+ import { Stream as Stream14 } from "@dxos/codec-protobuf";
6655
6454
  import { GetDiagnosticsRequest as GetDiagnosticsRequest2 } from "@dxos/protocols/proto/dxos/client/services";
6656
6455
  import { jsonKeyReplacer as jsonKeyReplacer2 } from "@dxos/util";
6657
6456
  var SystemServiceImpl = class {
@@ -6687,7 +6486,7 @@ var SystemServiceImpl = class {
6687
6486
  }
6688
6487
  // TODO(burdon): Standardize interval option in stream request?
6689
6488
  queryStatus({ interval = 3e3 } = {}) {
6690
- return new Stream15(({ next }) => {
6489
+ return new Stream14(({ next }) => {
6691
6490
  const update = () => {
6692
6491
  next({
6693
6492
  status: this._getCurrentStatus()
@@ -6718,7 +6517,7 @@ function _ts_decorate8(decorators, target, key, desc) {
6718
6517
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6719
6518
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6720
6519
  }
6721
- var __dxlog_file24 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
6520
+ var __dxlog_file23 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
6722
6521
  var ClientServicesHost = class {
6723
6522
  constructor({
6724
6523
  config,
@@ -6751,10 +6550,7 @@ var ClientServicesHost = class {
6751
6550
  lockKey,
6752
6551
  onAcquire: () => {
6753
6552
  if (!this._opening) {
6754
- void this.open(new Context11(void 0, {
6755
- F: __dxlog_file24,
6756
- L: 121
6757
- }));
6553
+ void this.open(new Context11());
6758
6554
  }
6759
6555
  },
6760
6556
  onRelease: () => this.close()
@@ -6810,8 +6606,8 @@ var ClientServicesHost = class {
6810
6606
  */
6811
6607
  initialize({ config, ...options }) {
6812
6608
  invariant18(!this._open, "service host is open", {
6813
- F: __dxlog_file24,
6814
- L: 187,
6609
+ F: __dxlog_file23,
6610
+ L: 186,
6815
6611
  S: this,
6816
6612
  A: [
6817
6613
  "!this._open",
@@ -6819,15 +6615,15 @@ var ClientServicesHost = class {
6819
6615
  ]
6820
6616
  });
6821
6617
  log21("initializing...", void 0, {
6822
- F: __dxlog_file24,
6823
- L: 188,
6618
+ F: __dxlog_file23,
6619
+ L: 187,
6824
6620
  S: this,
6825
6621
  C: (f, a) => f(...a)
6826
6622
  });
6827
6623
  if (config) {
6828
6624
  invariant18(!this._config, "config already set", {
6829
- F: __dxlog_file24,
6830
- L: 191,
6625
+ F: __dxlog_file23,
6626
+ L: 190,
6831
6627
  S: this,
6832
6628
  A: [
6833
6629
  "!this._config",
@@ -6841,8 +6637,8 @@ var ClientServicesHost = class {
6841
6637
  }
6842
6638
  if (!options.signalManager) {
6843
6639
  log21.warn("running signaling without telemetry metadata.", void 0, {
6844
- F: __dxlog_file24,
6845
- L: 199,
6640
+ F: __dxlog_file23,
6641
+ L: 198,
6846
6642
  S: this,
6847
6643
  C: (f, a) => f(...a)
6848
6644
  });
@@ -6852,8 +6648,8 @@ var ClientServicesHost = class {
6852
6648
  }), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
6853
6649
  this._signalManager = signalManager;
6854
6650
  invariant18(!this._networkManager, "network manager already set", {
6855
- F: __dxlog_file24,
6856
- L: 210,
6651
+ F: __dxlog_file23,
6652
+ L: 209,
6857
6653
  S: this,
6858
6654
  A: [
6859
6655
  "!this._networkManager",
@@ -6866,8 +6662,8 @@ var ClientServicesHost = class {
6866
6662
  signalManager
6867
6663
  });
6868
6664
  log21("initialized", void 0, {
6869
- F: __dxlog_file24,
6870
- L: 217,
6665
+ F: __dxlog_file23,
6666
+ L: 216,
6871
6667
  S: this,
6872
6668
  C: (f, a) => f(...a)
6873
6669
  });
@@ -6876,18 +6672,18 @@ var ClientServicesHost = class {
6876
6672
  if (this._open) {
6877
6673
  return;
6878
6674
  }
6879
- const traceId = PublicKey17.random().toHex();
6675
+ const traceId = PublicKey16.random().toHex();
6880
6676
  log21.trace("dxos.client-services.host.open", trace10.begin({
6881
6677
  id: traceId
6882
6678
  }), {
6883
- F: __dxlog_file24,
6884
- L: 228,
6679
+ F: __dxlog_file23,
6680
+ L: 227,
6885
6681
  S: this,
6886
6682
  C: (f, a) => f(...a)
6887
6683
  });
6888
6684
  invariant18(this._config, "config not set", {
6889
- F: __dxlog_file24,
6890
- L: 230,
6685
+ F: __dxlog_file23,
6686
+ L: 229,
6891
6687
  S: this,
6892
6688
  A: [
6893
6689
  "this._config",
@@ -6895,8 +6691,8 @@ var ClientServicesHost = class {
6895
6691
  ]
6896
6692
  });
6897
6693
  invariant18(this._storage, "storage not set", {
6898
- F: __dxlog_file24,
6899
- L: 231,
6694
+ F: __dxlog_file23,
6695
+ L: 230,
6900
6696
  S: this,
6901
6697
  A: [
6902
6698
  "this._storage",
@@ -6904,8 +6700,8 @@ var ClientServicesHost = class {
6904
6700
  ]
6905
6701
  });
6906
6702
  invariant18(this._signalManager, "signal manager not set", {
6907
- F: __dxlog_file24,
6908
- L: 232,
6703
+ F: __dxlog_file23,
6704
+ L: 231,
6909
6705
  S: this,
6910
6706
  A: [
6911
6707
  "this._signalManager",
@@ -6913,8 +6709,8 @@ var ClientServicesHost = class {
6913
6709
  ]
6914
6710
  });
6915
6711
  invariant18(this._networkManager, "network manager not set", {
6916
- F: __dxlog_file24,
6917
- L: 233,
6712
+ F: __dxlog_file23,
6713
+ L: 232,
6918
6714
  S: this,
6919
6715
  A: [
6920
6716
  "this._networkManager",
@@ -6925,8 +6721,8 @@ var ClientServicesHost = class {
6925
6721
  log21("opening...", {
6926
6722
  lockKey: this._resourceLock?.lockKey
6927
6723
  }, {
6928
- F: __dxlog_file24,
6929
- L: 236,
6724
+ F: __dxlog_file23,
6725
+ L: 235,
6930
6726
  S: this,
6931
6727
  C: (f, a) => f(...a)
6932
6728
  });
@@ -6937,18 +6733,16 @@ var ClientServicesHost = class {
6937
6733
  await this._level.open();
6938
6734
  await this._loggingService.open();
6939
6735
  this._serviceContext = new ServiceContext(this._storage, this._level, this._networkManager, this._signalManager, this._runtimeParams);
6940
- const dataSpaceManagerProvider = async () => {
6941
- await this._serviceContext.initialized.wait();
6942
- return this._serviceContext.dataSpaceManager;
6943
- };
6944
6736
  const identityService = new IdentityServiceImpl(this._serviceContext.identityManager, this._serviceContext.keyring, () => this._serviceContext.dataSpaceManager, (params) => this._createIdentity(params), (profile) => this._serviceContext.broadcastProfileUpdate(profile));
6945
6737
  this._serviceRegistry.setServices({
6946
6738
  SystemService: this._systemService,
6947
6739
  IdentityService: identityService,
6948
- ContactsService: new ContactsServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, dataSpaceManagerProvider),
6949
6740
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitationsManager),
6950
6741
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
6951
- SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, dataSpaceManagerProvider),
6742
+ SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, async () => {
6743
+ await this._serviceContext.initialized.wait();
6744
+ return this._serviceContext.dataSpaceManager;
6745
+ }),
6952
6746
  DataService: this._serviceContext.echoHost.dataService,
6953
6747
  QueryService: this._serviceContext.echoHost.queryService,
6954
6748
  NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
@@ -6981,16 +6775,16 @@ var ClientServicesHost = class {
6981
6775
  log21("opened", {
6982
6776
  deviceKey
6983
6777
  }, {
6984
- F: __dxlog_file24,
6985
- L: 322,
6778
+ F: __dxlog_file23,
6779
+ L: 314,
6986
6780
  S: this,
6987
6781
  C: (f, a) => f(...a)
6988
6782
  });
6989
6783
  log21.trace("dxos.client-services.host.open", trace10.end({
6990
6784
  id: traceId
6991
6785
  }), {
6992
- F: __dxlog_file24,
6993
- L: 323,
6786
+ F: __dxlog_file23,
6787
+ L: 315,
6994
6788
  S: this,
6995
6789
  C: (f, a) => f(...a)
6996
6790
  });
@@ -7003,8 +6797,8 @@ var ClientServicesHost = class {
7003
6797
  log21("closing...", {
7004
6798
  deviceKey
7005
6799
  }, {
7006
- F: __dxlog_file24,
7007
- L: 334,
6800
+ F: __dxlog_file23,
6801
+ L: 326,
7008
6802
  S: this,
7009
6803
  C: (f, a) => f(...a)
7010
6804
  });
@@ -7021,41 +6815,41 @@ var ClientServicesHost = class {
7021
6815
  log21("closed", {
7022
6816
  deviceKey
7023
6817
  }, {
7024
- F: __dxlog_file24,
7025
- L: 343,
6818
+ F: __dxlog_file23,
6819
+ L: 335,
7026
6820
  S: this,
7027
6821
  C: (f, a) => f(...a)
7028
6822
  });
7029
6823
  }
7030
6824
  async reset() {
7031
- const traceId = PublicKey17.random().toHex();
6825
+ const traceId = PublicKey16.random().toHex();
7032
6826
  log21.trace("dxos.sdk.client-services-host.reset", trace10.begin({
7033
6827
  id: traceId
7034
6828
  }), {
7035
- F: __dxlog_file24,
7036
- L: 348,
6829
+ F: __dxlog_file23,
6830
+ L: 340,
7037
6831
  S: this,
7038
6832
  C: (f, a) => f(...a)
7039
6833
  });
7040
6834
  log21.info("resetting...", void 0, {
7041
- F: __dxlog_file24,
7042
- L: 350,
6835
+ F: __dxlog_file23,
6836
+ L: 342,
7043
6837
  S: this,
7044
6838
  C: (f, a) => f(...a)
7045
6839
  });
7046
6840
  await this._serviceContext?.close();
7047
6841
  await this._storage.reset();
7048
6842
  log21.info("reset", void 0, {
7049
- F: __dxlog_file24,
7050
- L: 353,
6843
+ F: __dxlog_file23,
6844
+ L: 345,
7051
6845
  S: this,
7052
6846
  C: (f, a) => f(...a)
7053
6847
  });
7054
6848
  log21.trace("dxos.sdk.client-services-host.reset", trace10.end({
7055
6849
  id: traceId
7056
6850
  }), {
7057
- F: __dxlog_file24,
7058
- L: 354,
6851
+ F: __dxlog_file23,
6852
+ L: 346,
7059
6853
  S: this,
7060
6854
  C: (f, a) => f(...a)
7061
6855
  });
@@ -7125,4 +6919,4 @@ export {
7125
6919
  ClientServicesProviderResource,
7126
6920
  DiagnosticsCollector
7127
6921
  };
7128
- //# sourceMappingURL=chunk-LFGNDWPO.mjs.map
6922
+ //# sourceMappingURL=chunk-24JXJ6S3.mjs.map