@dxos/client-services 0.1.53-main.3ecc504 → 0.1.53-main.602887f

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.
@@ -248,8 +248,10 @@ var DevtoolsServiceImpl = class {
248
248
  });
249
249
  });
250
250
  }
251
- getConfig(request) {
252
- throw new Error();
251
+ async getConfig(request) {
252
+ return {
253
+ config: JSON.stringify(this.params.config.values)
254
+ };
253
255
  }
254
256
  async getStorageInfo() {
255
257
  var _a, _b, _c, _d, _e;
@@ -2939,7 +2941,7 @@ DataSpaceManager = __decorate2([
2939
2941
  ], DataSpaceManager);
2940
2942
 
2941
2943
  // packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
2942
- import { EventSubscriptions as EventSubscriptions2, scheduleTask as scheduleTask5 } from "@dxos/async";
2944
+ import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTask as scheduleTask5 } from "@dxos/async";
2943
2945
  import { Stream as Stream9 } from "@dxos/codec-protobuf";
2944
2946
  import { raise, todo as todo2 } from "@dxos/debug";
2945
2947
  import { SpaceNotFoundError } from "@dxos/echo-pipeline";
@@ -2947,7 +2949,6 @@ import { log as log11 } from "@dxos/log";
2947
2949
  import { encodeError } from "@dxos/protocols";
2948
2950
  import { SpaceMember as SpaceMember2 } from "@dxos/protocols/proto/dxos/client/services";
2949
2951
  import { humanize } from "@dxos/util";
2950
- var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
2951
2952
  var SpacesServiceImpl = class {
2952
2953
  constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
2953
2954
  this._identityManager = _identityManager;
@@ -2961,16 +2962,16 @@ var SpacesServiceImpl = class {
2961
2962
  }
2962
2963
  const dataSpaceManager = await this._getDataSpaceManager();
2963
2964
  const space = await dataSpaceManager.createSpace();
2964
- return this._transformSpace(space);
2965
+ return this._serializeSpace(space);
2965
2966
  }
2966
2967
  async updateSpace(request) {
2967
2968
  todo2();
2968
2969
  }
2969
2970
  querySpaces() {
2970
2971
  return new Stream9(({ next, ctx }) => {
2971
- const onUpdate = async () => {
2972
+ const scheduler = new UpdateScheduler(ctx, async () => {
2972
2973
  const dataSpaceManager = await this._getDataSpaceManager();
2973
- const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._transformSpace(space));
2974
+ const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
2974
2975
  log11("update", {
2975
2976
  spaces
2976
2977
  }, {
@@ -2982,7 +2983,9 @@ var SpacesServiceImpl = class {
2982
2983
  next({
2983
2984
  spaces
2984
2985
  });
2985
- };
2986
+ }, {
2987
+ maxFrequency: 2
2988
+ });
2986
2989
  scheduleTask5(ctx, async () => {
2987
2990
  const dataSpaceManager = await this._getDataSpaceManager();
2988
2991
  const subscriptions = new EventSubscriptions2();
@@ -2990,21 +2993,21 @@ var SpacesServiceImpl = class {
2990
2993
  const subscribeSpaces = () => {
2991
2994
  subscriptions.clear();
2992
2995
  for (const space of dataSpaceManager.spaces.values()) {
2993
- subscriptions.add(space.stateUpdate.on(ctx, onUpdate));
2994
- subscriptions.add(space.presence.updated.on(ctx, onUpdate));
2995
- subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, onUpdate));
2996
- space.inner.controlPipeline.state.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate);
2996
+ subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.trigger()));
2997
+ subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
2998
+ subscriptions.add(space.dataPipeline.onNewEpoch.on(ctx, () => scheduler.trigger()));
2999
+ space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger());
2997
3000
  if (space.dataPipeline.pipelineState) {
2998
- subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.debounce(TIMEFRAME_UPDATE_DEBOUNCE_TIME).on(ctx, onUpdate));
3001
+ subscriptions.add(space.dataPipeline.pipelineState.timeframeUpdate.on(ctx, () => scheduler.trigger()));
2999
3002
  }
3000
3003
  }
3001
3004
  };
3002
3005
  dataSpaceManager.updated.on(ctx, () => {
3003
3006
  subscribeSpaces();
3004
- void onUpdate();
3007
+ scheduler.trigger();
3005
3008
  });
3006
3009
  subscribeSpaces();
3007
- void onUpdate();
3010
+ scheduler.trigger();
3008
3011
  });
3009
3012
  if (!this._identityManager.identity) {
3010
3013
  next({
@@ -3062,7 +3065,7 @@ var SpacesServiceImpl = class {
3062
3065
  const space = (_a = dataSpaceManager.spaces.get(spaceKey)) != null ? _a : raise(new SpaceNotFoundError(spaceKey));
3063
3066
  await space.createEpoch();
3064
3067
  }
3065
- _transformSpace(space) {
3068
+ _serializeSpace(space) {
3066
3069
  var _a, _b, _c, _d, _e, _f, _g;
3067
3070
  return {
3068
3071
  spaceKey: space.key,
@@ -4004,4 +4007,4 @@ export {
4004
4007
  ServiceRegistry,
4005
4008
  ClientServicesHost
4006
4009
  };
4007
- //# sourceMappingURL=chunk-5JZKP3BY.mjs.map
4010
+ //# sourceMappingURL=chunk-6ITWCQIT.mjs.map