@dxos/client-services 0.7.5-labs.ea4b4c2 → 0.7.5-labs.f400bbc

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 (30) hide show
  1. package/dist/lib/browser/{chunk-X65X3DJU.mjs → chunk-VWZJYGCJ.mjs} +17 -15
  2. package/dist/lib/browser/chunk-VWZJYGCJ.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/testing/index.mjs +1 -1
  6. package/dist/lib/node/{chunk-2XAKPWJ6.cjs → chunk-TVKZUCQN.cjs} +19 -17
  7. package/dist/lib/node/chunk-TVKZUCQN.cjs.map +7 -0
  8. package/dist/lib/node/index.cjs +47 -47
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/testing/index.cjs +8 -8
  11. package/dist/lib/node-esm/{chunk-UCFK27SP.mjs → chunk-OEO5PHCK.mjs} +17 -15
  12. package/dist/lib/node-esm/chunk-OEO5PHCK.mjs.map +7 -0
  13. package/dist/lib/node-esm/index.mjs +1 -1
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/lib/node-esm/testing/index.mjs +1 -1
  16. package/dist/types/src/packlets/diagnostics/diagnostics-collector.d.ts.map +1 -1
  17. package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts +2 -2
  18. package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts.map +1 -1
  19. package/dist/types/src/packlets/identity/identity-service.d.ts +2 -2
  20. package/dist/types/src/packlets/services/service-host.d.ts +1 -1
  21. package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
  22. package/dist/types/src/version.d.ts +1 -1
  23. package/package.json +39 -38
  24. package/src/packlets/diagnostics/diagnostics-collector.ts +2 -2
  25. package/src/packlets/identity/identity-recovery-manager.ts +7 -5
  26. package/src/packlets/spaces/data-space.ts +2 -2
  27. package/src/version.ts +1 -1
  28. package/dist/lib/browser/chunk-X65X3DJU.mjs.map +0 -7
  29. package/dist/lib/node/chunk-2XAKPWJ6.cjs.map +0 -7
  30. package/dist/lib/node-esm/chunk-UCFK27SP.mjs.map +0 -7
@@ -32,7 +32,7 @@ __export(testing_exports, {
32
32
  sanitizeInvitation: () => sanitizeInvitation
33
33
  });
34
34
  module.exports = __toCommonJS(testing_exports);
35
- var import_chunk_2XAKPWJ6 = require("../chunk-2XAKPWJ6.cjs");
35
+ var import_chunk_TVKZUCQN = require("../chunk-TVKZUCQN.cjs");
36
36
  var import_credentials = require("@dxos/credentials");
37
37
  var import_keys = require("@dxos/keys");
38
38
  var import_async = require("@dxos/async");
@@ -235,7 +235,7 @@ var createInvitation = async (host, options) => {
235
235
  authMethod: import_services.Invitation.AuthMethod.NONE,
236
236
  ...options ?? {}
237
237
  };
