@dxos/client-services 0.3.2 → 0.3.3-main.006ca4d

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.
@@ -344,7 +344,7 @@ import { Context as Context2 } from "@dxos/context";
344
344
  import { verifyCredential } from "@dxos/credentials";
345
345
  import { log } from "@dxos/log";
346
346
  import { schema } from "@dxos/protocols";
347
- var __dxlog_file = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
347
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
348
348
  var Credential = schema.getCodecForType("dxos.halo.credentials.Credential");
349
349
  var createAuthProvider = (signer) => async (nonce) => {
350
350
  const credential = await signer.createCredential({
@@ -475,7 +475,7 @@ function _ts_decorate(decorators, target, key, desc) {
475
475
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
476
476
  return c > 3 && r && Object.defineProperty(target, key, r), r;
477
477
  }
478
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity.ts";
478
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
479
479
  var Identity = class Identity2 {
480
480
  constructor({ space, signer, identityKey, deviceKey }) {
481
481
  this.stateUpdate = new Event();
@@ -657,7 +657,7 @@ function _ts_decorate2(decorators, target, key, desc) {
657
657
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
658
658
  return c > 3 && r && Object.defineProperty(target, key, r), r;
659
659
  }
660
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
660
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
661
661
  var IdentityManager = class IdentityManager2 {
662
662
  // TODO(burdon): IdentityManagerParams.
663
663
  // TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
@@ -1017,7 +1017,7 @@ import { Stream as Stream7 } from "@dxos/codec-protobuf";
1017
1017
  import { signPresentation } from "@dxos/credentials";
1018
1018
  import { todo } from "@dxos/debug";
1019
1019
  import { invariant as invariant3 } from "@dxos/invariant";
1020
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1020
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
1021
1021
  var IdentityServiceImpl = class {
1022
1022
  constructor(_createIdentity, _identityManager, _keyring) {
1023
1023
  this._createIdentity = _createIdentity;
@@ -1086,7 +1086,7 @@ var IdentityServiceImpl = class {
1086
1086
  // packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
1087
1087
  import { invariant as invariant4 } from "@dxos/invariant";
1088
1088
  import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
1089
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1089
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
1090
1090
  var DeviceInvitationProtocol = class {
1091
1091
  constructor(_keyring, _getIdentity, _acceptIdentity) {
1092
1092
  this._keyring = _keyring;
@@ -1196,7 +1196,7 @@ import { InvalidInvitationExtensionRoleError, schema as schema2, trace as trace3
1196
1196
  import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
1197
1197
  import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
1198
1198
  import { RpcExtension } from "@dxos/teleport";
1199
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
1199
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
1200
1200
  var OPTIONS_TIMEOUT = 1e4;
1201
1201
  var MAX_OTP_ATTEMPTS = 3;
1202
1202
  var InvitationHostExtension = class extends RpcExtension {
@@ -1527,7 +1527,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1527
1527
  var isAuthenticationRequired = (invitation) => invitation.authMethod !== Invitation2.AuthMethod.NONE;
1528
1528
 
1529
1529
  // packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
1530
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
1530
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
1531
1531
  var InvitationsHandler = class {
1532
1532
  /**
1533
1533
  * @internal
@@ -2086,7 +2086,7 @@ import { Stream as Stream8 } from "@dxos/codec-protobuf";
2086
2086
  import { invariant as invariant7 } from "@dxos/invariant";
2087
2087
  import { log as log6 } from "@dxos/log";
2088
2088
  import { Invitation as Invitation4, QueryInvitationsResponse } from "@dxos/protocols/proto/dxos/client/services";
2089
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
2089
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
2090
2090
  var InvitationsServiceImpl = class {
2091
2091
  constructor(_invitationsHandler, _getHandler) {
2092
2092
  this._invitationsHandler = _invitationsHandler;
@@ -2268,7 +2268,7 @@ import { writeMessages as writeMessages2 } from "@dxos/feed-store";
2268
2268
  import { invariant as invariant8 } from "@dxos/invariant";
2269
2269
  import { log as log7 } from "@dxos/log";
2270
2270
  import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
2271
- var __dxlog_file9 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
2271
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
2272
2272
  var SpaceInvitationProtocol = class {
2273
2273
  constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
2274
2274
  this._spaceManager = _spaceManager;
@@ -2469,6 +2469,7 @@ var ClientRpcServer = class {
2469
2469
  };
2470
2470
 
2471
2471
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2472
+ import { Trigger as Trigger4 } from "@dxos/async";
2472
2473
  import { getFirstStreamValue } from "@dxos/codec-protobuf";
2473
2474
  import { credentialTypeFilter } from "@dxos/credentials";
2474
2475
  import { DocumentModel } from "@dxos/document-model";
@@ -2507,10 +2508,10 @@ var getPlatform = () => {
2507
2508
  };
2508
2509
 
2509
2510
  // packages/sdk/client-services/src/version.ts
2510
- var DXOS_VERSION = "0.3.2";
2511
+ var DXOS_VERSION = "0.3.3-main.006ca4d";
2511
2512
 
2512
2513
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2513
- var __dxlog_file10 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
2514
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
2514
2515
  var DEFAULT_TIMEOUT = 1e3;
2515
2516
  var createDiagnostics = async (clientServices, serviceContext, config) => {
2516
2517
  const diagnostics = {
@@ -2526,7 +2527,7 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
2526
2527
  {
2527
2528
  invariant9(clientServices.LoggingService, "SystemService is not available.", {
2528
2529
  F: __dxlog_file10,
2529
- L: 88,
2530
+ L: 93,
2530
2531
  S: void 0,
2531
2532
  A: [
2532
2533
  "clientServices.LoggingService",
@@ -2559,6 +2560,19 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
2559
2560
  bytes,
2560
2561
  length
2561
2562
  }));
2563
+ const status = await getFirstStreamValue(clientServices.NetworkService.queryStatus(), {
2564
+ timeout: DEFAULT_TIMEOUT
2565
+ }).catch(() => void 0);
2566
+ diagnostics.networkStatus = status;
2567
+ const swarmInfoDone = new Trigger4();
2568
+ serviceContext.networkManager.connectionLog?.update.on(async () => {
2569
+ const swarms = serviceContext.networkManager.connectionLog?.swarms;
2570
+ diagnostics.swarms = swarms;
2571
+ await swarmInfoDone.wake();
2572
+ });
2573
+ await swarmInfoDone.wait({
2574
+ timeout: DEFAULT_TIMEOUT
2575
+ });
2562
2576
  }
2563
2577
  diagnostics.config = config.values;
2564
2578
  return diagnostics;
@@ -2572,7 +2586,7 @@ var getProperties = (space) => {
2572
2586
  } catch (err) {
2573
2587
  log8.warn(err.message, void 0, {
2574
2588
  F: __dxlog_file10,
2575
- L: 145,
2589
+ L: 168,
2576
2590
  S: void 0,
2577
2591
  C: (f, a) => f(...a)
2578
2592
  });
@@ -2643,7 +2657,7 @@ import { trace as trace5 } from "@dxos/tracing";
2643
2657
  import { ComplexSet as ComplexSet3 } from "@dxos/util";
2644
2658
 
2645
2659
  // packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
2646
- import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger4 } from "@dxos/async";
2660
+ import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger5 } from "@dxos/async";
2647
2661
  import { Context as Context6, rejectOnDispose } from "@dxos/context";
2648
2662
  import { invariant as invariant10 } from "@dxos/invariant";
2649
2663
  import { PublicKey as PublicKey7 } from "@dxos/keys";
@@ -2651,7 +2665,7 @@ import { log as log9 } from "@dxos/log";
2651
2665
  import { schema as schema3 } from "@dxos/protocols";
2652
2666
  import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
2653
2667
  import { ComplexMap as ComplexMap2, ComplexSet as ComplexSet2, entry } from "@dxos/util";
2654
- var __dxlog_file11 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2668
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
2655
2669
  var DEFAULT_RETRY_TIMEOUT = 1e3;
2656
2670
  var DEFAULT_SUCCESS_DELAY = 1e3;
2657
2671
  var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
@@ -2693,7 +2707,7 @@ var NotarizationPlugin = class {
2693
2707
  "'Credentials must have an id'"
2694
2708
  ]
2695
2709
  });
2696
- const errors = new Trigger4();
2710
+ const errors = new Trigger5();
2697
2711
  const ctx = this._ctx.derive({
2698
2712
  onError: (err) => {
2699
2713
  log9.warn("Notarization error", {
@@ -2824,7 +2838,7 @@ var NotarizationPlugin = class {
2824
2838
  if (this._processedCredentials.has(id)) {
2825
2839
  return;
2826
2840
  }
2827
- await entry(this._processCredentialsTriggers, id).orInsert(new Trigger4()).value.wait();
2841
+ await entry(this._processCredentialsTriggers, id).orInsert(new Trigger5()).value.wait();
2828
2842
  }
2829
2843
  /**
2830
2844
  * Requests from other peers to notarize credentials.
@@ -2921,7 +2935,7 @@ function _ts_decorate3(decorators, target, key, desc) {
2921
2935
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2922
2936
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2923
2937
  }
2924
- var __dxlog_file12 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
2938
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
2925
2939
  var ENABLE_FEED_PURGE = false;
2926
2940
  var DataSpace = class DataSpace2 {
2927
2941
  constructor(params) {
@@ -3364,7 +3378,7 @@ function _ts_decorate4(decorators, target, key, desc) {
3364
3378
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3365
3379
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3366
3380
  }
3367
- var __dxlog_file13 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
3381
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
3368
3382
  var DataSpaceManager = class DataSpaceManager2 {
3369
3383
  constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
3370
3384
  this._spaceManager = _spaceManager;
@@ -3694,7 +3708,7 @@ import { invariant as invariant12 } from "@dxos/invariant";
3694
3708
  import { log as log12 } from "@dxos/log";
3695
3709
  import { ApiError, SpaceNotFoundError, encodeError } from "@dxos/protocols";
3696
3710
  import { SpaceMember as SpaceMember3, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
3697
- var __dxlog_file14 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3711
+ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3698
3712
  var SpacesServiceImpl = class {
3699
3713
  constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
3700
3714
  this._identityManager = _identityManager;
@@ -3908,7 +3922,7 @@ var SpacesServiceImpl = class {
3908
3922
  var getChannelId = (channel) => `user-channel/${channel}`;
3909
3923
 
3910
3924
  // packages/sdk/client-services/src/packlets/services/service-context.ts
3911
- import { Trigger as Trigger5 } from "@dxos/async";
3925
+ import { Trigger as Trigger6 } from "@dxos/async";
3912
3926
  import { Context as Context9 } from "@dxos/context";
3913
3927
  import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
3914
3928
  import { failUndefined as failUndefined3 } from "@dxos/debug";
@@ -3933,14 +3947,14 @@ function _ts_decorate5(decorators, target, key, desc) {
3933
3947
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3934
3948
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3935
3949
  }
3936
- var __dxlog_file15 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-context.ts";
3950
+ var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
3937
3951
  var ServiceContext = class ServiceContext2 {
3938
3952
  constructor(storage, networkManager, signalManager, modelFactory) {
3939
3953
  this.storage = storage;
3940
3954
  this.networkManager = networkManager;
3941
3955
  this.signalManager = signalManager;
3942
3956
  this.modelFactory = modelFactory;
3943
- this.initialized = new Trigger5();
3957
+ this.initialized = new Trigger6();
3944
3958
  this.dataServiceSubscriptions = new DataServiceSubscriptions();
3945
3959
  this._handlerFactories = /* @__PURE__ */ new Map();
3946
3960
  this._instanceId = PublicKey10.random().toHex();
@@ -4193,7 +4207,7 @@ var ServiceRegistry = class {
4193
4207
  };
4194
4208
 
4195
4209
  // packages/sdk/client-services/src/packlets/locks/browser.ts
4196
- import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
4210
+ import { asyncTimeout, Trigger as Trigger7 } from "@dxos/async";
4197
4211
  import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
4198
4212
  import { log as log14, logInfo } from "@dxos/log";
4199
4213
  function _ts_decorate6(decorators, target, key, desc) {
@@ -4206,7 +4220,7 @@ function _ts_decorate6(decorators, target, key, desc) {
4206
4220
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4207
4221
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4208
4222
  }
4209
- var __dxlog_file16 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/locks/browser.ts";
4223
+ var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/browser.ts";
4210
4224
  var Message;
4211
4225
  (function(Message2) {
4212
4226
  Message2["ACQUIRING"] = "acquiring";
@@ -4214,7 +4228,7 @@ var Message;
4214
4228
  var Lock = class {
4215
4229
  constructor({ lockKey, onAcquire, onRelease }) {
4216
4230
  this._broadcastChannel = new BroadcastChannel("vault-resource-lock");
4217
- this._releaseTrigger = new Trigger6();
4231
+ this._releaseTrigger = new Trigger7();
4218
4232
  this._lockKey = lockKey;
4219
4233
  this._onAcquire = onAcquire;
4220
4234
  this._onRelease = onRelease;
@@ -4274,13 +4288,13 @@ var Lock = class {
4274
4288
  S: this,
4275
4289
  C: (f, a) => f(...a)
4276
4290
  });
4277
- const acquired = new Trigger6();
4291
+ const acquired = new Trigger7();
4278
4292
  void navigator.locks.request(this._lockKey, {
4279
4293
  steal
4280
4294
  }, async () => {
4281
4295
  await this._onAcquire?.();
4282
4296
  acquired.wake();
4283
- this._releaseTrigger = new Trigger6();
4297
+ this._releaseTrigger = new Trigger7();
4284
4298
  await this._releaseTrigger.wait();
4285
4299
  log14("releasing lock...", void 0, {
4286
4300
  F: __dxlog_file16,
@@ -4642,7 +4656,7 @@ function _ts_decorate7(decorators, target, key, desc) {
4642
4656
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4643
4657
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4644
4658
  }
4645
- var __dxlog_file17 = "/mnt/ramdisk/work/packages/sdk/client-services/src/packlets/services/service-host.ts";
4659
+ var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
4646
4660
  var createDefaultModelFactory = () => {
4647
4661
  return new ModelFactory().registerModel(DocumentModel2).registerModel(TextModel);
4648
4662
  };
@@ -5045,4 +5059,4 @@ export {
5045
5059
  createDefaultModelFactory,
5046
5060
  ClientServicesHost
5047
5061
  };
5048
- //# sourceMappingURL=chunk-5YN7ZUGL.mjs.map
5062
+ //# sourceMappingURL=chunk-4EFKLUEF.mjs.map