@dxos/client-services 0.3.5-next.5910692 → 0.3.5-next.b7dc283

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 (38) hide show
  1. package/dist/lib/browser/{chunk-RZTCGO36.mjs → chunk-OKAP23U4.mjs} +94 -73
  2. package/dist/lib/browser/chunk-OKAP23U4.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/packlets/testing/index.mjs +3 -2
  6. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  7. package/dist/lib/node/index.cjs +93 -72
  8. package/dist/lib/node/index.cjs.map +3 -3
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/packlets/testing/index.cjs +95 -73
  11. package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
  12. package/dist/types/src/packlets/identity/identity-service.d.ts +2 -1
  13. package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
  14. package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
  15. package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
  16. package/dist/types/src/packlets/services/service-context.d.ts +2 -0
  17. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  18. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  19. package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -1
  20. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  21. package/dist/types/src/packlets/spaces/data-space.d.ts +2 -0
  22. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  23. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  24. package/dist/types/src/version.d.ts +1 -1
  25. package/package.json +35 -35
  26. package/src/packlets/identity/identity-service.ts +2 -0
  27. package/src/packlets/invitations/invitation-extension.ts +0 -1
  28. package/src/packlets/invitations/invitations-handler.ts +0 -3
  29. package/src/packlets/invitations/space-invitation-protocol.ts +1 -1
  30. package/src/packlets/services/service-context.ts +12 -2
  31. package/src/packlets/services/service-host.ts +1 -0
  32. package/src/packlets/spaces/data-space-manager.ts +2 -1
  33. package/src/packlets/spaces/data-space.ts +13 -1
  34. package/src/packlets/spaces/genesis.ts +1 -1
  35. package/src/packlets/spaces/spaces-service.ts +1 -1
  36. package/src/packlets/testing/test-builder.ts +1 -0
  37. package/src/version.ts +1 -1
  38. package/dist/lib/browser/chunk-RZTCGO36.mjs.map +0 -7
@@ -185,7 +185,7 @@ var getPlatform = () => {
185
185
  };
186
186
 
187
187
  // packages/sdk/client-services/src/version.ts
188
- var DXOS_VERSION = "0.3.5-next.5910692";
188
+ var DXOS_VERSION = "0.3.5-next.b7dc283";
189
189
 
190
190
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
191
191
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -1008,10 +1008,11 @@ var import_debug3 = require("@dxos/debug");
1008
1008
  var import_invariant4 = require("@dxos/invariant");
1009
1009
  var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1010
1010
  var IdentityServiceImpl = class {
1011
- constructor(_createIdentity, _identityManager, _keyring) {
1011
+ constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
1012
1012
  this._createIdentity = _createIdentity;
1013
1013
  this._identityManager = _identityManager;
1014
1014
  this._keyring = _keyring;
1015
+ this._onProfileUpdate = _onProfileUpdate;
1015
1016
  }
1016
1017
  async createIdentity(request) {
1017
1018
  await this._createIdentity(request);
@@ -1042,7 +1043,7 @@ var IdentityServiceImpl = class {
1042
1043
  async updateProfile(profile) {
1043
1044
  (0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
1044
1045
  F: __dxlog_file5,
1045
- L: 59,
1046
+ L: 60,
1046
1047
  S: this,
1047
1048
  A: [
1048
1049
  "this._identityManager.identity",
@@ -1050,12 +1051,13 @@ var IdentityServiceImpl = class {
1050
1051
  ]
1051
1052
  });
1052
1053
  await this._identityManager.updateProfile(profile);
1054
+ await this._onProfileUpdate?.(this._identityManager.identity.profileDocument);
1053
1055
  return this._getIdentity();
1054
1056
  }
1055
1057
  async signPresentation({ presentation, nonce }) {
1056
1058
  (0, import_invariant4.invariant)(this._identityManager.identity, "Identity not initialized.", {
1057
1059
  F: __dxlog_file5,
1058
- L: 65,
1060
+ L: 67,
1059
1061
  S: this,
1060
1062
  A: [
1061
1063
  "this._identityManager.identity",
@@ -1274,7 +1276,6 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1274
1276
  C: (f, a) => f(...a)
1275
1277
  });
1276
1278
  return {
1277
- spaceKey: this.invitation.authMethod === import_services3.Invitation.AuthMethod.NONE ? this.invitation.spaceKey : void 0,
1278
1279
  authMethod: this.invitation.authMethod
1279
1280
  };
1280
1281
  },
@@ -1284,7 +1285,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1284
1285
  id: traceId
1285
1286
  }), {
1286
1287
  F: __dxlog_file7,
1287
- L: 125,
1288
+ L: 124,
1288
1289
  S: this,
1289
1290
  C: (f, a) => f(...a)
1290
1291
  });
@@ -1292,14 +1293,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1292
1293
  authCode: code
1293
1294
  }, {
1294
1295
  F: __dxlog_file7,
1295
- L: 126,
1296
+ L: 125,
1296
1297
  S: this,
1297
1298
  C: (f, a) => f(...a)
1298
1299
  });
