@dxos/client-services 0.1.51-next.57ad9f3 → 0.1.51

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.
Files changed (36) hide show
  1. package/dist/lib/browser/{chunk-YPN5TDAA.mjs → chunk-2GQ7337P.mjs} +91 -44
  2. package/dist/lib/browser/chunk-2GQ7337P.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/packlets/testing/index.mjs +8 -2
  6. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  7. package/dist/lib/node/index.cjs +108 -61
  8. package/dist/lib/node/index.cjs.map +3 -3
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/packlets/testing/index.cjs +132 -79
  11. package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
  12. package/dist/types/src/packlets/devtools/devtools.d.ts +2 -1
  13. package/dist/types/src/packlets/devtools/devtools.d.ts.map +1 -1
  14. package/dist/types/src/packlets/devtools/feeds.d.ts.map +1 -1
  15. package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
  16. package/dist/types/src/packlets/logging/logging-service.d.ts +1 -1
  17. package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
  18. package/dist/types/src/packlets/services/service-context.d.ts +5 -0
  19. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  20. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  21. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  22. package/dist/types/src/packlets/testing/test-builder.d.ts +3 -0
  23. package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
  24. package/package.json +31 -30
  25. package/src/packlets/devtools/devtools.ts +7 -0
  26. package/src/packlets/devtools/feeds.ts +1 -0
  27. package/src/packlets/identity/identity-manager.test.ts +4 -1
  28. package/src/packlets/identity/identity-manager.ts +4 -1
  29. package/src/packlets/identity/identity.test.ts +40 -21
  30. package/src/packlets/logging/logging-service.ts +58 -15
  31. package/src/packlets/services/service-context.ts +7 -0
  32. package/src/packlets/spaces/data-space-manager.ts +2 -2
  33. package/src/packlets/spaces/data-space.ts +4 -1
  34. package/src/packlets/spaces/spaces-service.ts +3 -0
  35. package/src/packlets/testing/test-builder.ts +7 -0
  36. package/dist/lib/browser/chunk-YPN5TDAA.mjs.map +0 -7
@@ -92,11 +92,15 @@ var subscribeToFeeds = ({ feedStore }, { feedKeys }) => {
92
92
  }
93
93
  });
94
94
  next({
95
- feeds: Array.from(feedMap.values()).map((feed) => ({
96
- feedKey: feed.key,
97
- length: feed.properties.length,
98
- bytes: feed.core.byteLength
99
- }))
95
+ feeds: Array.from(feedMap.values()).map((feed) => {
96
+ var _a, _b;
97
+ return {
98
+ feedKey: feed.key,
99
+ length: feed.properties.length,
100
+ bytes: feed.core.byteLength,
101
+ downloaded: (_b = (_a = feed.core.bitfield) == null ? void 0 : _a.data.toBuffer()) != null ? _b : new Uint8Array()
102
+ };
103
+ })
100
104
  });
101
105
  };
102
106
  subscriptions.add(feedStore.feedOpened.on(update));
@@ -328,6 +332,11 @@ var DevtoolsServiceImpl = class {
328
332
  usageQuota: (_e = navigatorInfo == null ? void 0 : navigatorInfo.quota) != null ? _e : 0
329
333
  };
330
334
  }
