@dxos/client-services 0.5.9-main.2d0a5e6 → 0.5.9-main.2dbe289

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.
@@ -355,7 +355,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
355
355
  import { TRACE_PROCESSOR } from "@dxos/tracing";
356
356
 
357
357
  // packages/sdk/client-services/src/version.ts
358
- var DXOS_VERSION = "0.5.9-main.2d0a5e6";
358
+ var DXOS_VERSION = "0.5.9-main.2dbe289";
359
359
 
360
360
  // packages/sdk/client-services/src/packlets/services/platform.ts
361
361
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -3929,7 +3929,7 @@ var DataSpace = class {
3929
3929
  state: SpaceState[this._state]
3930
3930
  }, {
3931
3931
  F: __dxlog_file15,
3932
- L: 142,
3932
+ L: 143,
3933
3933
  S: this,
3934
3934
  C: (f, a) => f(...a)
3935
3935
  });
@@ -3982,7 +3982,7 @@ var DataSpace = class {
3982
3982
  state: SpaceState[this._state]
3983
3983
  }, {
3984
3984
  F: __dxlog_file15,
3985
- L: 205,
3985
+ L: 206,
3986
3986
  S: this,
3987
3987
  C: (f, a) => f(...a)
3988
3988
  });
@@ -4000,7 +4000,7 @@ var DataSpace = class {
4000
4000
  state: SpaceState[this._state]
4001
4001
  }, {
4002
4002
  F: __dxlog_file15,
4003
- L: 219,
4003
+ L: 220,
4004
4004
  S: this,
4005
4005
  C: (f, a) => f(...a)
4006
4006
  });
@@ -4032,7 +4032,7 @@ var DataSpace = class {
4032
4032
  if (err instanceof CancelledError || err instanceof ContextDisposedError3) {
4033
4033
  log12("data pipeline initialization cancelled", err, {
4034
4034
  F: __dxlog_file15,
4035
- L: 252,
4035
+ L: 253,
4036
4036
  S: this,
4037
4037
  C: (f, a) => f(...a)
4038
4038
  });
@@ -4040,7 +4040,7 @@ var DataSpace = class {
4040
4040
  }
4041
4041
  log12.error("Error initializing data pipeline", err, {
4042
4042
  F: __dxlog_file15,
4043
- L: 256,
4043
+ L: 257,
4044
4044
  S: this,
4045
4045
  C: (f, a) => f(...a)
4046
4046
  });
@@ -4049,7 +4049,7 @@ var DataSpace = class {
4049
4049
  state: SpaceState[this._state]
4050
4050
  }, {
4051
4051
  F: __dxlog_file15,
4052
- L: 258,
4052
+ L: 259,
4053
4053
  S: this,
4054
4054
  C: (f, a) => f(...a)
4055
4055
  });
@@ -4069,7 +4069,7 @@ var DataSpace = class {
4069
4069
  state: SpaceState[this._state]
4070
4070
  }, {
4071
4071
  F: __dxlog_file15,
4072
- L: 274,
4072
+ L: 275,
4073
4073
  S: this,
4074
4074
  C: (f, a) => f(...a)
4075
4075
  });
@@ -4079,7 +4079,7 @@ var DataSpace = class {
4079
4079
  await cancelWithContext4(this._ctx, this.automergeSpaceState.ensureEpochInitialized());
4080
4080
  log12("data pipeline ready", void 0, {
4081
4081
  F: __dxlog_file15,
4082
- L: 286,
4082
+ L: 287,
4083
4083
  S: this,
4084
4084
  C: (f, a) => f(...a)
4085
4085
  });
@@ -4089,7 +4089,7 @@ var DataSpace = class {
4089
4089
  state: SpaceState[this._state]
4090
4090
  }, {
4091
4091
  F: __dxlog_file15,
4092
- L: 290,
4092
+ L: 291,
4093
4093
  S: this,
4094
4094
  C: (f, a) => f(...a)
4095
4095
  });
@@ -4105,7 +4105,7 @@ var DataSpace = class {
4105
4105
  await this._createWritableFeeds();
4106
4106
  log12("writable feeds created", void 0, {
4107
4107
  F: __dxlog_file15,
4108
- L: 306,
4108
+ L: 307,
4109
4109
  S: this,
4110
4110
  C: (f, a) => f(...a)
4111
4111
  });
@@ -4168,7 +4168,7 @@ var DataSpace = class {
4168
4168
  rootUrl
4169
4169
  }, {
4170
4170
  F: __dxlog_file15,
4171
- L: 372,
4171
+ L: 373,
4172
4172
  S: this,
4173
4173
  C: (f, a) => f(...a)
4174
4174
  });
@@ -4198,7 +4198,7 @@ var DataSpace = class {
4198
4198
  rootUrl
4199
4199
  }, {
4200
4200
  F: __dxlog_file15,
4201
- L: 399,
4201
+ L: 400,
4202
4202
  S: this,
4203
4203
  C: (f, a) => f(...a)
4204
4204
  });
