@dxos/client-services 0.5.5-next.8e7c8c8 → 0.5.6-main.04fedb4

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.
@@ -4745,6 +4745,7 @@ import { invariant as invariant14 } from "@dxos/invariant";
4745
4745
  import { log as log13 } from "@dxos/log";
4746
4746
  import { ApiError, SpaceNotFoundError as SpaceNotFoundError2, encodeError, IdentityNotInitializedError, AuthorizationError as AuthorizationError2 } from "@dxos/protocols";
4747
4747
  import { SpaceMember as SpaceMember6, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
4748
+ import { trace as trace8 } from "@dxos/tracing";
4748
4749
  var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
4749
4750
  var SpacesServiceImpl = class {
4750
4751
  constructor(_identityManager, _spaceManager, _getDataSpaceManager) {
@@ -4756,6 +4757,7 @@ var SpacesServiceImpl = class {
4756
4757
  this._requireIdentity();
4757
4758
  const dataSpaceManager = await this._getDataSpaceManager();
4758
4759
  const space = await dataSpaceManager.createSpace();
4760
+ await this._updateMetrics();
4759
4761
  return this._serializeSpace(space);
4760
4762
  }
4761
4763
  async updateSpace({ spaceKey, state }) {
@@ -4789,7 +4791,7 @@ var SpacesServiceImpl = class {
4789
4791
  const credentials = await createAdmissionCredentials2(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
4790
4792
  invariant14(credentials[0].credential, void 0, {
4791
4793
  F: __dxlog_file15,
4792
- L: 95,
4794
+ L: 97,
4793
4795
  S: this,
4794
4796
  A: [
4795
4797
  "credentials[0].credential",
@@ -4799,7 +4801,7 @@ var SpacesServiceImpl = class {
4799
4801
  const spaceMemberCredential = credentials[0].credential.credential;
4800
4802
  invariant14(getCredentialAssertion3(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
4801
4803
  F: __dxlog_file15,
4802
- L: 97,
4804
+ L: 99,
4803
4805
  S: this,
4804
4806
  A: [
4805
4807
  "getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
@@ -4817,10 +4819,11 @@ var SpacesServiceImpl = class {
4817
4819
  spaces
4818
4820
  }, {
4819
4821
  F: __dxlog_file15,
4820
- L: 108,
4822
+ L: 110,
4821
4823
  S: this,
4822
4824
  C: (f, a) => f(...a)
4823
4825
  });
4826
+ await this._updateMetrics();
4824
4827
  next({
4825
4828
  spaces
4826
4829
  });
@@ -4900,7 +4903,7 @@ var SpacesServiceImpl = class {
4900
4903
  } else {
4901
4904
  invariant14(!credential.id, "Id on unsigned credentials is not allowed", {
4902
4905
  F: __dxlog_file15,
4903
- L: 195,
4906
+ L: 198,
4904
4907
  S: this,
4905
4908
  A: [
4906
4909
  "!credential.id",
@@ -4909,7 +4912,7 @@ var SpacesServiceImpl = class {
4909
4912
  });
4910
4913
  invariant14(this._identityManager.identity, "Identity is not available", {
4911
4914
  F: __dxlog_file15,
4912
- L: 196,
4915
+ L: 199,
4913
4916
  S: this,
4914
4917
  A: [
4915
4918
  "this._identityManager.identity",
@@ -4919,7 +4922,7 @@ var SpacesServiceImpl = class {
4919
4922
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
4920
4923
  invariant14(credential.issuer.equals(signer.getIssuer()), void 0, {
4921
4924
  F: __dxlog_file15,
4922
- L: 198,
4925
+ L: 201,
4923
4926
  S: this,
4924
4927
  A: [
4925
4928
  "credential.issuer.equals(signer.getIssuer())",
@@ -4990,6 +4993,17 @@ var SpacesServiceImpl = class {
4990
4993
  }
4991
4994
  return this._identityManager.identity;
4992
4995
  }
4996
+ async _updateMetrics() {
4997
+ const dataSpaceManager = await this._getDataSpaceManager();
4998
+ const identity = this._identityManager.identity?.identityKey.truncate();
4999
+ if (identity) {
5000
+ trace8.metrics.gauge("echo.space.count", dataSpaceManager.spaces.size, {
5001
+ tags: {
5002
+ identity
5003
+ }
5004
+ });
5005
+ }
5006
+ }
4993
5007
  };
4994
5008
  var getChannelId = (channel) => `user-channel/${channel}`;
4995
5009
 
@@ -5005,7 +5019,7 @@ import { invariant as invariant15 } from "@dxos/invariant";
5005
5019
  import { Keyring } from "@dxos/keyring";
5006
5020
  import { PublicKey as PublicKey12 } from "@dxos/keys";
5007
5021
  import { log as log14 } from "@dxos/log";
5008
- import { InvalidStorageVersionError, STORAGE_VERSION, trace as trace8 } from "@dxos/protocols";
5022
+ import { InvalidStorageVersionError, STORAGE_VERSION, trace as trace9 } from "@dxos/protocols";
5009
5023
  import { Invitation as Invitation8 } from "@dxos/protocols/proto/dxos/client/services";
5010
5024
  import { BlobStore } from "@dxos/teleport-extension-object-sync";
5011
5025
  import { trace as Trace3 } from "@dxos/tracing";
@@ -5070,7 +5084,7 @@ var ServiceContext = class extends Resource {
5070
5084
  S: this,
5071
5085
  C: (f, a) => f(...a)
5072
5086
  });
5073
- log14.trace("dxos.sdk.service-context.open", trace8.begin({
5087
+ log14.trace("dxos.sdk.service-context.open", trace9.begin({
5074
5088
  id: this._instanceId
5075
5089
  }), {
5076
5090
  F: __dxlog_file16,
@@ -5096,7 +5110,7 @@ var ServiceContext = class extends Resource {
5096
5110
  S: this,
5097
5111
  C: (f, a) => f(...a)
5098
5112
  });
5099
- log14.trace("dxos.sdk.service-context.open", trace8.end({
5113
+ log14.trace("dxos.sdk.service-context.open", trace9.end({
5100
5114
  id: this._instanceId
5101
5115
  }), {
5102
5116
  F: __dxlog_file16,
@@ -5312,7 +5326,7 @@ import { SpaceMember as SpaceMember7 } from "@dxos/protocols/proto/dxos/client/s
5312
5326
  import { TRACE_PROCESSOR } from "@dxos/tracing";
5313
5327
 
5314
5328
  // packages/sdk/client-services/src/version.ts
5315
- var DXOS_VERSION = "0.5.5-next.8e7c8c8";
5329
+ var DXOS_VERSION = "0.5.6-main.04fedb4";
5316
5330
 
5317
5331
  // packages/sdk/client-services/src/packlets/services/platform.ts
5318
5332
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -5574,7 +5588,7 @@ import { PublicKey as PublicKey15 } from "@dxos/keys";
5574
5588
  import { log as log18 } from "@dxos/log";
5575
5589
  import { WebsocketSignalManager } from "@dxos/messaging";
5576
5590
  import { NetworkManager, createSimplePeerTransportFactory } from "@dxos/network-manager";
5577
- import { trace as trace9 } from "@dxos/protocols";
5591
+ import { trace as trace10 } from "@dxos/protocols";
5578
5592
  import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
5579
5593
  import { TRACE_PROCESSOR as TRACE_PROCESSOR2, trace as Trace4 } from "@dxos/tracing";
5580
5594
  import { assignDeep as assignDeep2 } from "@dxos/util";
@@ -6241,7 +6255,7 @@ var ClientServicesHost = class {
6241
6255
  return;
6242
6256
  }
6243
6257
  const traceId = PublicKey15.random().toHex();
6244
- log18.trace("dxos.client-services.host.open", trace9.begin({
6258
+ log18.trace("dxos.client-services.host.open", trace10.begin({
6245
6259
  id: traceId
6246
6260
  }), {
6247
6261
  F: __dxlog_file21,
@@ -6346,7 +6360,7 @@ var ClientServicesHost = class {
6346
6360
  S: this,
6347
6361
  C: (f, a) => f(...a)
6348
6362
  });
6349
- log18.trace("dxos.client-services.host.open", trace9.end({
6363
+ log18.trace("dxos.client-services.host.open", trace10.end({
6350
6364
  id: traceId
6351
6365
  }), {
6352
6366
  F: __dxlog_file21,
@@ -6389,7 +6403,7 @@ var ClientServicesHost = class {
6389
6403
  }
6390
6404
  async reset() {
6391
6405
  const traceId = PublicKey15.random().toHex();
6392
- log18.trace("dxos.sdk.client-services-host.reset", trace9.begin({
6406
+ log18.trace("dxos.sdk.client-services-host.reset", trace10.begin({
6393
6407
  id: traceId
6394
6408
  }), {
6395
6409
  F: __dxlog_file21,
@@ -6411,7 +6425,7 @@ var ClientServicesHost = class {
6411
6425
  S: this,
6412
6426
  C: (f, a) => f(...a)
6413
6427
  });
6414
- log18.trace("dxos.sdk.client-services-host.reset", trace9.end({
6428
+ log18.trace("dxos.sdk.client-services-host.reset", trace10.end({
6415
6429
  id: traceId
6416
6430
  }), {
6417
6431
  F: __dxlog_file21,
@@ -6559,4 +6573,4 @@ export {
6559
6573
  ClientServicesHost,
6560
6574
  ClientServicesProviderResource
6561
6575
  };
6562
- //# sourceMappingURL=chunk-JSVR6DBG.mjs.map
6576
+ //# sourceMappingURL=chunk-NHNUD4SR.mjs.map