@dxos/client-services 0.4.10-main.7ab08e9 → 0.4.10-main.93fda5f

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.
@@ -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_ZVSJIOW6_exports = {};
30
- __export(chunk_ZVSJIOW6_exports, {
29
+ var chunk_4TLGRMKO_exports = {};
30
+ __export(chunk_4TLGRMKO_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  DataSpace: () => DataSpace,
@@ -60,7 +60,7 @@ __export(chunk_ZVSJIOW6_exports, {
60
60
  subscribeToSpaces: () => subscribeToSpaces,
61
61
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
62
62
  });
63
- module.exports = __toCommonJS(chunk_ZVSJIOW6_exports);
63
+ module.exports = __toCommonJS(chunk_4TLGRMKO_exports);
64
64
  var import_async = require("@dxos/async");
65
65
  var import_codec_protobuf = require("@dxos/codec-protobuf");
66
66
  var import_feed_store = require("@dxos/feed-store");
@@ -158,9 +158,7 @@ var import_async10 = require("@dxos/async");
158
158
  var import_client_protocol3 = require("@dxos/client-protocol");
159
159
  var import_context7 = require("@dxos/context");
160
160
  var import_debug3 = require("@dxos/debug");
161
- var import_echo_db = require("@dxos/echo-db");
162
161
  var import_echo_pipeline = require("@dxos/echo-pipeline");
163
- var import_echo_pipeline2 = require("@dxos/echo-pipeline");
164
162
  var import_invariant10 = require("@dxos/invariant");
165
163
  var import_keys7 = require("@dxos/keys");
166
164
  var import_log8 = require("@dxos/log");
@@ -205,7 +203,7 @@ var import_async15 = require("@dxos/async");
205
203
  var import_context10 = require("@dxos/context");
206
204
  var import_credentials15 = require("@dxos/credentials");
207
205
  var import_debug6 = require("@dxos/debug");
208
- var import_echo_pipeline3 = require("@dxos/echo-pipeline");
206
+ var import_echo_pipeline2 = require("@dxos/echo-pipeline");
209
207
  var import_feed_store4 = require("@dxos/feed-store");
210
208
  var import_indexing = require("@dxos/indexing");
211
209
  var import_invariant14 = require("@dxos/invariant");
@@ -231,7 +229,7 @@ var import_util8 = require("@dxos/util");
231
229
  var import_async16 = require("@dxos/async");
232
230
  var import_client_protocol5 = require("@dxos/client-protocol");
233
231
  var import_context11 = require("@dxos/context");
234
- var import_echo_pipeline4 = require("@dxos/echo-pipeline");
232
+ var import_echo_pipeline3 = require("@dxos/echo-pipeline");
235
233
  var import_echo_schema = require("@dxos/echo-schema");
236
234
  var import_indexing2 = require("@dxos/indexing");
237
235
  var import_invariant16 = require("@dxos/invariant");
@@ -2886,7 +2884,7 @@ var getPlatform = () => {
2886
2884
  };
2887
2885
  }
2888
2886
  };
2889
- var DXOS_VERSION = "0.4.10-main.7ab08e9";
2887
+ var DXOS_VERSION = "0.4.10-main.93fda5f";
2890
2888
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
2891
2889
  var DEFAULT_TIMEOUT = 1e3;
2892
2890
  var createDiagnostics = async (clientServices, serviceContext, config) => {
@@ -3328,7 +3326,7 @@ var DataSpace = class {
3328
3326
  state: import_services9.SpaceState[this._state]
3329
3327
  }, {
3330
3328
  F: __dxlog_file12,
3331
- L: 140,
3329
+ L: 132,
3332
3330
  S: this,
3333
3331
  C: (f, a) => f(...a)
3334
3332
  });
@@ -3378,7 +3376,7 @@ var DataSpace = class {
3378
3376
  state: import_services9.SpaceState[this._state]
3379
3377
  }, {
3380
3378
  F: __dxlog_file12,
3381
- L: 198,
3379
+ L: 190,
3382
3380
  S: this,
3383
3381
  C: (f, a) => f(...a)
3384
3382
  });
@@ -3396,7 +3394,7 @@ var DataSpace = class {
3396
3394
  state: import_services9.SpaceState[this._state]
3397
3395
  }, {
3398
3396
  F: __dxlog_file12,
3399
- L: 212,
3397
+ L: 204,
3400
3398
  S: this,
3401
3399
  C: (f, a) => f(...a)
3402
3400
  });
