@dxos/client-services 0.3.2-main.de57e73 → 0.3.2-main.fa875a7

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 (154) hide show
  1. package/dist/lib/browser/{chunk-XEZCTVLQ.mjs → chunk-IM7YVH3R.mjs} +122 -112
  2. package/dist/lib/browser/chunk-IM7YVH3R.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +2 -2
  4. package/dist/lib/browser/index.mjs.map +2 -2
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +1 -1
  7. package/dist/lib/browser/packlets/testing/index.mjs.map +2 -2
  8. package/dist/lib/node/index.cjs +158 -138
  9. package/dist/lib/node/index.cjs.map +3 -3
  10. package/dist/lib/node/meta.json +1 -1
  11. package/dist/lib/node/packlets/testing/index.cjs +155 -135
  12. package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
  13. package/dist/types/src/packlets/devices/devices-service.d.ts +4 -4
  14. package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -1
  15. package/dist/types/src/packlets/devtools/devtools.d.ts +4 -4
  16. package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
  17. package/dist/types/src/packlets/devtools/feeds.d.ts +3 -3
  18. package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
  19. package/dist/types/src/packlets/devtools/keys.d.ts +2 -2
  20. package/dist/types/src/packlets/devtools/keys.d.ts.map +1 -1
  21. package/dist/types/src/packlets/devtools/metadata.d.ts +2 -2
  22. package/dist/types/src/packlets/devtools/metadata.d.ts.map +1 -1
  23. package/dist/types/src/packlets/devtools/network.d.ts +3 -3
  24. package/dist/types/src/packlets/devtools/network.d.ts.map +1 -1
  25. package/dist/types/src/packlets/devtools/spaces.d.ts +2 -2
  26. package/dist/types/src/packlets/devtools/spaces.d.ts.map +1 -1
  27. package/dist/types/src/packlets/identity/authenticator.d.ts +5 -5
  28. package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
  29. package/dist/types/src/packlets/identity/identity-manager.d.ts +5 -5
  30. package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
  31. package/dist/types/src/packlets/identity/identity-service.d.ts +4 -4
  32. package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
  33. package/dist/types/src/packlets/identity/identity.d.ts +8 -8
  34. package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
  35. package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +4 -4
  36. package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
  37. package/dist/types/src/packlets/invitations/invitation-extension.d.ts +3 -3
  38. package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
  39. package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +3 -3
  40. package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
  41. package/dist/types/src/packlets/invitations/invitations-handler.d.ts +1 -1
  42. package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
  43. package/dist/types/src/packlets/invitations/invitations-service.d.ts +3 -3
  44. package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
  45. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +6 -6
  46. package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
  47. package/dist/types/src/packlets/locks/browser.d.ts +1 -1
  48. package/dist/types/src/packlets/locks/browser.d.ts.map +1 -1
  49. package/dist/types/src/packlets/locks/node.d.ts +1 -1
  50. package/dist/types/src/packlets/locks/node.d.ts.map +1 -1
  51. package/dist/types/src/packlets/locks/resource-lock.d.ts +1 -1
  52. package/dist/types/src/packlets/locks/resource-lock.d.ts.map +1 -1
  53. package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
  54. package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
  55. package/dist/types/src/packlets/network/network-service.d.ts +3 -3
  56. package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
  57. package/dist/types/src/packlets/services/client-rpc-server.d.ts +5 -5
  58. package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
  59. package/dist/types/src/packlets/services/diagnostics.d.ts +8 -8
  60. package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
  61. package/dist/types/src/packlets/services/service-context.d.ts +6 -6
  62. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  63. package/dist/types/src/packlets/services/service-host.d.ts +5 -5
  64. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  65. package/dist/types/src/packlets/services/service-registry.d.ts +1 -1
  66. package/dist/types/src/packlets/services/service-registry.d.ts.map +1 -1
  67. package/dist/types/src/packlets/spaces/data-space-manager.d.ts +7 -7
  68. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  69. package/dist/types/src/packlets/spaces/data-space.d.ts +9 -9
  70. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  71. package/dist/types/src/packlets/spaces/genesis.d.ts +3 -3
  72. package/dist/types/src/packlets/spaces/genesis.d.ts.map +1 -1
  73. package/dist/types/src/packlets/spaces/notarization-plugin.d.ts +5 -5
  74. package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
  75. package/dist/types/src/packlets/spaces/spaces-service.d.ts +7 -7
  76. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  77. package/dist/types/src/packlets/system/system-service.d.ts +5 -5
  78. package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
  79. package/dist/types/src/packlets/testing/credential-utils.d.ts +2 -2
  80. package/dist/types/src/packlets/testing/credential-utils.d.ts.map +1 -1
  81. package/dist/types/src/packlets/testing/invitation-utils.d.ts +1 -1
  82. package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
  83. package/dist/types/src/packlets/testing/test-builder.d.ts +4 -4
  84. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  85. package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +4 -4
  86. package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
  87. package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts +4 -4
  88. package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts.map +1 -1
  89. package/dist/types/src/packlets/vault/shell-runtime.d.ts +4 -4
  90. package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
  91. package/dist/types/src/packlets/vault/worker-runtime.d.ts +3 -3
  92. package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
  93. package/dist/types/src/packlets/vault/worker-session.d.ts +3 -3
  94. package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
  95. package/dist/types/src/version.d.ts +1 -1
  96. package/package.json +37 -35
  97. package/src/packlets/devices/devices-service.test.ts +2 -2
  98. package/src/packlets/devices/devices-service.ts +11 -5
  99. package/src/packlets/devtools/devtools.ts +35 -35
  100. package/src/packlets/devtools/feeds.ts +6 -6
  101. package/src/packlets/devtools/keys.ts +2 -2
  102. package/src/packlets/devtools/metadata.ts +2 -2
  103. package/src/packlets/devtools/network.ts +8 -8
  104. package/src/packlets/devtools/spaces.ts +8 -5
  105. package/src/packlets/identity/authenticator.ts +5 -5
  106. package/src/packlets/identity/identity-manager.test.ts +13 -1
  107. package/src/packlets/identity/identity-manager.ts +18 -6
  108. package/src/packlets/identity/identity-service.test.ts +2 -2
  109. package/src/packlets/identity/identity-service.ts +8 -8
  110. package/src/packlets/identity/identity.test.ts +4 -4
  111. package/src/packlets/identity/identity.ts +16 -10
  112. package/src/packlets/invitations/device-invitation-protocol.test.ts +1 -1
  113. package/src/packlets/invitations/device-invitation-protocol.ts +8 -4
  114. package/src/packlets/invitations/invitation-extension.ts +6 -6
  115. package/src/packlets/invitations/invitation-protocol.ts +7 -3
  116. package/src/packlets/invitations/invitations-handler.ts +7 -2
  117. package/src/packlets/invitations/invitations-service.ts +5 -7
  118. package/src/packlets/invitations/space-invitation-protocol.test.ts +1 -1
  119. package/src/packlets/invitations/space-invitation-protocol.ts +12 -8
  120. package/src/packlets/locks/browser.ts +1 -1
  121. package/src/packlets/locks/node.ts +2 -2
  122. package/src/packlets/locks/resource-lock.ts +1 -1
  123. package/src/packlets/logging/logging-service.ts +14 -8
  124. package/src/packlets/logging/logging.test.ts +1 -1
  125. package/src/packlets/network/network-service.test.ts +2 -2
  126. package/src/packlets/network/network-service.ts +7 -3
  127. package/src/packlets/services/client-rpc-server.ts +5 -5
  128. package/src/packlets/services/diagnostics.ts +13 -13
  129. package/src/packlets/services/service-context.test.ts +2 -2
  130. package/src/packlets/services/service-context.ts +9 -9
  131. package/src/packlets/services/service-host.test.ts +3 -3
  132. package/src/packlets/services/service-host.ts +9 -9
  133. package/src/packlets/services/service-registry.test.ts +2 -2
  134. package/src/packlets/services/service-registry.ts +1 -1
  135. package/src/packlets/spaces/data-space-manager.test.ts +4 -4
  136. package/src/packlets/spaces/data-space-manager.ts +8 -8
  137. package/src/packlets/spaces/data-space.ts +10 -10
  138. package/src/packlets/spaces/genesis.ts +3 -3
  139. package/src/packlets/spaces/notarization-plugin.test.ts +2 -2
  140. package/src/packlets/spaces/notarization-plugin.ts +5 -5
  141. package/src/packlets/spaces/spaces-service.test.ts +2 -2
  142. package/src/packlets/spaces/spaces-service.ts +17 -17
  143. package/src/packlets/system/system-service.test.ts +1 -1
  144. package/src/packlets/system/system-service.ts +9 -9
  145. package/src/packlets/testing/credential-utils.ts +2 -2
  146. package/src/packlets/testing/invitation-utils.ts +1 -1
  147. package/src/packlets/testing/test-builder.ts +4 -4
  148. package/src/packlets/vault/iframe-host-runtime.ts +6 -6
  149. package/src/packlets/vault/iframe-proxy-runtime.ts +10 -5
  150. package/src/packlets/vault/shell-runtime.ts +4 -4
  151. package/src/packlets/vault/worker-runtime.ts +3 -3
  152. package/src/packlets/vault/worker-session.ts +5 -5
  153. package/src/version.ts +1 -1
  154. package/dist/lib/browser/chunk-XEZCTVLQ.mjs.map +0 -7
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // packages/sdk/client-services/src/packlets/testing/index.ts
@@ -87,10 +97,10 @@ var getPlatform = () => {
87
97
  };
