@dxos/client-services 0.1.52 → 0.1.53-main.032dce6

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.
@@ -315,8 +315,10 @@ var DevtoolsServiceImpl = class {
315
315
  });
316
316
  });
317
317
  }
318
- getConfig(request) {
319
- throw new Error();
318
+ async getConfig(request) {
319
+ return {
320
+ config: JSON.stringify(this.params.config.values)
321
+ };
320
322
  }
321
323
  async getStorageInfo() {
322
324
  var _a, _b, _c, _d, _e;
@@ -3028,7 +3030,6 @@ var import_log11 = require("@dxos/log");
3028
3030
  var import_protocols7 = require("@dxos/protocols");
3029
3031
  var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
3030
3032
  var import_util6 = require("@dxos/util");
3031
- var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
3032
3033
  var SpacesServiceImpl = class {
3033
3034
  constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
3034
3035
  this._identityManager = _identityManager;
@@ -3042,16 +3043,16 @@ var SpacesServiceImpl = class {
3042
3043
  }
3043
3044
  const dataSpaceManager = await this._getDataSpaceManager();
3044
3045
  const space = await dataSpaceManager.createSpace();
3045
- return this._transformSpace(space);
3046
+ return this._serializeSpace(space);
3046
3047
  }
3047
3048
  async updateSpace(request) {
3048
3049
  (0, import_debug5.todo)();
3049
3050
  }
3050
3051
  querySpaces() {
3051
3052
  return new import_codec_protobuf9.Stream(({ next, ctx }) => {
3052
- const onUpdate = async () => {
3053
+ const scheduler = new import_async13.UpdateScheduler(ctx, async () => {
3053
3054
  const dataSpaceManager = await this._getDataSpaceManager();
3054
- const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._transformSpace(space));
3055
+ const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
3055
3056
  (0, import_log11.log)("update", {
3056
3057
  spaces
3057
3058
  }, {
@@ -3063,7 +3064,9 @@ var SpacesServiceImpl = class {
3063
3064
  next({
3064
3065
  spaces
3065
3066
  });
3066
- };
3067
+ }, {
3068
+ maxFrequency: 2
3069
+ });
3067
3070
  (0, import_async13.scheduleTask)(ctx, async () => {
3068
3071
  const dataSpaceManager = await this._getDataSpaceManager();
3069
3072
  const subscriptions = new import_async13.EventSubscriptions();
@@ -3071,21 +3074,21 @@ var SpacesServiceImpl = class {
3071
3074
  const subscribeSpaces = () => {
3072
3075
  subscriptions.clear();
3073
3076
  for (const space of dataSpaceManager.spaces.values()) {
3074
- subscriptions.add(space.stateUpdate.on(ctx, onUpdate));
3075
- subscriptions.add(space.presence.updated.on(ctx, onUpdate));
3076
- subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, onUpdate));
3077
- space.inner.controlPipeline.state.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate);
3077
+ subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.trigger()));
3078
+ subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
3079
+ subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, () => scheduler.trigger()));
3080
+ space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger());
3078
3081
  if (space.dataPipeline.pipelineState) {
3079
- subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate));
3082
+ subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.on(ctx, () => scheduler.trigger()));
3080
3083
  }
3081
3084
  }
3082
3085
  };
3083
3086
  dataSpaceManager.updated.on(ctx, () => {
3084
3087
  subscribeSpaces();
3085
- void onUpdate();
3088
+ scheduler.trigger();
3086
3089
  });
3087
3090
  subscribeSpaces();
3088
- void onUpdate();
3091
+ scheduler.trigger();
3089
3092
  });