1299
1300
  let status = import_invitations.AuthenticationResponse.Status.OK;
1300
1301
  (0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
1301
1302
  F: __dxlog_file7,
1302
- L: 129,
1303
+ L: 128,
1303
1304
  S: this,
1304
1305
  A: [
1305
1306
  "this.invitation",
@@ -1310,7 +1311,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1310
1311
  case import_services3.Invitation.AuthMethod.NONE: {
1311
1312
  (0, import_log5.log)("authentication not required", void 0, {
1312
1313
  F: __dxlog_file7,
1313
- L: 132,
1314
+ L: 131,
1314
1315
  S: this,
1315
1316
  C: (f, a) => f(...a)
1316
1317
  });
@@ -1335,7 +1336,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1335
1336
  authMethod: this.invitation.authMethod
1336
1337
  }, {
1337
1338
  F: __dxlog_file7,
1338
- L: 150,
1339
+ L: 149,
1339
1340
  S: this,
1340
1341
  C: (f, a) => f(...a)
1341
1342
  });
@@ -1350,7 +1351,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1350
1351
  }
1351
1352
  }), {
1352
1353
  F: __dxlog_file7,
1353
- L: 156,
1354
+ L: 155,
1354
1355
  S: this,
1355
1356
  C: (f, a) => f(...a)
1356
1357
  });
@@ -1364,14 +1365,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1364
1365
  id: traceId
1365
1366
  }), {
1366
1367
  F: __dxlog_file7,
1367
- L: 162,
1368
+ L: 161,
1368
1369
  S: this,
1369
1370
  C: (f, a) => f(...a)
1370
1371
  });
1371
1372
  try {
1372
1373
  (0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
1373
1374
  F: __dxlog_file7,
1374
- L: 165,
1375
+ L: 164,
1375
1376
  S: this,
1376
1377
  A: [
1377
1378
  "this.invitation",
@@ -1386,7 +1387,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1386
1387
  id: traceId
1387
1388
  }), {
1388
1389
  F: __dxlog_file7,
1389
- L: 173,
1390
+ L: 172,
1390
1391
  S: this,
1391
1392
  C: (f, a) => f(...a)
1392
1393
  });
