@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
@@ -1019,10 +1019,11 @@ import { todo } from "@dxos/debug";
1019
1019
  import { invariant as invariant3 } from "@dxos/invariant";
1020
1020
  var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1021
1021
  var IdentityServiceImpl = class {
1022
- constructor(_createIdentity, _identityManager, _keyring) {
1022
+ constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
1023
1023
  this._createIdentity = _createIdentity;
1024
1024
  this._identityManager = _identityManager;
1025
1025
  this._keyring = _keyring;
1026
+ this._onProfileUpdate = _onProfileUpdate;
1026
1027
  }
1027
1028
  async createIdentity(request) {
1028
1029
  await this._createIdentity(request);
@@ -1053,7 +1054,7 @@ var IdentityServiceImpl = class {
1053
1054
  async updateProfile(profile) {
1054
1055
  invariant3(this._identityManager.identity, "Identity not initialized.", {
1055
1056
  F: __dxlog_file4,
1056
- L: 59,
1057
+ L: 60,
1057
1058
  S: this,
1058
1059
  A: [
1059
1060
  "this._identityManager.identity",
@@ -1061,12 +1062,13 @@ var IdentityServiceImpl = class {
1061
1062
  ]
1062
1063
  });
1063
1064
  await this._identityManager.updateProfile(profile);
1065
+ await this._onProfileUpdate?.(this._identityManager.identity.profileDocument);
1064
1066
  return this._getIdentity();
1065
1067
  }
1066
1068
  async signPresentation({ presentation, nonce }) {
1067
1069
  invariant3(this._identityManager.identity, "Identity not initialized.", {
1068
1070
  F: __dxlog_file4,
1069
- L: 65,
1071
+ L: 67,
1070
1072
  S: this,
1071
1073
  A: [
1072
1074
  "this._identityManager.identity",
@@ -1285,7 +1287,6 @@ var InvitationHostExtension = class extends RpcExtension {
1285
1287
  C: (f, a) => f(...a)
1286
1288
  });
1287
1289
  return {
1288
- spaceKey: this.invitation.authMethod === Invitation2.AuthMethod.NONE ? this.invitation.spaceKey : void 0,
1289
1290
  authMethod: this.invitation.authMethod
1290
1291
  };
1291
1292
  },
@@ -1295,7 +1296,7 @@ var InvitationHostExtension = class extends RpcExtension {
1295
1296
  id: traceId
1296
1297
  }), {
1297
1298
  F: __dxlog_file6,
1298
- L: 125,
1299
+ L: 124,
1299
1300
  S: this,
1300
1301
  C: (f, a) => f(...a)
1301
1302
  });
@@ -1303,14 +1304,14 @@ var InvitationHostExtension = class extends RpcExtension {
1303
1304
  authCode: code
1304
1305
  }, {
1305
1306
  F: __dxlog_file6,
1306
- L: 126,
1307
+ L: 125,
1307
1308
  S: this,
1308
1309
  C: (f, a) => f(...a)
1309
1310
  });
1310
1311
  let status = AuthenticationResponse.Status.OK;
1311
1312
  invariant5(this.invitation, "Invitation is not set.", {
1312
1313
  F: __dxlog_file6,
1313
- L: 129,
1314
+ L: 128,
1314
1315
  S: this,
1315
1316
  A: [
1316
1317
  "this.invitation",
@@ -1321,7 +1322,7 @@ var InvitationHostExtension = class extends RpcExtension {
1321
1322
  case Invitation2.AuthMethod.NONE: {
1322
1323
  log4("authentication not required", void 0, {
1323
1324
  F: __dxlog_file6,
1324
- L: 132,
1325
+ L: 131,
1325
1326
  S: this,
1326
1327
  C: (f, a) => f(...a)
1327
1328
  });
@@ -1346,7 +1347,7 @@ var InvitationHostExtension = class extends RpcExtension {
1346
1347
  authMethod: this.invitation.authMethod
1347
1348
  }, {
1348
1349
  F: __dxlog_file6,
1349
- L: 150,
1350
+ L: 149,
1350
1351
  S: this,
1351
1352
  C: (f, a) => f(...a)
1352
1353
  });
@@ -1361,7 +1362,7 @@ var InvitationHostExtension = class extends RpcExtension {
1361
1362
  }
1362
1363
  }), {
1363
1364
  F: __dxlog_file6,
1364
- L: 156,
1365
+ L: 155,
1365
1366
  S: this,
1366
1367
  C: (f, a) => f(...a)
1367
1368
  });
@@ -1375,14 +1376,14 @@ var InvitationHostExtension = class extends RpcExtension {
1375
1376
  id: traceId
1376
1377
  }), {
1377
1378
  F: __dxlog_file6,
1378
- L: 162,
1379
+ L: 161,
1379
1380
  S: this,
1380
1381
  C: (f, a) => f(...a)
1381
1382
  });
1382
1383
  try {
1383
1384
  invariant5(this.invitation, "Invitation is not set.", {
1384
1385
  F: __dxlog_file6,
1385
- L: 165,
1386
+ L: 164,
1386
1387
  S: this,
1387
1388
  A: [
1388
1389
  "this.invitation",
@@ -1397,7 +1398,7 @@ var InvitationHostExtension = class extends RpcExtension {
1397
1398
  id: traceId
1398
1399
  }), {
1399
1400
  F: __dxlog_file6,
1400
- L: 173,
1401
+ L: 172,
1401
1402
  S: this,
1402
1403
  C: (f, a) => f(...a)
1403
1404
  });
@@ -1454,7 +1455,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1454
1455
  options: async (options) => {
1455
1456
  invariant5(!this._remoteOptions, "Remote options already set.", {
1456
1457
  F: __dxlog_file6,
1457
- L: 240,
1458
+ L: 239,
1458
1459
  S: this,
1459
1460
  A: [
1460
1461
  "!this._remoteOptions",
@@ -1481,7 +1482,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1481
1482
  try {
1482
1483
  log4("begin options", void 0, {
1483
1484
  F: __dxlog_file6,
1484
- L: 261,
1485
+ L: 260,
1485
1486
  S: this,
1486
1487
  C: (f, a) => f(...a)
1487
1488
  });
@@ -1493,7 +1494,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1493
1494
  }));
1494
1495
  log4("end options", void 0, {
1495
1496
  F: __dxlog_file6,
1496
- L: 264,
1497
+ L: 263,
1497
1498
  S: this,
1498
1499
  C: (f, a) => f(...a)
1499
1500
  });
@@ -1507,7 +1508,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1507
1508
  } catch (err) {
1508
1509
  log4("openError", err, {
1509
1510
  F: __dxlog_file6,
1510
- L: 274,
1511
+ L: 273,
1511
1512
  S: this,
1512
1513
  C: (f, a) => f(...a)
1513
1514
  });
@@ -1517,7 +1518,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1517
1518
  async onClose() {
1518
1519
  log4("onClose", void 0, {
1519
1520
  F: __dxlog_file6,
1520
- L: 280,
1521
+ L: 279,
1521
1522
  S: this,
1522
1523
  C: (f, a) => f(...a)
1523
1524
  });
@@ -1888,14 +1889,11 @@ var InvitationsHandler = class {
1888
1889
  C: (f, a) => f(...a)
1889
1890
  });
1890
1891
  invitation.authMethod = introductionResponse.authMethod;
1891
- if (introductionResponse.spaceKey) {
1892
- invitation.spaceKey = introductionResponse.spaceKey;
1893
- }
1894
1892
  if (isAuthenticationRequired(invitation)) {
1895
1893
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
1896
1894
  log5("guest waiting for authentication code...", void 0, {
1897
1895
  F: __dxlog_file7,
1898
- L: 289,
1896
+ L: 286,
1899
1897
  S: this,
1900
1898
  C: (f, a) => f(...a)
1901
1899
  });
@@ -1907,7 +1905,7 @@ var InvitationsHandler = class {
1907
1905
  });
1908
1906
  log5("sending authentication request", void 0, {
1909
1907
  F: __dxlog_file7,
1910
- L: 293,
1908
+ L: 290,
1911
1909
  S: this,
1912
1910
  C: (f, a) => f(...a)
1913
1911
  });
@@ -1928,7 +1926,7 @@ var InvitationsHandler = class {
1928
1926
  attempt
1929
1927
  }, {
1930
1928
  F: __dxlog_file7,
1931
- L: 304,
1929
+ L: 301,
1932
1930
  S: this,
1933
1931
  C: (f, a) => f(...a)
1934
1932
  });
@@ -1945,7 +1943,7 @@ var InvitationsHandler = class {
1945
1943
  ...protocol.toJSON()
1946
1944
  }, {
1947
1945
  F: __dxlog_file7,
1948
- L: 315,
1946
+ L: 312,
1949
1947
  S: this,
1950
1948
  C: (f, a) => f(...a)
1951
1949
  });
@@ -1957,7 +1955,7 @@ var InvitationsHandler = class {
1957
1955
  ...protocol.toJSON()
1958
1956
  }, {
1959
1957
  F: __dxlog_file7,
1960
- L: 326,
1958
+ L: 323,
1961
1959
  S: this,
1962
1960
  C: (f, a) => f(...a)
1963
1961
  });
@@ -1969,7 +1967,7 @@ var InvitationsHandler = class {
1969
1967
  id: traceId
1970
1968
  }), {
1971
1969
  F: __dxlog_file7,
1972
- L: 328,
1970
+ L: 325,
1973
1971
  S: this,
1974
1972
  C: (f, a) => f(...a)
1975
1973
  });
@@ -1979,7 +1977,7 @@ var InvitationsHandler = class {
1979
1977
  ...protocol.toJSON()
1980
1978
  }, {
1981
1979
  F: __dxlog_file7,
1982
- L: 331,
1980
+ L: 328,
1983
1981
  S: this,
1984
1982
  C: (f, a) => f(...a)
1985
1983
  });
