@dxos/client-services 0.4.7-main.33db07e → 0.4.7-main.340e96b

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 (29) hide show
  1. package/dist/lib/browser/{chunk-VVD3JD7X.mjs → chunk-E5BDO7U6.mjs} +37 -25
  2. package/dist/lib/browser/{chunk-VVD3JD7X.mjs.map → chunk-E5BDO7U6.mjs.map} +3 -3
  3. package/dist/lib/browser/index.mjs +4 -2
  4. package/dist/lib/browser/index.mjs.map +2 -2
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +4 -2
  7. package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
  8. package/dist/lib/node/{chunk-2NY7O4AT.cjs → chunk-KUSFOIO4.cjs} +39 -27
  9. package/dist/lib/node/{chunk-2NY7O4AT.cjs.map → chunk-KUSFOIO4.cjs.map} +3 -3
  10. package/dist/lib/node/index.cjs +40 -38
  11. package/dist/lib/node/index.cjs.map +2 -2
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/packlets/testing/index.cjs +11 -9
  14. package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
  15. package/dist/types/src/packlets/logging/logging-service.d.ts +1 -0
  16. package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
  17. package/dist/types/src/packlets/services/service-context.d.ts +2 -0
  18. package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
  19. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  20. package/dist/types/src/packlets/vault/shared-worker-connection.d.ts.map +1 -1
  21. package/dist/types/src/version.d.ts +1 -1
  22. package/package.json +35 -35
  23. package/src/packlets/logging/logging-service.ts +9 -2
  24. package/src/packlets/services/automerge-host.test.ts +1 -1
  25. package/src/packlets/services/service-context.ts +7 -1
  26. package/src/packlets/spaces/spaces-service.ts +1 -3
  27. package/src/packlets/testing/test-builder.ts +1 -1
  28. package/src/packlets/vault/shared-worker-connection.ts +2 -0
  29. package/src/version.ts +1 -1
@@ -2671,7 +2671,7 @@ var getPlatform = () => {
2671
2671
  };
2672
2672
 
2673
2673
  // packages/sdk/client-services/src/version.ts
2674
- var DXOS_VERSION = "0.4.7-main.33db07e";
2674
+ var DXOS_VERSION = "0.4.7-main.340e96b";
2675
2675
 
2676
2676
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2677
2677
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -4225,9 +4225,7 @@ var SpacesServiceImpl = class {
4225
4225
  return {
4226
4226
  identity: {
4227
4227
  identityKey: member.key,
4228
- profile: {
4229
- displayName: member.profile?.displayName
4230
- }
4228
+ profile: member.profile ?? {}
4231
4229
  },
4232
4230
  presence: member.removed ? SpaceMember3.PresenceState.REMOVED : isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
4233
4231
  peerStates: peers
@@ -4247,6 +4245,7 @@ import { Context as Context9 } from "@dxos/context";
4247
4245
  import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
4248
4246
  import { failUndefined as failUndefined2 } from "@dxos/debug";
4249
4247
  import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore, AutomergeHost } from "@dxos/echo-pipeline";
4248
+ import { IndexMetadataStore } from "@dxos/echo-schema";
4250
4249
  import { FeedFactory, FeedStore } from "@dxos/feed-store";
4251
4250
  import { invariant as invariant13 } from "@dxos/invariant";
4252
4251
  import { Keyring } from "@dxos/keyring";
@@ -4280,6 +4279,9 @@ var ServiceContext = class {
4280
4279
  this._handlerFactories = /* @__PURE__ */ new Map();
4281
4280
  this._instanceId = PublicKey10.random().toHex();
4282
4281
  this.metadataStore = new MetadataStore(storage.createDirectory("metadata"));
4282
+ this.indexMetadata = new IndexMetadataStore({
4283
+ directory: storage.createDirectory("index-metadata")
4284
+ });
4283
4285
  this.snapshotStore = new SnapshotStore(storage.createDirectory("snapshots"));
4284
4286
  this.blobStore = new BlobStore(storage.createDirectory("blobs"));
4285
4287
  this.keyring = new Keyring(storage.createDirectory("keyring"));
@@ -4302,7 +4304,10 @@ var ServiceContext = class {
4302
4304
  snapshotStore: this.snapshotStore
4303
4305
  });
4304
4306
  this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager, this._runtimeParams);