@@ -1443,7 +1444,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1443
1444
  options: async (options) => {
1444
1445
  (0, import_invariant6.invariant)(!this._remoteOptions, "Remote options already set.", {
1445
1446
  F: __dxlog_file7,
1446
- L: 240,
1447
+ L: 239,
1447
1448
  S: this,
1448
1449
  A: [
1449
1450
  "!this._remoteOptions",
@@ -1470,7 +1471,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1470
1471
  try {
1471
1472
  (0, import_log5.log)("begin options", void 0, {
1472
1473
  F: __dxlog_file7,
1473
- L: 261,
1474
+ L: 260,
1474
1475
  S: this,
1475
1476
  C: (f, a) => f(...a)
1476
1477
  });
@@ -1482,7 +1483,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1482
1483
  }));
1483
1484
  (0, import_log5.log)("end options", void 0, {
1484
1485
  F: __dxlog_file7,
1485
- L: 264,
1486
+ L: 263,
1486
1487
  S: this,
1487
1488
  C: (f, a) => f(...a)
1488
1489
  });
@@ -1496,7 +1497,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1496
1497
  } catch (err) {
1497
1498
  (0, import_log5.log)("openError", err, {
1498
1499
  F: __dxlog_file7,
1499
- L: 274,
1500
+ L: 273,
1500
1501
  S: this,
1501
1502
  C: (f, a) => f(...a)
1502
1503
  });
@@ -1506,7 +1507,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
1506
1507
  async onClose() {
1507
1508
  (0, import_log5.log)("onClose", void 0, {
1508
1509
  F: __dxlog_file7,
1509
- L: 280,
1510
+ L: 279,
1510
1511
  S: this,
1511
1512
  C: (f, a) => f(...a)
1512
1513
  });
@@ -1877,14 +1878,11 @@ var InvitationsHandler = class {
1877
1878
  C: (f, a) => f(...a)
1878
1879
  });
1879
1880
  invitation.authMethod = introductionResponse.authMethod;
1880
- if (introductionResponse.spaceKey) {
1881
- invitation.spaceKey = introductionResponse.spaceKey;
1882
- }
1883
1881
  if (isAuthenticationRequired(invitation)) {
1884
1882
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
1885
1883
  (0, import_log6.log)("guest waiting for authentication code...", void 0, {
1886
1884
  F: __dxlog_file8,
1887
- L: 289,
1885
+ L: 286,
1888
1886
  S: this,
1889
1887
  C: (f, a) => f(...a)
1890
1888
  });
@@ -1896,7 +1894,7 @@ var InvitationsHandler = class {
1896
1894
  });
1897
1895
  (0, import_log6.log)("sending authentication request", void 0, {
1898
1896
  F: __dxlog_file8,
1899
- L: 293,
1897
+ L: 290,
1900
1898
  S: this,
1901
1899
  C: (f, a) => f(...a)
1902
1900
  });
@@ -1917,7 +1915,7 @@ var InvitationsHandler = class {
1917
1915
  attempt
1918
1916
  }, {
1919
1917
  F: __dxlog_file8,
1920
- L: 304,
1918
+ L: 301,
1921
1919
  S: this,
1922
1920
  C: (f, a) => f(...a)
1923
1921
  });
@@ -1934,7 +1932,7 @@ var InvitationsHandler = class {
1934
1932
  ...protocol.toJSON()
1935
1933
  }, {
1936
1934
  F: __dxlog_file8,
1937
- L: 315,
1935
+ L: 312,
1938
1936
  S: this,
1939
1937
  C: (f, a) => f(...a)
1940
1938
  });
@@ -1946,7 +1944,7 @@ var InvitationsHandler = class {
1946
1944
  ...protocol.toJSON()
1947
1945
  }, {
1948
1946
  F: __dxlog_file8,
1949
- L: 326,
1947
+ L: 323,
1950
1948
  S: this,
1951
1949
  C: (f, a) => f(...a)
1952
1950
  });
@@ -1958,7 +1956,7 @@ var InvitationsHandler = class {
1958
1956
  id: traceId
1959
1957
  }), {
1960
1958
  F: __dxlog_file8,
1961
- L: 328,
1959
+ L: 325,
1962
1960
  S: this,
1963
1961
  C: (f, a) => f(...a)
1964
1962
  });
@@ -1968,7 +1966,7 @@ var InvitationsHandler = class {
1968
1966
  ...protocol.toJSON()
1969
1967
  }, {
1970
1968
  F: __dxlog_file8,
1971
- L: 331,
1969
+ L: 328,
1972
1970
  S: this,
1973
1971
  C: (f, a) => f(...a)
1974
1972
  });
@@ -1978,7 +1976,7 @@ var InvitationsHandler = class {
1978
1976
  } else {
1979
1977
  (0, import_log6.log)("auth failed", err, {
1980
1978
  F: __dxlog_file8,
1981
- L: 334,
1979
+ L: 331,
1982
1980
  S: this,
1983
1981
  C: (f, a) => f(...a)
1984
1982
  });
@@ -1989,7 +1987,7 @@ var InvitationsHandler = class {
1989
1987
  error: err
1990
1988
  }), {
1991
1989
  F: __dxlog_file8,
1992
- L: 337,
1990
+ L: 334,
1993
1991
  S: this,
1994
1992
  C: (f, a) => f(...a)
1995
1993
  });