@@ -3428,7 +3426,7 @@ var DataSpace = class {
3428
3426
  if (err instanceof import_protocols8.CancelledError || err instanceof import_context7.ContextDisposedError) {
3429
3427
  (0, import_log8.log)("data pipeline initialization cancelled", err, {
3430
3428
  F: __dxlog_file12,
3431
- L: 245,
3429
+ L: 237,
3432
3430
  S: this,
3433
3431
  C: (f, a) => f(...a)
3434
3432
  });
@@ -3436,7 +3434,7 @@ var DataSpace = class {
3436
3434
  }
3437
3435
  import_log8.log.error("Error initializing data pipeline", err, {
3438
3436
  F: __dxlog_file12,
3439
- L: 249,
3437
+ L: 241,
3440
3438
  S: this,
3441
3439
  C: (f, a) => f(...a)
3442
3440
  });
@@ -3445,7 +3443,7 @@ var DataSpace = class {
3445
3443
  state: import_services9.SpaceState[this._state]
3446
3444
  }, {
3447
3445
  F: __dxlog_file12,
3448
- L: 251,
3446
+ L: 243,
3449
3447
  S: this,
3450
3448
  C: (f, a) => f(...a)
3451
3449
  });
@@ -3465,7 +3463,7 @@ var DataSpace = class {
3465
3463
  state: import_services9.SpaceState[this._state]
3466
3464
  }, {
3467
3465
  F: __dxlog_file12,
3468
- L: 267,
3466
+ L: 259,
3469
3467
  S: this,
3470
3468
  C: (f, a) => f(...a)
3471
3469
  });
@@ -3475,7 +3473,7 @@ var DataSpace = class {
3475
3473
  await (0, import_context7.cancelWithContext)(this._ctx, this.automergeSpaceState.ensureEpochInitialized());
3476
3474
  (0, import_log8.log)("data pipeline ready", void 0, {
3477
3475
  F: __dxlog_file12,
3478
- L: 279,
3476
+ L: 271,
3479
3477
  S: this,
3480
3478
  C: (f, a) => f(...a)
3481
3479
  });
@@ -3485,7 +3483,7 @@ var DataSpace = class {
3485
3483
  state: import_services9.SpaceState[this._state]
3486
3484
  }, {
3487
3485
  F: __dxlog_file12,
3488
- L: 283,
3486
+ L: 275,
3489
3487
  S: this,
3490
3488
  C: (f, a) => f(...a)
3491
3489
  });
@@ -3501,7 +3499,7 @@ var DataSpace = class {
3501
3499
  await this._createWritableFeeds();
3502
3500
  (0, import_log8.log)("writable feeds created", void 0, {
3503
3501
  F: __dxlog_file12,
3504
- L: 299,
3502
+ L: 291,
3505
3503
  S: this,
3506
3504
  C: (f, a) => f(...a)
3507
3505
  });
@@ -3564,7 +3562,7 @@ var DataSpace = class {
3564
3562
  rootUrl
3565
3563
  }, {
3566
3564
  F: __dxlog_file12,
3567
- L: 365,
3565
+ L: 357,
3568
3566
  S: this,
3569
3567
  C: (f, a) => f(...a)
3570
3568
  });
@@ -3596,7 +3594,7 @@ var DataSpace = class {
3596
3594
  err
3597
3595
  }, {
3598
3596
  F: __dxlog_file12,
3599
- L: 388,
3597
+ L: 380,
3600
3598
  S: this,
3601
3599
  C: (f, a) => f(...a)
3602
3600
  });
@@ -3651,73 +3649,13 @@ var DataSpace = class {
3651
3649
  const newRoot = this._automergeHost.repo.create(rootHandle.docSync());
3652
3650
  (0, import_invariant10.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3653
3651
  F: __dxlog_file12,
3654
- L: 438,
3655
- S: this,
3656
- A: [
3657
- "typeof newRoot.url === 'string' && newRoot.url.length > 0",
3658
- ""
3659
- ]
3660
- });
3661
- epoch = {
3662
- previousId: this._automergeSpaceState.lastEpoch?.id,
3663
- number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
3664
- timeframe: this._automergeSpaceState.lastEpoch?.subject.assertion.timeframe ?? new import_timeframe2.Timeframe(),
3665
- automergeRoot: newRoot.url
3666
- };
3667
- }
3668
- break;
3669
- case import_services9.CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT:
3670
- {
3671
- import_log8.log.info("Fragmenting", void 0, {
3672
- F: __dxlog_file12,
3673
- L: 450,
3674
- S: this,
3675
- C: (f, a) => f(...a)
3676
- });
3677
- const currentRootUrl = this._automergeSpaceState.rootUrl;
3678
- const rootHandle = this._automergeHost.repo.find(currentRootUrl);
3679
- await (0, import_context7.cancelWithContext)(this._ctx, (0, import_async10.asyncTimeout)(rootHandle.whenReady(), 1e4));
3680
- const objects = Object.entries(rootHandle.docSync().objects);
3681
- const properties = objects.find(([_, value]) => value.system.type?.itemId === import_echo_db.TYPE_PROPERTIES);
3682
- const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
3683
- (0, import_invariant10.invariant)(properties, "Properties not found", {
3684
- F: __dxlog_file12,
3685
- L: 460,
3686
- S: this,
3687
- A: [
3688
- "properties",
3689
- "'Properties not found'"
3690
- ]
3691
- });
3692
- const newSpaceDoc = {
3693
- ...rootHandle.docSync(),
3694
- objects: Object.fromEntries([
3695
- properties
3696
- ])
3697
- };
3698
- const newRoot = this._automergeHost.repo.create(newSpaceDoc);
3699
- (0, import_invariant10.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
3700
- F: __dxlog_file12,
3701
- L: 465,
3652
+ L: 430,
3702
3653
  S: this,
3703
3654
  A: [
3704
3655
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
3705
3656
  ""
3706
3657
  ]
3707
3658
  });
