@dxos/client-services 0.4.4-next.e0df51e → 0.4.5-main.4000b4b

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.
@@ -1025,7 +1025,6 @@ import { signPresentation } from "@dxos/credentials";
1025
1025
  import { todo } from "@dxos/debug";
1026
1026
  import { invariant as invariant3 } from "@dxos/invariant";
1027
1027
  var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1028
- var CREATE_PROFILE_WITH_AUTOMERGE_DEFAULT = true;
1029
1028
  var IdentityServiceImpl = class {
1030
1029
  constructor(_createIdentity, _identityManager, _keyring, _onProfileUpdate) {
1031
1030
  this._createIdentity = _createIdentity;
@@ -1034,7 +1033,7 @@ var IdentityServiceImpl = class {
1034
1033
  this._onProfileUpdate = _onProfileUpdate;
1035
1034
  }
1036
1035
  async createIdentity(request) {
1037
- await this._createIdentity(request.profile ?? {}, request.useAutomerge ?? CREATE_PROFILE_WITH_AUTOMERGE_DEFAULT);
1036
+ await this._createIdentity(request.profile ?? {});
1038
1037
  return this._getIdentity();
1039
1038
  }
1040
1039
  async recoverIdentity(request) {
@@ -1062,7 +1061,7 @@ var IdentityServiceImpl = class {
1062
1061
  async updateProfile(profile) {
1063
1062
  invariant3(this._identityManager.identity, "Identity not initialized.", {
1064
1063
  F: __dxlog_file4,
1065
- L: 63,
1064
+ L: 61,
1066
1065
  S: this,
1067
1066
  A: [
1068
1067
  "this._identityManager.identity",
@@ -1076,7 +1075,7 @@ var IdentityServiceImpl = class {
1076
1075
  async signPresentation({ presentation, nonce }) {
1077
1076
  invariant3(this._identityManager.identity, "Identity not initialized.", {
1078
1077
  F: __dxlog_file4,
1079
- L: 70,
1078
+ L: 68,
1080
1079
  S: this,
1081
1080
  A: [
1082
1081
  "this._identityManager.identity",
@@ -2566,7 +2565,7 @@ var getPlatform = () => {
2566
2565
  };
2567
2566
 
2568
2567
  // packages/sdk/client-services/src/version.ts
2569
- var DXOS_VERSION = "0.4.4-next.e0df51e";
2568
+ var DXOS_VERSION = "0.4.5-main.4000b4b";
2570
2569
 
2571
2570
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2572
2571
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -4614,6 +4613,7 @@ import { trace as trace9 } from "@dxos/protocols";
4614
4613
  import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
4615
4614
  import { TextModel } from "@dxos/text-model";
4616
4615
  import { TRACE_PROCESSOR as TRACE_PROCESSOR2, trace as Trace3 } from "@dxos/tracing";
4616
+ import { assignDeep } from "@dxos/util";
4617
4617
  import { WebsocketRpcClient } from "@dxos/websocket-rpc";
4618
4618
 
4619
4619
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
@@ -4882,18 +4882,6 @@ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
4882
4882
  var createDefaultModelFactory = () => {
4883
4883
  return new ModelFactory().registerModel(DocumentModel2).registerModel(TextModel);
4884
4884
  };
4885
- var createGenesisMutationFromTypedObject = (obj) => {
4886
- const snapshot = obj[base]._createSnapshot();
4887
- return {
4888
- objectId: obj[base]._id,
4889
- genesis: {
4890
- modelType: obj[base]._modelConstructor.meta.type
4891
- },
4892
- snapshot: {
4893
- model: snapshot
4894
- }
4895
- };
4896
- };
4897
4885
  var ClientServicesHost = class {
4898
4886
  constructor({
4899
4887
  config,
@@ -4980,7 +4968,7 @@ var ClientServicesHost = class {
4980
4968
  initialize({ config, ...options }) {
4981
4969
  invariant14(!this._open, "service host is open", {
4982
4970
  F: __dxlog_file17,
4983
- L: 201,
4971
+ L: 186,
4984
4972
  S: this,
4985
4973
  A: [
4986
4974
  "!this._open",
@@ -4989,14 +4977,14 @@ var ClientServicesHost = class {
4989
4977
  });
4990
4978
  log16("initializing...", void 0, {
4991
4979
  F: __dxlog_file17,
4992
- L: 202,
4980
+ L: 187,
4993
4981
  S: this,
4994
4982
  C: (f, a) => f(...a)
4995
4983
  });
4996
4984
  if (config) {
4997
4985
  invariant14(!this._config, "config already set", {
4998
4986
  F: __dxlog_file17,
4999
- L: 205,
4987
+ L: 190,
5000
4988
  S: this,
5001
4989
  A: [
5002
4990
  "!this._config",
@@ -5014,7 +5002,7 @@ var ClientServicesHost = class {
5014
5002
  this._signalManager = signalManager;
5015
5003
  invariant14(!this._networkManager, "network manager already set", {
5016
5004
  F: __dxlog_file17,
5017
- L: 221,
5005
+ L: 206,
5018
5006
  S: this,
5019
5007
  A: [
5020
5008
  "!this._networkManager",
@@ -5028,7 +5016,7 @@ var ClientServicesHost = class {
5028
5016
  });
5029
5017
  log16("initialized", void 0, {
5030
5018
  F: __dxlog_file17,
5031
- L: 228,
5019
+ L: 213,
5032
5020
  S: this,
5033
5021
  C: (f, a) => f(...a)
5034
5022
  });
@@ -5042,13 +5030,13 @@ var ClientServicesHost = class {
5042
5030
  id: traceId
5043
5031
  }), {
5044
5032
  F: __dxlog_file17,
5045
- L: 239,
5033
+ L: 224,
5046
5034
  S: this,
5047
5035
  C: (f, a) => f(...a)
5048
5036
  });
5049
5037
  invariant14(this._config, "config not set", {
5050
5038
  F: __dxlog_file17,
5051
- L: 241,
5039
+ L: 226,
5052
5040
  S: this,
5053
5041
  A: [
5054
5042
  "this._config",
@@ -5057,7 +5045,7 @@ var ClientServicesHost = class {
5057
5045
  });
5058
5046
  invariant14(this._storage, "storage not set", {
5059
5047
  F: __dxlog_file17,
5060
- L: 242,
5048
+ L: 227,
5061
5049
  S: this,
5062
5050
  A: [
5063
5051
  "this._storage",
@@ -5066,7 +5054,7 @@ var ClientServicesHost = class {
5066
5054
  });
5067
5055
  invariant14(this._signalManager, "signal manager not set", {
5068
5056
  F: __dxlog_file17,
5069
- L: 243,
5057
+ L: 228,
5070
5058
  S: this,
5071
5059
  A: [
5072
5060
  "this._signalManager",
@@ -5075,7 +5063,7 @@ var ClientServicesHost = class {
5075
5063
  });
5076
5064
  invariant14(this._networkManager, "network manager not set", {
5077
5065
  F: __dxlog_file17,
5078
- L: 244,
5066
+ L: 229,
5079
5067
  S: this,
5080
5068
  A: [
5081
5069
  "this._networkManager",
@@ -5087,7 +5075,7 @@ var ClientServicesHost = class {
5087
5075
  lockKey: this._resourceLock?.lockKey
5088
5076
  }, {
5089
5077
  F: __dxlog_file17,
5090
- L: 247,
5078
+ L: 232,
5091
5079
  S: this,
5092
5080
  C: (f, a) => f(...a)
5093
5081
  });
@@ -5096,7 +5084,7 @@ var ClientServicesHost = class {
5096
5084
  this._serviceContext = new ServiceContext(this._storage, this._networkManager, this._signalManager, this._modelFactory);
5097
5085
  this._serviceRegistry.setServices({
5098
5086
  SystemService: this._systemService,
5099
- IdentityService: new IdentityServiceImpl((params, useAutomerge) => this._createIdentity(params, useAutomerge), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
5087
+ IdentityService: new IdentityServiceImpl((params) => this._createIdentity(params), this._serviceContext.identityManager, this._serviceContext.keyring, (profile) => this._serviceContext.broadcastProfileUpdate(profile)),
5100
5088
  InvitationsService: new InvitationsServiceImpl(this._serviceContext.invitations, (invitation) => this._serviceContext.getInvitationHandler(invitation)),
5101
5089
  DevicesService: new DevicesServiceImpl(this._serviceContext.identityManager),
5102
5090
  SpacesService: new SpacesServiceImpl(this._serviceContext.identityManager, this._serviceContext.spaceManager, this._serviceContext.dataServiceSubscriptions, async () => {
@@ -5133,7 +5121,7 @@ var ClientServicesHost = class {
5133
5121
  deviceKey
5134
5122
  }, {
5135
5123
  F: __dxlog_file17,
5136
- L: 320,
5124
+ L: 305,
5137
5125
  S: this,
5138
5126
  C: (f, a) => f(...a)
5139
5127
  });
@@ -5141,7 +5129,7 @@ var ClientServicesHost = class {
5141
5129
  id: traceId
5142
5130
  }), {
5143
5131
  F: __dxlog_file17,
5144
- L: 321,
5132
+ L: 306,
5145
5133
  S: this,
5146
5134
  C: (f, a) => f(...a)
5147
5135
  });
@@ -5155,7 +5143,7 @@ var ClientServicesHost = class {
5155
5143
  deviceKey
5156
5144
  }, {
5157
5145
  F: __dxlog_file17,
5158
- L: 332,
5146
+ L: 317,
5159
5147
  S: this,
5160
5148
  C: (f, a) => f(...a)
5161
5149
  });
@@ -5171,7 +5159,7 @@ var ClientServicesHost = class {
5171
5159
  deviceKey
5172
5160
  }, {
5173
5161
  F: __dxlog_file17,
5174
- L: 339,
5162
+ L: 324,
5175
5163
  S: this,
5176
5164
  C: (f, a) => f(...a)
5177
5165
  });
@@ -5182,13 +5170,13 @@ var ClientServicesHost = class {
5182
5170
  id: traceId
5183
5171
  }), {
5184
5172
  F: __dxlog_file17,
5185
- L: 344,
5173
+ L: 329,
5186
5174
  S: this,
5187
5175
  C: (f, a) => f(...a)
5188
5176
  });
5189
5177
  log16("resetting...", void 0, {
5190
5178
  F: __dxlog_file17,
5191
- L: 346,
5179
+ L: 331,
5192
5180
  S: this,
5193
5181
  C: (f, a) => f(...a)
5194
5182
  });
@@ -5196,7 +5184,7 @@ var ClientServicesHost = class {
5196
5184
  await this._storage.reset();
5197
5185
  log16("reset", void 0, {
5198
5186
  F: __dxlog_file17,
5199
- L: 349,
5187
+ L: 334,
5200
5188
  S: this,
5201
5189
  C: (f, a) => f(...a)
5202
5190
  });
@@ -5204,50 +5192,36 @@ var ClientServicesHost = class {
5204
5192
  id: traceId
5205
5193
  }), {
5206
5194
  F: __dxlog_file17,
5207
- L: 350,
5195
+ L: 335,
5208
5196
  S: this,
5209
5197
  C: (f, a) => f(...a)
5210
5198
  });
5211
5199
  await this._callbacks?.onReset?.();
5212
5200
  }
5213
- async _createIdentity(params, useAutomerge) {
5201
+ async _createIdentity(params) {
5214
5202
  const identity = await this._serviceContext.createIdentity(params);
5215
5203
  await this._serviceContext.initialized.wait();
5216
5204
  const space = await this._serviceContext.dataSpaceManager.createSpace();
5217
- const obj = new Properties(void 0, {
5218
- automerge: useAutomerge
5219
- });
5205
+ const obj = new Properties(void 0);
5220
5206
  obj[defaultKey] = identity.identityKey.toHex();
5221
- if (!useAutomerge) {
5222
- await this._serviceRegistry.services.DataService.write({
5223
- spaceKey: space.key,
5224
- batch: {
5225
- objects: [
5226
- createGenesisMutationFromTypedObject(obj)
5227
- ]
5228
- }
5229
- });
5230
- await this._serviceRegistry.services.DataService.flush({
5231
- spaceKey: space.key
5232
- });
5233
- } else {
5234
- const automergeIndex = space.automergeSpaceState.rootUrl;
5235
- invariant14(automergeIndex, void 0, {
5236
- F: __dxlog_file17,
5237
- L: 375,
5238
- S: this,
5239
- A: [
5240
- "automergeIndex",
5241
- ""
5242
- ]
5243
- });
5244
- const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
5245
- await document.whenReady();
5246
- document.change((doc) => {
5247
- doc.objects ??= {};
5248
- doc.objects[obj[base]._id] = getRawDoc(obj).handle.docSync();
5249
- });
5250
- }
5207
+ const automergeIndex = space.automergeSpaceState.rootUrl;
5208
+ invariant14(automergeIndex, void 0, {
5209
+ F: __dxlog_file17,
5210
+ L: 350,
5211
+ S: this,
5212
+ A: [
5213
+ "automergeIndex",
5214
+ ""
5215
+ ]
5216
+ });
5217
+ const document = await this._serviceContext.automergeHost.repo.find(automergeIndex);
5218
+ await document.whenReady();
5219
+ document.change((doc) => {
5220
+ assignDeep(doc, [
5221
+ "objects",
5222
+ obj[base]._id
5223
+ ], getRawDoc(obj).handle.docSync());
5224
+ });
5251
5225
  return identity;
5252
5226
  }
5253
5227
  };
@@ -5303,4 +5277,4 @@ export {
5303
5277
  createDefaultModelFactory,
5304
5278
  ClientServicesHost
5305
5279
  };
5306
- //# sourceMappingURL=chunk-GJSXXOWH.mjs.map
5280
+ //# sourceMappingURL=chunk-HD5CFBAF.mjs.map