@@ -2007,7 +2005,7 @@ var InvitationsHandler = class {
2007
2005
  ...protocol.toJSON()
2008
2006
  }, {
2009
2007
  F: __dxlog_file8,
2010
- L: 348,
2008
+ L: 345,
2011
2009
  S: this,
2012
2010
  C: (f, a) => f(...a)
2013
2011
  });
@@ -2017,7 +2015,7 @@ var InvitationsHandler = class {
2017
2015
  } else {
2018
2016
  (0, import_log6.log)("auth failed", err, {
2019
2017
  F: __dxlog_file8,
2020
- L: 351,
2018
+ L: 348,
2021
2019
  S: this,
2022
2020
  C: (f, a) => f(...a)
2023
2021
  });
@@ -2030,7 +2028,7 @@ var InvitationsHandler = class {
2030
2028
  (0, import_async5.scheduleTask)(ctx, async () => {
2031
2029
  (0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
2032
2030
  F: __dxlog_file8,
2033
- L: 361,
2031
+ L: 358,
2034
2032
  S: this,
2035
2033
  A: [
2036
2034
  "invitation.swarmKey",
@@ -2347,7 +2345,7 @@ var SpaceInvitationProtocol = class {
2347
2345
  }
2348
2346
  createIntroduction() {
2349
2347
  return {
2350
- profile: this._signingContext.profile
2348
+ profile: this._signingContext.getProfile()
2351
2349
  };
2352
2350
  }
2353
2351
  async createAdmissionRequest() {
@@ -2978,6 +2976,21 @@ var DataSpace = class DataSpace2 {
2978
2976
  await this._metadataStore.setWritableFeedKeys(this.key, this.inner.controlFeedKey, this.inner.dataFeedKey);
2979
2977
  }
2980
2978
  }
2979
+ // TODO(dmaretskyi): Use profile from signing context.
2980
+ async updateOwnProfile(profile) {
2981
+ const credential = await this._signingContext.credentialSigner.createCredential({
2982
+ subject: this._signingContext.identityKey,
2983
+ assertion: {
2984
+ "@type": "dxos.halo.credentials.MemberProfile",
2985
+ profile
2986
+ }
2987
+ });
2988
+ await this.inner.controlPipeline.writer.write({
2989
+ credential: {
2990
+ credential
2991
+ }
2992
+ });
2993
+ }
2981
2994
  async createEpoch() {
2982
2995
  const epoch = await this.dataPipeline.createEpoch();
2983
2996
  const receipt = await this.inner.controlPipeline.writer.write({
@@ -3026,7 +3039,7 @@ var DataSpace = class DataSpace2 {
3026
3039
  state: import_services7.SpaceState[this._state]
3027
3040
  }, {
3028
3041
  F: __dxlog_file12,
3029
- L: 392,
3042
+ L: 404,
3030
3043
  S: this,
3031
3044
  C: (f, a) => f(...a)
3032
3045
  });
@@ -3086,7 +3099,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
3086
3099
  "@type": "dxos.halo.credentials.SpaceMember",
3087
3100
  spaceKey: space.key,
3088
3101
  role: import_credentials13.SpaceMember.Role.ADMIN,
3089
- profile: signingContext.profile,
3102
+ profile: signingContext.getProfile(),
3090
3103
  genesisFeedKey: space.controlFeedKey ?? (0, import_debug5.failUndefined)()
3091
3104
  }
3092
3105
  }),
@@ -3166,7 +3179,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3166
3179
  async open() {
3167
3180
  (0, import_log11.log)("open", void 0, {
3168
3181
  F: __dxlog_file13,
3169
- L: 82,
3182
+ L: 83,
3170
3183
  S: this,
3171
3184
  C: (f, a) => f(...a)
3172
3185
  });
@@ -3174,7 +3187,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3174
3187
  id: this._instanceId
3175
3188
  }), {
3176
3189
  F: __dxlog_file13,
3177
- L: 83,
3190
+ L: 84,
3178
3191
  S: this,
3179
3192
  C: (f, a) => f(...a)
3180
3193
  });
@@ -3182,7 +3195,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3182
3195
  spaces: this._metadataStore.spaces.length
3183
3196
  }, {
3184
3197
  F: __dxlog_file13,
3185
- L: 84,
3198
+ L: 85,
3186
3199
  S: this,
3187
3200
  C: (f, a) => f(...a)
3188
3201
  });
@@ -3192,7 +3205,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3192
3205
  spaceMetadata
3193
3206
  }, {
3194
3207
  F: __dxlog_file13,
3195
- L: 88,
3208
+ L: 89,
3196
3209
  S: this,
3197
3210
  C: (f, a) => f(...a)
3198
3211
  });
