@dxos/client-services 0.5.1-next.2ad6c47 → 0.5.1-next.7f021b8

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 (48) hide show
  1. package/dist/lib/browser/{chunk-CMVTOS5E.mjs → chunk-FKKPCNDO.mjs} +105 -164
  2. package/dist/lib/browser/chunk-FKKPCNDO.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +6 -4
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +8 -6
  7. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  8. package/dist/lib/node/{chunk-EAWN3LCD.cjs → chunk-Q6Z4BMTZ.cjs} +118 -173
  9. package/dist/lib/node/chunk-Q6Z4BMTZ.cjs.map +7 -0
  10. package/dist/lib/node/index.cjs +48 -46
  11. package/dist/lib/node/index.cjs.map +3 -3
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/packlets/testing/index.cjs +13 -11
  14. package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
  15. package/dist/types/src/packlets/services/service-context.d.ts +4 -6
  16. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  17. package/dist/types/src/packlets/services/service-host.d.ts +0 -1
  18. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  19. package/dist/types/src/packlets/spaces/data-space-manager.d.ts +4 -3
  20. package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
  21. package/dist/types/src/packlets/spaces/data-space.d.ts +4 -3
  22. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  23. package/dist/types/src/packlets/storage/level.d.ts.map +1 -1
  24. package/dist/types/src/packlets/testing/test-builder.d.ts +4 -3
  25. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  26. package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
  27. package/dist/types/src/version.d.ts +1 -1
  28. package/package.json +34 -34
  29. package/src/packlets/services/automerge-host.test.ts +3 -3
  30. package/src/packlets/services/service-context.test.ts +3 -3
  31. package/src/packlets/services/service-context.ts +11 -25
  32. package/src/packlets/services/service-host.test.ts +6 -0
  33. package/src/packlets/services/service-host.ts +7 -23
  34. package/src/packlets/spaces/data-space-manager.test.ts +4 -4
  35. package/src/packlets/spaces/data-space-manager.ts +8 -11
  36. package/src/packlets/spaces/data-space.ts +13 -18
  37. package/src/packlets/storage/level.ts +1 -0
  38. package/src/packlets/testing/test-builder.ts +8 -13
  39. package/src/packlets/vault/worker-runtime.ts +3 -1
  40. package/src/version.ts +1 -1
  41. package/dist/lib/browser/chunk-CMVTOS5E.mjs.map +0 -7
  42. package/dist/lib/node/chunk-EAWN3LCD.cjs.map +0 -7
  43. package/dist/types/src/packlets/indexing/index.d.ts +0 -2
  44. package/dist/types/src/packlets/indexing/index.d.ts.map +0 -1
  45. package/dist/types/src/packlets/indexing/util.d.ts +0 -11
  46. package/dist/types/src/packlets/indexing/util.d.ts.map +0 -1
  47. package/src/packlets/indexing/index.ts +0 -5
  48. package/src/packlets/indexing/util.ts +0 -32
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_EAWN3LCD_exports = {};
30
- __export(chunk_EAWN3LCD_exports, {
29
+ var chunk_Q6Z4BMTZ_exports = {};
30
+ __export(chunk_Q6Z4BMTZ_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  ClientServicesProviderResource: () => ClientServicesProviderResource,
@@ -66,7 +66,7 @@ __export(chunk_EAWN3LCD_exports, {
66
66
  subscribeToSpaces: () => subscribeToSpaces,
67
67
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
68
68
  });
69
- module.exports = __toCommonJS(chunk_EAWN3LCD_exports);
69
+ module.exports = __toCommonJS(chunk_Q6Z4BMTZ_exports);
70
70
  var import_async = require("@dxos/async");
71
71
  var import_codec_protobuf = require("@dxos/codec-protobuf");
72
72
  var import_feed_store = require("@dxos/feed-store");
@@ -211,9 +211,9 @@ var import_async15 = require("@dxos/async");
211
211
  var import_context10 = require("@dxos/context");
212
212
  var import_credentials15 = require("@dxos/credentials");
213
213
  var import_debug6 = require("@dxos/debug");
214
+ var import_echo_db = require("@dxos/echo-db");
214
215
  var import_echo_pipeline4 = require("@dxos/echo-pipeline");
215
216
  var import_feed_store4 = require("@dxos/feed-store");
216
- var import_indexing = require("@dxos/indexing");
217
217
  var import_invariant13 = require("@dxos/invariant");
218
218
  var import_keyring = require("@dxos/keyring");
219
219
  var import_keys11 = require("@dxos/keys");
@@ -223,12 +223,10 @@ var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
223
223
  var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
224
224
  var import_tracing5 = require("@dxos/tracing");
225
225
  var import_util7 = require("@dxos/util");
226
- var import_automerge = require("@dxos/automerge/automerge");
227
- var import_protocols12 = require("@dxos/protocols");
228
226
  var import_codec_protobuf11 = require("@dxos/codec-protobuf");
229
227
  var import_credentials16 = require("@dxos/credentials");
230
228
  var import_invariant14 = require("@dxos/invariant");
231
- var import_protocols13 = require("@dxos/protocols");
229
+ var import_protocols12 = require("@dxos/protocols");
232
230
  var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
233
231
  var import_tracing6 = require("@dxos/tracing");
234
232
  var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
@@ -241,13 +239,12 @@ var import_client_protocol5 = require("@dxos/client-protocol");
241
239
  var import_context11 = require("@dxos/context");
242
240
  var import_echo_pipeline5 = require("@dxos/echo-pipeline");
243
241
  var import_echo_schema2 = require("@dxos/echo-schema");
244
- var import_indexing2 = require("@dxos/indexing");
245
242
  var import_invariant15 = require("@dxos/invariant");
246
243
  var import_keys12 = require("@dxos/keys");
247
244
  var import_log13 = require("@dxos/log");
248
245
  var import_messaging = require("@dxos/messaging");
249
246
  var import_network_manager2 = require("@dxos/network-manager");
250
- var import_protocols14 = require("@dxos/protocols");
247
+ var import_protocols13 = require("@dxos/protocols");
251
248
  var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
252
249
  var import_tracing8 = require("@dxos/tracing");
253
250
  var import_util9 = require("@dxos/util");
@@ -266,7 +263,7 @@ var import_log15 = require("@dxos/log");
266
263
  var import_services17 = require("@dxos/protocols/proto/dxos/client/services");
267
264
  var import_util10 = require("@dxos/util");
268
265
  var import_codec_protobuf14 = require("@dxos/codec-protobuf");
269
- var import_protocols15 = require("@dxos/protocols");
266
+ var import_protocols14 = require("@dxos/protocols");
270
267
  var import_config2 = require("@dxos/protocols/proto/dxos/config");
271
268
  var import_random_access_storage = require("@dxos/random-access-storage");
272
269
  var import_client_protocol6 = require("@dxos/client-protocol");
@@ -3382,7 +3379,7 @@ var DataSpace = class {
3382
3379
  this._metadataStore = params.metadataStore;
3383
3380
  this._signingContext = params.signingContext;
3384
3381
  this._callbacks = params.callbacks ?? {};
3385
- this._automergeHost = params.automergeHost;
3382
+ this._echoHost = params.echoHost;
3386
3383
  this.authVerifier = new TrustedKeySetAuthVerifier({
3387
3384
  trustedKeysProvider: () => new import_util4.ComplexSet(import_keys8.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
3388
3385
  update: this._inner.stateUpdate,
@@ -3394,7 +3391,7 @@ var DataSpace = class {
3394
3391
  state: import_services8.SpaceState[this._state]
3395
3392
  }, {
3396
3393
  F: __dxlog_file11,
3397
- L: 140,
3394
+ L: 135,
3398
3395
  S: this,
3399
3396
  C: (f, a) => f(...a)
3400
3397
  });
@@ -3444,7 +3441,7 @@ var DataSpace = class {
3444
3441
  state: import_services8.SpaceState[this._state]
3445
3442
  }, {
3446
3443
  F: __dxlog_file11,
3447
- L: 198,
3444
+ L: 193,
3448
3445
  S: this,
3449
3446
  C: (f, a) => f(...a)
3450
3447
  });
@@ -3462,7 +3459,7 @@ var DataSpace = class {
3462
3459
  state: import_services8.SpaceState[this._state]
3463
3460
  }, {
3464
3461
  F: __dxlog_file11,
3465
- L: 212,
3462
+ L: 207,
3466
3463
  S: this,
3467
3464
  C: (f, a) => f(...a)
3468
3465
  });
@@ -3494,7 +3491,7 @@ var DataSpace = class {
3494
3491
  if (err instanceof import_protocols7.CancelledError || err instanceof import_context7.ContextDisposedError) {
3495
3492
  (0, import_log8.log)("data pipeline initialization cancelled", err, {
3496
3493
  F: __dxlog_file11,
3497
- L: 245,
3494
+ L: 240,
3498
3495
  S: this,
3499
3496
  C: (f, a) => f(...a)
3500
3497
  });
@@ -3502,7 +3499,7 @@ var DataSpace = class {
3502
3499
  }
3503
3500
  import_log8.log.error("Error initializing data pipeline", err, {
3504
3501
  F: __dxlog_file11,
3505
- L: 249,
3502
+ L: 244,
3506
3503
  S: this,
3507
3504
  C: (f, a) => f(...a)
3508
3505
  });
@@ -3511,7 +3508,7 @@ var DataSpace = class {
3511
3508
  state: import_services8.SpaceState[this._state]
3512
3509
  }, {
3513
3510
  F: __dxlog_file11,
3514
- L: 251,
3511
+ L: 246,
3515
3512
  S: this,
3516
3513
  C: (f, a) => f(...a)
3517
3514
  });
@@ -3531,7 +3528,7 @@ var DataSpace = class {
3531
3528
  state: import_services8.SpaceState[this._state]
3532
3529
  }, {
3533
3530
  F: __dxlog_file11,
3534
- L: 267,
3531
+ L: 262,
3535
3532
  S: this,
3536
3533
  C: (f, a) => f(...a)
3537
3534
  });
@@ -3541,7 +3538,7 @@ var DataSpace = class {
3541
3538
  await (0, import_context7.cancelWithContext)(this._ctx, this.automergeSpaceState.ensureEpochInitialized());
3542
3539
  (0, import_log8.log)("data pipeline ready", void 0, {
3543
3540
  F: __dxlog_file11,
3544
- L: 279,
3541
+ L: 274,
3545
3542
  S: this,
3546
3543
  C: (f, a) => f(...a)
3547
3544
  });
@@ -3551,7 +3548,7 @@ var DataSpace = class {
3551
3548
  state: import_services8.SpaceState[this._state]
3552
3549
  }, {
3553
3550
  F: __dxlog_file11,
3554
- L: 283,
3551
+ L: 278,
3555
3552
  S: this,
3556
3553
  C: (f, a) => f(...a)
3557
3554
  });
@@ -3567,7 +3564,7 @@ var DataSpace = class {
3567
3564
  await this._createWritableFeeds();
3568
3565
  (0, import_log8.log)("writable feeds created", void 0, {
3569
3566
  F: __dxlog_file11,
3570
- L: 299,
3567
+ L: 294,
3571
3568
  S: this,
3572
3569
  C: (f, a) => f(...a)
3573
3570
  });
@@ -3630,12 +3627,12 @@ var DataSpace = class {
3630
3627
  rootUrl
3631
3628
  }, {
3632
3629
  F: __dxlog_file11,
3633
- L: 365,
3630
+ L: 360,
3634
3631
  S: this,
3635
3632
  C: (f, a) => f(...a)
3636
3633
  });
3637
- this._automergeHost._requestedDocs.add(rootUrl);
3638
- const handle = this._automergeHost.repo.find(rootUrl);
3634
+ this._echoHost.replicateDocument(rootUrl);
3635
+ const handle = this._echoHost.automergeRepo.find(rootUrl);
3639
3636
  queueMicrotask(async () => {
3640
3637
  try {
3641
3638
  await (0, import_debug3.warnAfterTimeout)(5e3, "Automerge root doc load timeout (DataSpace)", async () => {
@@ -3662,7 +3659,7 @@ var DataSpace = class {
3662
3659
  err
3663
3660
  }, {
3664
3661
  F: __dxlog_file11,
3665
- L: 388,
3662
+ L: 383,
3666
3663
  S: this,
3667
3664
  C: (f, a) => f(...a)
3668
3665
  });
@@ -3700,7 +3697,7 @@ var DataSpace = class {
3700
3697
  break;
3701
3698
  case import_services8.CreateEpochRequest.Migration.INIT_AUTOMERGE:
3702
3699
  {
3703
- const document = this._automergeHost.repo.create();
3700
+ const document = this._echoHost.automergeRepo.create();
3704
3701
  epoch = {
3705
3702
  previousId: this._automergeSpaceState.lastEpoch?.id,
3706
3703
  number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
@@ -3712,12 +3709,12 @@ var DataSpace = class {
3712
3709
  case import_services8.CreateEpochRequest.Migration.PRUNE_AUTOMERGE_ROOT_HISTORY:
3713
3710
  {
3714
3711
  const currentRootUrl = this._automergeSpaceState.rootUrl;
3715
- const rootHandle = this._automergeHost.repo.find(currentRootUrl);
3712
+ const rootHandle = this._echoHost.automergeRepo.find(currentRootUrl);
3716
3713
  await (0, import_context7.cancelWithContext)(this._ctx, (0, import_async10.asyncTimeout)(rootHandle.whenReady(), 1e4));
3717
- const newRoot = this._automergeHost.repo.create(rootHandle.docSync());
3714
+ const newRoot = this._echoHost.automergeRepo.create(rootHandle.docSync());
3718
3715
  (0, import_invariant9.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3719
3716
  F: __dxlog_file11,
3720
- L: 438,
3717
+ L: 433,
3721
3718
  S: this,
3722
3719
  A: [
3723
3720
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
@@ -3736,19 +3733,19 @@ var DataSpace = class {
3736
3733
  {
3737
3734
  import_log8.log.info("Fragmenting", void 0, {
3738
3735
  F: __dxlog_file11,
3739
- L: 450,
3736
+ L: 445,
3740
3737
  S: this,
3741
3738
  C: (f, a) => f(...a)
3742
3739
  });
3743
3740
  const currentRootUrl = this._automergeSpaceState.rootUrl;
3744
- const rootHandle = this._automergeHost.repo.find(currentRootUrl);
3741
+ const rootHandle = this._echoHost.automergeRepo.find(currentRootUrl);
3745
3742
  await (0, import_context7.cancelWithContext)(this._ctx, (0, import_async10.asyncTimeout)(rootHandle.whenReady(), 1e4));
3746
3743
  const objects = Object.entries(rootHandle.docSync().objects);
3747
3744
  const properties = objects.find(([_, value]) => value.system.type?.itemId === import_echo_schema.TYPE_PROPERTIES);
3748
3745
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
3749
3746
  (0, import_invariant9.invariant)(properties, "Properties not found", {
3750
3747
  F: __dxlog_file11,
3751
- L: 460,
3748
+ L: 455,
3752
3749
  S: this,
3753
3750
  A: [
3754
3751
  "properties",
@@ -3761,17 +3758,17 @@ var DataSpace = class {
3761
3758
  properties
3762
3759
  ])
3763
3760
  };
3764
- const newRoot = this._automergeHost.repo.create(newSpaceDoc);
3761
+ const newRoot = this._echoHost.automergeRepo.create(newSpaceDoc);
3765
3762
  (0, import_invariant9.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3766
3763
  F: __dxlog_file11,
3767
- L: 465,
3764
+ L: 460,
3768
3765
  S: this,
3769
3766
  A: [
3770
3767
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
3771
3768
  ""
3772
3769
  ]
3773
3770
  });
3774
- const docLoader = new import_echo_pipeline3.AutomergeDocumentLoaderImpl(this.key, this._automergeHost.repo);
3771
+ const docLoader = new import_echo_pipeline3.AutomergeDocumentLoaderImpl(this.key, this._echoHost.automergeRepo);
3775
3772
  await docLoader.loadSpaceRootDocHandle(this._ctx, {
3776
3773
  rootUrl: newRoot.url
3777
3774
  });
@@ -3833,7 +3830,7 @@ var DataSpace = class {
3833
3830
  state: import_services8.SpaceState[this._state]
3834
3831
  }, {
3835
3832
  F: __dxlog_file11,
3836
- L: 531,
3833
+ L: 526,
3837
3834
  S: this,
3838
3835
  C: (f, a) => f(...a)
3839
3836
  });
@@ -3963,13 +3960,13 @@ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
3963
3960
  var PRESENCE_ANNOUNCE_INTERVAL = 1e4;
3964
3961
  var PRESENCE_OFFLINE_TIMEOUT = 2e4;
3965
3962
  var DataSpaceManager = class {
3966
- constructor(_spaceManager, _metadataStore, _keyring, _signingContext, _feedStore, _automergeHost, _invitationsManager, params) {
3963
+ constructor(_spaceManager, _metadataStore, _keyring, _signingContext, _feedStore, _echoHost, _invitationsManager, params) {
3967
3964
  this._spaceManager = _spaceManager;
3968
3965
  this._metadataStore = _metadataStore;
3969
3966
  this._keyring = _keyring;
3970
3967
  this._signingContext = _signingContext;
3971
3968
  this._feedStore = _feedStore;
3972
- this._automergeHost = _automergeHost;
3969
+ this._echoHost = _echoHost;
3973
3970
  this._invitationsManager = _invitationsManager;
3974
3971
  this._ctx = new import_context9.Context();
3975
3972
  this.updated = new import_async13.Event();
@@ -3987,7 +3984,7 @@ var DataSpaceManager = class {
3987
3984
  async open() {
3988
3985
  (0, import_log10.log)("open", void 0, {
3989
3986
  F: __dxlog_file12,
3990
- L: 101,
3987
+ L: 102,
3991
3988
  S: this,
3992
3989
  C: (f, a) => f(...a)
3993
3990
  });
@@ -3995,7 +3992,7 @@ var DataSpaceManager = class {
3995
3992
  id: this._instanceId
3996
3993
  }), {
3997
3994
  F: __dxlog_file12,
3998
- L: 102,
3995
+ L: 103,
3999
3996
  S: this,
4000
3997
  C: (f, a) => f(...a)
4001
3998
  });
@@ -4003,7 +4000,7 @@ var DataSpaceManager = class {
4003
4000
  spaces: this._metadataStore.spaces.length
4004
4001
  }, {
4005
4002
  F: __dxlog_file12,
4006
- L: 103,
4003
+ L: 104,
4007
4004
  S: this,
4008
4005
  C: (f, a) => f(...a)
4009
4006
  });
@@ -4013,7 +4010,7 @@ var DataSpaceManager = class {
4013
4010
  spaceMetadata
4014
4011
  }, {
4015
4012
  F: __dxlog_file12,
4016
- L: 107,
4013
+ L: 108,
4017
4014
  S: this,
4018
4015
  C: (f, a) => f(...a)
4019
4016
  });
@@ -4024,7 +4021,7 @@ var DataSpaceManager = class {
4024
4021
  err
4025
4022
  }, {
4026
4023
  F: __dxlog_file12,
4027
- L: 110,
4024
+ L: 111,
4028
4025
  S: this,
4029
4026
  C: (f, a) => f(...a)
4030
4027
  });
@@ -4041,7 +4038,7 @@ var DataSpaceManager = class {
4041
4038
  id: this._instanceId
4042
4039
  }), {
4043
4040
  F: __dxlog_file12,
4044
- L: 123,
4041
+ L: 124,
4045
4042
  S: this,
4046
4043
  C: (f, a) => f(...a)
4047
4044
  });
@@ -4049,7 +4046,7 @@ var DataSpaceManager = class {
4049
4046
  async close() {
4050
4047
  (0, import_log10.log)("close", void 0, {
4051
4048
  F: __dxlog_file12,
4052
- L: 128,
4049
+ L: 129,
4053
4050
  S: this,
4054
4051
  C: (f, a) => f(...a)
4055
4052
  });
@@ -4065,7 +4062,7 @@ var DataSpaceManager = class {
4065
4062
  async createSpace() {
4066
4063
  (0, import_invariant11.invariant)(this._isOpen, "Not open.", {
4067
4064
  F: __dxlog_file12,
4068
- L: 141,
4065
+ L: 142,
4069
4066
  S: this,
4070
4067
  A: [
4071
4068
  "this._isOpen",
@@ -4086,23 +4083,18 @@ var DataSpaceManager = class {
4086
4083
  spaceKey
4087
4084
  }, {
4088
4085
  F: __dxlog_file12,
4089
- L: 153,
4086
+ L: 154,
4090
4087
  S: this,
4091
4088
  C: (f, a) => f(...a)
4092
4089
  });
4093
- const automergeRoot = this._automergeHost.repo.create();
4094
- automergeRoot.change((doc) => {
4095
- doc.access = {
4096
- spaceKey: spaceKey.toHex()
4097
- };
4098
- });
4090
+ const automergeRootUrl = await this._echoHost.createSpaceRoot(spaceKey);
4099
4091
  const space = await this._constructSpace(metadata);
4100
- const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner, automergeRoot.url);
4092
+ const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner, automergeRootUrl);
4101
4093
  await this._metadataStore.addSpace(metadata);
4102
4094
  const memberCredential = credentials[1];
4103
4095
  (0, import_invariant11.invariant)((0, import_credentials12.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4104
4096
  F: __dxlog_file12,
4105
- L: 166,
4097
+ L: 163,
4106
4098
  S: this,
4107
4099
  A: [
4108
4100
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -4120,13 +4112,13 @@ var DataSpaceManager = class {
4120
4112
  opts
4121
4113
  }, {
4122
4114
  F: __dxlog_file12,
4123
- L: 178,
4115
+ L: 175,
4124
4116
  S: this,
4125
4117
  C: (f, a) => f(...a)
4126
4118
  });
4127
4119
  (0, import_invariant11.invariant)(this._isOpen, "Not open.", {
4128
4120
  F: __dxlog_file12,
4129
- L: 179,
4121
+ L: 176,
4130
4122
  S: this,
4131
4123
  A: [
4132
4124
  "this._isOpen",
@@ -4135,7 +4127,7 @@ var DataSpaceManager = class {
4135
4127
  });
4136
4128
  (0, import_invariant11.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
4137
4129
  F: __dxlog_file12,
4138
- L: 180,
4130
+ L: 177,
4139
4131
  S: this,
4140
4132
  A: [
4141
4133
  "!this._spaces.has(opts.spaceKey)",
@@ -4170,7 +4162,7 @@ var DataSpaceManager = class {
4170
4162
  metadata
4171
4163
  }, {
4172
4164
  F: __dxlog_file12,
4173
- L: 213,
4165
+ L: 210,
4174
4166
  S: this,
4175
4167
  C: (f, a) => f(...a)
4176
4168
  });
@@ -4202,13 +4194,13 @@ var DataSpaceManager = class {
4202
4194
  remotePeerId: session.remotePeerId
4203
4195
  }));
4204
4196
  session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
4205
- this._automergeHost.authorizeDevice(space.key, session.remotePeerId);
4206
- session.addExtension("dxos.mesh.teleport.automerge", this._automergeHost.createExtension());
4197
+ this._echoHost.authorizeDevice(space.key, session.remotePeerId);
4198
+ session.addExtension("dxos.mesh.teleport.automerge", this._echoHost.createReplicationExtension());
4207
4199
  },
4208
4200
  onAuthFailure: () => {
4209
4201
  import_log10.log.warn("auth failure", void 0, {
4210
4202
  F: __dxlog_file12,
4211
- L: 250,
4203
+ L: 247,
4212
4204
  S: this,
4213
4205
  C: (f, a) => f(...a)
4214
4206
  });
@@ -4228,6 +4220,7 @@ var DataSpaceManager = class {
4228
4220
  presence,
4229
4221
  keyring: this._keyring,
4230
4222
  feedStore: this._feedStore,
4223
+ echoHost: this._echoHost,
4231
4224
  signingContext: this._signingContext,
4232
4225
  callbacks: {
4233
4226
  beforeReady: async () => {
@@ -4235,7 +4228,7 @@ var DataSpaceManager = class {
4235
4228
  space: space.key
4236
4229
  }, {
4237
4230
  F: __dxlog_file12,
4238
- L: 271,
4231
+ L: 269,
4239
4232
  S: this,
4240
4233
  C: (f, a) => f(...a)
4241
4234
  });
@@ -4246,7 +4239,7 @@ var DataSpaceManager = class {
4246
4239
  open: this._isOpen
4247
4240
  }, {
4248
4241
  F: __dxlog_file12,
4249
- L: 274,
4242
+ L: 272,
4250
4243
  S: this,
4251
4244
  C: (f, a) => f(...a)
4252
4245
  });
@@ -4262,14 +4255,13 @@ var DataSpaceManager = class {
4262
4255
  space: space.key
4263
4256
  }, {
4264
4257
  F: __dxlog_file12,
4265
- L: 281,
4258
+ L: 279,
4266
4259
  S: this,
4267
4260
  C: (f, a) => f(...a)
4268
4261
  });
4269
4262
  }
4270
4263
  },
4271
- cache: metadata.cache,
4272
- automergeHost: this._automergeHost
4264
+ cache: metadata.cache
4273
4265
  });
4274
4266
  if (metadata.state !== import_services9.SpaceState.INACTIVE) {
4275
4267
  await dataSpace.open();
@@ -4539,31 +4531,6 @@ var SpacesServiceImpl = class {
4539
4531
  }
4540
4532
  };
4541
4533
  var getChannelId = (channel) => `user-channel/${channel}`;
4542
- var createSelectedDocumentsIterator = (automergeHost) => (
4543
- /**
4544
- * Get object data blobs from Automerge Repo by ids.
4545
- * @param ids
4546
- */
4547
- // TODO(mykola): Unload automerge handles after usage.
4548
- async function* loadDocuments(ids) {
4549
- for (const id of ids) {
4550
- const { documentId, objectId } = import_protocols12.idCodec.decode(id);
4551
- const handle = automergeHost.repo.handles[documentId] ?? automergeHost.repo.find(documentId);
4552
- if (!handle.isReady()) {
4553
- await handle.whenReady();
4554
- }
4555
- const doc = handle.docSync();
4556
- const hash = (0, import_automerge.getHeads)(doc).join("");
4557
- yield doc.objects?.[objectId] ? [
4558
- {
4559
- id,
4560
- object: doc.objects[objectId],
4561
- currentHash: hash
4562
- }
4563
- ] : [];
4564
- }
4565
- }
4566
- );
4567
4534
  function _ts_decorate6(decorators, target, key, desc) {
4568
4535
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4569
4536
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
@@ -4608,24 +4575,9 @@ var ServiceContext = class extends import_context10.Resource {
4608
4575
  snapshotStore: this.snapshotStore
4609
4576
  });
4610
4577
  this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
4611
- this.indexMetadata = new import_indexing.IndexMetadataStore({
4612
- db: level.sublevel("index-metadata")
4613
- });
4614
- this.automergeHost = new import_echo_pipeline4.AutomergeHost({
4615
- directory: storage.createDirectory("automerge"),
4616
- db: level.sublevel("automerge"),
4617
- storageCallbacks: (0, import_indexing.createStorageCallbacks)({
4618
- host: () => this.automergeHost,
4619
- metadata: this.indexMetadata
4620
- })
4621
- });
4622
- this.indexer = new import_indexing.Indexer({
4623
- db: this.level,
4624
- indexStore: new import_indexing.IndexStore({
4625
- db: level.sublevel("index-storage")
4626
- }),
4627
- metadataStore: this.indexMetadata,
4628
- loadDocuments: createSelectedDocumentsIterator(this.automergeHost)
4578
+ this.echoHost = new import_echo_db.EchoHost({
4579
+ kv: this.level,
4580
+ storage: this.storage
4629
4581
  });
4630
4582
  this.invitations = new InvitationsHandler(this.networkManager);
4631
4583
  this.invitationsManager = new InvitationsManager(this.invitations, (invitation) => this.getInvitationHandler(invitation), this.metadataStore);
@@ -4635,7 +4587,7 @@ var ServiceContext = class extends import_context10.Resource {
4635
4587
  await this._checkStorageVersion();
4636
4588
  (0, import_log12.log)("opening...", void 0, {
4637
4589
  F: __dxlog_file14,
4638
- L: 164,
4590
+ L: 151,
4639
4591
  S: this,
4640
4592
  C: (f, a) => f(...a)
4641
4593
  });
@@ -4643,13 +4595,13 @@ var ServiceContext = class extends import_context10.Resource {
4643
4595
  id: this._instanceId
4644
4596
  }), {
4645
4597
  F: __dxlog_file14,
4646
- L: 165,
4598
+ L: 152,
4647
4599
  S: this,
4648
4600
  C: (f, a) => f(...a)
4649
4601
  });
4650
4602
  await this.signalManager.open();
4651
4603
  await this.networkManager.open();
4652
- await this.automergeHost.open();
4604
+ await this.echoHost.open(ctx);
4653
4605
  await this.metadataStore.load();
4654
4606
  await this.spaceManager.open();
4655
4607
  await this.identityManager.open(ctx);
@@ -4661,7 +4613,7 @@ var ServiceContext = class extends import_context10.Resource {
4661
4613
  count: loadedInvitations.invitations?.length
4662
4614
  }, {
4663
4615
  F: __dxlog_file14,
4664
- L: 178,
4616
+ L: 165,
4665
4617
  S: this,
4666
4618
  C: (f, a) => f(...a)
4667
4619
  });
@@ -4669,39 +4621,38 @@ var ServiceContext = class extends import_context10.Resource {
4669
4621
  id: this._instanceId
4670
4622
  }), {
4671
4623
  F: __dxlog_file14,
4672
- L: 180,
4624
+ L: 167,
4673
4625
  S: this,
4674
4626
  C: (f, a) => f(...a)
4675
4627
  });
4676
4628
  (0, import_log12.log)("opened", void 0, {
4677
4629
  F: __dxlog_file14,
4678
- L: 181,
4630
+ L: 168,
4679
4631
  S: this,
4680
4632
  C: (f, a) => f(...a)
4681
4633
  });
4682
4634
  }
4683
- async _close() {
4635
+ async _close(ctx) {
4684
4636
  (0, import_log12.log)("closing...", void 0, {
4685
4637
  F: __dxlog_file14,
4686
- L: 185,
4638
+ L: 172,
4687
4639
  S: this,
4688
4640
  C: (f, a) => f(...a)
4689
4641
  });
4690
4642
  if (this._deviceSpaceSync && this.identityManager.identity) {
4691
4643
  await this.identityManager.identity.space.spaceState.removeCredentialProcessor(this._deviceSpaceSync);
4692
4644
  }
4693
- await this.automergeHost.close();
4694
4645
  await this.dataSpaceManager?.close();
4695
4646
  await this.identityManager.close();
4696
4647
  await this.spaceManager.close();
4697
4648
  await this.feedStore.close();
4649
+ await this.metadataStore.close();
4650
+ await this.echoHost.close(ctx);
4698
4651
  await this.networkManager.close();
4699
4652
  await this.signalManager.close();
4700
- await this.metadataStore.close();
4701
- await this.indexer.destroy();
4702
4653
  (0, import_log12.log)("closed", void 0, {
4703
4654
  F: __dxlog_file14,
4704
- L: 198,
4655
+ L: 184,
4705
4656
  S: this,
4706
4657
  C: (f, a) => f(...a)
4707
4658
  });
@@ -4715,7 +4666,7 @@ var ServiceContext = class extends import_context10.Resource {
4715
4666
  const factory = this._handlerFactories.get(invitation.kind);
4716
4667
  (0, import_invariant13.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
4717
4668
  F: __dxlog_file14,
4718
- L: 209,
4669
+ L: 195,
4719
4670
  S: this,
4720
4671
  A: [
4721
4672
  "factory",
@@ -4747,7 +4698,7 @@ var ServiceContext = class extends import_context10.Resource {
4747
4698
  async _initialize(ctx) {
4748
4699
  (0, import_log12.log)("initializing spaces...", void 0, {
4749
4700
  F: __dxlog_file14,
4750
- L: 240,
4701
+ L: 226,
4751
4702
  S: this,
4752
4703
  C: (f, a) => f(...a)
4753
4704
  });
@@ -4765,12 +4716,12 @@ var ServiceContext = class extends import_context10.Resource {
4765
4716
  });
4766
4717
  }
4767
4718
  };
4768
- this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, signingContext, this.feedStore, this.automergeHost, this.invitationsManager, this._runtimeParams);
4719
+ this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, signingContext, this.feedStore, this.echoHost, this.invitationsManager, this._runtimeParams);
4769
4720
  await this.dataSpaceManager.open();
4770
4721
  this._handlerFactories.set(import_services11.Invitation.Kind.SPACE, (invitation) => {
4771
4722
  (0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
4772
4723
  F: __dxlog_file14,
4773
- L: 265,
4724
+ L: 251,
4774
4725
  S: this,
4775
4726
  A: [
4776
4727
  "this.dataSpaceManager",
@@ -4794,7 +4745,7 @@ var ServiceContext = class extends import_context10.Resource {
4794
4745
  details: assertion
4795
4746
  }, {
4796
4747
  F: __dxlog_file14,
4797
- L: 281,
4748
+ L: 267,
4798
4749
  S: this,
4799
4750
  C: (f, a) => f(...a)
4800
4751
  });
@@ -4805,7 +4756,7 @@ var ServiceContext = class extends import_context10.Resource {
4805
4756
  details: assertion
4806
4757
  }, {
4807
4758
  F: __dxlog_file14,
4808
- L: 285,
4759
+ L: 271,
4809
4760
  S: this,
4810
4761
  C: (f, a) => f(...a)
4811
4762
  });
@@ -4816,7 +4767,7 @@ var ServiceContext = class extends import_context10.Resource {
4816
4767
  details: assertion
4817
4768
  }, {
4818
4769
  F: __dxlog_file14,
4819
- L: 290,
4770
+ L: 276,
4820
4771
  S: this,
4821
4772
  C: (f, a) => f(...a)
4822
4773
  });
@@ -4827,7 +4778,7 @@ var ServiceContext = class extends import_context10.Resource {
4827
4778
  } catch (err) {
4828
4779
  import_log12.log.catch(err, void 0, {
4829
4780
  F: __dxlog_file14,
4830
- L: 296,
4781
+ L: 282,
4831
4782
  S: this,
4832
4783
  C: (f, a) => f(...a)
4833
4784
  });
@@ -4869,7 +4820,7 @@ var ServiceRegistry = class {
4869
4820
  delete this._handlers[name];
4870
4821
  }
4871
4822
  };
4872
- var DXOS_VERSION = "0.5.1-next.2ad6c47";
4823
+ var DXOS_VERSION = "0.5.1-next.7f021b8";
4873
4824
  var getPlatform = () => {
4874
4825
  if (process.browser) {
4875
4826
  if (typeof window !== "undefined") {
@@ -4906,7 +4857,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
4906
4857
  client: {
4907
4858
  version: DXOS_VERSION,
4908
4859
  storage: {
4909
- version: import_protocols13.STORAGE_VERSION
4860
+ version: import_protocols12.STORAGE_VERSION
4910
4861
  }
4911
4862
  },
4912
4863
  trace: import_tracing6.TRACE_PROCESSOR.getDiagnostics()
@@ -5305,16 +5256,16 @@ var StorageDriver = import_config2.Runtime.Client.Storage.StorageDriver;
5305
5256
  var createStorageObjects = (config) => {
5306
5257
  const { persistent = false, keyStore, dataStore } = config ?? {};
5307
5258
  if (persistent && dataStore === StorageDriver.RAM) {
5308
- throw new import_protocols15.InvalidConfigError("RAM storage cannot be used in persistent mode.");
5259
+ throw new import_protocols14.InvalidConfigError("RAM storage cannot be used in persistent mode.");
5309
5260
  }
5310
5261
  if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
5311
- throw new import_protocols15.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
5262
+ throw new import_protocols14.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
5312
5263
  }
5313
5264
  if (persistent && keyStore === StorageDriver.RAM) {
5314
- throw new import_protocols15.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
5265
+ throw new import_protocols14.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
5315
5266
  }
5316
5267
  if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
5317
- throw new import_protocols15.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
5268
+ throw new import_protocols14.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
5318
5269
  }
5319
5270
  return {
5320
5271
  storage: (0, import_random_access_storage.createStorage)({
@@ -5502,7 +5453,7 @@ var ClientServicesHost = class {
5502
5453
  initialize({ config, ...options }) {
5503
5454
  (0, import_invariant15.invariant)(!this._open, "service host is open", {
5504
5455
  F: __dxlog_file18,
5505
- L: 198,
5456
+ L: 190,
5506
5457
  S: this,
5507
5458
  A: [
5508
5459
  "!this._open",
@@ -5511,14 +5462,14 @@ var ClientServicesHost = class {
5511
5462
  });
5512
5463
  (0, import_log13.log)("initializing...", void 0, {
5513
5464
  F: __dxlog_file18,
5514
- L: 199,
5465
+ L: 191,
5515
5466
  S: this,
5516
5467
  C: (f, a) => f(...a)
5517
5468
  });
5518
5469
  if (config) {
5519
5470
  (0, import_invariant15.invariant)(!this._config, "config already set", {
5520
5471
  F: __dxlog_file18,
5521
- L: 202,
5472
+ L: 194,
5522
5473
  S: this,
5523
5474
  A: [
5524
5475
  "!this._config",
@@ -5533,7 +5484,7 @@ var ClientServicesHost = class {
5533
5484
  if (!options.signalManager) {
5534
5485
  import_log13.log.warn("running signaling without telemetry metadata.", void 0, {
5535
5486
  F: __dxlog_file18,
5536
- L: 210,
5487
+ L: 202,
5537
5488
  S: this,
5538
5489
  C: (f, a) => f(...a)
5539
5490
  });
@@ -5544,7 +5495,7 @@ var ClientServicesHost = class {
5544
5495
  this._signalManager = signalManager;
5545
5496
  (0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
5546
5497
  F: __dxlog_file18,
5547
- L: 221,
5498
+ L: 213,
5548
5499
  S: this,
5549
5500
  A: [
5550
5501
  "!this._networkManager",
@@ -5558,7 +5509,7 @@ var ClientServicesHost = class {
5558
5509
  });
5559
5510
  (0, import_log13.log)("initialized", void 0, {
5560
5511
  F: __dxlog_file18,
5561
- L: 228,
5512
+ L: 220,
5562
5513
  S: this,
5563
5514
  C: (f, a) => f(...a)
5564
5515
  });
@@ -5568,17 +5519,17 @@ var ClientServicesHost = class {
5568
5519
  return;
5569
5520
  }
5570
5521
  const traceId = import_keys12.PublicKey.random().toHex();
5571
- import_log13.log.trace("dxos.client-services.host.open", import_protocols14.trace.begin({
5522
+ import_log13.log.trace("dxos.client-services.host.open", import_protocols13.trace.begin({
5572
5523
  id: traceId
5573
5524
  }), {
5574
5525
  F: __dxlog_file18,
5575
- L: 239,
5526
+ L: 231,
5576
5527
  S: this,
5577
5528
  C: (f, a) => f(...a)
5578
5529
  });
5579
5530
  (0, import_invariant15.invariant)(this._config, "config not set", {
5580
5531
  F: __dxlog_file18,
5581
- L: 241,
5532
+ L: 233,
5582
5533
  S: this,
5583
5534
  A: [
5584
5535
  "this._config",
@@ -5587,7 +5538,7 @@ var ClientServicesHost = class {
5587
5538
  });
5588
5539
  (0, import_invariant15.invariant)(this._storage, "storage not set", {
5589
5540
  F: __dxlog_file18,
5590
- L: 242,
5541
+ L: 234,
5591
5542
  S: this,
5592
5543
  A: [
5593
5544
  "this._storage",
@@ -5596,7 +5547,7 @@ var ClientServicesHost = class {
5596
5547
  });
5597
5548
  (0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
5598
5549
  F: __dxlog_file18,
5599
- L: 243,
5550
+ L: 235,
5600
5551
  S: this,
5601
5552
  A: [
5602
5553
  "this._signalManager",
@@ -5605,7 +5556,7 @@ var ClientServicesHost = class {
5605
5556
  });
5606
5557
  (0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
5607
5558
  F: __dxlog_file18,
5608
- L: 244,
5559
+ L: 236,
5609
5560
  S: this,
5610
5561
  A: [
5611
5562
  "this._networkManager",
@@ -5617,22 +5568,17 @@ var ClientServicesHost = class {
5617
5568
  lockKey: this._resourceLock?.lockKey
5618
5569
  }, {
5619
5570
  F: __dxlog_file18,
5620
- L: 247,
5571
+ L: 239,
5621
5572
  S: this,
5622
5573
  C: (f, a) => f(...a)
5623
5574
  });
5575
+ await this._resourceLock?.acquire();
5624
5576
  if (!this._level) {
5625
5577
  this._level = await createLevel(this._config.get("runtime.client.storage", {}));
5626
5578
  }
5627
5579
  await this._level.open();
5628
- await this._resourceLock?.acquire();
5629
5580
  await this._loggingService.open();
5630
5581
  this._serviceContext = new ServiceContext(this._storage, this._level, this._networkManager, this._signalManager, this._runtimeParams);
5631
- this._queryService = new import_indexing2.QueryServiceImpl({
5632
- indexer: this._serviceContext.indexer,
5633
- automergeHost: this._serviceContext.automergeHost
5634
- });
5635
- await this._queryService.open(ctx);
5636
5582
  this._serviceRegistry.setServices({
5637
5583
  SystemService: this._systemService,
5638
5584
  IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
@@ -5642,8 +5588,8 @@ var ClientServicesHost = class {
5642
5588
  await this._serviceContext.initialized.wait();
5643
5589
  return this._serviceContext.dataSpaceManager;
5644
5590
  }),
5645
- DataService: new import_echo_pipeline5.DataServiceImpl(this._serviceContext.automergeHost),
5646
- QueryService: this._queryService,
5591
+ DataService: this._serviceContext.echoHost.dataService,
5592
+ QueryService: this._serviceContext.echoHost.queryService,
5647
5593
  NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
5648
5594
  LoggingService: this._loggingService,
5649
5595
  TracingService: this._tracingService,
@@ -5674,15 +5620,15 @@ var ClientServicesHost = class {
5674
5620
  deviceKey
5675
5621
  }, {
5676
5622
  F: __dxlog_file18,
5677
- L: 330,
5623
+ L: 315,
5678
5624
  S: this,
5679
5625
  C: (f, a) => f(...a)
5680
5626
  });
5681
- import_log13.log.trace("dxos.client-services.host.open", import_protocols14.trace.end({
5627
+ import_log13.log.trace("dxos.client-services.host.open", import_protocols13.trace.end({
5682
5628
  id: traceId
5683
5629
  }), {
5684
5630
  F: __dxlog_file18,
5685
- L: 331,
5631
+ L: 316,
5686
5632
  S: this,
5687
5633
  C: (f, a) => f(...a)
5688
5634
  });
@@ -5696,7 +5642,7 @@ var ClientServicesHost = class {
5696
5642
  deviceKey
5697
5643
  }, {
5698
5644
  F: __dxlog_file18,
5699
- L: 342,
5645
+ L: 327,
5700
5646
  S: this,
5701
5647
  C: (f, a) => f(...a)
5702
5648
  });
@@ -5706,7 +5652,6 @@ var ClientServicesHost = class {
5706
5652
  SystemService: this._systemService
5707
5653
  });
5708
5654
  await this._loggingService.close();
5709
- await this._queryService.close();
5710
5655
  await this._serviceContext.close();
5711
5656
  await this._level?.close();
5712
5657
  this._open = false;
@@ -5715,24 +5660,24 @@ var ClientServicesHost = class {
5715
5660
  deviceKey
5716
5661
  }, {
5717
5662
  F: __dxlog_file18,
5718
- L: 352,
5663
+ L: 336,
5719
5664
  S: this,
5720
5665
  C: (f, a) => f(...a)
5721
5666
  });
5722
5667
  }
5723
5668
  async reset() {
5724
5669
  const traceId = import_keys12.PublicKey.random().toHex();
5725
- import_log13.log.trace("dxos.sdk.client-services-host.reset", import_protocols14.trace.begin({
5670
+ import_log13.log.trace("dxos.sdk.client-services-host.reset", import_protocols13.trace.begin({
5726
5671
  id: traceId
5727
5672
  }), {
5728
5673
  F: __dxlog_file18,
5729
- L: 357,
5674
+ L: 341,
5730
5675
  S: this,
5731
5676
  C: (f, a) => f(...a)
5732
5677
  });
5733
5678
  (0, import_log13.log)("resetting...", void 0, {
5734
5679
  F: __dxlog_file18,
5735
- L: 359,
5680
+ L: 343,
5736
5681
  S: this,
5737
5682
  C: (f, a) => f(...a)
5738
5683
  });
@@ -5740,15 +5685,15 @@ var ClientServicesHost = class {
5740
5685
  await this._storage.reset();
5741
5686
  (0, import_log13.log)("reset", void 0, {
5742
5687
  F: __dxlog_file18,
5743
- L: 362,
5688
+ L: 346,
5744
5689
  S: this,
5745
5690
  C: (f, a) => f(...a)
5746
5691
  });
5747
- import_log13.log.trace("dxos.sdk.client-services-host.reset", import_protocols14.trace.end({
5692
+ import_log13.log.trace("dxos.sdk.client-services-host.reset", import_protocols13.trace.end({
5748
5693
  id: traceId
5749
5694
  }), {
5750
5695
  F: __dxlog_file18,
5751
- L: 363,
5696
+ L: 347,
5752
5697
  S: this,
5753
5698
  C: (f, a) => f(...a)
5754
5699
  });
@@ -5761,14 +5706,14 @@ var ClientServicesHost = class {
5761
5706
  const automergeIndex = space.automergeSpaceState.rootUrl;
5762
5707
  (0, import_invariant15.invariant)(automergeIndex, void 0, {
5763
5708
  F: __dxlog_file18,
5764
- L: 375,
5709
+ L: 359,
5765
5710
  S: this,
5766
5711
  A: [
5767
5712
  "automergeIndex",
5768
5713
  ""
5769
5714
  ]
5770
5715
  });
5771
- const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
5716
+ const document = await this._serviceContext.echoHost.automergeRepo.find(automergeIndex);
5772
5717
  await document.whenReady();
5773
5718
  const properties = {
5774
5719
  system: {
@@ -5788,7 +5733,7 @@ var ClientServicesHost = class {
5788
5733
  propertiesId
5789
5734
  ], properties);
5790
5735
  });
5791
- await this._serviceContext.automergeHost.repo.flush();
5736
+ await this._serviceContext.echoHost.flush();
5792
5737
  return identity;
5793
5738
  }
5794
5739
  };
@@ -5881,4 +5826,4 @@ var findConfigs = () => {
5881
5826
  subscribeToSpaces,
5882
5827
  subscribeToSwarmInfo
5883
5828
  });
5884
- //# sourceMappingURL=chunk-EAWN3LCD.cjs.map
5829
+ //# sourceMappingURL=chunk-Q6Z4BMTZ.cjs.map