@@ -1989,7 +1987,7 @@ var InvitationsHandler = class {
1989
1987
  } else {
1990
1988
  log5("auth failed", err, {
1991
1989
  F: __dxlog_file7,
1992
- L: 334,
1990
+ L: 331,
1993
1991
  S: this,
1994
1992
  C: (f, a) => f(...a)
1995
1993
  });
@@ -2000,7 +1998,7 @@ var InvitationsHandler = class {
2000
1998
  error: err
2001
1999
  }), {
2002
2000
  F: __dxlog_file7,
2003
- L: 337,
2001
+ L: 334,
2004
2002
  S: this,
2005
2003
  C: (f, a) => f(...a)
2006
2004
  });
@@ -2018,7 +2016,7 @@ var InvitationsHandler = class {
2018
2016
  ...protocol.toJSON()
2019
2017
  }, {
2020
2018
  F: __dxlog_file7,
2021
- L: 348,
2019
+ L: 345,
2022
2020
  S: this,
2023
2021
  C: (f, a) => f(...a)
2024
2022
  });
@@ -2028,7 +2026,7 @@ var InvitationsHandler = class {
2028
2026
  } else {
2029
2027
  log5("auth failed", err, {
2030
2028
  F: __dxlog_file7,
2031
- L: 351,
2029
+ L: 348,
2032
2030
  S: this,
2033
2031
  C: (f, a) => f(...a)
2034
2032
  });
@@ -2041,7 +2039,7 @@ var InvitationsHandler = class {
2041
2039
  scheduleTask2(ctx, async () => {
2042
2040
  invariant6(invitation.swarmKey, void 0, {
2043
2041
  F: __dxlog_file7,
2044
- L: 361,
2042
+ L: 358,
2045
2043
  S: this,
2046
2044
  A: [
2047
2045
  "invitation.swarmKey",
@@ -2358,7 +2356,7 @@ var SpaceInvitationProtocol = class {
2358
2356
  }
2359
2357
  createIntroduction() {
2360
2358
  return {
2361
- profile: this._signingContext.profile
2359
+ profile: this._signingContext.getProfile()
2362
2360
  };
2363
2361
  }
2364
2362
  async createAdmissionRequest() {
@@ -2536,7 +2534,7 @@ var getPlatform = () => {
2536
2534
  };
2537
2535
 
2538
2536
  // packages/sdk/client-services/src/version.ts
2539
- var DXOS_VERSION = "0.3.5-next.5910692";
2537
+ var DXOS_VERSION = "0.3.5-next.b7dc283";
2540
2538
 
2541
2539
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2542
2540
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -3222,6 +3220,21 @@ var DataSpace = class DataSpace2 {
3222
3220
  await this._metadataStore.setWritableFeedKeys(this.key, this.inner.controlFeedKey, this.inner.dataFeedKey);
3223
3221
  }
3224
3222
  }
3223
+ // TODO(dmaretskyi): Use profile from signing context.
3224
+ async updateOwnProfile(profile) {
3225
+ const credential = await this._signingContext.credentialSigner.createCredential({
3226
+ subject: this._signingContext.identityKey,
3227
+ assertion: {
3228
+ "@type": "dxos.halo.credentials.MemberProfile",
3229
+ profile
3230
+ }
3231
+ });
3232
+ await this.inner.controlPipeline.writer.write({
3233
+ credential: {
3234
+ credential
3235
+ }
3236
+ });
3237
+ }
3225
3238
  async createEpoch() {
3226
3239
  const epoch = await this.dataPipeline.createEpoch();
3227
3240
  const receipt = await this.inner.controlPipeline.writer.write({
@@ -3270,7 +3283,7 @@ var DataSpace = class DataSpace2 {
3270
3283
  state: SpaceState[this._state]
3271
3284
  }, {
3272
3285
  F: __dxlog_file12,
3273
- L: 392,
3286
+ L: 404,
3274
3287
  S: this,
3275
3288
  C: (f, a) => f(...a)
3276
3289
  });
@@ -3342,7 +3355,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
3342
3355
  "@type": "dxos.halo.credentials.SpaceMember",
3343
3356
  spaceKey: space.key,
3344
3357
  role: SpaceMember2.Role.ADMIN,
3345
- profile: signingContext.profile,
3358
+ profile: signingContext.getProfile(),
3346
3359
  genesisFeedKey: space.controlFeedKey ?? failUndefined2()
3347
3360
  }
3348
3361
  }),
@@ -3422,7 +3435,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3422
3435
  async open() {
3423
3436
  log11("open", void 0, {
3424
3437
  F: __dxlog_file13,
3425
- L: 82,
3438
+ L: 83,
3426
3439
  S: this,
3427
3440
  C: (f, a) => f(...a)
3428
3441
  });
@@ -3430,7 +3443,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3430
3443
  id: this._instanceId
3431
3444
  }), {
3432
3445
  F: __dxlog_file13,
3433
- L: 83,
3446
+ L: 84,
3434
3447
  S: this,
3435
3448
  C: (f, a) => f(...a)
3436
3449
  });
@@ -3438,7 +3451,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3438
3451
  spaces: this._metadataStore.spaces.length
3439
3452
  }, {
3440
3453
  F: __dxlog_file13,
3441
- L: 84,
3454
+ L: 85,
3442
3455
  S: this,
3443
3456
  C: (f, a) => f(...a)
3444
3457
  });
@@ -3448,7 +3461,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3448
3461
  spaceMetadata
3449
3462
  }, {
3450
3463
  F: __dxlog_file13,
3451
- L: 88,
3464
+ L: 89,
3452
3465
  S: this,
3453
3466
  C: (f, a) => f(...a)
3454
3467
  });
@@ -3459,7 +3472,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3459
3472
  err
3460
3473
  }, {
3461
3474
  F: __dxlog_file13,
3462
- L: 91,
3475
+ L: 92,
3463
3476
  S: this,
3464
3477
  C: (f, a) => f(...a)
3465
3478
  });
@@ -3476,7 +3489,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3476
3489
  id: this._instanceId
3477
3490
  }), {
3478
3491
  F: __dxlog_file13,
3479
- L: 104,
3492
+ L: 105,
3480
3493
  S: this,
3481
3494
  C: (f, a) => f(...a)
3482
3495
  });
@@ -3484,7 +3497,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3484
3497
  async close() {
3485
3498
  log11("close", void 0, {
3486
3499
  F: __dxlog_file13,
3487
- L: 109,
3500
+ L: 110,
3488
3501
  S: this,
3489
3502
  C: (f, a) => f(...a)
3490
3503
  });
@@ -3500,7 +3513,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3500
3513
  async createSpace() {
3501
3514
  invariant11(this._isOpen, "Not open.", {
3502
3515
  F: __dxlog_file13,
3503
- L: 122,
3516
+ L: 123,
3504
3517
  S: this,
3505
3518
  A: [
3506
3519
  "this._isOpen",
@@ -3521,7 +3534,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3521
3534
  spaceKey
3522
3535
  }, {
3523
3536
  F: __dxlog_file13,
3524
- L: 134,
3537
+ L: 135,
3525
3538
  S: this,
3526
3539
  C: (f, a) => f(...a)
3527
3540
  });
@@ -3531,7 +3544,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3531
3544
  const memberCredential = credentials[1];
3532
3545
  invariant11(getCredentialAssertion2(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
3533
3546
  F: __dxlog_file13,
3534
- L: 141,
3547
+ L: 142,
3535
3548
  S: this,
3536
3549
  A: [
3537
3550
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -3549,13 +3562,13 @@ var DataSpaceManager = class DataSpaceManager2 {
3549
3562
  opts
3550
3563
  }, {
3551
3564
  F: __dxlog_file13,
3552
- L: 153,
3565
+ L: 154,
3553
3566
  S: this,
3554
3567
  C: (f, a) => f(...a)
3555
3568
  });
3556
3569
  invariant11(this._isOpen, "Not open.", {
3557
3570
  F: __dxlog_file13,
3558
- L: 154,
3571
+ L: 155,
3559
3572
  S: this,
3560
3573
  A: [
3561
3574
  "this._isOpen",
@@ -3564,7 +3577,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3564
3577
  });
3565
3578
  invariant11(!this._spaces.has(opts.spaceKey), "Space already exists.", {
3566
3579
  F: __dxlog_file13,
3567
- L: 155,
3580
+ L: 156,
3568
3581
  S: this,
3569
3582
  A: [
3570
3583
  "!this._spaces.has(opts.spaceKey)",
@@ -3599,7 +3612,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3599
3612
  metadata
3600
3613
  }, {
3601
3614
  F: __dxlog_file13,
3602
- L: 188,
3615
+ L: 189,
3603
3616
  S: this,
3604
3617
  C: (f, a) => f(...a)
3605
3618
  });
@@ -3635,7 +3648,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3635
3648
  onAuthFailure: () => {
3636
3649
  log11.warn("auth failure", void 0, {
3637
3650
  F: __dxlog_file13,
3638
- L: 223,
3651
+ L: 224,
3639
3652
  S: this,
3640
3653
  C: (f, a) => f(...a)
3641
3654
  });
@@ -3659,7 +3672,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3659
3672
  space: space.key
3660
3673
  }, {
3661
3674
  F: __dxlog_file13,
3662
- L: 241,
3675
+ L: 242,
3663
3676
  S: this,
3664
3677
  C: (f, a) => f(...a)
3665
3678
  });
@@ -3671,7 +3684,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3671
3684
  open: this._isOpen
3672
3685
  }, {
3673
3686
  F: __dxlog_file13,
3674
- L: 248,
3687
+ L: 249,
3675
3688
  S: this,
3676
3689
  C: (f, a) => f(...a)
3677
3690
  });
@@ -3684,7 +3697,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3684
3697
  space: space.key
3685
3698
  }, {
3686
3699
  F: __dxlog_file13,
3687
- L: 254,
3700
+ L: 255,
3688
3701
  S: this,
3689
3702
  C: (f, a) => f(...a)
3690
3703
  });
@@ -3928,7 +3941,7 @@ var SpacesServiceImpl = class {
3928
3941
  identity: {
3929
3942
  identityKey: member.key,
3930
3943
  profile: {
3931
- displayName: member.assertion.profile?.displayName
3944
+ displayName: member.profile?.displayName
3932
3945
  }
3933
3946
  },
3934
3947
  presence: member.removed ? SpaceMember3.PresenceState.REMOVED : isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
@@ -4088,6 +4101,14 @@ var ServiceContext = class ServiceContext2 {
4088
4101
  });
4089
4102
  return factory(invitation);
4090
4103
  }
4104
+ async broadcastProfileUpdate(profile) {
4105
+ if (!profile || !this.dataSpaceManager) {
4106
+ return;
4107
+ }
4108
+ for (const space of this.dataSpaceManager.spaces.values()) {
4109
+ await space.updateOwnProfile(profile);
4110
+ }
4111
+ }
4091
4112
  async _acceptIdentity(params) {
4092
4113
  const identity = await this.identityManager.acceptIdentity(params);
4093
4114
  await this._initialize(new Context9());
@@ -4103,7 +4124,7 @@ var ServiceContext = class ServiceContext2 {
4103
4124
  async _initialize(ctx) {
4104
4125
  log13("initializing spaces...", void 0, {
4105
4126
  F: __dxlog_file15,
4106
- L: 189,
4127
+ L: 199,
4107
4128
  S: this,
4108
4129
  C: (f, a) => f(...a)
4109
4130
  });
@@ -4112,7 +4133,7 @@ var ServiceContext = class ServiceContext2 {
4112
4133
  credentialSigner: identity.getIdentityCredentialSigner(),
4113
4134
  identityKey: identity.identityKey,
4114
4135
  deviceKey: identity.deviceKey,
4115
- profile: identity.profileDocument,
4136
+ getProfile: () => identity.profileDocument,
4116
4137
  recordCredential: async (credential) => {
4117
4138
  await identity.controlPipeline.writer.write({
4118
4139
  credential: {
@@ -4126,7 +4147,7 @@ var ServiceContext = class ServiceContext2 {
4126
4147
  this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
4127
4148
  invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
4128
4149
  F: __dxlog_file15,
4129
- L: 212,
4150
+ L: 222,
4130
4151
  S: this,
4131
4152
  A: [
4132
4153
  "this.dataSpaceManager",
@@ -4150,7 +4171,7 @@ var ServiceContext = class ServiceContext2 {
4150
4171
  details: assertion
4151
4172
  }, {
4152
4173
  F: __dxlog_file15,
4153
- L: 228,
4174
+ L: 238,
4154
4175
  S: this,
4155
4176
  C: (f, a) => f(...a)
4156
4177
  });
@@ -4161,7 +4182,7 @@ var ServiceContext = class ServiceContext2 {
4161
4182
  details: assertion
4162
4183
  }, {
4163
4184
  F: __dxlog_file15,
4164
- L: 232,
4185
+ L: 242,
4165
4186
  S: this,
4166
4187
  C: (f, a) => f(...a)
4167
4188
  });
@@ -4172,7 +4193,7 @@ var ServiceContext = class ServiceContext2 {
4172
4193
  details: assertion
4173
4194
  }, {
4174
4195
  F: __dxlog_file15,
4175
- L: 237,
4196
+ L: 247,
4176
4197
  S: this,
4177
4198
  C: (f, a) => f(...a)
4178
4199
  });
@@ -4183,7 +4204,7 @@ var ServiceContext = class ServiceContext2 {
4183
4204
  } catch (err) {
4184
4205
  log13.catch(err, void 0, {
4185
4206
  F: __dxlog_file15,
4186
- L: 243,
4207
+ L: 253,
4187
4208
  S: this,
4188
4209
  C: (f, a) => f(...a)
4189
4210
  });
@@ -4896,7 +4917,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4896
4917
  this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
4897
4918
  this._serviceRegistry.setServices({
4898
4919
  SystemService: this._systemService,
4899
- IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring),
4920
+ IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
4900
4921
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
4901
4922
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
4902
4923
  SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
@@ -4933,7 +4954,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4933
4954
  deviceKey
4934
4955
  }, {
4935
4956
  F: __dxlog_file17,
4936
- L: 316,
4957
+ L: 317,
4937
4958
  S: this,
4938
4959
  C: (f, a) => f(...a)
4939
4960
  });
@@ -4941,7 +4962,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4941
4962
  id: traceId
4942
4963
  }), {
4943
4964
  F: __dxlog_file17,
4944
- L: 317,
4965
+ L: 318,
4945
4966
  S: this,
4946
4967
  C: (f, a) => f(...a)
4947
4968
  });
@@ -4955,7 +4976,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4955
4976
  deviceKey
4956
4977
  }, {
4957
4978
  F: __dxlog_file17,
4958
- L: 328,
4979
+ L: 329,
4959
4980
  S: this,
4960
4981
  C: (f, a) => f(...a)
4961
4982
  });
@@ -4971,7 +4992,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4971
4992
  deviceKey
4972
4993
  }, {
4973
4994
  F: __dxlog_file17,
4974
- L: 335,
4995
+ L: 336,
4975
4996
  S: this,
4976
4997
  C: (f, a) => f(...a)
4977
4998
  });
@@ -4982,13 +5003,13 @@ var ClientServicesHost = class ClientServicesHost2 {
4982
5003
  id: traceId
4983
5004
  }), {
4984
5005
  F: __dxlog_file17,
4985
- L: 340,
5006
+ L: 341,
4986
5007
  S: this,
4987
5008
  C: (f, a) => f(...a)
4988
5009
  });