@@ -3203,7 +3216,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3203
3216
  err
3204
3217
  }, {
3205
3218
  F: __dxlog_file13,
3206
- L: 91,
3219
+ L: 92,
3207
3220
  S: this,
3208
3221
  C: (f, a) => f(...a)
3209
3222
  });
@@ -3220,7 +3233,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3220
3233
  id: this._instanceId
3221
3234
  }), {
3222
3235
  F: __dxlog_file13,
3223
- L: 104,
3236
+ L: 105,
3224
3237
  S: this,
3225
3238
  C: (f, a) => f(...a)
3226
3239
  });
@@ -3228,7 +3241,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3228
3241
  async close() {
3229
3242
  (0, import_log11.log)("close", void 0, {
3230
3243
  F: __dxlog_file13,
3231
- L: 109,
3244
+ L: 110,
3232
3245
  S: this,
3233
3246
  C: (f, a) => f(...a)
3234
3247
  });
@@ -3244,7 +3257,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3244
3257
  async createSpace() {
3245
3258
  (0, import_invariant11.invariant)(this._isOpen, "Not open.", {
3246
3259
  F: __dxlog_file13,
3247
- L: 122,
3260
+ L: 123,
3248
3261
  S: this,
3249
3262
  A: [
3250
3263
  "this._isOpen",
@@ -3265,7 +3278,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3265
3278
  spaceKey
3266
3279
  }, {
3267
3280
  F: __dxlog_file13,
3268
- L: 134,
3281
+ L: 135,
3269
3282
  S: this,
3270
3283
  C: (f, a) => f(...a)
3271
3284
  });
@@ -3275,7 +3288,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3275
3288
  const memberCredential = credentials[1];
3276
3289
  (0, import_invariant11.invariant)((0, import_credentials14.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
3277
3290
  F: __dxlog_file13,
3278
- L: 141,
3291
+ L: 142,
3279
3292
  S: this,
3280
3293
  A: [
3281
3294
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -3293,13 +3306,13 @@ var DataSpaceManager = class DataSpaceManager2 {
3293
3306
  opts
3294
3307
  }, {
3295
3308
  F: __dxlog_file13,
3296
- L: 153,
3309
+ L: 154,
3297
3310
  S: this,
3298
3311
  C: (f, a) => f(...a)
3299
3312
  });
3300
3313
  (0, import_invariant11.invariant)(this._isOpen, "Not open.", {
3301
3314
  F: __dxlog_file13,
3302
- L: 154,
3315
+ L: 155,
3303
3316
  S: this,
3304
3317
  A: [
3305
3318
  "this._isOpen",
@@ -3308,7 +3321,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3308
3321
  });
3309
3322
  (0, import_invariant11.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
3310
3323
  F: __dxlog_file13,
3311
- L: 155,
3324
+ L: 156,
3312
3325
  S: this,
3313
3326
  A: [
3314
3327
  "!this._spaces.has(opts.spaceKey)",
@@ -3343,7 +3356,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3343
3356
  metadata
3344
3357
  }, {
3345
3358
  F: __dxlog_file13,
3346
- L: 188,
3359
+ L: 189,
3347
3360
  S: this,
3348
3361
  C: (f, a) => f(...a)
3349
3362
  });
@@ -3379,7 +3392,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3379
3392
  onAuthFailure: () => {
3380
3393
  import_log11.log.warn("auth failure", void 0, {
3381
3394
  F: __dxlog_file13,
3382
- L: 223,
3395
+ L: 224,
3383
3396
  S: this,
3384
3397
  C: (f, a) => f(...a)
3385
3398
  });
@@ -3403,7 +3416,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3403
3416
  space: space.key
3404
3417
  }, {
3405
3418
  F: __dxlog_file13,
3406
- L: 241,
3419
+ L: 242,
3407
3420
  S: this,
3408
3421
  C: (f, a) => f(...a)
3409
3422
  });
@@ -3415,7 +3428,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3415
3428
  open: this._isOpen
3416
3429
  }, {
3417
3430
  F: __dxlog_file13,
3418
- L: 248,
3431
+ L: 249,
3419
3432
  S: this,
3420
3433
  C: (f, a) => f(...a)
3421
3434
  });
@@ -3428,7 +3441,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3428
3441
  space: space.key
3429
3442
  }, {
3430
3443
  F: __dxlog_file13,
3431
- L: 254,
3444
+ L: 255,
3432
3445
  S: this,
3433
3446
  C: (f, a) => f(...a)
3434
3447
  });
@@ -3672,7 +3685,7 @@ var SpacesServiceImpl = class {
3672
3685
  identity: {
3673
3686
  identityKey: member.key,
3674
3687
  profile: {
3675
- displayName: member.assertion.profile?.displayName
3688
+ displayName: member.profile?.displayName
3676
3689
  }
3677
3690
  },
3678
3691
  presence: member.removed ? import_services9.SpaceMember.PresenceState.REMOVED : isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
@@ -3817,6 +3830,14 @@ var ServiceContext = class ServiceContext2 {
3817
3830
  });
3818
3831
  return factory(invitation);
3819
3832
  }