238
- if (host instanceof import_chunk_2XAKPWJ6.ServiceContext) {
238
+ if (host instanceof import_chunk_TVKZUCQN.ServiceContext) {
239
239
  return host.invitationsManager.createInvitation({
240
240
  kind: import_services.Invitation.Kind.SPACE,
241
241
  ...options
@@ -245,7 +245,7 @@ var createInvitation = async (host, options) => {
245
245
  };
246
246
  var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
247
247
  invitation = sanitizeInvitation(invitation);
248
- if (guest instanceof import_chunk_2XAKPWJ6.ServiceContext) {
248
+ if (guest instanceof import_chunk_TVKZUCQN.ServiceContext) {
249
249
  return guest.invitationsManager.acceptInvitation({
250
250
  invitation,
251
251
  deviceProfile: guestDeviceProfile
@@ -255,7 +255,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
255
255
  };
256
256
  var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
257
257
  var createServiceHost = (config, signalManagerContext) => {
258
- return new import_chunk_2XAKPWJ6.ClientServicesHost({
258
+ return new import_chunk_TVKZUCQN.ClientServicesHost({
259
259
  config,
260
260
  signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
261
261
  transportFactory: import_network_manager.MemoryTransportFactory
@@ -274,7 +274,7 @@ var createServiceContext = async ({ signalManagerFactory = async () => {
274
274
  });
275
275
  const level = (0, import_testing.createTestLevel)();
276
276
  await level.open();
277
- return new import_chunk_2XAKPWJ6.ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
277
+ return new import_chunk_TVKZUCQN.ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
278
278
  invitationConnectionDefaultParams: {
279
279
  teleport: {
280
280
  controlHeartbeatInterval: 200
@@ -385,7 +385,7 @@ var TestPeer = class {
385
385
  return this._props.meshEchoReplicator ??= new import_echo_pipeline.MeshEchoReplicator();
386
386
  }
387
387
  get dataSpaceManager() {
388
- return this._props.dataSpaceManager ??= new import_chunk_2XAKPWJ6.DataSpaceManager({
388
+ return this._props.dataSpaceManager ??= new import_chunk_TVKZUCQN.DataSpaceManager({
389
389
  spaceManager: this.spaceManager,
390
390
  metadataStore: this.metadataStore,
391
391
  keyring: this.keyring,
@@ -400,9 +400,9 @@ var TestPeer = class {
400
400
  });
401
401
  }
402
402
  get invitationsManager() {
403
- return this._props.invitationsManager ??= new import_chunk_2XAKPWJ6.InvitationsManager(new import_chunk_2XAKPWJ6.InvitationsHandler(this.networkManager), (invitation) => {
403
+ return this._props.invitationsManager ??= new import_chunk_TVKZUCQN.InvitationsManager(new import_chunk_TVKZUCQN.InvitationsHandler(this.networkManager), (invitation) => {
404
404
  if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
405
- return new import_chunk_2XAKPWJ6.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
405
+ return new import_chunk_TVKZUCQN.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
406
406
  } else {
407
407
  throw new Error("not implemented");
408
408
  }
@@ -397,7 +397,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
397
397
  import { TRACE_PROCESSOR } from "@dxos/tracing";
398
398
 
399
399
  // packages/sdk/client-services/src/version.ts
400
- var DXOS_VERSION = "0.7.5-labs.ea4b4c2";
400
+ var DXOS_VERSION = "0.7.5-labs.f400bbc";
401
401
 
402
402
  // packages/sdk/client-services/src/packlets/services/platform.ts
403
403
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -571,7 +571,7 @@ import { ClientServicesProviderResource } from "@dxos/client-protocol";
571
571
  import { ConfigResource } from "@dxos/config";
572
572
  import { GetDiagnosticsRequest } from "@dxos/protocols/proto/dxos/client/services";
573
573
  import { TRACE_PROCESSOR as TRACE_PROCESSOR2 } from "@dxos/tracing";
574
- import { jsonKeyReplacer, nonNullable } from "@dxos/util";
574
+ import { jsonKeyReplacer, isNonNullable } from "@dxos/util";
575
575
  var GET_DIAGNOSTICS_RPC_TIMEOUT = 1e4;
576
576
  var DiagnosticsCollector = class {
577
577
  static {
@@ -604,7 +604,7 @@ var findSystemServiceProvider = () => {
604
604
  };
605
605
  var findConfigs = () => {
606
606
  const configs = TRACE_PROCESSOR2.findResourcesByAnnotation(ConfigResource);
607
- return configs.map((r) => r.instance.deref()).filter(nonNullable);
607
+ return configs.map((r) => r.instance.deref()).filter(isNonNullable);
608
608
  };
609
609
 
610
610
  // packages/sdk/client-services/src/packlets/identity/authenticator.ts
@@ -7285,7 +7285,7 @@ var EdgeIdentityRecoveryManager = class {
7285
7285
  this._identityProvider = _identityProvider;
7286
7286
  this._acceptRecoveredIdentity = _acceptRecoveredIdentity;
7287
7287
  }
7288
- async createRecoveryCredential({ recoveryKey, algorithm }) {
7288
+ async createRecoveryCredential({ recoveryKey, lookupKey, algorithm }) {
7289
7289
  const identity = this._identityProvider();
7290
7290
  invariant20(identity, void 0, {
7291
7291
  F: __dxlog_file26,
@@ -7297,15 +7297,16 @@ var EdgeIdentityRecoveryManager = class {
7297
7297
  ]
7298
7298
  });
7299
7299
  let recoveryCode;
7300
- if (!recoveryKey) {
7300
+ if (!recoveryKey || !lookupKey) {
7301
7301
  recoveryCode = generateSeedPhrase();
7302
7302
  const keypair = keyPairFromSeedPhrase(recoveryCode);
7303
7303
  recoveryKey = PublicKey14.from(keypair.publicKey);
7304
+ lookupKey = PublicKey14.random();
7304
7305
  algorithm = "ED25519";
7305
7306
  }
7306
7307
  invariant20(algorithm, "Algorithm is required.", {
7307
7308
  F: __dxlog_file26,
7308
- L: 47,
7309
+ L: 48,
7309
7310
  S: this,
7310
7311
  A: [
7311
7312
  "algorithm",
@@ -7319,7 +7320,8 @@ var EdgeIdentityRecoveryManager = class {
7319
7320
  "@type": "dxos.halo.credentials.IdentityRecovery",
7320
7321
  recoveryKey,
7321
7322
  identityKey,
7322
- algorithm
7323
+ algorithm,
7324
+ lookupKey
7323
7325
  }
7324
7326
  });
7325
7327
  const receipt = await identity.controlPipeline.writer.write({
@@ -7340,7 +7342,7 @@ var EdgeIdentityRecoveryManager = class {
7340
7342
  async requestRecoveryChallenge() {
7341
7343
  invariant20(this._edgeClient, "Not connected to EDGE.", {
7342
7344
  F: __dxlog_file26,
7343
- L: 66,
7345
+ L: 68,
7344
7346
  S: this,
7345
7347
  A: [
7346
7348
  "this._edgeClient",
@@ -7367,10 +7369,10 @@ var EdgeIdentityRecoveryManager = class {
7367
7369
  };
7368
7370
  }
7369
7371
  }
7370
- async recoverIdentityWithExternalSignature({ identityDid, deviceKey, controlFeedKey, signature, clientDataJson, authenticatorData }) {
7372
+ async recoverIdentityWithExternalSignature({ lookupKey, deviceKey, controlFeedKey, signature, clientDataJson, authenticatorData }) {
7371
7373
  invariant20(this._edgeClient, "Not connected to EDGE.", {
7372
7374
  F: __dxlog_file26,
7373
- L: 98,
7375
+ L: 100,
7374
7376
  S: this,
7375
7377
  A: [
7376
7378
  "this._edgeClient",
@@ -7378,7 +7380,7 @@ var EdgeIdentityRecoveryManager = class {
7378
7380
  ]
7379
7381
  });
7380
7382
  const request = {
7381
- identityDid,
7383
+ lookupKey: lookupKey.toHex(),
7382
7384
  deviceKey: deviceKey.toHex(),
7383
7385
  controlFeedKey: controlFeedKey.toHex(),
7384
7386
  signature: clientDataJson && authenticatorData ? {
@@ -7401,7 +7403,7 @@ var EdgeIdentityRecoveryManager = class {
7401
7403
  async recoverIdentity({ recoveryCode }) {
7402
7404
  invariant20(this._edgeClient, "Not connected to EDGE.", {
7403
7405
  F: __dxlog_file26,
7404
- L: 128,
7406
+ L: 130,
7405
7407
  S: this,
7406
7408
  A: [
7407
7409
  "this._edgeClient",
@@ -7413,7 +7415,7 @@ var EdgeIdentityRecoveryManager = class {
7413
7415
  const deviceKey = await this._keyring.createKey();
7414
7416
  const controlFeedKey = await this._keyring.createKey();
7415
7417
  const request = {
7416
- recoveryKey: recoveryKey.toHex(),
7418
+ lookupKey: recoveryKey.toHex(),
7417
7419
  deviceKey: deviceKey.toHex(),
7418
7420
  controlFeedKey: controlFeedKey.toHex()
7419
7421
  };
@@ -7432,7 +7434,7 @@ var EdgeIdentityRecoveryManager = class {
7432
7434
  }
7433
7435
  log22.info("recovering identity", response, {
7434
7436
  F: __dxlog_file26,
7435
- L: 154,
7437
+ L: 156,
7436
7438
  S: this,
7437
7439
  C: (f, a) => f(...a)
7438
7440
  });
@@ -9034,4 +9036,4 @@ export {
9034
9036
  importProfileData,
9035
9037
  ClientServicesHost
9036
9038
  };
9037
- //# sourceMappingURL=chunk-UCFK27SP.mjs.map
9039
+ //# sourceMappingURL=chunk-OEO5PHCK.mjs.map