335
+ async getBlobs() {
336
+ return {
337
+ blobs: await this.params.context.blobStore.list()
338
+ };
339
+ }
331
340
  async getSnapshots() {
332
341
  return {
333
342
  snapshots: await this.params.context.snapshotStore.listSnapshots()
@@ -868,7 +877,8 @@ var IdentityManager = class {
868
877
  });
869
878
  (0, import_node_assert2.default)(identityRecord.haloSpace.dataFeedKey);
870
879
  const dataFeed = await this._feedStore.openFeed(identityRecord.haloSpace.dataFeedKey, {
871
- writable: true
880
+ writable: true,
881
+ sparse: true
872
882
  });
873
883
  const space = await this._constructSpace({
874
884
  spaceRecord: identityRecord.haloSpace,
@@ -891,7 +901,7 @@ var IdentityManager = class {
891
901
  identityKey: identityRecord.identityKey
892
902
  }, {
893
903
  file: "identity-manager.ts",
894
- line: 223,
904
+ line: 226,
895
905
  scope: this,
896
906
  callSite: (f, a) => f(...a)
897
907
  });
@@ -912,7 +922,7 @@ var IdentityManager = class {
912
922
  onAuthFailure: () => {
913
923
  import_log3.log.warn("auth failure", {}, {
914
924
  file: "identity-manager.ts",
915
- line: 242,
925
+ line: 245,
916
926
  scope: this,
917
927
  callSite: (f, a) => f(...a)
918
928
  });
@@ -2140,7 +2150,7 @@ var import_log15 = require("@dxos/log");
2140
2150
  var import_messaging = require("@dxos/messaging");
2141
2151
  var import_network_manager2 = require("@dxos/network-manager");
2142
2152
  var import_protocols9 = require("@dxos/protocols");
2143
- var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
2153
+ var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
2144
2154
 
2145
2155
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
2146
2156
  var import_async10 = require("@dxos/async");
@@ -2251,6 +2261,7 @@ var isLocked = (lockPath) => import_lockfile.default.checkSync(lockPath);
2251
2261
  var import_async12 = require("@dxos/async");
2252
2262
  var import_codec_protobuf10 = require("@dxos/codec-protobuf");
2253
2263
  var import_log9 = require("@dxos/log");
2264
+ var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2254
2265
  var import_util3 = require("@dxos/util");
2255
2266
  var LoggingServiceImpl = class {
2256
2267
  constructor() {
@@ -2267,31 +2278,60 @@ var LoggingServiceImpl = class {
2267
2278
  import_log9.log.runtimeConfig.processors.splice(index, 1);
2268
2279
  }
2269
2280
  queryLogs(request) {
2270
- var _a;
2271
- const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
2272
2281
  return new import_codec_protobuf10.Stream(({ ctx, next }) => {
2273
2282
  const handler = (entry2) => {
2274
- var _a2, _b, _c;
2275
- if (((_a2 = entry2.meta) == null ? void 0 : _a2.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
2283
+ var _a, _b, _c, _d, _e;
2284
+ if (LOG_PROCESSING > 0) {
2276
2285
  return;
2277
2286
  }
2278
- if ((0, import_log9.shouldLog)(entry2, filters)) {
2279
- const record = {
2280
- ...entry2,
2281
- context: (0, import_util3.jsonify)((0, import_log9.getContextFromEntry)(entry2))
2282
- };
2283
- (_b = record.meta) == null ? true : delete _b.bugcheck;
2284
- (_c = record.meta) == null ? true : delete _c.scope;
2287
+ if (((_a = entry2.meta) == null ? void 0 : _a.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
2288
+ return;
2289
+ }
2290
+ if (!shouldLog(entry2, request)) {
2291
+ return;
2292
+ }
2293
+ const record = {
2294
+ ...entry2,
2295
+ context: (0, import_util3.jsonify)((0, import_log9.getContextFromEntry)(entry2)),
2296
+ timestamp: new Date(),
2297
+ meta: {
2298
+ // TODO(dmaretskyi): Fix proto.
2299
+ file: (_c = (_b = entry2.meta) == null ? void 0 : _b.file) != null ? _c : "",
2300
+ line: (_e = (_d = entry2.meta) == null ? void 0 : _d.line) != null ? _e : 0
2301
+ }
2302
+ };
2303
+ try {
2304
+ LOG_PROCESSING++;
2285
2305
  next(record);
2306
+ } finally {
2307
+ LOG_PROCESSING--;
2286
2308
  }
2287
2309
  };
2288
- ctx.onDispose(() => {
2289
- this._logs.off(handler);
2290
- });
2291
- this._logs.on(handler);
2310
+ this._logs.on(ctx, handler);
2292
2311
  });
2293
2312
  }
2294
2313
  };
2314
+ var matchFilter = (filter, level, path, options) => {
2315
+ switch (options) {
2316
+ case import_services7.QueryLogsRequest.MatchingOptions.INCLUSIVE:
2317
+ return level >= filter.level && (!filter.pattern || path.includes(filter.pattern));
2318
+ case import_services7.QueryLogsRequest.MatchingOptions.EXPLICIT:
2319
+ return level === filter.level && (!filter.pattern || path.includes(filter.pattern));
2320
+ }
2321
+ };
2322
+ var shouldLog = (entry2, request) => {
2323
+ var _a;
2324
+ const options = (_a = request.options) != null ? _a : import_services7.QueryLogsRequest.MatchingOptions.INCLUSIVE;
2325
+ if (request.filters === void 0) {
2326
+ return options === import_services7.QueryLogsRequest.MatchingOptions.INCLUSIVE;
2327
+ } else {
2328
+ return request.filters.some((filter) => {
2329
+ var _a2, _b;
2330
+ return matchFilter(filter, entry2.level, (_b = (_a2 = entry2.meta) == null ? void 0 : _a2.file) != null ? _b : "", options);
2331
+ });
2332
+ }
2333
+ };
2334
+ var LOG_PROCESSING = 0;
2295
2335
 
2296
2336
  // packages/sdk/client-services/src/packlets/network/network-service.ts
2297
2337
  var import_codec_protobuf11 = require("@dxos/codec-protobuf");
@@ -2333,7 +2373,7 @@ var import_credentials12 = require("@dxos/credentials");
2333
2373
  var import_keys9 = require("@dxos/keys");
2334
2374
  var import_log12 = require("@dxos/log");
2335
2375
  var import_protocols6 = require("@dxos/protocols");
2336
- var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
2376
+ var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
2337
2377
  var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
2338
2378
  var import_util6 = require("@dxos/util");
2339
2379
 
@@ -2346,7 +2386,7 @@ var import_echo_pipeline = require("@dxos/echo-pipeline");
2346
2386
  var import_errors3 = require("@dxos/errors");
2347
2387
  var import_keys8 = require("@dxos/keys");
2348
2388
  var import_log11 = require("@dxos/log");
2349
- var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2389
+ var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
2350
2390
  var import_credentials9 = require("@dxos/protocols/proto/dxos/halo/credentials");
2351
2391
  var import_timeframe = require("@dxos/timeframe");
2352
2392
  var import_util5 = require("@dxos/util");
@@ -2607,7 +2647,7 @@ var __decorate2 = function(decorators, target, key, desc) {
2607
2647
  var DataSpace = class DataSpace2 {
2608
2648
  constructor(params) {
2609
2649
  this._ctx = new import_context6.Context();
2610
- this._state = import_services7.SpaceState.CLOSED;
2650
+ this._state = import_services8.SpaceState.CLOSED;
2611
2651
  /**
2612
2652
  * Error for _state === SpaceState.ERROR.
2613
2653
  */
@@ -2661,11 +2701,11 @@ var DataSpace = class DataSpace2 {
2661
2701
  await this.notarizationPlugin.open();
2662
2702
  await this._notarizationPluginConsumer.open();
2663
2703
  await this._inner.open();
2664
- this._state = import_services7.SpaceState.INACTIVE;
2704
+ this._state = import_services8.SpaceState.INACTIVE;
2665
2705
  this.metrics.open = new Date();
2666
2706
  }
2667
2707
  async close() {
2668
- this._state = import_services7.SpaceState.CLOSED;
2708
+ this._state = import_services8.SpaceState.CLOSED;
2669
2709
  await this._ctx.dispose();
2670
2710
  await this.authVerifier.close();
2671
2711
  await this._inner.close();
@@ -2703,7 +2743,7 @@ var DataSpace = class DataSpace2 {
2703
2743
  scope: this,
2704
2744
  callSite: (f, a) => f(...a)
2705
2745
  });
2706
- this._state = import_services7.SpaceState.ERROR;
2746
+ this._state = import_services8.SpaceState.ERROR;
2707
2747
  this.error = err;
2708
2748
  this.stateUpdate.emit();
2709
2749
  } finally {
@@ -2713,10 +2753,10 @@ var DataSpace = class DataSpace2 {
2713
2753
  }
2714
2754
  async initializeDataPipeline() {
2715
2755
  var _a, _b, _c, _d;
2716
- if (this._state !== import_services7.SpaceState.INACTIVE) {
2756
+ if (this._state !== import_services8.SpaceState.INACTIVE) {
2717
2757
  throw new import_errors3.SystemError("Invalid operation");
2718
2758
  }
2719
- this._state = import_services7.SpaceState.INITIALIZING;
2759
+ this._state = import_services8.SpaceState.INITIALIZING;
2720
2760
  await this._inner.controlPipeline.state.waitUntilReachedTargetTimeframe({
2721
2761
  ctx: this._ctx,
2722
2762
  breakOnStall: false
@@ -2756,7 +2796,7 @@ var DataSpace = class DataSpace2 {
2756
2796
  callSite: (f, a) => f(...a)
2757
2797
  });
2758
2798
  await ((_b = (_a = this._callbacks).beforeReady) == null ? void 0 : _b.call(_a));
2759
- this._state = import_services7.SpaceState.READY;
2799
+ this._state = import_services8.SpaceState.READY;
2760
2800
  this.stateUpdate.emit();
2761
2801
  await ((_d = (_c = this._callbacks).afterReady) == null ? void 0 : _d.call(_c));
2762
2802
  }
@@ -2780,7 +2820,8 @@ var DataSpace = class DataSpace2 {
2780
2820
  }
2781
2821
  if (!this.inner.dataFeedKey) {
2782
2822
  const dataFeed = await this._feedStore.openFeed(await this._keyring.createKey(), {
2783
- writable: true
2823
+ writable: true,
2824
+ sparse: true
2784
2825
  });
2785
2826
  this.inner.setDataFeed(dataFeed);
2786
2827
  credentials.push(await this._signingContext.credentialSigner.createCredential({
@@ -3073,7 +3114,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3073
3114
  async waitUntilSpaceReady(spaceKey) {
3074
3115
  await (0, import_context7.cancelWithContext)(this._ctx, this.updated.waitForCondition(() => {
3075
3116
  const space = this._spaces.get(spaceKey);
3076
- return !!space && space.state === import_services8.SpaceState.READY;
3117
+ return !!space && space.state === import_services9.SpaceState.READY;
3077
3118
  }));
3078
3119
  }
3079
3120
  async _constructSpace(metadata) {
@@ -3098,7 +3139,8 @@ var DataSpaceManager = class DataSpaceManager2 {
3098
3139
  writable: true
3099
3140
  });
3100
3141
  const dataFeed = metadata.dataFeedKey && await this._feedStore.openFeed(metadata.dataFeedKey, {
3101
- writable: true
3142
+ writable: true,
3143
+ sparse: true
3102
3144
  });
3103
3145
  const space = await this._spaceManager.constructSpace({
3104
3146
  metadata,
@@ -3111,7 +3153,6 @@ var DataSpaceManager = class DataSpaceManager2 {
3111
3153
  session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
3112
3154
  remotePeerId: session.remotePeerId
3113
3155
  }));
3114
- session.addExtension("dxos.mesh.teleport.objectsync", space.snapshotManager.objectSync.createExtension());
3115
3156
  session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
3116
3157
  },
3117
3158
  onAuthFailure: () => {
@@ -3197,7 +3238,7 @@ var import_debug5 = require("@dxos/debug");
3197
3238
  var import_echo_pipeline2 = require("@dxos/echo-pipeline");
3198
3239
  var import_log13 = require("@dxos/log");
3199
3240
  var import_protocols7 = require("@dxos/protocols");
3200
- var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
3241
+ var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
3201
3242
  var import_util7 = require("@dxos/util");
3202
3243
  var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
3203
3244
  var SpacesServiceImpl = class {
@@ -3244,6 +3285,7 @@ var SpacesServiceImpl = class {
3244
3285
  for (const space of dataSpaceManager.spaces.values()) {
3245
3286
  subscriptions.add(space.stateUpdate.on(ctx, onUpdate));
3246
3287
  subscriptions.add(space.presence.updated.on(ctx, onUpdate));
3288
+ subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, onUpdate));
3247
3289
  space.inner.controlPipeline.state.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate);
3248
3290
  if (space.dataPipeline.pipelineState) {
3249
3291
  subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate));
@@ -3314,21 +3356,23 @@ var SpacesServiceImpl = class {
3314
3356
  await space.createEpoch();
3315
3357
  }
3316
3358
  _transformSpace(space) {
3317
- var _a, _b, _c, _d, _e, _f;
3359
+ var _a, _b, _c, _d, _e, _f, _g;
3318
3360
  return {
3319
3361
  spaceKey: space.key,
3320
3362
  state: space.state,
3321
3363
  error: space.error ? (0, import_protocols7.encodeError)(space.error) : void 0,
3322
3364
  pipeline: {
3323
3365
  currentEpoch: space.dataPipeline.currentEpoch,
3366
+ appliedEpoch: space.dataPipeline.appliedEpoch,
3324
3367
  controlFeeds: space.inner.controlPipeline.state.feeds.map((feed) => feed.key),
3325
3368
  currentControlTimeframe: space.inner.controlPipeline.state.timeframe,
3326
3369
  targetControlTimeframe: space.inner.controlPipeline.state.targetTimeframe,
3327
3370
  totalControlTimeframe: space.inner.controlPipeline.state.endTimeframe,
3328
3371
  dataFeeds: (_b = (_a = space.dataPipeline.pipelineState) == null ? void 0 : _a.feeds.map((feed) => feed.key)) != null ? _b : [],
3329
- currentDataTimeframe: (_c = space.dataPipeline.pipelineState) == null ? void 0 : _c.timeframe,
3330
- targetDataTimeframe: (_d = space.dataPipeline.pipelineState) == null ? void 0 : _d.targetTimeframe,
3331
- totalDataTimeframe: (_e = space.dataPipeline.pipelineState) == null ? void 0 : _e.endTimeframe
3372
+ startDataTimeframe: (_c = space.dataPipeline.pipelineState) == null ? void 0 : _c.startTimeframe,
3373
+ currentDataTimeframe: (_d = space.dataPipeline.pipelineState) == null ? void 0 : _d.timeframe,
3374
+ targetDataTimeframe: (_e = space.dataPipeline.pipelineState) == null ? void 0 : _e.targetTimeframe,
3375
+ totalDataTimeframe: (_f = space.dataPipeline.pipelineState) == null ? void 0 : _f.endTimeframe
3332
3376
  },
3333
3377
  members: Array.from(space.inner.spaceState.members.values()).map((member) => {
3334
3378
  var _a2, _b2, _c2;
@@ -3339,10 +3383,10 @@ var SpacesServiceImpl = class {
3339
3383
  displayName: (_b2 = (_a2 = member.assertion.profile) == null ? void 0 : _a2.displayName) != null ? _b2 : (0, import_util7.humanize)(member.key)
3340
3384
  }
3341
3385
  },
3342
- presence: ((_c2 = this._identityManager.identity) == null ? void 0 : _c2.identityKey.equals(member.key)) || space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE
3386
+ presence: ((_c2 = this._identityManager.identity) == null ? void 0 : _c2.identityKey.equals(member.key)) || space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? import_services10.SpaceMember.PresenceState.ONLINE : import_services10.SpaceMember.PresenceState.OFFLINE
3343
3387
  };
3344
3388
  }),
3345
- creator: (_f = space.inner.spaceState.creator) == null ? void 0 : _f.key,
3389
+ creator: (_g = space.inner.spaceState.creator) == null ? void 0 : _g.key,
3346
3390
  cache: space.cache,
3347
3391
  metrics: space.metrics
3348
3392
  };
@@ -3448,7 +3492,8 @@ var import_keyring = require("@dxos/keyring");
3448
3492
  var import_keys10 = require("@dxos/keys");
3449
3493
  var import_log14 = require("@dxos/log");
3450
3494
  var import_protocols8 = require("@dxos/protocols");
3451
- var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
3495
+ var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
3496
+ var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
3452
3497
  var ServiceContext = class {
3453
3498
  // prettier-ignore
3454
3499
  constructor(storage, networkManager, signalManager, modelFactory) {
@@ -3462,6 +3507,7 @@ var ServiceContext = class {
3462
3507
  this._instanceId = import_keys10.PublicKey.random().toHex();
3463
3508
  this.metadataStore = new import_echo_pipeline3.MetadataStore(storage.createDirectory("metadata"));
3464
3509
  this.snapshotStore = new import_echo_pipeline3.SnapshotStore(storage.createDirectory("snapshots"));
3510
+ this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
3465
3511
  this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
3466
3512
  this.feedStore = new import_feed_store4.FeedStore({
3467
3513
  factory: new import_feed_store4.FeedFactory({
@@ -3475,13 +3521,14 @@ var ServiceContext = class {
3475
3521
  this.spaceManager = new import_echo_pipeline3.SpaceManager({
3476
3522
  feedStore: this.feedStore,
3477
3523
  networkManager: this.networkManager,
3524
+ blobStore: this.blobStore,
3478
3525
  metadataStore: this.metadataStore,
3479
3526
  modelFactory: this.modelFactory,
3480
3527
  snapshotStore: this.snapshotStore
3481
3528
  });
3482
3529
  this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
3483
3530
  this.invitations = new InvitationsHandler(this.networkManager);
3484
- this._handlerFactories.set(import_services10.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => {
3531
+ this._handlerFactories.set(import_services11.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => {
3485
3532
  var _a;
3486
3533
  return (_a = this.identityManager.identity) != null ? _a : (0, import_debug6.failUndefined)();
3487
3534
  }, this._acceptIdentity.bind(this)));
@@ -3491,14 +3538,14 @@ var ServiceContext = class {
3491
3538
  id: this._instanceId
3492
3539
  }), {
3493
3540
  file: "service-context.ts",
3494
- line: 119,
3541
+ line: 126,
3495
3542
  scope: this,
3496
3543
  callSite: (f, a) => f(...a)
3497
3544
  });
3498
3545
  await this._checkStorageVersion();
3499
3546
  (0, import_log14.log)("opening...", {}, {
3500
3547
  file: "service-context.ts",
3501
- line: 123,
3548
+ line: 130,
3502
3549
  scope: this,
3503
3550
  callSite: (f, a) => f(...a)
3504
3551
  });
@@ -3511,7 +3558,7 @@ var ServiceContext = class {
3511
3558
  }
3512
3559
  (0, import_log14.log)("opened", {}, {
3513
3560
  file: "service-context.ts",
3514
- line: 131,
3561
+ line: 138,
3515
3562
  scope: this,
3516
3563
  callSite: (f, a) => f(...a)
3517
3564
  });
@@ -3519,7 +3566,7 @@ var ServiceContext = class {
3519
3566
  id: this._instanceId
3520
3567
  }), {
3521
3568
  file: "service-context.ts",
3522
- line: 132,
3569
+ line: 139,
3523
3570
  scope: this,
3524
3571
  callSite: (f, a) => f(...a)
3525
3572
  });
@@ -3528,7 +3575,7 @@ var ServiceContext = class {
3528
3575
  var _a, _b;
3529
3576
  (0, import_log14.log)("closing...", {}, {
3530
3577
  file: "service-context.ts",
3531
- line: 136,
3578
+ line: 143,
3532
3579
  scope: this,
3533
3580
  callSite: (f, a) => f(...a)
3534
3581
  });
@@ -3542,7 +3589,7 @@ var ServiceContext = class {
3542
3589
  this.dataServiceSubscriptions.clear();
3543
3590
  (0, import_log14.log)("closed", {}, {
3544
3591
  file: "service-context.ts",
3545
- line: 145,
3592
+ line: 152,
3546
3593
  scope: this,
3547
3594
  callSite: (f, a) => f(...a)
3548
3595
  });
@@ -3573,7 +3620,7 @@ var ServiceContext = class {
3573
3620
  var _a;
3574
3621
  (0, import_log14.log)("initializing spaces...", {}, {
3575
3622
  file: "service-context.ts",
3576
- line: 178,
3623
+ line: 185,
3577
3624
  scope: this,
3578
3625
  callSite: (f, a) => f(...a)
3579
3626
  });
@@ -3593,7 +3640,7 @@ var ServiceContext = class {
3593
3640
  };
3594
3641
  this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
3595
3642
  await this.dataSpaceManager.open();
3596
- this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
3643
+ this._handlerFactories.set(import_services11.Invitation.Kind.SPACE, (invitation) => {
3597
3644
  (0, import_node_assert11.default)(this.dataSpaceManager, "dataSpaceManager not initialized yet");
3598
3645
  return new SpaceInvitationProtocol(this.dataSpaceManager, signingContext, this.keyring, invitation.spaceKey);
3599
3646
  });
@@ -3612,7 +3659,7 @@ var ServiceContext = class {
3612
3659
  details: assertion
3613
3660
  }, {
3614
3661
  file: "service-context.ts",
3615
- line: 217,
3662
+ line: 224,
3616
3663
  scope: this,
3617
3664
  callSite: (f, a) => f(...a)
3618
3665
  });
@@ -3623,7 +3670,7 @@ var ServiceContext = class {
3623
3670
  details: assertion
3624
3671
  }, {
3625
3672
  file: "service-context.ts",
3626
- line: 221,
3673
+ line: 228,
3627
3674
  scope: this,
3628
3675
  callSite: (f, a) => f(...a)
3629
3676
  });
@@ -3634,7 +3681,7 @@ var ServiceContext = class {
3634
3681
  details: assertion
3635
3682
  }, {
3636
3683
  file: "service-context.ts",
3637
- line: 226,
3684
+ line: 233,
3638
3685
  scope: this,
3639
3686
  callSite: (f, a) => f(...a)
3640
3687
  });
@@ -3645,7 +3692,7 @@ var ServiceContext = class {
3645
3692
  } catch (err) {
3646
3693
  import_log14.log.catch(err, {}, {
3647
3694
  file: "service-context.ts",
3648
- line: 232,
3695
+ line: 239,
3649
3696
  scope: this,
3650
3697
  callSite: (f, a) => f(...a)
3651
3698
  });
@@ -3719,12 +3766,12 @@ var ClientServicesHost = class {
3719
3766
  this._systemService = new SystemServiceImpl({
3720
3767
  config: this._config,
3721
3768
  statusUpdate: this._statusUpdate,
3722
- getCurrentStatus: () => this.isOpen ? import_services11.SystemStatus.ACTIVE : import_services11.SystemStatus.INACTIVE,
3769
+ getCurrentStatus: () => this.isOpen ? import_services12.SystemStatus.ACTIVE : import_services12.SystemStatus.INACTIVE,
3723
3770
  onUpdateStatus: async (status) => {
3724
3771
  var _a, _b;
3725
- if (!this.isOpen && status === import_services11.SystemStatus.ACTIVE) {
3772
+ if (!this.isOpen && status === import_services12.SystemStatus.ACTIVE) {
3726
3773
  await ((_a = this._resourceLock) == null ? void 0 : _a.acquire());
3727
- } else if (this.isOpen && status === import_services11.SystemStatus.INACTIVE) {
3774
+ } else if (this.isOpen && status === import_services12.SystemStatus.INACTIVE) {
3728
3775
  await ((_b = this._resourceLock) == null ? void 0 : _b.release());
3729
3776
  }
3730
3777
  },