3833
+ async broadcastProfileUpdate(profile) {
3834
+ if (!profile || !this.dataSpaceManager) {
3835
+ return;
3836
+ }
3837
+ for (const space of this.dataSpaceManager.spaces.values()) {
3838
+ await space.updateOwnProfile(profile);
3839
+ }
3840
+ }
3820
3841
  async _acceptIdentity(params) {
3821
3842
  const identity = await this.identityManager.acceptIdentity(params);
3822
3843
  await this._initialize(new import_context8.Context());
@@ -3832,7 +3853,7 @@ var ServiceContext = class ServiceContext2 {
3832
3853
  async _initialize(ctx) {
3833
3854
  (0, import_log13.log)("initializing spaces...", void 0, {
3834
3855
  F: __dxlog_file15,
3835
- L: 189,
3856
+ L: 199,
3836
3857
  S: this,
3837
3858
  C: (f, a) => f(...a)
3838
3859
  });
@@ -3841,7 +3862,7 @@ var ServiceContext = class ServiceContext2 {
3841
3862
  credentialSigner: identity.getIdentityCredentialSigner(),
3842
3863
  identityKey: identity.identityKey,
3843
3864
  deviceKey: identity.deviceKey,
3844
- profile: identity.profileDocument,
3865
+ getProfile: () => identity.profileDocument,
3845
3866
  recordCredential: async (credential) => {
3846
3867
  await identity.controlPipeline.writer.write({
3847
3868
  credential: {
@@ -3855,7 +3876,7 @@ var ServiceContext = class ServiceContext2 {
3855
3876
  this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
3856
3877
  (0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
3857
3878
  F: __dxlog_file15,
3858
- L: 212,
3879
+ L: 222,
3859
3880
  S: this,
3860
3881
  A: [
3861
3882
  "this.dataSpaceManager",
@@ -3879,7 +3900,7 @@ var ServiceContext = class ServiceContext2 {
3879
3900
  details: assertion
3880
3901
  }, {
3881
3902
  F: __dxlog_file15,
3882
- L: 228,
3903
+ L: 238,
3883
3904
  S: this,
3884
3905
  C: (f, a) => f(...a)
3885
3906
  });
@@ -3890,7 +3911,7 @@ var ServiceContext = class ServiceContext2 {
3890
3911
  details: assertion
3891
3912
  }, {
3892
3913
  F: __dxlog_file15,
3893
- L: 232,
3914
+ L: 242,
3894
3915
  S: this,
3895
3916
  C: (f, a) => f(...a)
3896
3917
  });
@@ -3901,7 +3922,7 @@ var ServiceContext = class ServiceContext2 {
3901
3922
  details: assertion
3902
3923
  }, {
3903
3924
  F: __dxlog_file15,
3904
- L: 237,
3925
+ L: 247,
3905
3926
  S: this,
3906
3927
  C: (f, a) => f(...a)
3907
3928
  });
@@ -3912,7 +3933,7 @@ var ServiceContext = class ServiceContext2 {
3912
3933
  } catch (err) {
3913
3934
  import_log13.log.catch(err, void 0, {
3914
3935
  F: __dxlog_file15,
3915
- L: 243,
3936
+ L: 253,
3916
3937
  S: this,
3917
3938
  C: (f, a) => f(...a)
3918
3939
  });
@@ -4867,7 +4888,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4867
4888
  this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
4868
4889
  this._serviceRegistry.setServices({
4869
4890
  SystemService: this._systemService,
4870
- IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
4891
+ IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
4871
4892
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
4872
4893
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
4873
4894
  SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
@@ -4904,7 +4925,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4904
4925
  deviceKey
4905
4926
  }, {
4906
4927
  F: __dxlog_file17,
4907
- L: 316,
4928
+ L: 317,
4908
4929
  S: this,
4909
4930
  C: (f, a) => f(...a)
4910
4931
  });
@@ -4912,7 +4933,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4912
4933
  id: traceId
4913
4934
  }), {
4914
4935
  F: __dxlog_file17,
4915
- L: 317,
4936
+ L: 318,
4916
4937
  S: this,
4917
4938
  C: (f, a) => f(...a)
4918
4939
  });
@@ -4926,7 +4947,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4926
4947
  deviceKey
4927
4948
  }, {
4928
4949
  F: __dxlog_file17,
4929
- L: 328,
4950
+ L: 329,
4930
4951
  S: this,
4931
4952
  C: (f, a) => f(...a)
4932
4953
  });
@@ -4942,7 +4963,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4942
4963
  deviceKey
4943
4964
  }, {
4944
4965
  F: __dxlog_file17,
4945
- L: 335,
4966
+ L: 336,
4946
4967
  S: this,
4947
4968
  C: (f, a) => f(...a)
4948
4969
  });
@@ -4953,13 +4974,13 @@ var ClientServicesHost = class ClientServicesHost2 {
4953
4974
  id: traceId
4954
4975
  }), {
4955
4976
  F: __dxlog_file17,
4956
- L: 340,
4977
+ L: 341,
4957
4978
  S: this,
4958
4979
  C: (f, a) => f(...a)
4959
4980
  });