3708
- const docLoader = new import_echo_pipeline2.AutomergeDocumentLoaderImpl(this.key, this._automergeHost.repo);
3709
- await docLoader.loadSpaceRootDocHandle(this._ctx, {
3710
- rootUrl: newRoot.url
3711
- });
3712
- otherObjects.forEach(([key, value]) => {
3713
- const handle = docLoader.createDocumentForObject(key);
3714
- handle.change((doc) => {
3715
- (0, import_util4.assignDeep)(doc, [
3716
- "objects",
3717
- key
3718
- ], value);
3719
- });
3720
- });
3721
3659
  epoch = {
3722
3660
  previousId: this._automergeSpaceState.lastEpoch?.id,
3723
3661
  number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
@@ -3767,7 +3705,7 @@ var DataSpace = class {
3767
3705
  state: import_services9.SpaceState[this._state]
3768
3706
  }, {
3769
3707
  F: __dxlog_file12,
3770
- L: 531,
3708
+ L: 482,
3771
3709
  S: this,
3772
3710
  C: (f, a) => f(...a)
3773
3711
  });
@@ -4525,8 +4463,8 @@ var ServiceContext = class {
4525
4463
  this.initialized = new import_async15.Trigger();
4526
4464
  this._handlerFactories = /* @__PURE__ */ new Map();
4527
4465
  this._instanceId = import_keys10.PublicKey.random().toHex();
4528
- this.metadataStore = new import_echo_pipeline3.MetadataStore(storage.createDirectory("metadata"));
4529
- this.snapshotStore = new import_echo_pipeline3.SnapshotStore(storage.createDirectory("snapshots"));
4466
+ this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
4467
+ this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
4530
4468
  this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
4531
4469
  this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
4532
4470
  this.feedStore = new import_feed_store4.FeedStore({
@@ -4534,12 +4472,12 @@ var ServiceContext = class {
4534
4472
  root: storage.createDirectory("feeds"),
4535
4473
  signer: this.keyring,
4536
4474
  hypercore: {
4537
- valueEncoding: import_echo_pipeline3.valueEncoding,
4475
+ valueEncoding: import_echo_pipeline2.valueEncoding,
4538
4476
  stats: true
4539
4477
  }
4540
4478
  })
4541
4479
  });
4542
- this.spaceManager = new import_echo_pipeline3.SpaceManager({
4480
+ this.spaceManager = new import_echo_pipeline2.SpaceManager({
4543
4481
  feedStore: this.feedStore,
4544
4482
  networkManager: this.networkManager,
4545
4483
  blobStore: this.blobStore,
@@ -4550,7 +4488,7 @@ var ServiceContext = class {
4550
4488
  this.indexMetadata = new import_indexing.IndexMetadataStore({
4551
4489
  directory: storage.createDirectory("index-metadata")
4552
4490
  });
4553
- this.automergeHost = new import_echo_pipeline3.AutomergeHost({
4491
+ this.automergeHost = new import_echo_pipeline2.AutomergeHost({
4554
4492
  directory: storage.createDirectory("automerge"),
4555
4493
  metadata: this.indexMetadata
4556
4494
  });
@@ -5391,7 +5329,7 @@ var ClientServicesHost = class {
5391
5329
  await this._serviceContext.initialized.wait();
5392
5330
  return this._serviceContext.dataSpaceManager;
5393
5331
  }),
5394
- DataService: new import_echo_pipeline4.DataServiceImpl(this._serviceContext.automergeHost),
5332
+ DataService: new import_echo_pipeline3.DataServiceImpl(this._serviceContext.automergeHost),
5395
5333
  IndexService: new import_indexing2.IndexServiceImpl({
5396
5334
  indexer: this._serviceContext.indexer,
5397
5335
  automergeHost: this._serviceContext.automergeHost
@@ -5598,4 +5536,4 @@ ClientServicesHost = _ts_decorate8([
5598
5536
  subscribeToSpaces,
5599
5537
  subscribeToSwarmInfo
5600
5538
  });
5601
- //# sourceMappingURL=chunk-ZVSJIOW6.cjs.map
5539
+ //# sourceMappingURL=chunk-4TLGRMKO.cjs.map