4989
5010
  log16("resetting...", void 0, {
4990
5011
  F: __dxlog_file17,
4991
- L: 342,
5012
+ L: 343,
4992
5013
  S: this,
4993
5014
  C: (f, a) => f(...a)
4994
5015
  });
@@ -4996,7 +5017,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4996
5017
  await this._storage.reset();
4997
5018
  log16("reset", void 0, {
4998
5019
  F: __dxlog_file17,
4999
- L: 345,
5020
+ L: 346,
5000
5021
  S: this,
5001
5022
  C: (f, a) => f(...a)
5002
5023
  });
@@ -5004,7 +5025,7 @@ var ClientServicesHost = class ClientServicesHost2 {
5004
5025
  id: traceId
5005
5026
  }), {
5006
5027
  F: __dxlog_file17,
5007
- L: 346,
5028
+ L: 347,
5008
5029
  S: this,
5009
5030
  C: (f, a) => f(...a)
5010
5031
  });
@@ -5081,4 +5102,4 @@ export {
5081
5102
  createDefaultModelFactory,
5082
5103
  ClientServicesHost
5083
5104
  };
5084
- //# sourceMappingURL=chunk-RZTCGO36.mjs.map
5105
+ //# sourceMappingURL=chunk-OKAP23U4.mjs.map