4960
4981
  (0, import_log16.log)("resetting...", void 0, {
4961
4982
  F: __dxlog_file17,
4962
- L: 342,
4983
+ L: 343,
4963
4984
  S: this,
4964
4985
  C: (f, a) => f(...a)
4965
4986
  });
@@ -4967,7 +4988,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4967
4988
  await this._storage.reset();
4968
4989
  (0, import_log16.log)("reset", void 0, {
4969
4990
  F: __dxlog_file17,
4970
- L: 345,
4991
+ L: 346,
4971
4992
  S: this,
4972
4993
  C: (f, a) => f(...a)
4973
4994
  });
@@ -4975,7 +4996,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4975
4996
  id: traceId
4976
4997
  }), {
4977
4998
  F: __dxlog_file17,
4978
- L: 346,
4999
+ L: 347,
4979
5000
  S: this,
4980
5001
  C: (f, a) => f(...a)
4981
5002
  });
@@ -5336,7 +5357,8 @@ var createSigningContext = async (keyring) => {
5336
5357
  credential: await new import_credentials16.CredentialGenerator(keyring, identityKey, deviceKey).createDeviceAuthorization(deviceKey)
5337
5358
  }, deviceKey),
5338
5359
  recordCredential: async () => {
5339
- }
5360
+ },
5361
+ getProfile: () => void 0
5340
5362
  };
5341
5363
  };
5342
5364
  // Annotate the CommonJS export names for ESM import in node: