@dxos/client-services 0.5.3-main.f9b873d → 0.5.3-next.57eca40

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_VYXGTUEI_exports = {};
30
- __export(chunk_VYXGTUEI_exports, {
29
+ var chunk_GVGQ4FCH_exports = {};
30
+ __export(chunk_GVGQ4FCH_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  ClientServicesProviderResource: () => ClientServicesProviderResource,
@@ -56,6 +56,7 @@ __export(chunk_VYXGTUEI_exports, {
56
56
  createDiagnostics: () => createDiagnostics,
57
57
  createLevel: () => createLevel,
58
58
  createStorageObjects: () => createStorageObjects,
59
+ findPropertiesObject: () => findPropertiesObject,
59
60
  getNetworkPeers: () => getNetworkPeers,
60
61
  isLocked: () => isLocked,
61
62
  subscribeToFeedBlocks: () => subscribeToFeedBlocks,
@@ -66,7 +67,7 @@ __export(chunk_VYXGTUEI_exports, {
66
67
  subscribeToSpaces: () => subscribeToSpaces,
67
68
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
68
69
  });
69
- module.exports = __toCommonJS(chunk_VYXGTUEI_exports);
70
+ module.exports = __toCommonJS(chunk_GVGQ4FCH_exports);
70
71
  var import_async = require("@dxos/async");
71
72
  var import_codec_protobuf = require("@dxos/codec-protobuf");
72
73
  var import_feed_store = require("@dxos/feed-store");
@@ -182,7 +183,6 @@ var import_client_protocol4 = require("@dxos/client-protocol");
182
183
  var import_context9 = require("@dxos/context");
183
184
  var import_debug3 = require("@dxos/debug");
184
185
  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,12 +190,11 @@ 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");
194
193
  var import_timeframe2 = require("@dxos/timeframe");
195
194
  var import_tracing4 = require("@dxos/tracing");
196
195
  var import_util6 = require("@dxos/util");
197
196
  var import_async12 = require("@dxos/async");
198
- var import_credentials13 = require("@dxos/credentials");
197
+ var import_credentials12 = require("@dxos/credentials");
199
198
  var import_async13 = require("@dxos/async");
200
199
  var import_context10 = require("@dxos/context");
201
200
  var import_invariant12 = require("@dxos/invariant");
@@ -206,23 +205,24 @@ var import_teleport3 = require("@dxos/teleport");
206
205
  var import_util7 = require("@dxos/util");
207
206
  var import_async14 = require("@dxos/async");
208
207
  var import_context11 = require("@dxos/context");
209
- var import_credentials14 = require("@dxos/credentials");
210
- var import_echo_pipeline4 = require("@dxos/echo-pipeline");
208
+ var import_credentials13 = require("@dxos/credentials");
209
+ var import_echo_pipeline3 = require("@dxos/echo-pipeline");
211
210
  var import_invariant13 = require("@dxos/invariant");
212
211
  var import_keys11 = require("@dxos/keys");
213
212
  var import_log12 = require("@dxos/log");
214
213
  var import_protocols10 = require("@dxos/protocols");
215
214
  var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
216
- var import_credentials15 = require("@dxos/protocols/proto/dxos/halo/credentials");
215
+ var import_credentials14 = require("@dxos/protocols/proto/dxos/halo/credentials");
217
216
  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_credentials16 = require("@dxos/credentials");
219
+ var import_credentials15 = require("@dxos/credentials");
220
220
  var import_debug4 = require("@dxos/debug");
221
- var import_credentials17 = require("@dxos/protocols/proto/dxos/halo/credentials");
221
+ var import_credentials16 = 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_credentials18 = require("@dxos/credentials");
225
+ var import_credentials17 = 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_credentials19 = require("@dxos/credentials");
234
+ var import_credentials18 = 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_pipeline5 = require("@dxos/echo-pipeline");
237
+ var import_echo_pipeline4 = 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_tracing5 = require("@dxos/tracing");
246
+ var import_tracing6 = 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_credentials20 = require("@dxos/credentials");
250
+ var import_credentials19 = 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_tracing6 = require("@dxos/tracing");
254
+ var import_tracing7 = 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_tracing7 = require("@dxos/tracing");
258
+ var import_tracing8 = 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_tracing8 = require("@dxos/tracing");
272
+ var import_tracing9 = 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_credentials13.checkCredentialType)(credential, "dxos.halo.credentials.Epoch")) {
3453
+ if (!(0, import_credentials12.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: 137,
3778
+ L: 141,
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: 195,
3828
+ L: 199,
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: 209,
3846
+ L: 213,
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: 242,
3878
+ L: 246,
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: 246,
3886
+ L: 250,
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: 248,
3895
+ L: 252,
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: 264,
3915
+ L: 268,
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: 276,
3925
+ L: 280,
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: 280,
3935
+ L: 284,
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: 296,
3951
+ L: 300,
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_credentials12.AdmittedFeed.Designation.CONTROL
3978
+ designation: import_credentials11.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_credentials12.AdmittedFeed.Designation.DATA
3995
+ designation: import_credentials11.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: 362,
4014
+ L: 366,
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: 387,
4046
+ L: 391,
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: 437,
4101
+ L: 441,
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: 449,
4120
+ L: 453,
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 = objects.find(([_, value]) => value.system.type?.itemId === import_echo_schema.TYPE_PROPERTIES);
4128
+ const properties = findPropertiesObject(rootHandle.docSync());
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: 459,
4132
+ L: 463,
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: 464,
4148
+ L: 468,
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_pipeline3.AutomergeDocumentLoaderImpl(this.key, this._echoHost.automergeRepo);
4155
+ const docLoader = new import_echo_pipeline2.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: 530,
4217
+ L: 534,
4218
4218
  S: this,
4219
4219
  C: (f, a) => f(...a)
4220
4220
  });
@@ -4266,9 +4266,21 @@ 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
+ };
4269
4281
  var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4270
4282
  const credentials = [
4271
- await (0, import_credentials16.createCredential)({
4283
+ await (0, import_credentials15.createCredential)({
4272
4284
  signer: keyring,
4273
4285
  issuer: space.key,
4274
4286
  subject: space.key,
@@ -4277,14 +4289,14 @@ var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4277
4289
  spaceKey: space.key
4278
4290
  }
4279
4291
  }),
4280
- await (0, import_credentials16.createCredential)({
4292
+ await (0, import_credentials15.createCredential)({
4281
4293
  signer: keyring,
4282
4294
  issuer: space.key,
4283
4295
  subject: signingContext.identityKey,
4284
4296
  assertion: {
4285
4297
  "@type": "dxos.halo.credentials.SpaceMember",
4286
4298
  spaceKey: space.key,
4287
- role: import_credentials17.SpaceMember.Role.OWNER,
4299
+ role: import_credentials16.SpaceMember.Role.OWNER,
4288
4300
  profile: signingContext.getProfile(),
4289
4301
  genesisFeedKey: space.controlFeedKey ?? (0, import_debug4.failUndefined)()
4290
4302
  }
@@ -4296,7 +4308,7 @@ var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4296
4308
  spaceKey: space.key,
4297
4309
  identityKey: signingContext.identityKey,
4298
4310
  deviceKey: signingContext.deviceKey,
4299
- designation: import_credentials17.AdmittedFeed.Designation.CONTROL
4311
+ designation: import_credentials16.AdmittedFeed.Designation.CONTROL
4300
4312
  }
4301
4313
  }),
4302
4314
  await signingContext.credentialSigner.createCredential({
@@ -4306,7 +4318,7 @@ var spaceGenesis = async (keyring, signingContext, space, automergeRoot) => {
4306
4318
  spaceKey: space.key,
4307
4319
  identityKey: signingContext.identityKey,
4308
4320
  deviceKey: signingContext.deviceKey,
4309
- designation: import_credentials17.AdmittedFeed.Designation.DATA
4321
+ designation: import_credentials16.AdmittedFeed.Designation.DATA
4310
4322
  }
4311
4323
  }),
4312
4324
  await signingContext.credentialSigner.createCredential({
@@ -4360,6 +4372,28 @@ var DataSpaceManager = class {
4360
4372
  const { spaceMemberPresenceAnnounceInterval = PRESENCE_ANNOUNCE_INTERVAL, spaceMemberPresenceOfflineTimeout = PRESENCE_OFFLINE_TIMEOUT } = params ?? {};
4361
4373
  this._spaceMemberPresenceAnnounceInterval = spaceMemberPresenceAnnounceInterval;
4362
4374
  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
+ });
4363
4397
  }
4364
4398
  // TODO(burdon): Remove.
4365
4399
  get spaces() {
@@ -4368,7 +4402,7 @@ var DataSpaceManager = class {
4368
4402
  async open() {
4369
4403
  (0, import_log12.log)("open", void 0, {
4370
4404
  F: __dxlog_file14,
4371
- L: 115,
4405
+ L: 144,
4372
4406
  S: this,
4373
4407
  C: (f, a) => f(...a)
4374
4408
  });
@@ -4376,7 +4410,7 @@ var DataSpaceManager = class {
4376
4410
  id: this._instanceId
4377
4411
  }), {
4378
4412
  F: __dxlog_file14,
4379
- L: 116,
4413
+ L: 145,
4380
4414
  S: this,
4381
4415
  C: (f, a) => f(...a)
4382
4416
  });
@@ -4384,7 +4418,7 @@ var DataSpaceManager = class {
4384
4418
  spaces: this._metadataStore.spaces.length
4385
4419
  }, {
4386
4420
  F: __dxlog_file14,
4387
- L: 117,
4421
+ L: 146,
4388
4422
  S: this,
4389
4423
  C: (f, a) => f(...a)
4390
4424
  });
@@ -4394,7 +4428,7 @@ var DataSpaceManager = class {
4394
4428
  spaceMetadata
4395
4429
  }, {
4396
4430
  F: __dxlog_file14,
4397
- L: 121,
4431
+ L: 150,
4398
4432
  S: this,
4399
4433
  C: (f, a) => f(...a)
4400
4434
  });
@@ -4405,7 +4439,7 @@ var DataSpaceManager = class {
4405
4439
  err
4406
4440
  }, {
4407
4441
  F: __dxlog_file14,
4408
- L: 124,
4442
+ L: 153,
4409
4443
  S: this,
4410
4444
  C: (f, a) => f(...a)
4411
4445
  });
@@ -4422,7 +4456,7 @@ var DataSpaceManager = class {
4422
4456
  id: this._instanceId
4423
4457
  }), {
4424
4458
  F: __dxlog_file14,
4425
- L: 137,
4459
+ L: 166,
4426
4460
  S: this,
4427
4461
  C: (f, a) => f(...a)
4428
4462
  });
@@ -4430,7 +4464,7 @@ var DataSpaceManager = class {
4430
4464
  async close() {
4431
4465
  (0, import_log12.log)("close", void 0, {
4432
4466
  F: __dxlog_file14,
4433
- L: 142,
4467
+ L: 171,
4434
4468
  S: this,
4435
4469
  C: (f, a) => f(...a)
4436
4470
  });
@@ -4446,7 +4480,7 @@ var DataSpaceManager = class {
4446
4480
  async createSpace() {
4447
4481
  (0, import_invariant13.invariant)(this._isOpen, "Not open.", {
4448
4482
  F: __dxlog_file14,
4449
- L: 155,
4483
+ L: 184,
4450
4484
  S: this,
4451
4485
  A: [
4452
4486
  "this._isOpen",
@@ -4467,7 +4501,7 @@ var DataSpaceManager = class {
4467
4501
  spaceKey
4468
4502
  }, {
4469
4503
  F: __dxlog_file14,
4470
- L: 167,
4504
+ L: 196,
4471
4505
  S: this,
4472
4506
  C: (f, a) => f(...a)
4473
4507
  });
@@ -4476,9 +4510,9 @@ var DataSpaceManager = class {
4476
4510
  const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner, automergeRootUrl);
4477
4511
  await this._metadataStore.addSpace(metadata);
4478
4512
  const memberCredential = credentials[1];
4479
- (0, import_invariant13.invariant)((0, import_credentials14.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4513
+ (0, import_invariant13.invariant)((0, import_credentials13.getCredentialAssertion)(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4480
4514
  F: __dxlog_file14,
4481
- L: 176,
4515
+ L: 205,
4482
4516
  S: this,
4483
4517
  A: [
4484
4518
  "getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -4496,13 +4530,13 @@ var DataSpaceManager = class {
4496
4530
  opts
4497
4531
  }, {
4498
4532
  F: __dxlog_file14,
4499
- L: 188,
4533
+ L: 217,
4500
4534
  S: this,
4501
4535
  C: (f, a) => f(...a)
4502
4536
  });
4503
4537
  (0, import_invariant13.invariant)(this._isOpen, "Not open.", {
4504
4538
  F: __dxlog_file14,
4505
- L: 189,
4539
+ L: 218,
4506
4540
  S: this,
4507
4541
  A: [
4508
4542
  "this._isOpen",
@@ -4511,7 +4545,7 @@ var DataSpaceManager = class {
4511
4545
  });
4512
4546
  (0, import_invariant13.invariant)(!this._spaces.has(opts.spaceKey), "Space already exists.", {
4513
4547
  F: __dxlog_file14,
4514
- L: 190,
4548
+ L: 219,
4515
4549
  S: this,
4516
4550
  A: [
4517
4551
  "!this._spaces.has(opts.spaceKey)",
@@ -4546,7 +4580,7 @@ var DataSpaceManager = class {
4546
4580
  metadata
4547
4581
  }, {
4548
4582
  F: __dxlog_file14,
4549
- L: 223,
4583
+ L: 252,
4550
4584
  S: this,
4551
4585
  C: (f, a) => f(...a)
4552
4586
  });
@@ -4584,7 +4618,7 @@ var DataSpaceManager = class {
4584
4618
  onAuthFailure: () => {
4585
4619
  import_log12.log.warn("auth failure", void 0, {
4586
4620
  F: __dxlog_file14,
4587
- L: 260,
4621
+ L: 289,
4588
4622
  S: this,
4589
4623
  C: (f, a) => f(...a)
4590
4624
  });
@@ -4617,7 +4651,7 @@ var DataSpaceManager = class {
4617
4651
  space: space.key
4618
4652
  }, {
4619
4653
  F: __dxlog_file14,
4620
- L: 287,
4654
+ L: 316,
4621
4655
  S: this,
4622
4656
  C: (f, a) => f(...a)
4623
4657
  });
@@ -4628,7 +4662,7 @@ var DataSpaceManager = class {
4628
4662
  open: this._isOpen
4629
4663
  }, {
4630
4664
  F: __dxlog_file14,
4631
- L: 290,
4665
+ L: 319,
4632
4666
  S: this,
4633
4667
  C: (f, a) => f(...a)
4634
4668
  });
@@ -4647,7 +4681,7 @@ var DataSpaceManager = class {
4647
4681
  space: space.key
4648
4682
  }, {
4649
4683
  F: __dxlog_file14,
4650
- L: 298,
4684
+ L: 327,
4651
4685
  S: this,
4652
4686
  C: (f, a) => f(...a)
4653
4687
  });
@@ -4678,7 +4712,7 @@ var DataSpaceManager = class {
4678
4712
  const peers = presence.getPeersByIdentityKey(member.key);
4679
4713
  const sessions = peers.map((p) => p.peerId && spaceProtocol.sessions.get(p.peerId));
4680
4714
  const sessionsToClose = sessions.filter((s) => {
4681
- return (s && member.role === import_credentials15.SpaceMember.Role.REMOVED !== (s.authStatus === import_echo_pipeline4.AuthStatus.FAILURE)) ?? false;
4715
+ return (s && member.role === import_credentials14.SpaceMember.Role.REMOVED !== (s.authStatus === import_echo_pipeline3.AuthStatus.FAILURE)) ?? false;
4682
4716
  });
4683
4717
  sessionsToClose.forEach((session) => {
4684
4718
  void session.close().catch(import_log12.log.error);
@@ -4691,7 +4725,7 @@ var DataSpaceManager = class {
4691
4725
  closedSessions
4692
4726
  }, {
4693
4727
  F: __dxlog_file14,
4694
- L: 338,
4728
+ L: 367,
4695
4729
  S: this,
4696
4730
  C: (f, a) => f(...a)
4697
4731
  });
@@ -4699,14 +4733,14 @@ var DataSpaceManager = class {
4699
4733
  }
4700
4734
  _handleNewPeerConnected(space, peerState) {
4701
4735
  const role = space.spaceState.getMemberRole(peerState.identityKey);
4702
- if (role === import_credentials15.SpaceMember.Role.REMOVED) {
4736
+ if (role === import_credentials14.SpaceMember.Role.REMOVED) {
4703
4737
  const session = peerState.peerId && space.protocol.sessions.get(peerState.peerId);
4704
4738
  if (session != null) {
4705
4739
  (0, import_log12.log)("closing a session with a removed peer", {
4706
4740
  peerId: peerState.peerId
4707
4741
  }, {
4708
4742
  F: __dxlog_file14,
4709
- L: 352,
4743
+ L: 381,
4710
4744
  S: this,
4711
4745
  C: (f, a) => f(...a)
4712
4746
  });
@@ -4806,7 +4840,7 @@ var SpacesServiceImpl = class {
4806
4840
  role: space.spaceState.getMemberRole(identity.identityKey)
4807
4841
  });
4808
4842
  }
4809
- const credentials = await (0, import_credentials18.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
4843
+ const credentials = await (0, import_credentials17.createAdmissionCredentials)(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
4810
4844
  (0, import_invariant14.invariant)(credentials[0].credential, void 0, {
4811
4845
  F: __dxlog_file15,
4812
4846
  L: 95,
@@ -4817,7 +4851,7 @@ var SpacesServiceImpl = class {
4817
4851
  ]
4818
4852
  });
4819
4853
  const spaceMemberCredential = credentials[0].credential.credential;
4820
- (0, import_invariant14.invariant)((0, import_credentials18.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4854
+ (0, import_invariant14.invariant)((0, import_credentials17.getCredentialAssertion)(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4821
4855
  F: __dxlog_file15,
4822
4856
  L: 97,
4823
4857
  S: this,
@@ -5034,8 +5068,8 @@ var ServiceContext = class extends import_context12.Resource {
5034
5068
  this.initialized = new import_async16.Trigger();
5035
5069
  this._handlerFactories = /* @__PURE__ */ new Map();
5036
5070
  this._instanceId = import_keys12.PublicKey.random().toHex();
5037
- this.metadataStore = new import_echo_pipeline5.MetadataStore(storage.createDirectory("metadata"));
5038
- this.snapshotStore = new import_echo_pipeline5.SnapshotStore(storage.createDirectory("snapshots"));
5071
+ this.metadataStore = new import_echo_pipeline4.MetadataStore(storage.createDirectory("metadata"));
5072
+ this.snapshotStore = new import_echo_pipeline4.SnapshotStore(storage.createDirectory("snapshots"));
5039
5073
  this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
5040
5074
  this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
5041
5075
  this.feedStore = new import_feed_store5.FeedStore({
@@ -5043,12 +5077,12 @@ var ServiceContext = class extends import_context12.Resource {
5043
5077
  root: storage.createDirectory("feeds"),
5044
5078
  signer: this.keyring,
5045
5079
  hypercore: {
5046
- valueEncoding: import_echo_pipeline5.valueEncoding,
5080
+ valueEncoding: import_echo_pipeline4.valueEncoding,
5047
5081
  stats: true
5048
5082
  }
5049
5083
  })
5050
5084
  });
5051
- this.spaceManager = new import_echo_pipeline5.SpaceManager({
5085
+ this.spaceManager = new import_echo_pipeline4.SpaceManager({
5052
5086
  feedStore: this.feedStore,
5053
5087
  networkManager: this.networkManager,
5054
5088
  blobStore: this.blobStore,
@@ -5214,7 +5248,7 @@ var ServiceContext = class extends import_context12.Resource {
5214
5248
  this.initialized.wake();
5215
5249
  this._deviceSpaceSync = {
5216
5250
  processCredential: async (credential) => {
5217
- const assertion = (0, import_credentials19.getCredentialAssertion)(credential);
5251
+ const assertion = (0, import_credentials18.getCredentialAssertion)(credential);
5218
5252
  if (assertion["@type"] !== "dxos.halo.credentials.SpaceMember") {
5219
5253
  return;
5220
5254
  }
@@ -5270,14 +5304,14 @@ var ServiceContext = class extends import_context12.Resource {
5270
5304
  }
5271
5305
  };
5272
5306
  _ts_decorate6([
5273
- import_tracing5.trace.span()
5307
+ import_tracing6.trace.span()
5274
5308
  ], ServiceContext.prototype, "_open", null);
5275
5309
  _ts_decorate6([
5276
- import_tracing5.trace.span()
5310
+ import_tracing6.trace.span()
5277
5311
  ], ServiceContext.prototype, "_initialize", null);
5278
5312
  ServiceContext = _ts_decorate6([
5279
5313
  (0, import_util9.safeInstanceof)("dxos.client-services.ServiceContext"),
5280
- import_tracing5.trace.resource()
5314
+ import_tracing6.trace.resource()
5281
5315
  ], ServiceContext);
5282
5316
  var ServiceRegistry = class {
5283
5317
  // prettier-ignore
@@ -5301,7 +5335,7 @@ var ServiceRegistry = class {
5301
5335
  delete this._handlers[name];
5302
5336
  }
5303
5337
  };
5304
- var DXOS_VERSION = "0.5.3-main.f9b873d";
5338
+ var DXOS_VERSION = "0.5.3-next.57eca40";
5305
5339
  var getPlatform = () => {
5306
5340
  if (process.browser) {
5307
5341
  if (typeof window !== "undefined") {
@@ -5341,7 +5375,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
5341
5375
  version: import_protocols13.STORAGE_VERSION
5342
5376
  }
5343
5377
  },
5344
- trace: import_tracing6.TRACE_PROCESSOR.getDiagnostics()
5378
+ trace: import_tracing7.TRACE_PROCESSOR.getDiagnostics()
5345
5379
  };
5346
5380
  await Promise.all([
5347
5381
  (async () => {
@@ -5399,7 +5433,7 @@ var getSpaceStats = async (space) => {
5399
5433
  const stats = {
5400
5434
  key: space.key,
5401
5435
  metrics: space.metrics,
5402
- epochs: space.inner.spaceState.credentials.filter((0, import_credentials20.credentialTypeFilter)("dxos.halo.credentials.Epoch")).map((credential) => ({
5436
+ epochs: space.inner.spaceState.credentials.filter((0, import_credentials19.credentialTypeFilter)("dxos.halo.credentials.Epoch")).map((credential) => ({
5403
5437
  ...credential.subject.assertion,
5404
5438
  id: credential.id
5405
5439
  })),
@@ -5868,7 +5902,7 @@ var ClientServicesHost = class {
5868
5902
  callbacks,
5869
5903
  runtimeParams
5870
5904
  } = {}) {
5871
- this._tracingService = import_tracing8.TRACE_PROCESSOR.createTraceSender();
5905
+ this._tracingService = import_tracing9.TRACE_PROCESSOR.createTraceSender();
5872
5906
  this._statusUpdate = new import_async18.Event();
5873
5907
  this._opening = false;
5874
5908
  this._open = false;
@@ -6230,21 +6264,21 @@ var ClientServicesHost = class {
6230
6264
  }
6231
6265
  };
6232
6266
  _ts_decorate8([
6233
- import_tracing8.trace.info()
6267
+ import_tracing9.trace.info()
6234
6268
  ], ClientServicesHost.prototype, "_opening", void 0);
6235
6269
  _ts_decorate8([
6236
- import_tracing8.trace.info()
6270
+ import_tracing9.trace.info()
6237
6271
  ], ClientServicesHost.prototype, "_open", void 0);
6238
6272
  _ts_decorate8([
6239
6273
  import_async18.synchronized,
6240
- import_tracing8.trace.span()
6274
+ import_tracing9.trace.span()
6241
6275
  ], ClientServicesHost.prototype, "open", null);
6242
6276
  _ts_decorate8([
6243
6277
  import_async18.synchronized,
6244
- import_tracing8.trace.span()
6278
+ import_tracing9.trace.span()
6245
6279
  ], ClientServicesHost.prototype, "close", null);
6246
6280
  ClientServicesHost = _ts_decorate8([
6247
- import_tracing8.trace.resource()
6281
+ import_tracing9.trace.resource()
6248
6282
  ], ClientServicesHost);
6249
6283
  var ClientServicesProviderResource = Symbol.for("dxos.resource.ClientServices");
6250
6284
  var GET_DIAGNOSTICS_RPC_TIMEOUT = 1e4;
@@ -6260,7 +6294,7 @@ var DiagnosticsCollector = class {
6260
6294
  });
6261
6295
  const clientDiagnostics = {
6262
6296
  config,
6263
- trace: import_tracing7.TRACE_PROCESSOR.getDiagnostics()
6297
+ trace: import_tracing8.TRACE_PROCESSOR.getDiagnostics()
6264
6298
  };
6265
6299
  const diagnostics = serviceDiagnostics != null ? {
6266
6300
  client: clientDiagnostics,
@@ -6273,12 +6307,12 @@ var DiagnosticsCollector = class {
6273
6307
  }
6274
6308
  };
6275
6309
  var findSystemServiceProvider = () => {
6276
- const serviceProviders = import_tracing7.TRACE_PROCESSOR.findResourcesByAnnotation(ClientServicesProviderResource);
6310
+ const serviceProviders = import_tracing8.TRACE_PROCESSOR.findResourcesByAnnotation(ClientServicesProviderResource);
6277
6311
  const providerResource = serviceProviders.find((r) => r.instance.deref()?.services?.SystemService != null);
6278
6312
  return providerResource?.instance?.deref() ?? null;
6279
6313
  };
6280
6314
  var findConfigs = () => {
6281
- const configs = import_tracing7.TRACE_PROCESSOR.findResourcesByAnnotation(import_config.ConfigResource);
6315
+ const configs = import_tracing8.TRACE_PROCESSOR.findResourcesByAnnotation(import_config.ConfigResource);
6282
6316
  return configs.map((r) => r.instance.deref()).filter(import_util10.nonNullable);
6283
6317
  };
6284
6318
  // Annotate the CommonJS export names for ESM import in node:
@@ -6311,6 +6345,7 @@ var findConfigs = () => {
6311
6345
  createDiagnostics,
6312
6346
  createLevel,
6313
6347
  createStorageObjects,
6348
+ findPropertiesObject,
6314
6349
  getNetworkPeers,
6315
6350
  isLocked,
6316
6351
  subscribeToFeedBlocks,
@@ -6321,4 +6356,4 @@ var findConfigs = () => {
6321
6356
  subscribeToSpaces,
6322
6357
  subscribeToSwarmInfo
6323
6358
  });
6324
- //# sourceMappingURL=chunk-VYXGTUEI.cjs.map
6359
+ //# sourceMappingURL=chunk-GVGQ4FCH.cjs.map