88
98
  }
89
99
  } else {
90
- const { platform, version, arch } = process;
100
+ const { platform: platform2, version, arch } = process;
91
101
  return {
92
102
  type: "node",
93
- platform: `${platform} ${version} ${arch}`,
103
+ platform: `${platform2} ${version} ${arch}`,
94
104
  runtime: process.version,
95
105
  uptime: Math.floor(process.uptime()),
96
106
  memory: process.memoryUsage()
@@ -99,7 +109,7 @@ var getPlatform = () => {
99
109
  };
100
110
 
101
111
  // packages/sdk/client-services/src/version.ts
102
- var DXOS_VERSION = "0.3.2-main.de57e73";
112
+ var DXOS_VERSION = "0.3.2-main.fa875a7";
103
113
 
104
114
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
105
115
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -228,13 +238,13 @@ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
228
238
  var import_feed_store3 = require("@dxos/feed-store");
229
239
  var import_invariant13 = require("@dxos/invariant");
230
240
  var import_keyring = require("@dxos/keyring");
231
- var import_keys8 = require("@dxos/keys");
241
+ var import_keys9 = require("@dxos/keys");
232
242
  var import_log13 = require("@dxos/log");
233
243
  var import_protocols10 = require("@dxos/protocols");
234
244
  var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
235
245
  var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
236
246
  var import_tracing4 = require("@dxos/tracing");
237
- var import_util5 = require("@dxos/util");
247
+ var import_util6 = require("@dxos/util");
238
248
 
239
249
  // packages/sdk/client-services/src/packlets/identity/authenticator.ts
240
250
  var import_async = require("@dxos/async");
@@ -358,9 +368,11 @@ var import_credentials4 = require("@dxos/credentials");
358
368
  var import_debug2 = require("@dxos/debug");
359
369
  var import_feed_store = require("@dxos/feed-store");
360
370
  var import_invariant2 = require("@dxos/invariant");
371
+ var import_keys2 = require("@dxos/keys");
361
372
  var import_log3 = require("@dxos/log");
362
373
  var import_credentials5 = require("@dxos/protocols/proto/dxos/halo/credentials");
363
374
  var import_tracing = require("@dxos/tracing");
375
+ var import_util = require("@dxos/util");
364
376
  function _ts_decorate(decorators, target, key, desc) {
365
377
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
366
378
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -379,6 +391,14 @@ var Identity = class Identity2 {
379
391
  this._signer = signer;
380
392
  this.identityKey = identityKey;
381
393
  this.deviceKey = deviceKey;
394
+ import_log3.log.trace("dxos.halo.device", {
395
+ deviceKey
396
+ }, {
397
+ F: __dxlog_file3,
398
+ L: 64,
399
+ S: this,
400
+ C: (f, a) => f(...a)
401
+ });
382
402
  this._deviceStateMachine = new import_credentials4.DeviceStateMachine({
383
403
  identityKey: this.identityKey,
384
404
  deviceKey: this.deviceKey,
@@ -389,7 +409,7 @@ var Identity = class Identity2 {
389
409
  onUpdate: () => this.stateUpdate.emit()
390
410
  });
391
411
  this.authVerifier = new TrustedKeySetAuthVerifier({
392
- trustedKeysProvider: () => this.authorizedDeviceKeys,
412
+ trustedKeysProvider: () => new import_util.ComplexSet(import_keys2.PublicKey.hash, this.authorizedDeviceKeys.keys()),
393
413
  update: this.stateUpdate,
394
414
  authTimeout: import_client_protocol.AUTH_TIMEOUT
395
415
  });
@@ -447,7 +467,7 @@ var Identity = class Identity2 {
447
467
  getIdentityCredentialSigner() {
448
468
  (0, import_invariant2.invariant)(this._deviceStateMachine.deviceCredentialChain, "Device credential chain is not ready.", {
449
469
  F: __dxlog_file3,
450
- L: 139,
470
+ L: 145,
451
471
  S: this,
452
472
  A: [
453
473
  "this._deviceStateMachine.deviceCredentialChain",
@@ -471,7 +491,7 @@ var Identity = class Identity2 {
471
491
  dataFeedKey
472
492
  }, {
473
493
  F: __dxlog_file3,
474
- L: 155,
494
+ L: 161,
475
495
  S: this,
476
496
  C: (f, a) => f(...a)
477
497
  });
@@ -523,17 +543,18 @@ Identity = _ts_decorate([
523
543
  ], Identity);
524
544
 
525
545
  // packages/sdk/client-services/src/packlets/identity/identity-manager.ts
546
+ var import_platform2 = __toESM(require("platform"));
526
547
  var import_async3 = require("@dxos/async");
527
548
  var import_context2 = require("@dxos/context");
528
549
  var import_credentials6 = require("@dxos/credentials");
529
550
  var import_invariant3 = require("@dxos/invariant");
530
- var import_keys2 = require("@dxos/keys");
551
+ var import_keys3 = require("@dxos/keys");
531
552
  var import_log4 = require("@dxos/log");
532
553
  var import_protocols3 = require("@dxos/protocols");
533
554
  var import_credentials7 = require("@dxos/protocols/proto/dxos/halo/credentials");
534
555
  var import_timeframe = require("@dxos/timeframe");
535
556
  var import_tracing2 = require("@dxos/tracing");
536
- var import_util = require("@dxos/util");
557
+ var import_util2 = require("@dxos/util");
537
558
  function _ts_decorate2(decorators, target, key, desc) {
538
559
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
539
560
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -559,12 +580,12 @@ var IdentityManager = class IdentityManager2 {
559
580
  return this._identity;
560
581
  }
561
582
  async open(ctx) {
562
- const traceId = import_keys2.PublicKey.random().toHex();
583
+ const traceId = import_keys3.PublicKey.random().toHex();
563
584
  import_log4.log.trace("dxos.halo.identity-manager.open", import_protocols3.trace.begin({
564
585
  id: traceId
565
586
  }), {
566
587
  F: __dxlog_file4,
567
- L: 73,
588
+ L: 75,
568
589
  S: this,
569
590
  C: (f, a) => f(...a)
570
591
  });
@@ -573,7 +594,7 @@ var IdentityManager = class IdentityManager2 {
573
594
  identityRecord
574
595
  }, {
575
596
  F: __dxlog_file4,
576
- L: 76,
597
+ L: 78,
577
598
  S: this,
578
599
  C: (f, a) => f(...a)
579
600
  });
@@ -586,7 +607,7 @@ var IdentityManager = class IdentityManager2 {
586
607
  displayName: this._identity.profileDocument?.displayName
587
608
  }, {
588
609
  F: __dxlog_file4,
589
- L: 81,
610
+ L: 83,
590
611
  S: this,
591
612
  C: (f, a) => f(...a)
592
613
  });
@@ -596,7 +617,7 @@ var IdentityManager = class IdentityManager2 {
596
617
  id: traceId
597
618
  }), {
598
619
  F: __dxlog_file4,
599
- L: 87,
620
+ L: 89,
600
621
  S: this,
601
622
  C: (f, a) => f(...a)
602
623
  });
@@ -607,7 +628,7 @@ var IdentityManager = class IdentityManager2 {
607
628
  async createIdentity({ displayName } = {}) {
608
629
  (0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
609
630
  F: __dxlog_file4,
610
- L: 95,
631
+ L: 97,
611
632
  S: this,
612
633
  A: [
613
634
  "!this._identity",
@@ -616,7 +637,7 @@ var IdentityManager = class IdentityManager2 {
616
637
  });
617
638
  (0, import_log4.log)("creating identity...", void 0, {
618
639
  F: __dxlog_file4,
619
- L: 96,
640
+ L: 98,
620
641
  S: this,
621
642
  C: (f, a) => f(...a)
622
643
  });
@@ -637,7 +658,7 @@ var IdentityManager = class IdentityManager2 {
637
658
  const generator = new import_credentials6.CredentialGenerator(this._keyring, identityRecord.identityKey, identityRecord.deviceKey);
638
659
  (0, import_invariant3.invariant)(identityRecord.haloSpace.genesisFeedKey, "Genesis feed key is required.", {
639
660
  F: __dxlog_file4,
640
- L: 115,
661
+ L: 117,
641
662
  S: this,
642
663
  A: [
643
664
  "identityRecord.haloSpace.genesisFeedKey",
@@ -646,7 +667,7 @@ var IdentityManager = class IdentityManager2 {
646
667
  });
647
668
  (0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, "Data feed key is required.", {
648
669
  F: __dxlog_file4,
649
- L: 116,
670
+ L: 118,
650
671
  S: this,
651
672
  A: [
652
673
  "identityRecord.haloSpace.dataFeedKey",
@@ -665,6 +686,13 @@ var IdentityManager = class IdentityManager2 {
665
686
  }));
666
687
  }
667
688
  credentials.push(await generator.createDeviceAuthorization(identityRecord.deviceKey));
689
+ credentials.push(await generator.createDeviceProfile({
690
+ platform: import_platform2.default.name,
691
+ platformVersion: import_platform2.default.version,
692
+ architecture: typeof import_platform2.default.os?.architecture === "number" ? String(import_platform2.default.os.architecture) : void 0,
693
+ os: import_platform2.default.os?.family,
694
+ osVersion: import_platform2.default.os?.version
695
+ }));
668
696
  for (const credential of credentials) {
669
697
  await identity.controlPipeline.writer.write({
670
698
  credential: {
@@ -681,7 +709,7 @@ var IdentityManager = class IdentityManager2 {
681
709
  displayName: this._identity.profileDocument?.displayName
682
710
  }, {
683
711
  F: __dxlog_file4,
684
- L: 151,
712
+ L: 163,
685
713
  S: this,
686
714
  C: (f, a) => f(...a)
687
715
  });
@@ -691,7 +719,7 @@ var IdentityManager = class IdentityManager2 {
691
719
  deviceKey: identity.deviceKey
692
720
  }, {
693
721
  F: __dxlog_file4,
694
- L: 157,
722
+ L: 169,
695
723
  S: this,
696
724
  C: (f, a) => f(...a)
697
725
  });
@@ -705,13 +733,13 @@ var IdentityManager = class IdentityManager2 {
705
733
  params
706
734
  }, {
707
735
  F: __dxlog_file4,
708
- L: 165,
736
+ L: 177,
709
737
  S: this,
710
738
  C: (f, a) => f(...a)
711
739
  });
712
740
  (0, import_invariant3.invariant)(!this._identity, "Identity already exists.", {
713
741
  F: __dxlog_file4,
714
- L: 166,
742
+ L: 178,
715
743
  S: this,
716
744
  A: [
717
745
  "!this._identity",
@@ -739,7 +767,7 @@ var IdentityManager = class IdentityManager2 {
739
767
  displayName: this._identity.profileDocument?.displayName
740
768
  }, {
741
769
  F: __dxlog_file4,
742
- L: 185,
770
+ L: 197,
743
771
  S: this,
744
772
  C: (f, a) => f(...a)
745
773
  });
@@ -749,7 +777,7 @@ var IdentityManager = class IdentityManager2 {
749
777
  deviceKey: identity.deviceKey
750
778
  }, {
751
779
  F: __dxlog_file4,
752
- L: 191,
780
+ L: 203,
753
781
  S: this,
754
782
  C: (f, a) => f(...a)
755
783
  });
@@ -761,7 +789,7 @@ var IdentityManager = class IdentityManager2 {
761
789
  async updateProfile(profile) {
762
790
  (0, import_invariant3.invariant)(this._identity, "Identity not initialized.", {
763
791
  F: __dxlog_file4,
764
- L: 199,
792
+ L: 211,
765
793
  S: this,
766
794
  A: [
767
795
  "this._identity",
@@ -792,7 +820,7 @@ var IdentityManager = class IdentityManager2 {
792
820
  async _constructIdentity(identityRecord) {
793
821
  (0, import_invariant3.invariant)(!this._identity, void 0, {
794
822
  F: __dxlog_file4,
795
- L: 216,
823
+ L: 228,
796
824
  S: this,
797
825
  A: [
798
826
  "!this._identity",
@@ -803,13 +831,13 @@ var IdentityManager = class IdentityManager2 {
803
831
  identityRecord
804
832
  }, {
805
833
  F: __dxlog_file4,
806
- L: 217,
834
+ L: 229,
807
835
  S: this,
808
836
  C: (f, a) => f(...a)
809
837
  });
810
838
  (0, import_invariant3.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
811
839
  F: __dxlog_file4,
812
- L: 220,
840
+ L: 232,
813
841
  S: this,
814
842
  A: [
815
843
  "identityRecord.haloSpace.controlFeedKey",
@@ -821,7 +849,7 @@ var IdentityManager = class IdentityManager2 {
821
849
  });
822
850
  (0, import_invariant3.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
823
851
  F: __dxlog_file4,
824
- L: 224,
852
+ L: 236,
825
853
  S: this,
826
854
  A: [
827
855
  "identityRecord.haloSpace.dataFeedKey",
@@ -837,7 +865,7 @@ var IdentityManager = class IdentityManager2 {
837
865
  swarmIdentity: {
838
866
  peerKey: identityRecord.deviceKey,
839
867
  credentialProvider: createAuthProvider((0, import_credentials6.createCredentialSignerWithKey)(this._keyring, identityRecord.deviceKey)),
840
- credentialAuthenticator: (0, import_util.deferFunction)(() => identity.authVerifier.verifier)
868
+ credentialAuthenticator: (0, import_util2.deferFunction)(() => identity.authVerifier.verifier)
841
869
  },
842
870
  identityKey: identityRecord.identityKey
843
871
  });
@@ -853,7 +881,7 @@ var IdentityManager = class IdentityManager2 {
853
881
  identityKey: identityRecord.identityKey
854
882
  }, {
855
883
  F: __dxlog_file4,
856
- L: 248,
884
+ L: 260,
857
885
  S: this,
858
886
  C: (f, a) => f(...a)
859
887
  });
@@ -874,7 +902,7 @@ var IdentityManager = class IdentityManager2 {
874
902
  onAuthFailure: () => {
875
903
  import_log4.log.warn("auth failure", void 0, {
876
904
  F: __dxlog_file4,
877
- L: 267,
905
+ L: 279,
878
906
  S: this,
879
907
  C: (f, a) => f(...a)
880
908
  });
@@ -984,7 +1012,7 @@ var DeviceInvitationProtocol = class {
984
1012
  async admit(request) {
985
1013
  (0, import_invariant5.invariant)(request.device, void 0, {
986
1014
  F: __dxlog_file6,
987
- L: 31,
1015
+ L: 35,
988
1016
  S: this,
989
1017
  A: [
990
1018
  "request.device",
@@ -1020,7 +1048,7 @@ var DeviceInvitationProtocol = class {
1020
1048
  async accept(response, request) {
1021
1049
  (0, import_invariant5.invariant)(response.device, void 0, {
1022
1050
  F: __dxlog_file6,
1023
- L: 64,
1051
+ L: 68,
1024
1052
  S: this,
1025
1053
  A: [
1026
1054
  "response.device",
@@ -1030,7 +1058,7 @@ var DeviceInvitationProtocol = class {
1030
1058
  const { identityKey, haloSpaceKey, genesisFeedKey, controlTimeframe } = response.device;
1031
1059
  (0, import_invariant5.invariant)(request.device, void 0, {
1032
1060
  F: __dxlog_file6,
1033
- L: 67,
1061
+ L: 71,
1034
1062
  S: this,
1035
1063
  A: [
1036
1064
  "request.device",
@@ -1059,7 +1087,7 @@ var import_client_protocol2 = require("@dxos/client-protocol");
1059
1087
  var import_context4 = require("@dxos/context");
1060
1088
  var import_credentials9 = require("@dxos/credentials");
1061
1089
  var import_invariant7 = require("@dxos/invariant");
1062
- var import_keys4 = require("@dxos/keys");
1090
+ var import_keys5 = require("@dxos/keys");
1063
1091
  var import_log6 = require("@dxos/log");
1064
1092
  var import_network_manager = require("@dxos/network-manager");
1065
1093
  var import_protocols5 = require("@dxos/protocols");
@@ -1070,7 +1098,7 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
1070
1098
  var import_async4 = require("@dxos/async");
1071
1099
  var import_context3 = require("@dxos/context");
1072
1100
  var import_invariant6 = require("@dxos/invariant");
1073
- var import_keys3 = require("@dxos/keys");
1101
+ var import_keys4 = require("@dxos/keys");
1074
1102
  var import_log5 = require("@dxos/log");
1075
1103
  var import_protocols4 = require("@dxos/protocols");
1076
1104
  var import_services3 = require("@dxos/protocols/proto/dxos/client/services");
@@ -1118,7 +1146,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1118
1146
  },
1119
1147
  introduce: async (request) => {
1120
1148
  const { profile, invitationId } = request;
1121
- const traceId = import_keys3.PublicKey.random().toHex();
1149
+ const traceId = import_keys4.PublicKey.random().toHex();
1122
1150
  import_log5.log.trace("dxos.sdk.invitation-handler.host.introduce", import_protocols4.trace.begin({
1123
1151
  id: traceId
1124
1152
  }), {
@@ -1170,7 +1198,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1170
1198
  };
1171
1199
  },
1172
1200
  authenticate: async ({ authCode: code }) => {
1173
- const traceId = import_keys3.PublicKey.random().toHex();
1201
+ const traceId = import_keys4.PublicKey.random().toHex();
1174
1202
  import_log5.log.trace("dxos.sdk.invitation-handler.host.authenticate", import_protocols4.trace.begin({
1175
1203
  id: traceId
1176
1204
  }), {
@@ -1250,7 +1278,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
1250
1278
  };
1251
1279
  },
1252
1280
  admit: async (request) => {
1253
- const traceId = import_keys3.PublicKey.random().toHex();
1281
+ const traceId = import_keys4.PublicKey.random().toHex();
1254
1282
  import_log5.log.trace("dxos.sdk.invitation-handler.host.admit", import_protocols4.trace.begin({
1255
1283
  id: traceId
1256
1284
  }), {
@@ -1416,11 +1444,11 @@ var InvitationsHandler = class {
1416
1444
  this._networkManager = _networkManager;
1417
1445
  }
1418
1446
  createInvitation(protocol, options) {
1419
- const { invitationId = import_keys4.PublicKey.random().toHex(), type = import_services4.Invitation.Type.INTERACTIVE, authMethod = import_services4.Invitation.AuthMethod.SHARED_SECRET, state = import_services4.Invitation.State.INIT, timeout = import_client_protocol2.INVITATION_TIMEOUT, swarmKey = import_keys4.PublicKey.random() } = options ?? {};
1447
+ const { invitationId = import_keys5.PublicKey.random().toHex(), type = import_services4.Invitation.Type.INTERACTIVE, authMethod = import_services4.Invitation.AuthMethod.SHARED_SECRET, state = import_services4.Invitation.State.INIT, timeout = import_client_protocol2.INVITATION_TIMEOUT, swarmKey = import_keys5.PublicKey.random() } = options ?? {};
1420
1448
  const authCode = options?.authCode ?? (authMethod === import_services4.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials9.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
1421
1449
  (0, import_invariant7.invariant)(protocol, void 0, {
1422
1450
  F: __dxlog_file8,
1423
- L: 75,
1451
+ L: 80,
1424
1452
  S: this,
1425
1453
  A: [
1426
1454
  "protocol",
@@ -1449,7 +1477,7 @@ var InvitationsHandler = class {
1449
1477
  ...protocol.toJSON()
1450
1478
  }, {
1451
1479
  F: __dxlog_file8,
1452
- L: 97,
1480
+ L: 102,
1453
1481
  S: this,
1454
1482
  C: (f, a) => f(...a)
1455
1483
  });
@@ -1474,7 +1502,7 @@ var InvitationsHandler = class {
1474
1502
  const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
1475
1503
  (0, import_invariant7.invariant)(deviceKey, void 0, {
1476
1504
  F: __dxlog_file8,
1477
- L: 118,
1505
+ L: 123,
1478
1506
  S: this,
1479
1507
  A: [
1480
1508
  "deviceKey",
@@ -1491,13 +1519,13 @@ var InvitationsHandler = class {
1491
1519
  },
1492
1520
  onOpen: () => {
1493
1521
  (0, import_async5.scheduleTask)(ctx, async () => {
1494
- const traceId = import_keys4.PublicKey.random().toHex();
1522
+ const traceId = import_keys5.PublicKey.random().toHex();
1495
1523
  try {
1496
1524
  import_log6.log.trace("dxos.sdk.invitations-handler.host.onOpen", import_protocols5.trace.begin({
1497
1525
  id: traceId
1498
1526
  }), {
1499
1527
  F: __dxlog_file8,
1500
- L: 136,
1528
+ L: 141,
1501
1529
  S: this,
1502
1530
  C: (f, a) => f(...a)
1503
1531
  });
@@ -1505,7 +1533,7 @@ var InvitationsHandler = class {
1505
1533
  ...protocol.toJSON()
1506
1534
  }, {
1507
1535
  F: __dxlog_file8,
1508
- L: 137,
1536
+ L: 142,
1509
1537
  S: this,
1510
1538
  C: (f, a) => f(...a)
1511
1539
  });
@@ -1521,7 +1549,7 @@ var InvitationsHandler = class {
1521
1549
  ...protocol.toJSON()
1522
1550
  }, {
1523
1551
  F: __dxlog_file8,
1524
- L: 140,
1552
+ L: 145,
1525
1553
  S: this,
1526
1554
  C: (f, a) => f(...a)
1527
1555
  });
@@ -1533,7 +1561,7 @@ var InvitationsHandler = class {
1533
1561
  id: traceId
1534
1562
  }), {
1535
1563
  F: __dxlog_file8,
1536
- L: 142,
1564
+ L: 147,
1537
1565
  S: this,
1538
1566
  C: (f, a) => f(...a)
1539
1567
  });
@@ -1543,7 +1571,7 @@ var InvitationsHandler = class {
1543
1571
  ...protocol.toJSON()
1544
1572
  }, {
1545
1573
  F: __dxlog_file8,
1546
- L: 145,
1574
+ L: 150,
1547
1575
  S: this,
1548
1576
  C: (f, a) => f(...a)
1549
1577
  });
@@ -1554,7 +1582,7 @@ var InvitationsHandler = class {
1554
1582
  } else {
1555
1583
  import_log6.log.error("failed", err, {
1556
1584
  F: __dxlog_file8,
1557
- L: 148,
1585
+ L: 153,
1558
1586
  S: this,
1559
1587
  C: (f, a) => f(...a)
1560
1588
  });
@@ -1565,7 +1593,7 @@ var InvitationsHandler = class {
1565
1593
  error: err
1566
1594
  }), {
1567
1595
  F: __dxlog_file8,
1568
- L: 151,
1596
+ L: 156,
1569
1597
  S: this,
1570
1598
  C: (f, a) => f(...a)
1571
1599
  });
@@ -1586,7 +1614,7 @@ var InvitationsHandler = class {
1586
1614
  ...protocol.toJSON()
1587
1615
  }, {
1588
1616
  F: __dxlog_file8,
1589
- L: 166,
1617
+ L: 171,
1590
1618
  S: this,
1591
1619
  C: (f, a) => f(...a)
1592
1620
  });
@@ -1597,7 +1625,7 @@ var InvitationsHandler = class {
1597
1625
  } else {
1598
1626
  import_log6.log.error("failed", err, {
1599
1627
  F: __dxlog_file8,
1600
- L: 169,
1628
+ L: 174,
1601
1629
  S: this,
1602
1630
  C: (f, a) => f(...a)
1603
1631
  });
@@ -1642,7 +1670,7 @@ var InvitationsHandler = class {
1642
1670
  const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
1643
1671
  (0, import_invariant7.invariant)(protocol, void 0, {
1644
1672
  F: __dxlog_file8,
1645
- L: 210,
1673
+ L: 215,
1646
1674
  S: this,
1647
1675
  A: [
1648
1676
  "protocol",
@@ -1656,7 +1684,7 @@ var InvitationsHandler = class {
1656
1684
  const setState = (newData) => {
1657
1685
  (0, import_invariant7.invariant)(newData.state !== void 0, void 0, {
1658
1686
  F: __dxlog_file8,
1659
- L: 221,
1687
+ L: 226,
1660
1688
  S: this,
1661
1689
  A: [
1662
1690
  "newData.state !== undefined",
@@ -1676,7 +1704,7 @@ var InvitationsHandler = class {
1676
1704
  ...protocol.toJSON()
1677
1705
  }, {
1678
1706
  F: __dxlog_file8,
1679
- L: 229,
1707
+ L: 234,
1680
1708
  S: this,
1681
1709
  C: (f, a) => f(...a)
1682
1710
  });
@@ -1686,7 +1714,7 @@ var InvitationsHandler = class {
1686
1714
  } else {
1687
1715
  import_log6.log.warn("auth failed", err, {
1688
1716
  F: __dxlog_file8,
1689
- L: 232,
1717
+ L: 237,
1690
1718
  S: this,
1691
1719
  C: (f, a) => f(...a)
1692
1720
  });
@@ -1700,7 +1728,7 @@ var InvitationsHandler = class {
1700
1728
  ...protocol.toJSON()
1701
1729
  }, {
1702
1730
  F: __dxlog_file8,
1703
- L: 240,
1731
+ L: 245,
1704
1732
  S: this,
1705
1733
  C: (f, a) => f(...a)
1706
1734
  });
@@ -1715,7 +1743,7 @@ var InvitationsHandler = class {
1715
1743
  currentState
1716
1744
  }, {
1717
1745
  F: __dxlog_file8,
1718
- L: 250,
1746
+ L: 255,
1719
1747
  S: this,
1720
1748
  C: (f, a) => f(...a)
1721
1749
  });
@@ -1724,13 +1752,13 @@ var InvitationsHandler = class {
1724
1752
  }
1725
1753
  });
1726
1754
  (0, import_async5.scheduleTask)(ctx, async () => {
1727
- const traceId = import_keys4.PublicKey.random().toHex();
1755
+ const traceId = import_keys5.PublicKey.random().toHex();
1728
1756
  try {
1729
1757
  import_log6.log.trace("dxos.sdk.invitations-handler.guest.onOpen", import_protocols5.trace.begin({
1730
1758
  id: traceId
1731
1759
  }), {
1732
1760
  F: __dxlog_file8,
1733
- L: 259,
1761
+ L: 264,
1734
1762
  S: this,
1735
1763
  C: (f, a) => f(...a)
1736
1764
  });
@@ -1742,7 +1770,7 @@ var InvitationsHandler = class {
1742
1770
  ...protocol.toJSON()
1743
1771
  }, {
1744
1772
  F: __dxlog_file8,
1745
- L: 267,
1773
+ L: 272,
1746
1774
  S: this,
1747
1775
  C: (f, a) => f(...a)
1748
1776
  });
@@ -1753,7 +1781,7 @@ var InvitationsHandler = class {
1753
1781
  ...protocol.toJSON()
1754
1782
  }, {
1755
1783
  F: __dxlog_file8,
1756
- L: 271,
1784
+ L: 276,
1757
1785
  S: this,
1758
1786
  C: (f, a) => f(...a)
1759
1787
  });
@@ -1763,7 +1791,7 @@ var InvitationsHandler = class {
1763
1791
  response: introductionResponse
1764
1792
  }, {
1765
1793
  F: __dxlog_file8,
1766
- L: 275,
1794
+ L: 280,
1767
1795
  S: this,
1768
1796
  C: (f, a) => f(...a)
1769
1797
  });
@@ -1775,7 +1803,7 @@ var InvitationsHandler = class {
1775
1803
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
1776
1804
  (0, import_log6.log)("guest waiting for authentication code...", void 0, {
1777
1805
  F: __dxlog_file8,
1778
- L: 284,
1806
+ L: 289,
1779
1807
  S: this,
1780
1808
  C: (f, a) => f(...a)
1781
1809
  });
@@ -1787,7 +1815,7 @@ var InvitationsHandler = class {
1787
1815
  });
1788
1816
  (0, import_log6.log)("sending authentication request", void 0, {
1789
1817
  F: __dxlog_file8,
1790
- L: 288,
1818
+ L: 293,
1791
1819
  S: this,
1792
1820
  C: (f, a) => f(...a)
1793
1821
  });
@@ -1808,7 +1836,7 @@ var InvitationsHandler = class {
1808
1836
  attempt
1809
1837
  }, {
1810
1838
  F: __dxlog_file8,
1811
- L: 299,
1839
+ L: 304,
1812
1840
  S: this,
1813
1841
  C: (f, a) => f(...a)
1814
1842
  });
@@ -1825,7 +1853,7 @@ var InvitationsHandler = class {
1825
1853
  ...protocol.toJSON()
1826
1854
  }, {
1827
1855
  F: __dxlog_file8,
1828
- L: 310,
1856
+ L: 315,
1829
1857
  S: this,
1830
1858
  C: (f, a) => f(...a)
1831
1859
  });
@@ -1837,7 +1865,7 @@ var InvitationsHandler = class {
1837
1865
  ...protocol.toJSON()
1838
1866
  }, {
1839
1867
  F: __dxlog_file8,
1840
- L: 321,
1868
+ L: 326,
1841
1869
  S: this,
1842
1870
  C: (f, a) => f(...a)
1843
1871
  });
@@ -1849,7 +1877,7 @@ var InvitationsHandler = class {
1849
1877
  id: traceId
1850
1878
  }), {
1851
1879
  F: __dxlog_file8,
1852
- L: 323,
1880
+ L: 328,
1853
1881
  S: this,
1854
1882
  C: (f, a) => f(...a)
1855
1883
  });
@@ -1859,7 +1887,7 @@ var InvitationsHandler = class {
1859
1887
  ...protocol.toJSON()
1860
1888
  }, {
1861
1889
  F: __dxlog_file8,
1862
- L: 326,
1890
+ L: 331,
1863
1891
  S: this,
1864
1892
  C: (f, a) => f(...a)
1865
1893
  });
@@ -1869,7 +1897,7 @@ var InvitationsHandler = class {
1869
1897
  } else {
1870
1898
  (0, import_log6.log)("auth failed", err, {
1871
1899
  F: __dxlog_file8,
1872
- L: 329,
1900
+ L: 334,
1873
1901
  S: this,
1874
1902
  C: (f, a) => f(...a)
1875
1903
  });
@@ -1880,7 +1908,7 @@ var InvitationsHandler = class {
1880
1908
  error: err
1881
1909
  }), {
1882
1910
  F: __dxlog_file8,
1883
- L: 332,
1911
+ L: 337,
1884
1912
  S: this,
1885
1913
  C: (f, a) => f(...a)
1886
1914
  });
@@ -1898,7 +1926,7 @@ var InvitationsHandler = class {
1898
1926
  ...protocol.toJSON()
1899
1927
  }, {
1900
1928
  F: __dxlog_file8,
1901
- L: 343,
1929
+ L: 348,
1902
1930
  S: this,
1903
1931
  C: (f, a) => f(...a)
1904
1932
  });
@@ -1908,7 +1936,7 @@ var InvitationsHandler = class {
1908
1936
  } else {
1909
1937
  (0, import_log6.log)("auth failed", err, {
1910
1938
  F: __dxlog_file8,
1911
- L: 346,
1939
+ L: 351,
1912
1940
  S: this,
1913
1941
  C: (f, a) => f(...a)
1914
1942
  });
@@ -1921,7 +1949,7 @@ var InvitationsHandler = class {
1921
1949
  (0, import_async5.scheduleTask)(ctx, async () => {
1922
1950
  (0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
1923
1951
  F: __dxlog_file8,
1924
- L: 356,
1952
+ L: 361,
1925
1953
  S: this,
1926
1954
  A: [
1927
1955
  "invitation.swarmKey",
@@ -1931,7 +1959,7 @@ var InvitationsHandler = class {
1931
1959
  const topic = invitation.swarmKey;
1932
1960
  const swarmConnection = await this._networkManager.joinSwarm({
1933
1961
  topic,
1934
- peerId: import_keys4.PublicKey.random(),
1962
+ peerId: import_keys5.PublicKey.random(),
1935
1963
  protocolProvider: (0, import_network_manager.createTeleportProtocolFactory)(async (teleport) => {
1936
1964
  teleport.addExtension("dxos.halo.invitations", createExtension());
1937
1965
  }),
@@ -2088,15 +2116,6 @@ var InvitationsServiceImpl = class {
2088
2116
  await accepted.cancel();
2089
2117
  this._acceptInvitations.delete(invitationId);
2090
2118
  this._removedAccepted.emit(accepted.get());
2091
- } else {
2092
- import_log7.log.warn("invalid invitation", {
2093
- invitationId
2094
- }, {
2095
- F: __dxlog_file9,
2096
- L: 132,
2097
- S: this,
2098
- C: (f, a) => f(...a)
2099
- });
2100
2119
  }
2101
2120
  }
2102
2121
  queryInvitations() {
@@ -2180,7 +2199,7 @@ var SpaceInvitationProtocol = class {
2180
2199
  async admit(request, guestProfile) {
2181
2200
  (0, import_invariant9.invariant)(this._spaceKey, void 0, {
2182
2201
  F: __dxlog_file10,
2183
- L: 42,
2202
+ L: 46,
2184
2203
  S: this,
2185
2204
  A: [
2186
2205
  "this._spaceKey",
@@ -2190,7 +2209,7 @@ var SpaceInvitationProtocol = class {
2190
2209
  const space = await this._spaceManager.spaces.get(this._spaceKey);
2191
2210
  (0, import_invariant9.invariant)(space, void 0, {
2192
2211
  F: __dxlog_file10,
2193
- L: 44,
2212
+ L: 48,
2194
2213
  S: this,
2195
2214
  A: [
2196
2215
  "space",
@@ -2199,7 +2218,7 @@ var SpaceInvitationProtocol = class {
2199
2218
  });
2200
2219
  (0, import_invariant9.invariant)(request.space, void 0, {
2201
2220
  F: __dxlog_file10,
2202
- L: 46,
2221
+ L: 50,
2203
2222
  S: this,
2204
2223
  A: [
2205
2224
  "request.space",
@@ -2212,14 +2231,14 @@ var SpaceInvitationProtocol = class {
2212
2231
  guest: deviceKey
2213
2232
  }, {
2214
2233
  F: __dxlog_file10,
2215
- L: 49,
2234
+ L: 53,
2216
2235
  S: this,
2217
2236
  C: (f, a) => f(...a)
2218
2237
  });
2219
2238
  const credentials = await (0, import_credentials10.createAdmissionCredentials)(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, guestProfile);
2220
2239
  (0, import_invariant9.invariant)(credentials[0].credential, void 0, {
2221
2240
  F: __dxlog_file10,
2222
- L: 60,
2241
+ L: 64,
2223
2242
  S: this,
2224
2243
  A: [
2225
2244
  "credentials[0].credential",
@@ -2229,7 +2248,7 @@ var SpaceInvitationProtocol = class {
2229
2248
  const spaceMemberCredential = credentials[0].credential.credential;
2230
2249
  (0, import_invariant9.invariant)((0, import_credentials10.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
2231
2250
  F: __dxlog_file10,
2232
- L: 62,
2251
+ L: 66,
2233
2252
  S: this,
2234
2253
  A: [
2235
2254
  "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -2265,7 +2284,7 @@ var SpaceInvitationProtocol = class {
2265
2284
  async accept(response) {
2266
2285
  (0, import_invariant9.invariant)(response.space, void 0, {
2267
2286
  F: __dxlog_file10,
2268
- L: 97,
2287
+ L: 101,
2269
2288
  S: this,
2270
2289
  A: [
2271
2290
  "response.space",
@@ -2276,7 +2295,7 @@ var SpaceInvitationProtocol = class {
2276
2295
  const assertion = (0, import_credentials10.getCredentialAssertion)(credential);
2277
2296
  (0, import_invariant9.invariant)(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
2278
2297
  F: __dxlog_file10,
2279
- L: 100,
2298
+ L: 104,
2280
2299
  S: this,
2281
2300
  A: [
2282
2301
  "assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -2285,7 +2304,7 @@ var SpaceInvitationProtocol = class {
2285
2304
  });
2286
2305
  (0, import_invariant9.invariant)(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
2287
2306
  F: __dxlog_file10,
2288
- L: 101,
2307
+ L: 105,
2289
2308
  S: this,
2290
2309
  A: [
2291
2310
  "credential.subject.id.equals(this._signingContext.identityKey)",
@@ -2310,12 +2329,12 @@ var import_async9 = require("@dxos/async");
2310
2329
  var import_context7 = require("@dxos/context");
2311
2330
  var import_credentials14 = require("@dxos/credentials");
2312
2331
  var import_invariant11 = require("@dxos/invariant");
2313
- var import_keys7 = require("@dxos/keys");
2332
+ var import_keys8 = require("@dxos/keys");
2314
2333
  var import_log11 = require("@dxos/log");
2315
2334
  var import_protocols8 = require("@dxos/protocols");
2316
2335
  var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
2317
2336
  var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
2318
- var import_util4 = require("@dxos/util");
2337
+ var import_util5 = require("@dxos/util");
2319
2338
 
2320
2339
  // packages/sdk/client-services/src/packlets/spaces/data-space.ts
2321
2340
  var import_async8 = require("@dxos/async");
@@ -2323,24 +2342,24 @@ var import_client_protocol3 = require("@dxos/client-protocol");
2323
2342
  var import_context6 = require("@dxos/context");
2324
2343
  var import_debug4 = require("@dxos/debug");
2325
2344
  var import_echo_pipeline = require("@dxos/echo-pipeline");
2326
- var import_keys6 = require("@dxos/keys");
2345
+ var import_keys7 = require("@dxos/keys");
2327
2346
  var import_log10 = require("@dxos/log");
2328
2347
  var import_protocols7 = require("@dxos/protocols");
2329
2348
  var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2330
2349
  var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
2331
2350
  var import_timeframe2 = require("@dxos/timeframe");
2332
2351
  var import_tracing3 = require("@dxos/tracing");
2333
- var import_util3 = require("@dxos/util");
2352
+ var import_util4 = require("@dxos/util");
2334
2353
 
2335
2354
  // packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
2336
2355
  var import_async7 = require("@dxos/async");
2337
2356
  var import_context5 = require("@dxos/context");
2338
2357
  var import_invariant10 = require("@dxos/invariant");
2339
- var import_keys5 = require("@dxos/keys");
2358
+ var import_keys6 = require("@dxos/keys");
2340
2359
  var import_log9 = require("@dxos/log");
2341
2360
  var import_protocols6 = require("@dxos/protocols");
2342
2361
  var import_teleport2 = require("@dxos/teleport");
2343
- var import_util2 = require("@dxos/util");
2362
+ var import_util3 = require("@dxos/util");
2344
2363
  var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2345
2364
  var DEFAULT_RETRY_TIMEOUT = 1e3;
2346
2365
  var DEFAULT_SUCCESS_DELAY = 1e3;
@@ -2351,8 +2370,8 @@ var NotarizationPlugin = class {
2351
2370
  this._ctx = new import_context5.Context();
2352
2371
  this._extensionOpened = new import_async7.Event();
2353
2372
  this._extensions = /* @__PURE__ */ new Set();
2354
- this._processedCredentials = new import_util2.ComplexSet(import_keys5.PublicKey.hash);
2355
- this._processCredentialsTriggers = new import_util2.ComplexMap(import_keys5.PublicKey.hash);
2373
+ this._processedCredentials = new import_util3.ComplexSet(import_keys6.PublicKey.hash);
2374
+ this._processCredentialsTriggers = new import_util3.ComplexMap(import_keys6.PublicKey.hash);
2356
2375
  }
2357
2376
  get hasWriter() {
2358
2377
  return !!this._writer;
@@ -2514,7 +2533,7 @@ var NotarizationPlugin = class {
2514
2533
  if (this._processedCredentials.has(id)) {
2515
2534
  return;
2516
2535
  }
2517
- await (0, import_util2.entry)(this._processCredentialsTriggers, id).orInsert(new import_async7.Trigger()).value.wait();
2536
+ await (0, import_util3.entry)(this._processCredentialsTriggers, id).orInsert(new import_async7.Trigger()).value.wait();
2518
2537
  }
2519
2538
  /**
2520
2539
  * Requests from other peers to notarize credentials.
@@ -2634,7 +2653,7 @@ var DataSpace = class DataSpace2 {
2634
2653
  this._signingContext = params.signingContext;
2635
2654
  this._callbacks = params.callbacks ?? {};
2636
2655
  this.authVerifier = new TrustedKeySetAuthVerifier({
2637
- trustedKeysProvider: () => new import_util3.ComplexSet(import_keys6.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
2656
+ trustedKeysProvider: () => new import_util4.ComplexSet(import_keys7.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
2638
2657
  update: this._inner.stateUpdate,
2639
2658
  authTimeout: import_client_protocol3.AUTH_TIMEOUT
2640
2659
  });
@@ -3053,9 +3072,9 @@ var DataSpaceManager = class DataSpaceManager2 {
3053
3072
  this._feedStore = _feedStore;
3054
3073
  this._ctx = new import_context7.Context();
3055
3074
  this.updated = new import_async9.Event();
3056
- this._spaces = new import_util4.ComplexMap(import_keys7.PublicKey.hash);
3075
+ this._spaces = new import_util5.ComplexMap(import_keys8.PublicKey.hash);
3057
3076
  this._isOpen = false;
3058
- this._instanceId = import_keys7.PublicKey.random().toHex();
3077
+ this._instanceId = import_keys8.PublicKey.random().toHex();
3059
3078
  }
3060
3079
  // TODO(burdon): Remove.
3061
3080
  get spaces() {
@@ -3084,7 +3103,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3084
3103
  S: this,
3085
3104
  C: (f, a) => f(...a)
3086
3105
  });
3087
- await (0, import_util4.forEachAsync)(this._metadataStore.spaces, async (spaceMetadata) => {
3106
+ await (0, import_util5.forEachAsync)(this._metadataStore.spaces, async (spaceMetadata) => {
3088
3107
  try {
3089
3108
  (0, import_log11.log)("load space", {
3090
3109
  spaceMetadata
@@ -3266,7 +3285,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3266
3285
  swarmIdentity: {
3267
3286
  peerKey: this._signingContext.deviceKey,
3268
3287
  credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
3269
- credentialAuthenticator: (0, import_util4.deferFunction)(() => dataSpace.authVerifier.verifier)
3288
+ credentialAuthenticator: (0, import_util5.deferFunction)(() => dataSpace.authVerifier.verifier)
3270
3289
  },
3271
3290
  onNetworkConnection: (session) => {
3272
3291
  session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
@@ -3606,7 +3625,7 @@ var ServiceContext = class ServiceContext2 {
3606
3625
  this.initialized = new import_async11.Trigger();
3607
3626
  this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
3608
3627
  this._handlerFactories = /* @__PURE__ */ new Map();
3609
- this._instanceId = import_keys8.PublicKey.random().toHex();
3628
+ this._instanceId = import_keys9.PublicKey.random().toHex();
3610
3629
  this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
3611
3630
  this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
3612
3631
  this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
@@ -3827,7 +3846,7 @@ _ts_decorate5([
3827
3846
  import_tracing4.trace.span()
3828
3847
  ], ServiceContext.prototype, "_initialize", null);
3829
3848
  ServiceContext = _ts_decorate5([
3830
- (0, import_util5.safeInstanceof)("dxos.client-services.ServiceContext"),
3849
+ (0, import_util6.safeInstanceof)("dxos.client-services.ServiceContext"),
3831
3850
  import_tracing4.trace.resource()
3832
3851
  ], ServiceContext);
3833
3852
 
@@ -3839,7 +3858,7 @@ var import_document_model2 = require("@dxos/document-model");
3839
3858
  var import_echo_pipeline3 = require("@dxos/echo-pipeline");
3840
3859
  var import_echo_schema = require("@dxos/echo-schema");
3841
3860
  var import_invariant15 = require("@dxos/invariant");
3842
- var import_keys12 = require("@dxos/keys");
3861
+ var import_keys13 = require("@dxos/keys");
3843
3862
  var import_log16 = require("@dxos/log");
3844
3863
  var import_messaging = require("@dxos/messaging");
3845
3864
  var import_model_factory = require("@dxos/model-factory");
@@ -3882,7 +3901,7 @@ var DevicesServiceImpl = class {
3882
3901
  constructor(_identityManager) {
3883
3902
  this._identityManager = _identityManager;
3884
3903
  }
3885
- updateDevice(request) {
3904
+ async updateDevice(profile) {
3886
3905
  throw new Error("Method not implemented.");
3887
3906
  }
3888
3907
  queryDevices() {
@@ -3895,9 +3914,10 @@ var DevicesServiceImpl = class {
3895
3914
  });
3896
3915
  } else {
3897
3916
  next({
3898
- devices: Array.from(deviceKeys.values()).map((key) => ({
3917
+ devices: Array.from(deviceKeys.entries()).map(([key, profile]) => ({
3899
3918
  deviceKey: key,
3900
- kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services11.DeviceKind.CURRENT : import_services11.DeviceKind.TRUSTED
3919
+ kind: this._identityManager.identity?.deviceKey.equals(key) ? import_services11.DeviceKind.CURRENT : import_services11.DeviceKind.TRUSTED,
3920
+ profile
3901
3921
  }))
3902
3922
  });
3903
3923
  }
@@ -3925,12 +3945,12 @@ var import_codec_protobuf12 = require("@dxos/codec-protobuf");
3925
3945
  var import_async13 = require("@dxos/async");
3926
3946
  var import_codec_protobuf7 = require("@dxos/codec-protobuf");
3927
3947
  var import_feed_store4 = require("@dxos/feed-store");
3928
- var import_keys9 = require("@dxos/keys");
3929
- var import_util6 = require("@dxos/util");
3948
+ var import_keys10 = require("@dxos/keys");
3949
+ var import_util7 = require("@dxos/util");
3930
3950
  var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
3931
3951
  return new import_codec_protobuf7.Stream(({ next }) => {
3932
3952
  const subscriptions = new import_async13.EventSubscriptions();
3933
- const feedMap = new import_util6.ComplexMap(import_keys9.PublicKey.hash);
3953
+ const feedMap = new import_util7.ComplexMap(import_keys10.PublicKey.hash);
3934
3954
  const update = () => {
3935
3955
  const { feeds } = feedStore;
3936
3956
  feeds.filter((feed) => !feedKeys?.length || feedKeys.some((feedKey) => feedKey.equals(feed.key))).forEach((feed) => {
@@ -4022,7 +4042,7 @@ var subscribeToMetadata = ({ context }) => new import_codec_protobuf9.Stream(({
4022
4042
  // packages/sdk/client-services/src/packlets/devtools/network.ts
4023
4043
  var import_codec_protobuf10 = require("@dxos/codec-protobuf");
4024
4044
  var import_context9 = require("@dxos/context");
4025
- var import_keys10 = require("@dxos/keys");
4045
+ var import_keys11 = require("@dxos/keys");
4026
4046
  var subscribeToNetworkStatus = ({ signalManager }) => new import_codec_protobuf10.Stream(({ next, close }) => {
4027
4047
  const update = () => {
4028
4048
  try {
@@ -4288,7 +4308,7 @@ var import_async16 = require("@dxos/async");
4288
4308
  var import_codec_protobuf13 = require("@dxos/codec-protobuf");
4289
4309
  var import_log15 = require("@dxos/log");
4290
4310
  var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
4291
- var import_util7 = require("@dxos/util");
4311
+ var import_util8 = require("@dxos/util");
4292
4312
  var LoggingServiceImpl = class {
4293
4313
  constructor() {
4294
4314
  this._logs = new import_async16.Event();
@@ -4306,15 +4326,15 @@ var LoggingServiceImpl = class {
4306
4326
  }
4307
4327
  async controlMetrics({ reset, record }) {
4308
4328
  if (reset) {
4309
- import_util7.tracer.clear();
4329
+ import_util8.tracer.clear();
4310
4330
  }
4311
4331
  if (record === true) {
4312
- import_util7.tracer.start();
4332
+ import_util8.tracer.start();
4313
4333
  } else if (record === false) {
4314
- import_util7.tracer.stop();
4334
+ import_util8.tracer.stop();
4315
4335
  }
4316
4336
  return {
4317
- recording: import_util7.tracer.recording
4337
+ recording: import_util8.tracer.recording
4318
4338
  };
4319
4339
  }
4320
4340
  /**
@@ -4322,10 +4342,10 @@ var LoggingServiceImpl = class {
4322
4342
  */
4323
4343
  queryMetrics({ interval = 5e3 }) {
4324
4344
  const getNumericalValues = (key) => {
4325
- const events = import_util7.tracer.get(key) ?? [];
4345
+ const events = import_util8.tracer.get(key) ?? [];
4326
4346
  return {
4327
4347
  key,
4328
- stats: (0, import_util7.numericalValues)(events, "duration")
4348
+ stats: (0, import_util8.numericalValues)(events, "duration")
4329
4349
  };
4330
4350
  };
4331
4351
  return new import_codec_protobuf13.Stream(({ next }) => {
@@ -4363,7 +4383,7 @@ var LoggingServiceImpl = class {
4363
4383
  }
4364
4384
  const record = {
4365
4385
  ...entry2,
4366
- context: (0, import_util7.jsonify)((0, import_log15.getContextFromEntry)(entry2)),
4386
+ context: (0, import_util8.jsonify)((0, import_log15.getContextFromEntry)(entry2)),
4367
4387
  timestamp: /* @__PURE__ */ new Date(),
4368
4388
  meta: {
4369
4389
  // TODO(dmaretskyi): Fix proto.
@@ -4437,10 +4457,10 @@ var import_client_protocol4 = require("@dxos/client-protocol");
4437
4457
  var import_protocols11 = require("@dxos/protocols");
4438
4458
  var import_config = require("@dxos/protocols/proto/dxos/config");
4439
4459
  var import_random_access_storage = require("@dxos/random-access-storage");
4440
- var import_util8 = require("@dxos/util");
4460
+ var import_util9 = require("@dxos/util");
4441
4461
  var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
4442
4462
  var createStorageObjects = (config) => {
4443
- const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
4463
+ const { persistent = false, keyStore, dataStore, dataRoot = (0, import_util9.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage" } = config ?? {};
4444
4464
  if (persistent && dataStore === StorageDriver.RAM) {
4445
4465
  throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
4446
4466
  }
@@ -4484,7 +4504,7 @@ var toStorageType = (type) => {
4484
4504
  // packages/sdk/client-services/src/packlets/system/system-service.ts
4485
4505
  var import_codec_protobuf15 = require("@dxos/codec-protobuf");
4486
4506
  var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
4487
- var import_util9 = require("@dxos/util");
4507
+ var import_util10 = require("@dxos/util");
4488
4508
  var SystemServiceImpl = class {
4489
4509
  constructor({ config, statusUpdate, getDiagnostics, onUpdateStatus, getCurrentStatus, onReset }) {
4490
4510
  this._config = config;
@@ -4504,7 +4524,7 @@ var SystemServiceImpl = class {
4504
4524
  const diagnostics = await this._getDiagnostics();
4505
4525
  return {
4506
4526
  timestamp: /* @__PURE__ */ new Date(),
4507
- diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util9.jsonKeyReplacer)({
4527
+ diagnostics: JSON.parse(JSON.stringify(diagnostics, (0, import_util10.jsonKeyReplacer)({
4508
4528
  truncate: keys === import_services13.GetDiagnosticsRequest.KEY_OPTION.TRUNCATE,
4509
4529
  humanize: keys === import_services13.GetDiagnosticsRequest.KEY_OPTION.HUMANIZE
4510
4530
  })))
@@ -4705,7 +4725,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4705
4725
  if (this._open) {
4706
4726
  return;
4707
4727
  }
4708
- const traceId = import_keys12.PublicKey.random().toHex();
4728
+ const traceId = import_keys13.PublicKey.random().toHex();
4709
4729
  import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
4710
4730
  id: traceId
4711
4731
  }), {
@@ -4845,7 +4865,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4845
4865
  });
4846
4866
  }
4847
4867
  async reset() {
4848
- const traceId = import_keys12.PublicKey.random().toHex();
4868
+ const traceId = import_keys13.PublicKey.random().toHex();
4849
4869
  import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
4850
4870
  id: traceId
4851
4871
  }), {