3090
3093
  if (!this._identityManager.identity) {
3091
3094
  next({
@@ -3143,7 +3146,7 @@ var SpacesServiceImpl = class {
3143
3146
  const space = (_a = dataSpaceManager.spaces.get(spaceKey)) != null ? _a : (0, import_debug5.raise)(new import_echo_pipeline2.SpaceNotFoundError(spaceKey));
3144
3147
  await space.createEpoch();
3145
3148
  }
3146
- _transformSpace(space) {
3149
+ _serializeSpace(space) {
3147
3150
  var _a, _b, _c, _d, _e, _f, _g;
3148
3151
  return {
3149
3152
  spaceKey: space.key,
@@ -3723,6 +3726,16 @@ var ServiceRegistry = class {
3723
3726
  };
3724
3727
 
3725
3728
  // packages/sdk/client-services/src/packlets/services/service-host.ts
3729
+ var __decorate4 = function(decorators, target, key, desc) {
3730
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3731
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3732
+ r = Reflect.decorate(decorators, target, key, desc);
3733
+ else
3734
+ for (var i = decorators.length - 1; i >= 0; i--)
3735
+ if (d = decorators[i])
3736
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3737
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3738
+ };
3726
3739
  var ClientServicesHost = class {
3727
3740
  constructor({
3728
3741
  config,
@@ -3827,7 +3840,7 @@ var ClientServicesHost = class {
3827
3840
  id: traceId
3828
3841
  }), {
3829
3842
  file: "service-host.ts",
3830
- line: 187,
3843
+ line: 188,
3831
3844
  scope: this,
3832
3845
  callSite: (f, a) => f(...a)
3833
3846
  });
@@ -3840,7 +3853,7 @@ var ClientServicesHost = class {
3840
3853
  lockKey: (_a = this._resourceLock) == null ? void 0 : _a.lockKey
3841
3854
  }, {
3842
3855
  file: "service-host.ts",
3843
- line: 195,
3856
+ line: 196,
3844
3857
  scope: this,
3845
3858
  callSite: (f, a) => f(...a)
3846
3859
  });
@@ -3875,7 +3888,7 @@ var ClientServicesHost = class {
3875
3888
  deviceKey
3876
3889
  }, {
3877
3890
  file: "service-host.ts",
3878
- line: 250,
3891
+ line: 251,
3879
3892
  scope: this,
3880
3893
  callSite: (f, a) => f(...a)
3881
3894
  });
@@ -3883,7 +3896,7 @@ var ClientServicesHost = class {
3883
3896
  id: traceId
3884
3897
  }), {
3885
3898
  file: "service-host.ts",
3886
- line: 251,
3899
+ line: 252,
3887
3900
  scope: this,
3888
3901
  callSite: (f, a) => f(...a)
3889
3902
  });
@@ -3898,7 +3911,7 @@ var ClientServicesHost = class {
3898
3911
  deviceKey
3899
3912
  }, {
3900
3913
  file: "service-host.ts",
3901
- line: 260,
3914
+ line: 262,
3902
3915
  scope: this,
3903
3916
  callSite: (f, a) => f(...a)
3904
3917
  });
@@ -3913,7 +3926,7 @@ var ClientServicesHost = class {
3913
3926
  deviceKey
3914
3927
  }, {
3915
3928
  file: "service-host.ts",
3916
- line: 266,
3929
+ line: 268,
3917
3930
  scope: this,
3918
3931
  callSite: (f, a) => f(...a)
3919
3932
  });
@@ -3925,13 +3938,13 @@ var ClientServicesHost = class {
3925
3938
  id: traceId
3926
3939
  }), {
3927
3940
  file: "service-host.ts",
3928
- line: 271,
3941
+ line: 273,
3929
3942
  scope: this,
3930
3943
  callSite: (f, a) => f(...a)
3931
3944
  });
3932
3945
  (0, import_log15.log)("resetting...", {}, {
3933
3946
  file: "service-host.ts",
3934
- line: 273,
3947
+ line: 275,
3935
3948
  scope: this,
3936
3949
  callSite: (f, a) => f(...a)
3937
3950
  });
@@ -3939,7 +3952,7 @@ var ClientServicesHost = class {
3939
3952
  await this._storage.reset();
3940
3953
  (0, import_log15.log)("reset", {}, {
3941
3954
  file: "service-host.ts",
3942
- line: 276,
3955
+ line: 278,
3943
3956
  scope: this,
3944
3957
  callSite: (f, a) => f(...a)
3945
3958
  });
@@ -3947,12 +3960,18 @@ var ClientServicesHost = class {
3947
3960
  id: traceId
3948
3961
  }), {
3949
3962
  file: "service-host.ts",
3950
- line: 277,
3963
+ line: 279,
3951
3964
  scope: this,
3952
3965
  callSite: (f, a) => f(...a)
3953
3966
  });
3954
3967
  }
3955
3968
  };
3969
+ __decorate4([
3970
+ import_async17.synchronized
3971
+ ], ClientServicesHost.prototype, "open", null);
3972
+ __decorate4([
3973
+ import_async17.synchronized
3974
+ ], ClientServicesHost.prototype, "close", null);
3956
3975
 
3957
3976
  // packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
3958
3977
  var import_async19 = require("@dxos/async");
@@ -4105,7 +4124,7 @@ var MemoryShellRuntime = class {
4105
4124
  };
4106
4125
 
4107
4126
  // packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
4108
- var __decorate4 = function(decorators, target, key, desc) {
4127
+ var __decorate5 = function(decorators, target, key, desc) {
4109
4128
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4110
4129
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4111
4130
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4219,7 +4238,7 @@ var IFrameHostRuntime = class {
4219
4238
  });
4220
4239
  }
4221
4240
  };
4222
- __decorate4([
4241
+ __decorate5([
4223
4242
  import_log16.logInfo
4224
4243
  ], IFrameHostRuntime.prototype, "origin", void 0);
4225
4244
 
@@ -4313,7 +4332,7 @@ var import_client_protocol9 = require("@dxos/client-protocol");
4313
4332
  var import_log18 = require("@dxos/log");
4314
4333
  var import_rpc4 = require("@dxos/rpc");
4315
4334
  var import_util11 = require("@dxos/util");
4316
- var __decorate5 = function(decorators, target, key, desc) {
4335
+ var __decorate6 = function(decorators, target, key, desc) {
4317
4336
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4318
4337
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4319
4338
  r = Reflect.decorate(decorators, target, key, desc);
@@ -4448,10 +4467,10 @@ var WorkerSession = class {
4448
4467
  }).then(callback);
4449
4468
  }
4450
4469
  };
4451
- __decorate5([
4470
+ __decorate6([
4452
4471
  import_log18.logInfo
4453
4472
  ], WorkerSession.prototype, "origin", void 0);
4454
- __decorate5([
4473
+ __decorate6([
4455
4474
  import_log18.logInfo
4456
4475
  ], WorkerSession.prototype, "lockKey", void 0);
4457
4476