@dxos/client-services 0.5.3-main.d3c5e1f → 0.5.3-main.e76d664

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_POBNOYEY_exports = {};
30
- __export(chunk_POBNOYEY_exports, {
29
+ var chunk_2LM7RUEW_exports = {};
30
+ __export(chunk_2LM7RUEW_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  ClientServicesProviderResource: () => ClientServicesProviderResource,
@@ -56,7 +56,6 @@ __export(chunk_POBNOYEY_exports, {
56
56
  createDiagnostics: () => createDiagnostics,
57
57
  createLevel: () => createLevel,
58
58
  createStorageObjects: () => createStorageObjects,
59
- findPropertiesObject: () => findPropertiesObject,
60
59
  getNetworkPeers: () => getNetworkPeers,
61
60
  isLocked: () => isLocked,
62
61
  subscribeToFeedBlocks: () => subscribeToFeedBlocks,
@@ -67,7 +66,7 @@ __export(chunk_POBNOYEY_exports, {
67
66
  subscribeToSpaces: () => subscribeToSpaces,
68
67
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
69
68
  });
70
- module.exports = __toCommonJS(chunk_POBNOYEY_exports);
69
+ module.exports = __toCommonJS(chunk_2LM7RUEW_exports);
71
70
  var import_async = require("@dxos/async");
72
71
  var import_codec_protobuf = require("@dxos/codec-protobuf");
73
72
  var import_feed_store = require("@dxos/feed-store");
@@ -183,6 +182,7 @@ var import_client_protocol4 = require("@dxos/client-protocol");
183
182
  var import_context9 = require("@dxos/context");
184
183
  var import_debug3 = require("@dxos/debug");
185
184
  var import_echo_pipeline2 = require("@dxos/echo-pipeline");
185
+ var import_echo_pipeline3 = require("@dxos/echo-pipeline");
186
186
  var import_echo_schema = require("@dxos/echo-schema");
187
187
  var import_invariant11 = require("@dxos/invariant");
188
188
  var import_keys9 = require("@dxos/keys");
@@ -190,11 +190,12 @@ var import_log10 = require("@dxos/log");
190
190
  var import_protocols8 = require("@dxos/protocols");
191
191
  var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
192
192
  var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
193
+ var import_credentials12 = require("@dxos/protocols/proto/dxos/halo/credentials");
193
194
  var import_timeframe2 = require("@dxos/timeframe");
194
195
  var import_tracing4 = require("@dxos/tracing");
195
196
  var import_util6 = require("@dxos/util");
196
197
  var import_async12 = require("@dxos/async");
197
- var import_credentials12 = require("@dxos/credentials");
198
+ var import_credentials13 = require("@dxos/credentials");
198
199
  var import_async13 = require("@dxos/async");
199
200
  var import_context10 = require("@dxos/context");
200
201
  var import_invariant12 = require("@dxos/invariant");
@@ -205,24 +206,23 @@ var import_teleport3 = require("@dxos/teleport");
205
206
  var import_util7 = require("@dxos/util");
206
207
  var import_async14 = require("@dxos/async");
207
208
  var import_context11 = require("@dxos/context");
208
- var import_credentials13 = require("@dxos/credentials");
209
- var import_echo_pipeline3 = require("@dxos/echo-pipeline");
209
+ var import_credentials14 = require("@dxos/credentials");
210
+ var import_echo_pipeline4 = require("@dxos/echo-pipeline");
210
211
  var import_invariant13 = require("@dxos/invariant");
211
212
  var import_keys11 = require("@dxos/keys");
212
213
  var import_log12 = require("@dxos/log");
213
214
  var import_protocols10 = require("@dxos/protocols");
214
215
  var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
215
- var import_credentials14 = require("@dxos/protocols/proto/dxos/halo/credentials");
216
+ var import_credentials15 = require("@dxos/protocols/proto/dxos/halo/credentials");
216
217
  var import_teleport_extension_gossip2 = require("@dxos/teleport-extension-gossip");
217
- var import_tracing5 = require("@dxos/tracing");
218
218
  var import_util8 = require("@dxos/util");
219
- var import_credentials15 = require("@dxos/credentials");
219
+ var import_credentials16 = require("@dxos/credentials");
220
220
  var import_debug4 = require("@dxos/debug");
221
- var import_credentials16 = require("@dxos/protocols/proto/dxos/halo/credentials");
221
+ var import_credentials17 = require("@dxos/protocols/proto/dxos/halo/credentials");
222
222
  var import_timeframe3 = require("@dxos/timeframe");
223
223
  var import_async15 = require("@dxos/async");
224
224
  var import_codec_protobuf10 = require("@dxos/codec-protobuf");
225
- var import_credentials17 = require("@dxos/credentials");
225
+ var import_credentials18 = require("@dxos/credentials");
226
226
  var import_debug5 = require("@dxos/debug");
227
227
  var import_feed_store4 = require("@dxos/feed-store");
228
228
  var import_invariant14 = require("@dxos/invariant");
@@ -231,10 +231,10 @@ var import_protocols11 = require("@dxos/protocols");
231
231
  var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
232
232
  var import_async16 = require("@dxos/async");
233
233
  var import_context12 = require("@dxos/context");
234
- var import_credentials18 = require("@dxos/credentials");
234
+ var import_credentials19 = require("@dxos/credentials");
235
235
  var import_debug6 = require("@dxos/debug");
236
236
  var import_echo_db = require("@dxos/echo-db");
237
- var import_echo_pipeline4 = require("@dxos/echo-pipeline");
237
+ var import_echo_pipeline5 = require("@dxos/echo-pipeline");
238
238
  var import_feed_store5 = require("@dxos/feed-store");
239
239
  var import_invariant15 = require("@dxos/invariant");
240
240
  var import_keyring = require("@dxos/keyring");
@@ -243,19 +243,19 @@ var import_log14 = require("@dxos/log");
243
243
  var import_protocols12 = require("@dxos/protocols");
244
244
  var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
245
245
  var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
246
- var import_tracing6 = require("@dxos/tracing");
246
+ var import_tracing5 = require("@dxos/tracing");
247
247
  var import_util9 = require("@dxos/util");
248
248
  var import_async17 = require("@dxos/async");
249
249
  var import_codec_protobuf11 = require("@dxos/codec-protobuf");
250
- var import_credentials19 = require("@dxos/credentials");
250
+ var import_credentials20 = require("@dxos/credentials");
251
251
  var import_invariant16 = require("@dxos/invariant");
252
252
  var import_protocols13 = require("@dxos/protocols");
253
253
  var import_services13 = require("@dxos/protocols/proto/dxos/client/services");
254
- var import_tracing7 = require("@dxos/tracing");
254
+ var import_tracing6 = require("@dxos/tracing");
255
255
  var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
256
256
  var import_config = require("@dxos/config");
257
257
  var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
258
- var import_tracing8 = require("@dxos/tracing");
258
+ var import_tracing7 = require("@dxos/tracing");
259
259
  var import_util10 = require("@dxos/util");
260
260
  var import_async18 = require("@dxos/async");
261
261
  var import_client_protocol5 = require("@dxos/client-protocol");
@@ -269,7 +269,7 @@ var import_messaging = require("@dxos/messaging");
269
269
  var import_network_manager2 = require("@dxos/network-manager");
270
270
  var import_protocols14 = require("@dxos/protocols");
271
271
  var import_services16 = require("@dxos/protocols/proto/dxos/client/services");
272
- var import_tracing9 = require("@dxos/tracing");
272
+ var import_tracing8 = require("@dxos/tracing");
273
273
  var import_util11 = require("@dxos/util");
274
274
  var import_websocket_rpc = require("@dxos/websocket-rpc");
275
275
  var import_async19 = require("@dxos/async");
@@ -3450,7 +3450,7 @@ var AutomergeSpaceState = class {
3450
3450
  this._isProcessingRootDocs = false;
3451
3451
  }
3452
3452
  async processCredential(credential) {
3453
- if (!(0, import_credentials12.checkCredentialType)(credential, "dxos.halo.credentials.Epoch")) {
3453
+ if (!(0, import_credentials13.checkCredentialType)(credential, "dxos.halo.credentials.Epoch")) {
3454
3454
  return;
3455
3455
  }
3456
3456
  this.lastEpoch = credential;
@@ -3775,7 +3775,7 @@ var DataSpace = class {
3775
3775
  state: import_services9.SpaceState[this._state]
3776
3776
  }, {
3777
3777
  F: __dxlog_file13,
3778
- L: 141,
3778
+ L: 137,
3779
3779
  S: this,
3780
3780
  C: (f, a) => f(...a)
3781
3781
  });
@@ -3825,7 +3825,7 @@ var DataSpace = class {
3825
3825
  state: import_services9.SpaceState[this._state]
3826
3826
  }, {
3827
3827
  F: __dxlog_file13,
3828
- L: 199,
3828
+ L: 195,
3829
3829
  S: this,
3830
3830
  C: (f, a) => f(...a)
3831
3831
  });
@@ -3843,7 +3843,7 @@ var DataSpace = class {
3843
3843
  state: import_services9.SpaceState[this._state]
3844
3844
  }, {
3845
3845
  F: __dxlog_file13,
3846
- L: 213,
3846
+ L: 209,
3847
3847
  S: this,
3848
3848
  C: (f, a) => f(...a)
3849
3849
  });
@@ -3875,7 +3875,7 @@ var DataSpace = class {
3875
3875
  if (err instanceof import_protocols8.CancelledError || err instanceof import_context9.ContextDisposedError) {
3876
3876
  (0, import_log10.log)("data pipeline initialization cancelled", err, {
3877
3877
  F: __dxlog_file13,
3878
- L: 246,
3878
+ L: 242,
3879
3879
  S: this,
3880
3880
  C: (f, a) => f(...a)
3881
3881
  });
@@ -3883,7 +3883,7 @@ var DataSpace = class {
3883
3883
  }
3884
3884
  import_log10.log.error("Error initializing data pipeline", err, {
3885
3885
  F: __dxlog_file13,
3886
- L: 250,
3886
+ L: 246,
3887
3887
  S: this,
3888
3888
  C: (f, a) => f(...a)
3889
3889
  });
@@ -3892,7 +3892,7 @@ var DataSpace = class {
3892
3892
  state: import_services9.SpaceState[this._state]
3893
3893
  }, {
3894
3894
  F: __dxlog_file13,
3895
- L: 252,
3895
+ L: 248,
3896
3896
  S: this,
3897
3897
  C: (f, a) => f(...a)
3898
3898
  });
@@ -3912,7 +3912,7 @@ var DataSpace = class {
3912
3912
  state: import_services9.SpaceState[this._state]
3913
3913
  }, {
3914
3914
  F: __dxlog_file13,
3915
- L: 268,
3915
+ L: 264,
3916
3916
  S: this,
3917
3917
  C: (f, a) => f(...a)
3918
3918
  });
@@ -3922,7 +3922,7 @@ var DataSpace = class {
3922
3922
  await (0, import_context9.cancelWithContext)(this._ctx, this.automergeSpaceState.ensureEpochInitialized());
3923
3923
  (0, import_log10.log)("data pipeline ready", void 0, {
3924
3924
  F: __dxlog_file13,
3925
- L: 280,
3925
+ L: 276,
3926
3926
  S: this,
3927
3927
  C: (f, a) => f(...a)
3928
3928
  });
@@ -3932,7 +3932,7 @@ var DataSpace = class {
3932
3932
  state: import_services9.SpaceState[this._state]
3933
3933
  }, {
3934
3934
  F: __dxlog_file13,
3935
- L: 284,
3935
+ L: 280,
3936
3936
  S: this,
3937
3937
  C: (f, a) => f(...a)
3938
3938
  });
@@ -3948,7 +3948,7 @@ var DataSpace = class {
3948
3948
  await this._createWritableFeeds();
3949
3949
  (0, import_log10.log)("writable feeds created", void 0, {
3950
3950
  F: __dxlog_file13,
3951
- L: 300,
3951
+ L: 296,
3952
3952
  S: this,
3953
3953
  C: (f, a) => f(...a)
3954
3954
  });
@@ -3975,7 +3975,7 @@ var DataSpace = class {
3975
3975
  spaceKey: this.key,
3976
3976
  deviceKey: this._signingContext.deviceKey,
3977
3977
  identityKey: this._signingContext.identityKey,
3978
- designation: import_credentials11.AdmittedFeed.Designation.CONTROL
3978
+ designation: import_credentials12.AdmittedFeed.Designation.CONTROL
3979
3979
  }
3980
3980
  }));
3981
3981
  }
@@ -3992,7 +3992,7 @@ var DataSpace = class {
3992
3992
  spaceKey: this.key,
3993
3993
  deviceKey: this._signingContext.deviceKey,
3994
3994
  identityKey: this._signingContext.identityKey,
3995
- designation: import_credentials11.AdmittedFeed.Designation.DATA
3995
+ designation: import_credentials12.AdmittedFeed.Designation.DATA
3996
3996
  }
3997
3997
  }));