4305
- this.automergeHost = new AutomergeHost(storage.createDirectory("automerge"));
4307
+ this.automergeHost = new AutomergeHost({
4308
+ directory: storage.createDirectory("automerge"),
4309
+ metadata: this.indexMetadata
4310
+ });
4306
4311
  this.invitations = new InvitationsHandler(this.networkManager);
4307
4312
  this._handlerFactories.set(Invitation6.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => this.identityManager.identity ?? failUndefined2(), this._acceptIdentity.bind(this)));
4308
4313
  }
@@ -4310,7 +4315,7 @@ var ServiceContext = class {
4310
4315
  await this._checkStorageVersion();
4311
4316
  log13("opening...", void 0, {
4312
4317
  F: __dxlog_file15,
4313
- L: 146,
4318
+ L: 152,
4314
4319
  S: this,
4315
4320
  C: (f, a) => f(...a)
4316
4321
  });
@@ -4318,7 +4323,7 @@ var ServiceContext = class {
4318
4323
  id: this._instanceId
4319
4324
  }), {
4320
4325
  F: __dxlog_file15,
4321
- L: 147,
4326
+ L: 153,
4322
4327
  S: this,
4323
4328
  C: (f, a) => f(...a)
4324
4329
  });
@@ -4334,13 +4339,13 @@ var ServiceContext = class {
4334
4339
  id: this._instanceId
4335
4340
  }), {
4336
4341
  F: __dxlog_file15,
4337
- L: 157,
4342
+ L: 163,
4338
4343
  S: this,
4339
4344
  C: (f, a) => f(...a)
4340
4345
  });
4341
4346
  log13("opened", void 0, {
4342
4347
  F: __dxlog_file15,
4343
- L: 158,
4348
+ L: 164,
4344
4349
  S: this,
4345
4350
  C: (f, a) => f(...a)
4346
4351
  });
