@dxos/client-services 0.3.1 → 0.3.2-main.14bd43d

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.
@@ -344,7 +344,7 @@ import { Context as Context2 } from "@dxos/context";
344
344
  import { verifyCredential } from "@dxos/credentials";
345
345
  import { log } from "@dxos/log";
346
346
  import { schema } from "@dxos/protocols";
347
- var __dxlog_file = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
347
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
348
348
  var Credential = schema.getCodecForType("dxos.halo.credentials.Credential");
349
349
  var createAuthProvider = (signer) => async (nonce) => {
350
350
  const credential = await signer.createCredential({
@@ -460,9 +460,11 @@ import { DeviceStateMachine, createCredentialSignerWithKey, createCredentialSign
460
460
  import { failUndefined } from "@dxos/debug";
461
461
  import { writeMessages } from "@dxos/feed-store";
462
462
  import { invariant } from "@dxos/invariant";
463
+ import { PublicKey as PublicKey3 } from "@dxos/keys";
463
464
  import { log as log2 } from "@dxos/log";
464
465
  import { AdmittedFeed } from "@dxos/protocols/proto/dxos/halo/credentials";
465
466
  import { trace } from "@dxos/tracing";
467
+ import { ComplexSet } from "@dxos/util";
466
468
  function _ts_decorate(decorators, target, key, desc) {
467
469
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
468
470
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -473,7 +475,7 @@ function _ts_decorate(decorators, target, key, desc) {
473
475
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
474
476
  return c > 3 && r && Object.defineProperty(target, key, r), r;
475
477
  }
476
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity.ts";
478
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
477
479
  var Identity = class Identity2 {
478
480
  constructor({ space, signer, identityKey, deviceKey }) {
479
481
  this.stateUpdate = new Event();
@@ -481,6 +483,14 @@ var Identity = class Identity2 {
481
483
  this._signer = signer;
482
484
  this.identityKey = identityKey;
483
485
  this.deviceKey = deviceKey;
486
+ log2.trace("dxos.halo.device", {
487
+ deviceKey
488
+ }, {
489
+ F: __dxlog_file2,
490
+ L: 60,
491
+ S: this,
492
+ C: (f, a) => f(...a)
493
+ });
484
494
  this._deviceStateMachine = new DeviceStateMachine({
485
495
  identityKey: this.identityKey,
486
496
  deviceKey: this.deviceKey,
@@ -491,7 +501,7 @@ var Identity = class Identity2 {
491
501
  onUpdate: () => this.stateUpdate.emit()
492
502
  });
493
503
  this.authVerifier = new TrustedKeySetAuthVerifier({
494
- trustedKeysProvider: () => this.authorizedDeviceKeys,
504
+ trustedKeysProvider: () => new ComplexSet(PublicKey3.hash, this.authorizedDeviceKeys.keys()),
495
505
  update: this.stateUpdate,
496
506
  authTimeout: AUTH_TIMEOUT
497
507
  });
@@ -549,7 +559,7 @@ var Identity = class Identity2 {
549
559
  getIdentityCredentialSigner() {
550
560
  invariant(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
551
561
  F: __dxlog_file2,
552
- L: 139,
562
+ L: 141,
553
563
  S: this,
554
564
  A: [
555
565
  "this._deviceStateMachine.deviceCredentialChain",
@@ -573,7 +583,7 @@ var Identity = class Identity2 {
573
583
  dataFeedKey
574
584
  }, {
575
585
  F: __dxlog_file2,
576
- L: 155,
586
+ L: 157,
577
587
  S: this,
578
588
  C: (f, a) => f(...a)
579
589
  });
@@ -629,7 +639,7 @@ import { Event as Event2 } from "@dxos/async";
629
639
  import { Context as Context3 } from "@dxos/context";
630
640
  import { createCredentialSignerWithKey as createCredentialSignerWithKey2, CredentialGenerator } from "@dxos/credentials";
631
641
  import { invariant as invariant2 } from "@dxos/invariant";
632
- import { PublicKey as PublicKey3 } from "@dxos/keys";
642
+ import { PublicKey as PublicKey4 } from "@dxos/keys";
633
643
  import { log as log3 } from "@dxos/log";
634
644
  import { trace as trace2 } from "@dxos/protocols";
635
645
  import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
@@ -646,7 +656,7 @@ function _ts_decorate2(decorators, target, key, desc) {
646
656
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
647
657
  return c > 3 && r && Object.defineProperty(target, key, r), r;
648
658
  }
649
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
659
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
650
660
  var IdentityManager = class IdentityManager2 {
651
661
  // TODO(burdon): IdentityManagerParams.
652
662
  // TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
@@ -661,7 +671,7 @@ var IdentityManager = class IdentityManager2 {
661
671
  return this._identity;
662
672
  }
663
673
  async open(ctx) {
664
- const traceId = PublicKey3.random().toHex();
674
+ const traceId = PublicKey4.random().toHex();
665
675
  log3.trace("dxos.halo.identity-manager.open", trace2.begin({
666
676
  id: traceId
667
677
  }), {
@@ -891,10 +901,51 @@ var IdentityManager = class IdentityManager2 {
891
901
  this.stateUpdate.emit();
892
902
  return profile;
893
903
  }
904
+ async updateDevice({ deviceKey, profile }) {
905
+ invariant2(this._identity, "Identity not initialized.", {
906
+ F: __dxlog_file3,
907
+ L: 216,
908
+ S: this,
909
+ A: [
910
+ "this._identity",
911
+ "'Identity not initialized.'"
912
+ ]
913
+ });
914
+ invariant2(this._identity.authorizedDeviceKeys.has(deviceKey), "Device not authorized.", {
915
+ F: __dxlog_file3,
916
+ L: 218,
917
+ S: this,
918
+ A: [
919
+ "this._identity.authorizedDeviceKeys.has(deviceKey)",
920
+ "'Device not authorized.'"
921
+ ]
922
+ });
923
+ const credential = await this._identity.getIdentityCredentialSigner().createCredential({
924
+ subject: this._identity.identityKey,
925
+ assertion: {
926
+ "@type": "dxos.halo.credentials.DeviceProfile",
927
+ deviceKey,
928
+ profile
929
+ }
930
+ });
931
+ const receipt = await this._identity.controlPipeline.writer.write({
932
+ credential: {
933
+ credential
934
+ }
935
+ });
936
+ await this._identity.controlPipeline.state.waitUntilTimeframe(new Timeframe([
937
+ [
938
+ receipt.feedKey,
939
+ receipt.seq
940
+ ]
941
+ ]));
942
+ this.stateUpdate.emit();
943
+ return profile;
944
+ }
894
945
  async _constructIdentity(identityRecord) {
895
946
  invariant2(!this._identity, void 0, {
896
947
  F: __dxlog_file3,
897
- L: 216,
948
+ L: 236,
898
949
  S: this,
899
950
  A: [
900
951
  "!this._identity",
@@ -905,13 +956,13 @@ var IdentityManager = class IdentityManager2 {
905
956
  identityRecord
906
957
  }, {
907
958
  F: __dxlog_file3,
908
- L: 217,
959
+ L: 237,
909
960
  S: this,
910
961
  C: (f, a) => f(...a)
911
962
  });
912
963
  invariant2(identityRecord.haloSpace.controlFeedKey, void 0, {
913
964
  F: __dxlog_file3,
914
- L: 220,
965
+ L: 240,
915
966
  S: this,
916
967
  A: [
917
968
  "identityRecord.haloSpace.controlFeedKey",
@@ -923,7 +974,7 @@ var IdentityManager = class IdentityManager2 {
923
974
  });
924
975
  invariant2(identityRecord.haloSpace.dataFeedKey, void 0, {
925
976
  F: __dxlog_file3,
926
- L: 224,
977
+ L: 244,
927
978
  S: this,
928
979
  A: [
929
980
  "identityRecord.haloSpace.dataFeedKey",
@@ -955,7 +1006,7 @@ var IdentityManager = class IdentityManager2 {
955
1006
  identityKey: identityRecord.identityKey
956
1007
  }, {
957
1008
  F: __dxlog_file3,
958
- L: 248,
1009
+ L: 268,
959
1010
  S: this,
960
1011
  C: (f, a) => f(...a)
961
1012
  });
@@ -976,7 +1027,7 @@ var IdentityManager = class IdentityManager2 {
976
1027
  onAuthFailure: () => {
977
1028
  log3.warn("auth failure", void 0, {
978
1029
  F: __dxlog_file3,
979
- L: 267,
1030
+ L: 287,
980
1031
  S: this,
981
1032
  C: (f, a) => f(...a)
982
1033
  });
@@ -999,7 +1050,7 @@ import { Stream as Stream7 } from "@dxos/codec-protobuf";
999
1050
  import { signPresentation } from "@dxos/credentials";
1000
1051
  import { todo } from "@dxos/debug";
1001
1052
  import { invariant as invariant3 } from "@dxos/invariant";
1002
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1053
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1003
1054
  var IdentityServiceImpl = class {
1004
1055
  constructor(_createIdentity, _identityManager, _keyring) {
1005
1056
  this._createIdentity = _createIdentity;
@@ -1068,7 +1119,7 @@ var IdentityServiceImpl = class {
1068
1119
  // packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
1069
1120
  import { invariant as invariant4 } from "@dxos/invariant";
1070
1121
  import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
1071
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1122
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1072
1123
  var DeviceInvitationProtocol = class {
1073
1124
  constructor(_keyring, _getIdentity, _acceptIdentity) {
1074
1125
  this._keyring = _keyring;
@@ -1161,7 +1212,7 @@ import { AuthenticatingInvitation, AUTHENTICATION_CODE_LENGTH, CancellableInvita
1161
1212
  import { Context as Context5 } from "@dxos/context";
1162
1213
  import { generatePasscode } from "@dxos/credentials";
1163
1214
  import { invariant as invariant6 } from "@dxos/invariant";
1164
- import { PublicKey as PublicKey5 } from "@dxos/keys";
1215
+ import { PublicKey as PublicKey6 } from "@dxos/keys";
1165
1216
  import { log as log5 } from "@dxos/log";
1166
1217
  import { createTeleportProtocolFactory, StarTopology } from "@dxos/network-manager";
1167
1218
  import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2, trace as trace4 } from "@dxos/protocols";
@@ -1172,13 +1223,13 @@ import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protoco
1172
1223
  import { Trigger as Trigger2 } from "@dxos/async";
1173
1224
  import { cancelWithContext, Context as Context4 } from "@dxos/context";
1174
1225
  import { invariant as invariant5 } from "@dxos/invariant";
1175
- import { PublicKey as PublicKey4 } from "@dxos/keys";
1226
+ import { PublicKey as PublicKey5 } from "@dxos/keys";
1176
1227
  import { log as log4 } from "@dxos/log";
1177
1228
  import { InvalidInvitationExtensionRoleError, schema as schema2, trace as trace3 } from "@dxos/protocols";
1178
1229
  import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
1179
1230
  import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
1180
1231
  import { RpcExtension } from "@dxos/teleport";
1181
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
1232
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
1182
1233
  var OPTIONS_TIMEOUT = 1e4;
1183
1234
  var MAX_OTP_ATTEMPTS = 3;
1184
1235
  var InvitationHostExtension = class extends RpcExtension {
@@ -1220,7 +1271,7 @@ var InvitationHostExtension = class extends RpcExtension {
1220
1271
  },
1221
1272
  introduce: async (request) => {
1222
1273
  const { profile, invitationId } = request;
1223
- const traceId = PublicKey4.random().toHex();
1274
+ const traceId = PublicKey5.random().toHex();
1224
1275
  log4.trace("dxos.sdk.invitation-handler.host.introduce", trace3.begin({
1225
1276
  id: traceId
1226
1277
  }), {
@@ -1272,7 +1323,7 @@ var InvitationHostExtension = class extends RpcExtension {
1272
1323
  };
1273
1324
  },
1274
1325
  authenticate: async ({ authCode: code }) => {
1275
- const traceId = PublicKey4.random().toHex();
1326
+ const traceId = PublicKey5.random().toHex();
1276
1327
  log4.trace("dxos.sdk.invitation-handler.host.authenticate", trace3.begin({
1277
1328
  id: traceId
1278
1329
  }), {
@@ -1352,7 +1403,7 @@ var InvitationHostExtension = class extends RpcExtension {
1352
1403
  };
1353
1404
  },
1354
1405
  admit: async (request) => {
1355
- const traceId = PublicKey4.random().toHex();
1406
+ const traceId = PublicKey5.random().toHex();
1356
1407
  log4.trace("dxos.sdk.invitation-handler.host.admit", trace3.begin({
1357
1408
  id: traceId
1358
1409
  }), {
@@ -1509,7 +1560,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1509
1560
  var isAuthenticationRequired = (invitation) => invitation.authMethod !== Invitation2.AuthMethod.NONE;
1510
1561
 
1511
1562
  // packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
1512
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
1563
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
1513
1564
  var InvitationsHandler = class {
1514
1565
  /**
1515
1566
  * @internal
@@ -1518,7 +1569,7 @@ var InvitationsHandler = class {
1518
1569
  this._networkManager = _networkManager;
1519
1570
  }
1520
1571
  createInvitation(protocol, options) {
1521
- const { invitationId = PublicKey5.random().toHex(), type = Invitation3.Type.INTERACTIVE, authMethod = Invitation3.AuthMethod.SHARED_SECRET, state = Invitation3.State.INIT, timeout = INVITATION_TIMEOUT, swarmKey = PublicKey5.random() } = options ?? {};
1572
+ const { invitationId = PublicKey6.random().toHex(), type = Invitation3.Type.INTERACTIVE, authMethod = Invitation3.AuthMethod.SHARED_SECRET, state = Invitation3.State.INIT, timeout = INVITATION_TIMEOUT, swarmKey = PublicKey6.random() } = options ?? {};
1522
1573
  const authCode = options?.authCode ?? (authMethod === Invitation3.AuthMethod.SHARED_SECRET ? generatePasscode(AUTHENTICATION_CODE_LENGTH) : void 0);
1523
1574
  invariant6(protocol, void 0, {
1524
1575
  F: __dxlog_file7,
@@ -1593,7 +1644,7 @@ var InvitationsHandler = class {
1593
1644
  },
1594
1645
  onOpen: () => {
1595
1646
  scheduleTask2(ctx, async () => {
1596
- const traceId = PublicKey5.random().toHex();
1647
+ const traceId = PublicKey6.random().toHex();
1597
1648
  try {
1598
1649
  log5.trace("dxos.sdk.invitations-handler.host.onOpen", trace4.begin({
1599
1650
  id: traceId
@@ -1826,7 +1877,7 @@ var InvitationsHandler = class {
1826
1877
  }
1827
1878
  });
1828
1879
  scheduleTask2(ctx, async () => {
1829
- const traceId = PublicKey5.random().toHex();
1880
+ const traceId = PublicKey6.random().toHex();
1830
1881
  try {
1831
1882
  log5.trace("dxos.sdk.invitations-handler.guest.onOpen", trace4.begin({
1832
1883
  id: traceId
@@ -2033,7 +2084,7 @@ var InvitationsHandler = class {
2033
2084
  const topic = invitation.swarmKey;
2034
2085
  const swarmConnection = await this._networkManager.joinSwarm({
2035
2086
  topic,
2036
- peerId: PublicKey5.random(),
2087
+ peerId: PublicKey6.random(),
2037
2088
  protocolProvider: createTeleportProtocolFactory(async (teleport) => {
2038
2089
  teleport.addExtension("dxos.halo.invitations", createExtension());
2039
2090
  }),
@@ -2068,7 +2119,7 @@ import { Stream as Stream8 } from "@dxos/codec-protobuf";
2068
2119
  import { invariant as invariant7 } from "@dxos/invariant";
2069
2120
  import { log as log6 } from "@dxos/log";
2070
2121
  import { Invitation as Invitation4, QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
2071
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
2122
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
2072
2123
  var InvitationsServiceImpl = class {
2073
2124
  constructor(_invitationsHandler, _getHandler) {
2074
2125
  this._invitationsHandler = _invitationsHandler;
@@ -2259,7 +2310,7 @@ import { writeMessages as writeMessages2 } from "@dxos/feed-store";
2259
2310
  import { invariant as invariant8 } from "@dxos/invariant";
2260
2311
  import { log as log7 } from "@dxos/log";
2261
2312
  import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
2262
- var __dxlog_file9 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
2313
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
2263
2314
  var SpaceInvitationProtocol = class {
2264
2315
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
2265
2316
  this._spaceManager = _spaceManager;
@@ -2498,10 +2549,10 @@ var getPlatform = () => {
2498
2549
  };
2499
2550
 
2500
2551
  // packages/sdk/client-services/src/version.ts
2501
- var DXOS_VERSION = "0.3.1";
2552
+ var DXOS_VERSION = "0.3.2-main.14bd43d";
2502
2553
 
2503
2554
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2504
- var __dxlog_file10 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
2555
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
2505
2556
  var DEFAULT_TIMEOUT = 1e3;
2506
2557
  var createDiagnostics = async (clientServices, serviceContext, config) => {
2507
2558
  const diagnostics = {
@@ -2624,25 +2675,25 @@ import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
2624
2675
  import { cancelWithContext as cancelWithContext2, Context as Context7 } from "@dxos/context";
2625
2676
  import { timed } from "@dxos/debug";
2626
2677
  import { createMappedFeedWriter } from "@dxos/echo-pipeline";
2627
- import { PublicKey as PublicKey7 } from "@dxos/keys";
2678
+ import { PublicKey as PublicKey8 } from "@dxos/keys";
2628
2679
  import { log as log10 } from "@dxos/log";
2629
2680
  import { CancelledError, SystemError } from "@dxos/protocols";
2630
2681
  import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
2631
2682
  import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
2632
2683
  import { Timeframe as Timeframe2 } from "@dxos/timeframe";
2633
2684
  import { trace as trace5 } from "@dxos/tracing";
2634
- import { ComplexSet as ComplexSet2 } from "@dxos/util";
2685
+ import { ComplexSet as ComplexSet3 } from "@dxos/util";
2635
2686
 
2636
2687
  // packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
2637
2688
  import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger4 } from "@dxos/async";
2638
2689
  import { Context as Context6, rejectOnDispose } from "@dxos/context";
2639
2690
  import { invariant as invariant10 } from "@dxos/invariant";
2640
- import { PublicKey as PublicKey6 } from "@dxos/keys";
2691
+ import { PublicKey as PublicKey7 } from "@dxos/keys";
2641
2692
  import { log as log9 } from "@dxos/log";
2642
2693
  import { schema as schema3 } from "@dxos/protocols";
2643
2694
  import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
2644
- import { ComplexMap as ComplexMap2, ComplexSet, entry } from "@dxos/util";
2645
- var __dxlog_file11 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2695
+ import { ComplexMap as ComplexMap2, ComplexSet as ComplexSet2, entry } from "@dxos/util";
2696
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2646
2697
  var DEFAULT_RETRY_TIMEOUT = 1e3;
2647
2698
  var DEFAULT_SUCCESS_DELAY = 1e3;
2648
2699
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
@@ -2652,8 +2703,8 @@ var NotarizationPlugin = class {
2652
2703
  this._ctx = new Context6();
2653
2704
  this._extensionOpened = new Event4();
2654
2705
  this._extensions = /* @__PURE__ */ new Set();
2655
- this._processedCredentials = new ComplexSet(PublicKey6.hash);
2656
- this._processCredentialsTriggers = new ComplexMap2(PublicKey6.hash);
2706
+ this._processedCredentials = new ComplexSet2(PublicKey7.hash);
2707
+ this._processCredentialsTriggers = new ComplexMap2(PublicKey7.hash);
2657
2708
  }
2658
2709
  get hasWriter() {
2659
2710
  return !!this._writer;
@@ -2912,7 +2963,7 @@ function _ts_decorate3(decorators, target, key, desc) {
2912
2963
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2913
2964
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2914
2965
  }
2915
- var __dxlog_file12 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
2966
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
2916
2967
  var ENABLE_FEED_PURGE = false;
2917
2968
  var DataSpace = class DataSpace2 {
2918
2969
  constructor(params) {
@@ -2935,7 +2986,7 @@ var DataSpace = class DataSpace2 {
2935
2986
  this._signingContext = params.signingContext;
2936
2987
  this._callbacks = params.callbacks ?? {};
2937
2988
  this.authVerifier = new TrustedKeySetAuthVerifier({
2938
- trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
2989
+ trustedKeysProvider: () => new ComplexSet3(PublicKey8.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
2939
2990
  update: this._inner.stateUpdate,
2940
2991
  authTimeout: AUTH_TIMEOUT2
2941
2992
  });
@@ -3268,7 +3319,7 @@ import { Event as Event6, synchronized as synchronized2, trackLeaks as trackLeak
3268
3319
  import { cancelWithContext as cancelWithContext3, Context as Context8 } from "@dxos/context";
3269
3320
  import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
3270
3321
  import { invariant as invariant11 } from "@dxos/invariant";
3271
- import { PublicKey as PublicKey8 } from "@dxos/keys";
3322
+ import { PublicKey as PublicKey9 } from "@dxos/keys";
3272
3323
  import { log as log11 } from "@dxos/log";
3273
3324
  import { trace as trace6 } from "@dxos/protocols";
3274
3325
  import { SpaceState as SpaceState2 } from "@dxos/protocols/proto/dxos/client/services";
@@ -3355,7 +3406,7 @@ function _ts_decorate4(decorators, target, key, desc) {
3355
3406
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3356
3407
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3357
3408
  }
3358
- var __dxlog_file13 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
3409
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
3359
3410
  var DataSpaceManager = class DataSpaceManager2 {
3360
3411
  constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
3361
3412
  this._spaceManager = _spaceManager;
@@ -3366,9 +3417,9 @@ var DataSpaceManager = class DataSpaceManager2 {
3366
3417
  this._feedStore = _feedStore;
3367
3418
  this._ctx = new Context8();
3368
3419
  this.updated = new Event6();
3369
- this._spaces = new ComplexMap3(PublicKey8.hash);
3420
+ this._spaces = new ComplexMap3(PublicKey9.hash);
3370
3421
  this._isOpen = false;
3371
- this._instanceId = PublicKey8.random().toHex();
3422
+ this._instanceId = PublicKey9.random().toHex();
3372
3423
  }
3373
3424
  // TODO(burdon): Remove.
3374
3425
  get spaces() {
@@ -3685,7 +3736,7 @@ import { invariant as invariant12 } from "@dxos/invariant";
3685
3736
  import { log as log12 } from "@dxos/log";
3686
3737
  import { ApiError, SpaceNotFoundError, encodeError } from "@dxos/protocols";
3687
3738
  import { SpaceMember as SpaceMember3, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
3688
- var __dxlog_file14 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3739
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3689
3740
  var SpacesServiceImpl = class {
3690
3741
  constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
3691
3742
  this._identityManager = _identityManager;
@@ -3907,7 +3958,7 @@ import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, S
3907
3958
  import { FeedFactory, FeedStore } from "@dxos/feed-store";
3908
3959
  import { invariant as invariant13 } from "@dxos/invariant";
3909
3960
  import { Keyring } from "@dxos/keyring";
3910
- import { PublicKey as PublicKey9 } from "@dxos/keys";
3961
+ import { PublicKey as PublicKey10 } from "@dxos/keys";
3911
3962
  import { log as log13 } from "@dxos/log";
3912
3963
  import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
3913
3964
  import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
@@ -3924,7 +3975,7 @@ function _ts_decorate5(decorators, target, key, desc) {
3924
3975
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3925
3976
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3926
3977
  }
3927
- var __dxlog_file15 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-context.ts";
3978
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
3928
3979
  var ServiceContext = class ServiceContext2 {
3929
3980
  constructor(storage, networkManager, signalManager, modelFactory) {
3930
3981
  this.storage = storage;
@@ -3934,7 +3985,7 @@ var ServiceContext = class ServiceContext2 {
3934
3985
  this.initialized = new Trigger5();
3935
3986
  this.dataServiceSubscriptions = new DataServiceSubscriptions();
3936
3987
  this._handlerFactories = /* @__PURE__ */ new Map();
3937
- this._instanceId = PublicKey9.random().toHex();
3988
+ this._instanceId = PublicKey10.random().toHex();
3938
3989
  this.metadataStore = new MetadataStore(storage.createDirectory("metadata"));
3939
3990
  this.snapshotStore = new SnapshotStore(storage.createDirectory("snapshots"));
3940
3991
  this.blobStore = new BlobStore(storage.createDirectory("blobs"));
@@ -4197,7 +4248,7 @@ function _ts_decorate6(decorators, target, key, desc) {
4197
4248
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4198
4249
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4199
4250
  }
4200
- var __dxlog_file16 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/locks/browser.ts";
4251
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
4201
4252
  var Message;
4202
4253
  (function(Message2) {
4203
4254
  Message2["ACQUIRING"] = "acquiring";
@@ -4363,8 +4414,8 @@ import { Context as Context10 } from "@dxos/context";
4363
4414
  import { DocumentModel as DocumentModel2 } from "@dxos/document-model";
4364
4415
  import { DataServiceImpl } from "@dxos/echo-pipeline";
4365
4416
  import { base } from "@dxos/echo-schema";
4366
- import { invariant as invariant14 } from "@dxos/invariant";
4367
- import { PublicKey as PublicKey10 } from "@dxos/keys";
4417
+ import { invariant as invariant15 } from "@dxos/invariant";
4418
+ import { PublicKey as PublicKey11 } from "@dxos/keys";
4368
4419
  import { log as log16 } from "@dxos/log";
4369
4420
  import { WebsocketSignalManager } from "@dxos/messaging";
4370
4421
  import { ModelFactory } from "@dxos/model-factory";
@@ -4378,13 +4429,33 @@ import { WebsocketRpcClient } from "@dxos/websocket-rpc";
4378
4429
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
4379
4430
  import { EventSubscriptions as EventSubscriptions3 } from "@dxos/async";
4380
4431
  import { Stream as Stream11 } from "@dxos/codec-protobuf";
4432
+ import { invariant as invariant14 } from "@dxos/invariant";
4381
4433
  import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
4434
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/devices/devices-service.ts";
4382
4435
  var DevicesServiceImpl = class {
4383
4436
  constructor(_identityManager) {
4384
4437
  this._identityManager = _identityManager;
4385
4438
  }
4386
- updateDevice(request) {
4387
- throw new Error("Method not implemented.");
4439
+ async updateDevice(profile) {
4440
+ invariant14(this._identityManager.identity, "Identity not initialized", {
4441
+ F: __dxlog_file17,
4442
+ L: 17,
4443
+ S: this,
4444
+ A: [
4445
+ "this._identityManager.identity",
4446
+ "'Identity not initialized'"
4447
+ ]
4448
+ });
4449
+ const deviceKey = this._identityManager.identity.deviceKey;
4450
+ await this._identityManager.updateDevice({
4451
+ deviceKey,
4452
+ profile
4453
+ });
4454
+ return {
4455
+ deviceKey,
4456
+ kind: DeviceKind.CURRENT,
4457
+ profile
4458
+ };
4388
4459
  }
4389
4460
  queryDevices() {
4390
4461
  return new Stream11(({ next }) => {
@@ -4396,9 +4467,10 @@ var DevicesServiceImpl = class {
4396
4467
  });
4397
4468
  } else {
4398
4469
  next({
4399
- devices: Array.from(deviceKeys.values()).map((key) => ({
4470
+ devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
4400
4471
  deviceKey: key,
4401
- kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind.CURRENT : DeviceKind.TRUSTED
4472
+ kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind.CURRENT : DeviceKind.TRUSTED,
4473
+ profile
4402
4474
  }))
4403
4475
  });
4404
4476
  }
@@ -4632,7 +4704,7 @@ function _ts_decorate7(decorators, target, key, desc) {
4632
4704
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4633
4705
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4634
4706
  }
4635
- var __dxlog_file17 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-host.ts";
4707
+ var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
4636
4708
  var createDefaultModelFactory = () => {
4637
4709
  return new ModelFactory().registerModel(DocumentModel2).registerModel(TextModel);
4638
4710
  };
@@ -4732,8 +4804,8 @@ var ClientServicesHost = class ClientServicesHost2 {
4732
4804
  * Can only be called once.
4733
4805
  */
4734
4806
  initialize({ config, ...options }) {
4735
- invariant14(!this._open, "service host is open", {
4736
- F: __dxlog_file17,
4807
+ invariant15(!this._open, "service host is open", {
4808
+ F: __dxlog_file18,
4737
4809
  L: 201,
4738
4810
  S: this,
4739
4811
  A: [
@@ -4742,14 +4814,14 @@ var ClientServicesHost = class ClientServicesHost2 {
4742
4814
  ]
4743
4815
  });
4744
4816
  log16("initializing...", void 0, {
4745
- F: __dxlog_file17,
4817
+ F: __dxlog_file18,
4746
4818
  L: 202,
4747
4819
  S: this,
4748
4820
  C: (f, a) => f(...a)
4749
4821
  });
4750
4822
  if (config) {
4751
- invariant14(!this._config, "config already set", {
4752
- F: __dxlog_file17,
4823
+ invariant15(!this._config, "config already set", {
4824
+ F: __dxlog_file18,
4753
4825
  L: 205,
4754
4826
  S: this,
4755
4827
  A: [
@@ -4766,8 +4838,8 @@ var ClientServicesHost = class ClientServicesHost2 {
4766
4838
  iceServers: this._config?.get("runtime.services.ice")
4767
4839
  }), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
4768
4840
  this._signalManager = signalManager;
4769
- invariant14(!this._networkManager, "network manager already set", {
4770
- F: __dxlog_file17,
4841
+ invariant15(!this._networkManager, "network manager already set", {
4842
+ F: __dxlog_file18,
4771
4843
  L: 221,
4772
4844
  S: this,
4773
4845
  A: [
@@ -4781,7 +4853,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4781
4853
  signalManager
4782
4854
  });
4783
4855
  log16("initialized", void 0, {
4784
- F: __dxlog_file17,
4856
+ F: __dxlog_file18,
4785
4857
  L: 228,
4786
4858
  S: this,
4787
4859
  C: (f, a) => f(...a)
@@ -4791,17 +4863,17 @@ var ClientServicesHost = class ClientServicesHost2 {
4791
4863
  if (this._open) {
4792
4864
  return;
4793
4865
  }
4794
- const traceId = PublicKey10.random().toHex();
4866
+ const traceId = PublicKey11.random().toHex();
4795
4867
  log16.trace("dxos.client-services.host.open", trace8.begin({
4796
4868
  id: traceId
4797
4869
  }), {
4798
- F: __dxlog_file17,
4870
+ F: __dxlog_file18,
4799
4871
  L: 239,
4800
4872
  S: this,
4801
4873
  C: (f, a) => f(...a)
4802
4874
  });
4803
- invariant14(this._config, "config not set", {
4804
- F: __dxlog_file17,
4875
+ invariant15(this._config, "config not set", {
4876
+ F: __dxlog_file18,
4805
4877
  L: 241,
4806
4878
  S: this,
4807
4879
  A: [
@@ -4809,8 +4881,8 @@ var ClientServicesHost = class ClientServicesHost2 {
4809
4881
  "'config not set'"
4810
4882
  ]
4811
4883
  });
4812
- invariant14(this._storage, "storage not set", {
4813
- F: __dxlog_file17,
4884
+ invariant15(this._storage, "storage not set", {
4885
+ F: __dxlog_file18,
4814
4886
  L: 242,
4815
4887
  S: this,
4816
4888
  A: [
@@ -4818,8 +4890,8 @@ var ClientServicesHost = class ClientServicesHost2 {
4818
4890
  "'storage not set'"
4819
4891
  ]
4820
4892
  });
4821
- invariant14(this._signalManager, "signal manager not set", {
4822
- F: __dxlog_file17,
4893
+ invariant15(this._signalManager, "signal manager not set", {
4894
+ F: __dxlog_file18,
4823
4895
  L: 243,
4824
4896
  S: this,
4825
4897
  A: [
@@ -4827,8 +4899,8 @@ var ClientServicesHost = class ClientServicesHost2 {
4827
4899
  "'signal manager not set'"
4828
4900
  ]
4829
4901
  });
4830
- invariant14(this._networkManager, "network manager not set", {
4831
- F: __dxlog_file17,
4902
+ invariant15(this._networkManager, "network manager not set", {
4903
+ F: __dxlog_file18,
4832
4904
  L: 244,
4833
4905
  S: this,
4834
4906
  A: [
@@ -4840,7 +4912,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4840
4912
  log16("opening...", {
4841
4913
  lockKey: this._resourceLock?.lockKey
4842
4914
  }, {
4843
- F: __dxlog_file17,
4915
+ F: __dxlog_file18,
4844
4916
  L: 247,
4845
4917
  S: this,
4846
4918
  C: (f, a) => f(...a)
@@ -4886,7 +4958,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4886
4958
  log16("opened", {
4887
4959
  deviceKey
4888
4960
  }, {
4889
- F: __dxlog_file17,
4961
+ F: __dxlog_file18,
4890
4962
  L: 316,
4891
4963
  S: this,
4892
4964
  C: (f, a) => f(...a)
@@ -4894,7 +4966,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4894
4966
  log16.trace("dxos.client-services.host.open", trace8.end({
4895
4967
  id: traceId
4896
4968
  }), {
4897
- F: __dxlog_file17,
4969
+ F: __dxlog_file18,
4898
4970
  L: 317,
4899
4971
  S: this,
4900
4972
  C: (f, a) => f(...a)
@@ -4908,7 +4980,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4908
4980
  log16("closing...", {
4909
4981
  deviceKey
4910
4982
  }, {
4911
- F: __dxlog_file17,
4983
+ F: __dxlog_file18,
4912
4984
  L: 328,
4913
4985
  S: this,
4914
4986
  C: (f, a) => f(...a)
@@ -4924,24 +4996,24 @@ var ClientServicesHost = class ClientServicesHost2 {
4924
4996
  log16("closed", {
4925
4997
  deviceKey
4926
4998
  }, {
4927
- F: __dxlog_file17,
4999
+ F: __dxlog_file18,
4928
5000
  L: 335,
4929
5001
  S: this,
4930
5002
  C: (f, a) => f(...a)
4931
5003
  });
4932
5004
  }
4933
5005
  async reset() {
4934
- const traceId = PublicKey10.random().toHex();
5006
+ const traceId = PublicKey11.random().toHex();
4935
5007
  log16.trace("dxos.sdk.client-services-host.reset", trace8.begin({
4936
5008
  id: traceId
4937
5009
  }), {
4938
- F: __dxlog_file17,
5010
+ F: __dxlog_file18,
4939
5011
  L: 340,
4940
5012
  S: this,
4941
5013
  C: (f, a) => f(...a)
4942
5014
  });
4943
5015
  log16("resetting...", void 0, {
4944
- F: __dxlog_file17,
5016
+ F: __dxlog_file18,
4945
5017
  L: 342,
4946
5018
  S: this,
4947
5019
  C: (f, a) => f(...a)
@@ -4949,7 +5021,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4949
5021
  await this._serviceContext?.close();
4950
5022
  await this._storage.reset();
4951
5023
  log16("reset", void 0, {
4952
- F: __dxlog_file17,
5024
+ F: __dxlog_file18,
4953
5025
  L: 345,
4954
5026
  S: this,
4955
5027
  C: (f, a) => f(...a)
@@ -4957,7 +5029,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4957
5029
  log16.trace("dxos.sdk.client-services-host.reset", trace8.end({
4958
5030
  id: traceId
4959
5031
  }), {
4960
- F: __dxlog_file17,
5032
+ F: __dxlog_file18,
4961
5033
  L: 346,
4962
5034
  S: this,
4963
5035
  C: (f, a) => f(...a)
@@ -5035,4 +5107,4 @@ export {
5035
5107
  createDefaultModelFactory,
5036
5108
  ClientServicesHost
5037
5109
  };
5038
- //# sourceMappingURL=chunk-LUZVKA6Z.mjs.map
5110
+ //# sourceMappingURL=chunk-D5YLUKQN.mjs.map