@@ -4213,7 +4213,7 @@ var DataSpace = class {
4213
4213
  err
4214
4214
  }, {
4215
4215
  F: __dxlog_file15,
4216
- L: 405,
4216
+ L: 406,
4217
4217
  S: this,
4218
4218
  C: (f, a) => f(...a)
4219
4219
  });
@@ -4266,9 +4266,12 @@ var DataSpace = class {
4266
4266
  const rootHandle = this._echoHost.automergeRepo.find(currentRootUrl);
4267
4267
  await cancelWithContext4(this._ctx, asyncTimeout2(rootHandle.whenReady(), 1e4));
4268
4268
  const newRoot = this._echoHost.automergeRepo.create(rootHandle.docSync());
4269
+ await this._echoHost.automergeRepo.flush([
4270
+ newRoot.documentId
4271
+ ]);
4269
4272
  invariant13(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
4270
4273
  F: __dxlog_file15,
4271
- L: 455,
4274
+ L: 457,
4272
4275
  S: this,
4273
4276
  A: [
4274
4277
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
@@ -4287,7 +4290,7 @@ var DataSpace = class {
4287
4290
  {
4288
4291
  log12.info("Fragmenting", void 0, {
4289
4292
  F: __dxlog_file15,
4290
- L: 467,
4293
+ L: 469,
4291
4294
  S: this,
4292
4295
  C: (f, a) => f(...a)
4293
4296
  });
@@ -4299,7 +4302,7 @@ var DataSpace = class {
4299
4302
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
4300
4303
  invariant13(properties, "Properties not found", {
4301
4304
  F: __dxlog_file15,
4302
- L: 477,
4305
+ L: 479,
4303
4306
  S: this,
4304
4307
  A: [
4305
4308
  "properties",
@@ -4315,7 +4318,7 @@ var DataSpace = class {
4315
4318
  const newRoot = this._echoHost.automergeRepo.create(newSpaceDoc);
4316
4319
  invariant13(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
4317
4320
  F: __dxlog_file15,
4318
- L: 482,
4321
+ L: 484,
4319
4322
  S: this,
4320
4323
  A: [
4321
4324
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
@@ -4343,6 +4346,25 @@ var DataSpace = class {
4343
4346
  };
4344
4347
  }
4345
4348
  break;
4349
+ case CreateEpochRequest.Migration.REPLACE_AUTOMERGE_ROOT:
4350
+ {
4351
+ invariant13(options.newAutomergeRoot, void 0, {
4352
+ F: __dxlog_file15,
4353
+ L: 514,
4354
+ S: this,
4355
+ A: [
4356
+ "options.newAutomergeRoot",
4357
+ ""
4358
+ ]
4359
+ });
4360
+ epoch = {
4361
+ previousId: this._automergeSpaceState.lastEpoch?.id,
4362
+ number: (this._automergeSpaceState.lastEpoch?.subject.assertion.number ?? -1) + 1,
4363
+ timeframe: this._automergeSpaceState.lastEpoch?.subject.assertion.timeframe ?? new Timeframe2(),
4364
+ automergeRoot: options.newAutomergeRoot
4365
+ };
4366
+ }
4367
+ break;
4346
4368
  }
4347
4369
  if (!epoch) {
4348
4370
  return;
@@ -4364,6 +4386,7 @@ var DataSpace = class {
4364
4386
  receipt.seq
4365
4387
  ]
4366
4388
  ]));
4389
+ await this._echoHost.updateIndexes();
4367
4390
  }
4368
4391
  async activate() {
4369
4392
  if (this._state !== SpaceState.INACTIVE) {
@@ -4384,7 +4407,7 @@ var DataSpace = class {
4384
4407
  state: SpaceState[this._state]
4385
4408
  }, {
4386
4409
  F: __dxlog_file15,
4387
- L: 552,
4410
+ L: 567,
4388
4411
  S: this,
4389
4412
  C: (f, a) => f(...a)
4390
4413
  });
@@ -5202,11 +5225,12 @@ var SpacesServiceImpl = class {
5202
5225
  }
5203
5226
  }
5204
5227
  }
5205
- async createEpoch({ spaceKey, migration }) {
5228
+ async createEpoch({ spaceKey, migration, automergeRootUrl }) {
5206
5229
  const dataSpaceManager = await this._getDataSpaceManager();
5207
5230
  const space = dataSpaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError2(spaceKey));
5208
5231
  await space.createEpoch({
5209
- migration
5232
+ migration,
5233
+ newAutomergeRoot: automergeRootUrl
5210
5234
  });
5211
5235
  }
5212
5236
  _serializeSpace(space) {
@@ -6580,4 +6604,4 @@ export {
6580
6604
  ClientServicesProviderResource,
6581
6605
  DiagnosticsCollector
6582
6606
  };
6583
- //# sourceMappingURL=chunk-5SOW3KZQ.mjs.map
6607
+ //# sourceMappingURL=chunk-QWL2M4EU.mjs.map