@@ -4348,7 +4353,7 @@ var ServiceContext = class {
4348
4353
  async close() {
4349
4354
  log13("closing...", void 0, {
4350
4355
  F: __dxlog_file15,
4351
- L: 162,
4356
+ L: 168,
4352
4357
  S: this,
4353
4358
  C: (f, a) => f(...a)
4354
4359
  });
@@ -4366,7 +4371,7 @@ var ServiceContext = class {
4366
4371
  await this.metadataStore.close();
4367
4372
  log13("closed", void 0, {
4368
4373
  F: __dxlog_file15,
4369
- L: 175,
4374
+ L: 181,
4370
4375
  S: this,
4371
4376
  C: (f, a) => f(...a)
4372
4377
  });
@@ -4380,7 +4385,7 @@ var ServiceContext = class {
4380
4385
  const factory = this._handlerFactories.get(invitation.kind);
4381
4386
  invariant13(factory, `Unknown invitation kind: ${invitation.kind}`, {
4382
4387
  F: __dxlog_file15,
4383
- L: 186,
4388
+ L: 192,
4384
4389
  S: this,
4385
4390
  A: [
4386
4391
  "factory",
@@ -4412,7 +4417,7 @@ var ServiceContext = class {
4412
4417
  async _initialize(ctx) {
4413
4418
  log13("initializing spaces...", void 0, {
4414
4419
  F: __dxlog_file15,
4415
- L: 217,
4420
+ L: 223,
4416
4421
  S: this,
4417
4422
  C: (f, a) => f(...a)
4418
4423
  });
@@ -4435,7 +4440,7 @@ var ServiceContext = class {
4435
4440
  this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
4436
4441
  invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
4437
4442
  F: __dxlog_file15,
4438
- L: 242,
4443
+ L: 248,
4439
4444
  S: this,
4440
4445
  A: [
4441
4446
  "this.dataSpaceManager",
@@ -4459,7 +4464,7 @@ var ServiceContext = class {
4459
4464
  details: assertion
4460
4465
  }, {
4461
4466
  F: __dxlog_file15,
4462
- L: 258,
4467
+ L: 264,
4463
4468
  S: this,
4464
4469
  C: (f, a) => f(...a)
4465
4470
  });
@@ -4470,7 +4475,7 @@ var ServiceContext = class {
4470
4475
  details: assertion
4471
4476
  }, {
4472
4477
  F: __dxlog_file15,
4473
- L: 262,
4478
+ L: 268,
4474
4479
  S: this,
4475
4480
  C: (f, a) => f(...a)
4476
4481
  });
@@ -4481,7 +4486,7 @@ var ServiceContext = class {
4481
4486
  details: assertion
4482
4487
  }, {
4483
4488
  F: __dxlog_file15,
4484
- L: 267,
4489
+ L: 273,
4485
4490
  S: this,
4486
4491
  C: (f, a) => f(...a)
4487
4492
  });
@@ -4492,7 +4497,7 @@ var ServiceContext = class {
4492
4497
  } catch (err) {
4493
4498
  log13.catch(err, void 0, {
4494
4499
  F: __dxlog_file15,
4495
- L: 273,
4500
+ L: 279,
4496
4501
  S: this,
4497
4502
  C: (f, a) => f(...a)
4498
4503
  });
@@ -4718,7 +4723,7 @@ import { DocumentModel as DocumentModel2 } from "@dxos/document-model";
4718
4723
  import { DataServiceImpl } from "@dxos/echo-pipeline";
4719
4724
  import { getRawDoc, getAutomergeObjectCore } from "@dxos/echo-schema";
4720
4725
  import { invariant as invariant15 } from "@dxos/invariant";
4721
- import { PublicKey as PublicKey11 } from "@dxos/keys";
4726
+ import { PublicKey as PublicKey12 } from "@dxos/keys";
4722
4727
  import { log as log16 } from "@dxos/log";
4723
4728
  import { WebsocketSignalManager } from "@dxos/messaging";
4724
4729
  import { ModelFactory } from "@dxos/model-factory";
@@ -4815,13 +4820,15 @@ var DevicesServiceImpl = class {
4815
4820
  // packages/sdk/client-services/src/packlets/logging/logging-service.ts
4816
4821
  import { Event as Event7 } from "@dxos/async";
4817
4822
  import { Stream as Stream12 } from "@dxos/codec-protobuf";
4823
+ import { PublicKey as PublicKey11 } from "@dxos/keys";
4818
4824
  import { getContextFromEntry, log as log15 } from "@dxos/log";
4819
4825
  import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
4820
- import { jsonify, numericalValues, tracer } from "@dxos/util";
4826
+ import { getDebugName, jsonify, numericalValues, tracer } from "@dxos/util";
4821
4827
  var LoggingServiceImpl = class {
4822
4828
  constructor() {
4823
4829
  this._logs = new Event7();
4824
- this._started = /* @__PURE__ */ new Date();
4830
+ this._started = Date.now();
4831
+ this._sessionId = PublicKey11.random().toHex();
4825
4832
  this._logProcessor = (_config, entry2) => {
4826
4833
  this._logs.emit(entry2);
4827
4834
  };
@@ -4897,7 +4904,12 @@ var LoggingServiceImpl = class {
4897
4904
  meta: {
4898
4905
  // TODO(dmaretskyi): Fix proto.
4899
4906
  file: entry2.meta?.F ?? "",
4900
- line: entry2.meta?.L ?? 0
4907
+ line: entry2.meta?.L ?? 0,
4908
+ scope: {
4909
+ hostSessionId: this._sessionId,
4910
+ uptimeSeconds: (Date.now() - this._started) / 1e3,
4911
+ name: getDebugName(entry2.meta?.S)
4912
+ }
4901
4913
  }
4902
4914
  };
4903
4915
  try {
@@ -5179,7 +5191,7 @@ var ClientServicesHost = class {
5179
5191
  if (this._open) {
5180
5192
  return;
5181
5193
  }
5182
- const traceId = PublicKey11.random().toHex();
5194
+ const traceId = PublicKey12.random().toHex();
5183
5195
  log16.trace("dxos.client-services.host.open", trace9.begin({
5184
5196
  id: traceId
5185
5197
  }), {
@@ -5319,7 +5331,7 @@ var ClientServicesHost = class {
5319
5331
  });
5320
5332
  }
5321
5333
  async reset() {
5322
- const traceId = PublicKey11.random().toHex();
5334
+ const traceId = PublicKey12.random().toHex();
5323
5335
  log16.trace("dxos.sdk.client-services-host.reset", trace9.begin({
5324
5336
  id: traceId
5325
5337
  }), {
@@ -5431,4 +5443,4 @@ export {
5431
5443
  createDefaultModelFactory,
5432
5444
  ClientServicesHost
5433
5445
  };
5434
- //# sourceMappingURL=chunk-VVD3JD7X.mjs.map
5446
+ //# sourceMappingURL=chunk-E5BDO7U6.mjs.map