3998
3998
  }
@@ -4011,7 +4011,7 @@ var DataSpace = class {
4011
4011
  rootUrl
4012
4012
  }, {
4013
4013
  F: __dxlog_file13,
4014
- L: 366,
4014
+ L: 362,
4015
4015
  S: this,
4016
4016
  C: (f, a) => f(...a)
4017
4017
  });
@@ -4043,7 +4043,7 @@ var DataSpace = class {
4043
4043
  err
4044
4044
  }, {
4045
4045
  F: __dxlog_file13,
4046
- L: 391,
4046
+ L: 387,
4047
4047
  S: this,
4048
4048
  C: (f, a) => f(...a)
4049
4049
  });
@@ -4098,7 +4098,7 @@ var DataSpace = class {
4098
4098
  const newRoot = this._echoHost.automergeRepo.create(rootHandle.docSync());
4099
4099
  (0, import_invariant11.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
4100
4100
  F: __dxlog_file13,
4101
- L: 441,
4101
+ L: 437,
4102
4102
  S: this,
4103
4103
  A: [
4104
4104
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
@@ -4117,7 +4117,7 @@ var DataSpace = class {
4117
4117
  {
4118
4118
  import_log10.log.info("Fragmenting", void 0, {
4119
4119
  F: __dxlog_file13,
4120
- L: 453,
4120
+ L: 449,
4121
4121
  S: this,
4122
4122
  C: (f, a) => f(...a)
4123
4123
  });
@@ -4125,11 +4125,11 @@ var DataSpace = class {
4125
4125
  const rootHandle = this._echoHost.automergeRepo.find(currentRootUrl);
4126
4126
  await (0, import_context9.cancelWithContext)(this._ctx, (0, import_async11.asyncTimeout)(rootHandle.whenReady(), 1e4));
4127
4127
  const objects = Object.entries(rootHandle.docSync().objects);
4128
- const properties = findPropertiesObject(rootHandle.docSync());
4128
+ const properties = objects.find(([_, value]) => value.system.type?.itemId === import_echo_schema.TYPE_PROPERTIES);
4129
4129
  const otherObjects = objects.filter(([key]) => key !== properties?.[0]);
4130
4130
  (0, import_invariant11.invariant)(properties, "Properties not found", {
4131
4131
  F: __dxlog_file13,
4132
- L: 463,
4132
+ L: 459,
4133
4133
  S: this,
4134
4134
  A: [
4135
4135
  "properties",
@@ -4145,14 +4145,14 @@ var DataSpace = class {
4145
4145
  const newRoot = this._echoHost.automergeRepo.create(newSpaceDoc);
4146
4146
  (0, import_invariant11.invariant)(typeof newRoot.url === "string" && newRoot.url.length > 0, void 0, {
4147
4147
  F: __dxlog_file13,
4148
- L: 468,
4148
+ L: 464,
4149
4149
  S: this,
4150
4150
  A: [
4151
4151
  "typeof newRoot.url === 'string' && newRoot.url.length > 0",
4152
4152
  ""
4153
4153
  ]
4154
4154
  });
4155
- const docLoader = new import_echo_pipeline2.AutomergeDocumentLoaderImpl(this.key, this._echoHost.automergeRepo);
4155
+ const docLoader = new import_echo_pipeline3.AutomergeDocumentLoaderImpl(this.key, this._echoHost.automergeRepo);
4156
4156
  await docLoader.loadSpaceRootDocHandle(this._ctx, {
4157
4157
  rootUrl: newRoot.url
4158
4158
  });
@@ -4214,7 +4214,7 @@ var DataSpace = class {
4214
4214
  state: import_services9.SpaceState[this._state]
4215
4215
  }, {
4216
4216
  F: __dxlog_file13,
4217
- L: 534,
4217
+ L: 530,
4218
4218
  S: this,
4219
4219
  C: (f, a) => f(...a)
4220
4220
  });
@@ -4266,21 +4266,9 @@ DataSpace = _ts_decorate4([
4266
4266
  (0, import_async11.trackLeaks)("open", "close"),
4267
4267
  import_tracing4.trace.resource()
4268
4268
  ], DataSpace);
4269
- var findPropertiesObject = (spaceDoc) => {
4270
- for (const id in spaceDoc.objects ?? {}) {
4271
- const obj = spaceDoc.objects[id];
4272
- if (obj.system.type?.itemId === import_echo_schema.TYPE_PROPERTIES) {
4273
- return [
4274
- id,
4275
- obj
4276
- ];
4277
- }
4278
- }
4279
- return void 0;
4280
- };
4281
4269
  var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4282
4270
  const credentials = [
4283
- await (0, import_credentials15.createCredential)({
4271
+ await (0, import_credentials16.createCredential)({
4284
4272
  signer: keyring,
4285
4273
  issuer: space.key,
4286
4274
  subject: space.key,
@@ -4289,14 +4277,14 @@ var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4289
4277
  spaceKey: space.key
4290
4278
  }
4291
4279
  }),
4292
- await (0, import_credentials15.createCredential)({
4280
+ await (0, import_credentials16.createCredential)({
4293
4281
  signer: keyring,
4294
4282
  issuer: space.key,
4295
4283
  subject: signingContext.identityKey,
4296
4284
  assertion: {
4297
4285
  "@type": "dxos.halo.credentials.SpaceMember",
4298
4286
  spaceKey: space.key,
4299
- role: import_credentials16.SpaceMember.Role.OWNER,
4287
+ role: import_credentials17.SpaceMember.Role.OWNER,
4300
4288
  profile: signingContext.getProfile(),
4301
4289
  genesisFeedKey: space.controlFeedKey ?? (0, import_debug4.failUndefined)()
4302
4290
  }
@@ -4308,7 +4296,7 @@ var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4308
4296
  spaceKey: space.key,
4309
4297
  identityKey: signingContext.identityKey,
4310
4298
  deviceKey: signingContext.deviceKey,
4311
- designation: import_credentials16.AdmittedFeed.Designation.CONTROL
4299
+ designation: import_credentials17.AdmittedFeed.Designation.CONTROL
4312
4300
  }
4313
4301
  }),
4314
4302
  await signingContext.credentialSigner.createCredential({
@@ -4318,7 +4306,7 @@ var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4318
4306
  spaceKey: space.key,
4319
4307
  identityKey: signingContext.identityKey,
4320
4308
  deviceKey: signingContext.deviceKey,
4321
- designation: import_credentials16.AdmittedFeed.Designation.DATA
4309
+ designation: import_credentials17.AdmittedFeed.Designation.DATA
4322
4310
  }
4323
4311
  }),
4324
4312
  await signingContext.credentialSigner.createCredential({
@@ -4372,28 +4360,6 @@ var DataSpaceManager = class {
4372
4360
  const { spaceMemberPresenceAnnounceInterval = PRESENCE_ANNOUNCE_INTERVAL, spaceMemberPresenceOfflineTimeout = PRESENCE_OFFLINE_TIMEOUT } = params ?? {};
4373
4361
  this._spaceMemberPresenceAnnounceInterval = spaceMemberPresenceAnnounceInterval;
4374
4362
  this._spaceMemberPresenceOfflineTimeout = spaceMemberPresenceOfflineTimeout;
4375
- import_tracing5.trace.diagnostic({
4376
- id: "spaces",
4377
- name: "Spaces",
4378
- fetch: async () => {
4379
- return Array.from(this._spaces.values()).map((space) => {
4380
- const rootUrl = space.automergeSpaceState.rootUrl;
4381
- const rootHandle = rootUrl ? this._echoHost.automergeRepo.find(rootUrl) : void 0;
4382
- const rootDoc = rootHandle?.docSync();
4383
- const properties = rootDoc && findPropertiesObject(rootDoc);
4384
- return {
4385
- key: space.key.toHex(),
4386
- state: import_services10.SpaceState[space.state],
4387
- name: properties?.[1].data.name ?? null,
4388
- inlineObjects: rootDoc ? Object.keys(rootDoc.objects ?? {}).length : null,
4389
- linkedObjects: rootDoc ? Object.keys(rootDoc.links ?? {}).length : null,
4390
- credentials: space.inner.spaceState.credentials.length,
4391
- members: space.inner.spaceState.members.size,
4392
- rootUrl
4393
- };
4394
- });
4395
- }
4396
- });
4397
4363
  }
4398
4364
  // TODO(burdon): Remove.
4399
4365
  get spaces() {
@@ -4402,7 +4368,7 @@ var DataSpaceManager = class {
4402
4368
  async open() {
4403
4369
  (0, import_log12.log)("open", void 0, {
4404
4370
  F: __dxlog_file14,
4405
- L: 144,
4371
+ L: 115,
4406
4372
  S: this,
4407
4373
  C: (f, a) => f(...a)
4408
4374
  });
@@ -4410,7 +4376,7 @@ var DataSpaceManager = class {
4410
4376
  id: this._instanceId
4411
4377
  }), {
4412
4378
  F: __dxlog_file14,
4413
- L: 145,
4379
+ L: 116,
4414
4380
  S: this,
4415
4381
  C: (f, a) => f(...a)
4416
4382
  });
@@ -4418,7 +4384,7 @@ var DataSpaceManager = class {
4418
4384
  spaces: this._metadataStore.spaces.length
4419
4385
  }, {
4420
4386
  F: __dxlog_file14,
4421
- L: 146,
4387
+ L: 117,
4422
4388
  S: this,
4423
4389
  C: (f, a) => f(...a)
4424
4390
  });
@@ -4428,7 +4394,7 @@ var DataSpaceManager = class {
4428
4394
  spaceMetadata
4429
4395
  }, {
4430
4396
  F: __dxlog_file14,
4431
- L: 150,
4397
+ L: 121,
4432
4398
  S: this,
4433
4399
  C: (f, a) => f(...a)
4434
4400
  });
@@ -4439,7 +4405,7 @@ var DataSpaceManager = class {
4439
4405
  err
4440
4406
  }, {
4441
4407
  F: __dxlog_file14,
4442
- L: 153,
4408
+ L: 124,
4443
4409
  S: this,
4444
4410
  C: (f, a) => f(...a)
4445
4411
  });
@@ -4456,7 +4422,7 @@ var DataSpaceManager = class {
4456
4422
  id: this._instanceId
4457
4423
  }), {
4458
4424
  F: __dxlog_file14,
4459
- L: 166,
4425
+ L: 137,
4460
4426
  S: this,
4461
4427
  C: (f, a) => f(...a)
4462
4428
  });
@@ -4464,7 +4430,7 @@ var DataSpaceManager = class {
4464
4430
  async close() {
4465
4431
  (0, import_log12.log)("close", void 0, {
4466
4432
  F: __dxlog_file14,
4467
- L: 171,
4433
+ L: 142,
4468
4434
  S: this,
4469
4435
  C: (f, a) => f(...a)
4470
4436
  });
@@ -4480,7 +4446,7 @@ var DataSpaceManager = class {
4480
4446
  async createSpace() {
4481
4447
  (0, import_invariant13.invariant)(this._isOpen, "Not open.", {
4482
4448
  F: __dxlog_file14,
4483
- L: 184,
4449
+ L: 155,
4484
4450
  S: this,
4485
4451
  A: [
4486
4452
  "this._isOpen",
@@ -4501,7 +4467,7 @@ var DataSpaceManager = class {
4501
4467
  spaceKey
4502
4468
  }, {
4503
4469
  F: __dxlog_file14,
4504
- L: 196,
4470
+ L: 167,
4505
4471
  S: this,
4506
4472
  C: (f, a) => f(...a)
4507
4473
  });
@@ -4510,9 +4476,9 @@ var DataSpaceManager = class {
4510
4476
  const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner, automergeRootUrl);
4511
4477
  await this._metadataStore.addSpace(metadata);
4512
4478
  const memberCredential = credentials[1];
4513
- (0, import_invariant13.invariant)((0, import_credentials13.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4479
+ (0, import_invariant13.invariant)((0, import_credentials14.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4514
4480
  F: __dxlog_file14,
4515
- L: 205,
4481
+ L: 176,
4516
4482
  S: this,
4517
4483
  A: [
4518
4484
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -4530,13 +4496,13 @@ var DataSpaceManager = class {
4530
4496
  opts
4531
4497
  }, {
4532
4498
  F: __dxlog_file14,
4533
- L: 217,
4499
+ L: 188,
4534
4500
  S: this,
4535
4501
  C: (f, a) => f(...a)
4536
4502
  });
4537
4503
  (0, import_invariant13.invariant)(this._isOpen, "Not open.", {
4538
4504
  F: __dxlog_file14,
4539
- L: 218,
4505
+ L: 189,
4540
4506
  S: this,
4541
4507
  A: [
4542
4508
  "this._isOpen",
@@ -4545,7 +4511,7 @@ var DataSpaceManager = class {
4545
4511
  });
4546
4512
  (0, import_invariant13.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
4547
4513
  F: __dxlog_file14,
4548
- L: 219,
4514
+ L: 190,
4549
4515
  S: this,
4550
4516
  A: [
4551
4517
  "!this._spaces.has(opts.spaceKey)",
@@ -4580,7 +4546,7 @@ var DataSpaceManager = class {
4580
4546
  metadata
4581
4547
  }, {
4582
4548
  F: __dxlog_file14,
4583
- L: 252,
4549
+ L: 223,
4584
4550
  S: this,
4585
4551
  C: (f, a) => f(...a)
4586
4552
  });
@@ -4618,7 +4584,7 @@ var DataSpaceManager = class {
4618
4584
  onAuthFailure: () => {
4619
4585
  import_log12.log.warn("auth failure", void 0, {
4620
4586
  F: __dxlog_file14,
4621
- L: 289,
4587
+ L: 260,
4622
4588
  S: this,
4623
4589
  C: (f, a) => f(...a)
4624
4590
  });
@@ -4651,7 +4617,7 @@ var DataSpaceManager = class {
4651
4617
  space: space.key
4652
4618
  }, {
4653
4619
  F: __dxlog_file14,
4654
- L: 316,
4620
+ L: 287,
4655
4621
  S: this,
4656
4622
  C: (f, a) => f(...a)
4657
4623
  });
@@ -4662,7 +4628,7 @@ var DataSpaceManager = class {
4662
4628
  open: this._isOpen
4663
4629
  }, {
4664
4630
  F: __dxlog_file14,
4665
- L: 319,
4631
+ L: 290,
4666
4632
  S: this,
4667
4633
  C: (f, a) => f(...a)
4668
4634
  });
@@ -4681,7 +4647,7 @@ var DataSpaceManager = class {
4681
4647
  space: space.key
4682
4648
  }, {
4683
4649
  F: __dxlog_file14,
4684
- L: 327,
4650
+ L: 298,
4685
4651
  S: this,
4686
4652
  C: (f, a) => f(...a)
4687
4653
  });
@@ -4712,7 +4678,7 @@ var DataSpaceManager = class {
4712
4678
  const peers = presence.getPeersByIdentityKey(member.key);
4713
4679
  const sessions = peers.map((p) => p.peerId && spaceProtocol.sessions.get(p.peerId));
4714
4680
  const sessionsToClose = sessions.filter((s) => {
4715
- return (s && member.role === import_credentials14.SpaceMember.Role.REMOVED !== (s.authStatus === import_echo_pipeline3.AuthStatus.FAILURE)) ?? false;
4681
+ return (s && member.role === import_credentials15.SpaceMember.Role.REMOVED !== (s.authStatus === import_echo_pipeline4.AuthStatus.FAILURE)) ?? false;
4716
4682
  });
4717
4683
  sessionsToClose.forEach((session) => {
4718
4684
  void session.close().catch(import_log12.log.error);
@@ -4725,7 +4691,7 @@ var DataSpaceManager = class {
4725
4691
  closedSessions
4726
4692
  }, {
4727
4693
  F: __dxlog_file14,
4728
- L: 367,
4694
+ L: 338,
4729
4695
  S: this,
4730
4696
  C: (f, a) => f(...a)
4731
4697
  });
@@ -4733,14 +4699,14 @@ var DataSpaceManager = class {
4733
4699
  }
4734
4700
  _handleNewPeerConnected(space, peerState) {
4735
4701
  const role = space.spaceState.getMemberRole(peerState.identityKey);
4736
- if (role === import_credentials14.SpaceMember.Role.REMOVED) {
4702
+ if (role === import_credentials15.SpaceMember.Role.REMOVED) {
4737
4703
  const session = peerState.peerId && space.protocol.sessions.get(peerState.peerId);
4738
4704
  if (session != null) {
4739
4705
  (0, import_log12.log)("closing a session with a removed peer", {
4740
4706
  peerId: peerState.peerId
4741
4707
  }, {
4742
4708
  F: __dxlog_file14,
4743
- L: 381,
4709
+ L: 352,
4744
4710
  S: this,
4745
4711
  C: (f, a) => f(...a)
4746
4712
  });
@@ -4840,7 +4806,7 @@ var SpacesServiceImpl = class {
4840
4806
  role: space.spaceState.getMemberRole(identity.identityKey)
4841
4807
  });
4842
4808
  }
4843
- const credentials = await (0, import_credentials17.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
4809
+ const credentials = await (0, import_credentials18.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
4844
4810
  (0, import_invariant14.invariant)(credentials[0].credential, void 0, {
4845
4811
  F: __dxlog_file15,
4846
4812
  L: 95,
@@ -4851,7 +4817,7 @@ var SpacesServiceImpl = class {
4851
4817
  ]
4852
4818
  });
4853
4819
  const spaceMemberCredential = credentials[0].credential.credential;
4854
- (0, import_invariant14.invariant)((0, import_credentials17.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4820
+ (0, import_invariant14.invariant)((0, import_credentials18.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4855
4821
  F: __dxlog_file15,
4856
4822
  L: 97,
4857
4823
  S: this,
@@ -5068,8 +5034,8 @@ var ServiceContext = class extends import_context12.Resource {
5068
5034
  this.initialized = new import_async16.Trigger();
5069
5035
  this._handlerFactories = /* @__PURE__ */ new Map();
5070
5036
  this._instanceId = import_keys12.PublicKey.random().toHex();
5071
- this.metadataStore = new import_echo_pipeline4.MetadataStore(storage.createDirectory("metadata"));
5072
- this.snapshotStore = new import_echo_pipeline4.SnapshotStore(storage.createDirectory("snapshots"));
5037
+ this.metadataStore = new import_echo_pipeline5.MetadataStore(storage.createDirectory("metadata"));
5038
+ this.snapshotStore = new import_echo_pipeline5.SnapshotStore(storage.createDirectory("snapshots"));
5073
5039
  this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
5074
5040
  this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
5075
5041
  this.feedStore = new import_feed_store5.FeedStore({
@@ -5077,12 +5043,12 @@ var ServiceContext = class extends import_context12.Resource {
5077
5043
  root: storage.createDirectory("feeds"),
5078
5044
  signer: this.keyring,
5079
5045
  hypercore: {
5080
- valueEncoding: import_echo_pipeline4.valueEncoding,
5046
+ valueEncoding: import_echo_pipeline5.valueEncoding,
5081
5047
  stats: true
5082
5048
  }
5083
5049
  })
5084
5050
  });
5085
- this.spaceManager = new import_echo_pipeline4.SpaceManager({
5051
+ this.spaceManager = new import_echo_pipeline5.SpaceManager({
5086
5052
  feedStore: this.feedStore,
5087
5053
  networkManager: this.networkManager,
5088
5054
  blobStore: this.blobStore,
@@ -5248,7 +5214,7 @@ var ServiceContext = class extends import_context12.Resource {
5248
5214
  this.initialized.wake();
5249
5215
  this._deviceSpaceSync = {
5250
5216
  processCredential: async (credential) => {
5251
- const assertion = (0, import_credentials18.getCredentialAssertion)(credential);
5217
+ const assertion = (0, import_credentials19.getCredentialAssertion)(credential);
5252
5218
  if (assertion["@type"] !== "dxos.halo.credentials.SpaceMember") {
5253
5219
  return;
5254
5220
  }
@@ -5304,14 +5270,14 @@ var ServiceContext = class extends import_context12.Resource {
5304
5270
  }
5305
5271
  };
5306
5272
  _ts_decorate6([
5307
- import_tracing6.trace.span()
5273
+ import_tracing5.trace.span()
5308
5274
  ], ServiceContext.prototype, "_open", null);
5309
5275
  _ts_decorate6([
5310
- import_tracing6.trace.span()
5276
+ import_tracing5.trace.span()
5311
5277
  ], ServiceContext.prototype, "_initialize", null);
5312
5278
  ServiceContext = _ts_decorate6([
5313
5279
  (0, import_util9.safeInstanceof)("dxos.client-services.ServiceContext"),
5314
- import_tracing6.trace.resource()
5280
+ import_tracing5.trace.resource()
5315
5281
  ], ServiceContext);
5316
5282
  var ServiceRegistry = class {
5317
5283
  // prettier-ignore
@@ -5335,7 +5301,7 @@ var ServiceRegistry = class {
5335
5301
  delete this._handlers[name];
5336
5302
  }
5337
5303
  };
5338
- var DXOS_VERSION = "0.5.3-main.d3c5e1f";
5304
+ var DXOS_VERSION = "0.5.3-main.e76d664";
5339
5305
  var getPlatform = () => {
5340
5306
  if (process.browser) {
5341
5307
  if (typeof window !== "undefined") {
@@ -5375,7 +5341,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
5375
5341
  version: import_protocols13.STORAGE_VERSION
5376
5342
  }
5377
5343
  },
5378
- trace: import_tracing7.TRACE_PROCESSOR.getDiagnostics()
5344
+ trace: import_tracing6.TRACE_PROCESSOR.getDiagnostics()
5379
5345
  };
5380
5346
  await Promise.all([
5381
5347
  (async () => {
@@ -5433,7 +5399,7 @@ var getSpaceStats = async (space) => {
5433
5399
  const stats = {
5434
5400
  key: space.key,
5435
5401
  metrics: space.metrics,
5436
- epochs: space.inner.spaceState.credentials.filter((0, import_credentials19.credentialTypeFilter)("dxos.halo.credentials.Epoch")).map((credential) => ({
5402
+ epochs: space.inner.spaceState.credentials.filter((0, import_credentials20.credentialTypeFilter)("dxos.halo.credentials.Epoch")).map((credential) => ({
5437
5403
  ...credential.subject.assertion,
5438
5404
  id: credential.id
5439
5405
  })),
@@ -5902,7 +5868,7 @@ var ClientServicesHost = class {
5902
5868
  callbacks,
5903
5869
  runtimeParams
5904
5870
  } = {}) {
5905
- this._tracingService = import_tracing9.TRACE_PROCESSOR.createTraceSender();
5871
+ this._tracingService = import_tracing8.TRACE_PROCESSOR.createTraceSender();
5906
5872
  this._statusUpdate = new import_async18.Event();
5907
5873
  this._opening = false;
5908
5874
  this._open = false;
@@ -6264,21 +6230,21 @@ var ClientServicesHost = class {
6264
6230
  }
6265
6231
  };
6266
6232
  _ts_decorate8([
6267
- import_tracing9.trace.info()
6233
+ import_tracing8.trace.info()
6268
6234
  ], ClientServicesHost.prototype, "_opening", void 0);
6269
6235
  _ts_decorate8([
6270
- import_tracing9.trace.info()
6236
+ import_tracing8.trace.info()
6271
6237
  ], ClientServicesHost.prototype, "_open", void 0);
6272
6238
  _ts_decorate8([
6273
6239
  import_async18.synchronized,
6274
- import_tracing9.trace.span()
6240
+ import_tracing8.trace.span()
6275
6241
  ], ClientServicesHost.prototype, "open", null);
6276
6242
  _ts_decorate8([
6277
6243
  import_async18.synchronized,
6278
- import_tracing9.trace.span()
6244
+ import_tracing8.trace.span()
6279
6245
  ], ClientServicesHost.prototype, "close", null);
6280
6246
  ClientServicesHost = _ts_decorate8([
6281
- import_tracing9.trace.resource()
6247
+ import_tracing8.trace.resource()
6282
6248
  ], ClientServicesHost);
6283
6249
  var ClientServicesProviderResource = Symbol.for("dxos.resource.ClientServices");
6284
6250
  var GET_DIAGNOSTICS_RPC_TIMEOUT = 1e4;
@@ -6294,7 +6260,7 @@ var DiagnosticsCollector = class {
6294
6260
  });
6295
6261
  const clientDiagnostics = {
6296
6262
  config,
6297
- trace: import_tracing8.TRACE_PROCESSOR.getDiagnostics()
6263
+ trace: import_tracing7.TRACE_PROCESSOR.getDiagnostics()
6298
6264
  };
6299
6265
  const diagnostics = serviceDiagnostics != null ? {
6300
6266
  client: clientDiagnostics,
@@ -6307,12 +6273,12 @@ var DiagnosticsCollector = class {
6307
6273
  }
6308
6274
  };
6309
6275
  var findSystemServiceProvider = () => {
6310
- const serviceProviders = import_tracing8.TRACE_PROCESSOR.findResourcesByAnnotation(ClientServicesProviderResource);
6276
+ const serviceProviders = import_tracing7.TRACE_PROCESSOR.findResourcesByAnnotation(ClientServicesProviderResource);
6311
6277
  const providerResource = serviceProviders.find((r) => r.instance.deref()?.services?.SystemService != null);
6312
6278
  return providerResource?.instance?.deref() ?? null;
6313
6279
  };
6314
6280
  var findConfigs = () => {
6315
- const configs = import_tracing8.TRACE_PROCESSOR.findResourcesByAnnotation(import_config.ConfigResource);
6281
+ const configs = import_tracing7.TRACE_PROCESSOR.findResourcesByAnnotation(import_config.ConfigResource);
6316
6282
  return configs.map((r) => r.instance.deref()).filter(import_util10.nonNullable);
6317
6283
  };
6318
6284
  // Annotate the CommonJS export names for ESM import in node:
@@ -6345,7 +6311,6 @@ var findConfigs = () => {
6345
6311
  createDiagnostics,
6346
6312
  createLevel,
6347
6313
  createStorageObjects,
6348
- findPropertiesObject,
6349
6314
  getNetworkPeers,
6350
6315
  isLocked,
6351
6316
  subscribeToFeedBlocks,
@@ -6356,4 +6321,4 @@ var findConfigs = () => {
6356
6321
  subscribeToSpaces,
6357
6322
  subscribeToSwarmInfo
6358
6323
  });
6359
- //# sourceMappingURL=chunk-POBNOYEY.cjs.map
6324
+ //# sourceMappingURL=chunk-2LM7RUEW.cjs.map