@dxos/client-services 0.3.11-main.c95bc86 → 0.3.11-main.cb5abf5

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-4ZZIUZXZ.mjs → chunk-ESWBGQCJ.mjs} +65 -34
  2. package/dist/lib/browser/chunk-ESWBGQCJ.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/packlets/testing/index.mjs +1 -1
  6. package/dist/lib/node/{chunk-KA7FPK35.cjs → chunk-Q7FPBLIU.cjs} +125 -94
  7. package/dist/lib/node/chunk-Q7FPBLIU.cjs.map +7 -0
  8. package/dist/lib/node/index.cjs +37 -37
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/packlets/testing/index.cjs +8 -8
  11. package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
  12. package/dist/types/src/packlets/services/diagnostics.d.ts +32 -20
  13. package/dist/types/src/packlets/services/diagnostics.d.ts.map +1 -1
  14. package/dist/types/src/packlets/services/platform.d.ts +1 -14
  15. package/dist/types/src/packlets/services/platform.d.ts.map +1 -1
  16. package/dist/types/src/packlets/spaces/data-space.d.ts +1 -0
  17. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  18. package/dist/types/src/packlets/system/system-service.d.ts +3 -2
  19. package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
  20. package/dist/types/src/version.d.ts +1 -1
  21. package/package.json +35 -35
  22. package/src/packlets/network/network-service.ts +5 -1
  23. package/src/packlets/services/diagnostics.ts +35 -17
  24. package/src/packlets/services/platform.ts +7 -19
  25. package/src/packlets/spaces/data-space.ts +18 -5
  26. package/src/packlets/spaces/spaces-service.ts +2 -2
  27. package/src/packlets/system/system-service.ts +7 -1
  28. package/src/version.ts +1 -1
  29. package/dist/lib/browser/chunk-4ZZIUZXZ.mjs.map +0 -7
  30. package/dist/lib/node/chunk-KA7FPK35.cjs.map +0 -7
@@ -2533,29 +2533,32 @@ import { invariant as invariant9 } from "@dxos/invariant";
2533
2533
  import { log as log8 } from "@dxos/log";
2534
2534
  import { STORAGE_VERSION } from "@dxos/protocols";
2535
2535
  import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
2536
+ import { TRACE_PROCESSOR } from "@dxos/tracing";
2536
2537
 
2537
2538
  // packages/sdk/client-services/src/packlets/services/platform.ts
2539
+ import { Platform } from "@dxos/protocols/proto/dxos/client/services";
2538
2540
  var getPlatform = () => {
2539
2541
  if (process.browser) {
2540
2542
  if (typeof window !== "undefined") {
2541
2543
  const { userAgent } = window.navigator;
2542
2544
  return {
2543
- type: "browser",
2545
+ type: Platform.PLATFORM_TYPE.BROWSER,
2544
2546
  userAgent,
2545
2547
  uptime: Math.floor((Date.now() - window.performance.timeOrigin) / 1e3)
2546
2548
  };
2547
2549
  } else {
2548
2550
  return {
2549
- type: "shared-worker",
2551
+ type: Platform.PLATFORM_TYPE.SHARED_WORKER,
2550
2552
  uptime: Math.floor((Date.now() - performance.timeOrigin) / 1e3)
2551
2553
  };
2552
2554
  }
2553
2555
  } else {
2554
2556
  const { platform: platform2, version, arch } = process;
2555
2557
  return {
2556
- type: "node",
2557
- platform: `${platform2} ${version} ${arch}`,
2558
- runtime: process.version,
2558
+ type: Platform.PLATFORM_TYPE.NODE,
2559
+ platform: platform2,
2560
+ arch,
2561
+ runtime: version,
2559
2562
  uptime: Math.floor(process.uptime()),
2560
2563
  memory: process.memoryUsage()
2561
2564
  };
@@ -2563,7 +2566,7 @@ var getPlatform = () => {
2563
2566
  };
2564
2567
 
2565
2568
  // packages/sdk/client-services/src/version.ts
2566
- var DXOS_VERSION = "0.3.11-main.c95bc86";
2569
+ var DXOS_VERSION = "0.3.11-main.cb5abf5";
2567
2570
 
2568
2571
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2569
2572
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -2577,12 +2580,13 @@ var createDiagnostics = async (clientServices, serviceContext, config) => {
2577
2580
  storage: {
2578
2581
  version: STORAGE_VERSION
2579
2582
  }
2580
- }
2583
+ },
2584
+ trace: TRACE_PROCESSOR.getDiagnostics()
2581
2585
  };
2582
2586
  {
2583
2587
  invariant9(clientServices.LoggingService, "SystemService is not available.", {
2584
2588
  F: __dxlog_file10,
2585
- L: 93,
2589
+ L: 111,
2586
2590
  S: void 0,
2587
2591
  A: [
2588
2592
  "clientServices.LoggingService",
@@ -2648,7 +2652,7 @@ var getProperties = (space) => {
2648
2652
  } catch (err) {
2649
2653
  log8.warn(err.message, void 0, {
2650
2654
  F: __dxlog_file10,
2651
- L: 178,
2655
+ L: 196,
2652
2656
  S: void 0,
2653
2657
  C: (f, a) => f(...a)
2654
2658
  });
@@ -2704,9 +2708,9 @@ var getSpaceStats = async (space) => {
2704
2708
  };
2705
2709
 
2706
2710
  // packages/sdk/client-services/src/packlets/spaces/data-space.ts
2707
- import { Event as Event5, scheduleTask as scheduleTask4, sleep as sleep2, synchronized, trackLeaks } from "@dxos/async";
2711
+ import { Event as Event5, asyncTimeout, scheduleTask as scheduleTask4, sleep as sleep2, synchronized, trackLeaks } from "@dxos/async";
2708
2712
  import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
2709
- import { cancelWithContext as cancelWithContext2, Context as Context7 } from "@dxos/context";
2713
+ import { cancelWithContext as cancelWithContext2, Context as Context7, ContextDisposedError } from "@dxos/context";
2710
2714
  import { timed } from "@dxos/debug";
2711
2715
  import { createMappedFeedWriter } from "@dxos/echo-pipeline";
2712
2716
  import { failedInvariant } from "@dxos/invariant";
@@ -3055,7 +3059,7 @@ var DataSpace = class {
3055
3059
  state: SpaceState[this._state]
3056
3060
  }, {
3057
3061
  F: __dxlog_file12,
3058
- L: 138,
3062
+ L: 141,
3059
3063
  S: this,
3060
3064
  C: (f, a) => f(...a)
3061
3065
  });
@@ -3088,6 +3092,12 @@ var DataSpace = class {
3088
3092
  get automergeSpaceState() {
3089
3093
  return this._automergeSpaceState;
3090
3094
  }
3095
+ get _automergeInfo() {
3096
+ return {
3097
+ rootUrl: this._automergeSpaceState.rootUrl,
3098
+ lastEpoch: this._automergeSpaceState.lastEpoch
3099
+ };
3100
+ }
3091
3101
  async open() {
3092
3102
  await this._open();
3093
3103
  }
@@ -3102,7 +3112,7 @@ var DataSpace = class {
3102
3112
  state: SpaceState[this._state]
3103
3113
  }, {
3104
3114
  F: __dxlog_file12,
3105
- L: 190,
3115
+ L: 203,
3106
3116
  S: this,
3107
3117
  C: (f, a) => f(...a)
3108
3118
  });
@@ -3120,7 +3130,7 @@ var DataSpace = class {
3120
3130
  state: SpaceState[this._state]
3121
3131
  }, {
3122
3132
  F: __dxlog_file12,
3123
- L: 204,
3133
+ L: 217,
3124
3134
  S: this,
3125
3135
  C: (f, a) => f(...a)
3126
3136
  });
@@ -3149,10 +3159,10 @@ var DataSpace = class {
3149
3159
  this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
3150
3160
  await this.initializeDataPipeline();
3151
3161
  } catch (err) {
3152
- if (err instanceof CancelledError) {
3162
+ if (err instanceof CancelledError || err instanceof ContextDisposedError) {
3153
3163
  log10("data pipeline initialization cancelled", err, {
3154
3164
  F: __dxlog_file12,
3155
- L: 237,
3165
+ L: 250,
3156
3166
  S: this,
3157
3167
  C: (f, a) => f(...a)
3158
3168
  });
@@ -3160,7 +3170,7 @@ var DataSpace = class {
3160
3170
  }
3161
3171
  log10.error("Error initializing data pipeline", err, {
3162
3172
  F: __dxlog_file12,
3163
- L: 241,
3173
+ L: 254,
3164
3174
  S: this,
3165
3175
  C: (f, a) => f(...a)
3166
3176
  });
@@ -3169,7 +3179,7 @@ var DataSpace = class {
3169
3179
  state: SpaceState[this._state]
3170
3180
  }, {
3171
3181
  F: __dxlog_file12,
3172
- L: 243,
3182
+ L: 256,
3173
3183
  S: this,
3174
3184
  C: (f, a) => f(...a)
3175
3185
  });
@@ -3189,7 +3199,7 @@ var DataSpace = class {
3189
3199
  state: SpaceState[this._state]
3190
3200
  }, {
3191
3201
  F: __dxlog_file12,
3192
- L: 259,
3202
+ L: 272,
3193
3203
  S: this,
3194
3204
  C: (f, a) => f(...a)
3195
3205
  });
@@ -3200,7 +3210,7 @@ var DataSpace = class {
3200
3210
  await cancelWithContext2(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
3201
3211
  log10("waiting for data pipeline to reach target timeframe", void 0, {
3202
3212
  F: __dxlog_file12,
3203
- L: 273,
3213
+ L: 286,
3204
3214
  S: this,
3205
3215
  C: (f, a) => f(...a)
3206
3216
  });
@@ -3211,7 +3221,7 @@ var DataSpace = class {
3211
3221
  this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
3212
3222
  log10("data pipeline ready", void 0, {
3213
3223
  F: __dxlog_file12,
3214
- L: 282,
3224
+ L: 295,
3215
3225
  S: this,
3216
3226
  C: (f, a) => f(...a)
3217
3227
  });
@@ -3221,7 +3231,7 @@ var DataSpace = class {
3221
3231
  state: SpaceState[this._state]
3222
3232
  }, {
3223
3233
  F: __dxlog_file12,
3224
- L: 286,
3234
+ L: 299,
3225
3235
  S: this,
3226
3236
  C: (f, a) => f(...a)
3227
3237
  });
@@ -3237,7 +3247,7 @@ var DataSpace = class {
3237
3247
  await this._createWritableFeeds();
3238
3248
  log10("writable feeds created", void 0, {
3239
3249
  F: __dxlog_file12,
3240
- L: 302,
3250
+ L: 315,
3241
3251
  S: this,
3242
3252
  C: (f, a) => f(...a)
3243
3253
  });
@@ -3295,19 +3305,19 @@ var DataSpace = class {
3295
3305
  }
3296
3306
  }
3297
3307
  _onNewAutomergeRoot(rootUrl) {
3298
- log10.info("loading automerge root doc for space", {
3308
+ log10("loading automerge root doc for space", {
3299
3309
  space: this.key,
3300
3310
  rootUrl
3301
3311
  }, {
3302
3312
  F: __dxlog_file12,
3303
- L: 368,
3313
+ L: 381,
3304
3314
  S: this,
3305
3315
  C: (f, a) => f(...a)
3306
3316
  });
3307
3317
  const handle = this._automergeHost.repo.find(rootUrl);
3308
3318
  queueMicrotask(async () => {
3309
3319
  try {
3310
- await handle.whenReady();
3320
+ await asyncTimeout(handle.whenReady(), 5e3);
3311
3321
  const doc = handle.docSync() ?? failedInvariant();
3312
3322
  if (!doc.experimental_spaceKey) {
3313
3323
  handle.change((doc2) => {
@@ -3321,7 +3331,7 @@ var DataSpace = class {
3321
3331
  err
3322
3332
  }, {
3323
3333
  F: __dxlog_file12,
3324
- L: 381,
3334
+ L: 394,
3325
3335
  S: this,
3326
3336
  C: (f, a) => f(...a)
3327
3337
  });
@@ -3411,13 +3421,29 @@ var DataSpace = class {
3411
3421
  state: SpaceState[this._state]
3412
3422
  }, {
3413
3423
  F: __dxlog_file12,
3414
- L: 470,
3424
+ L: 483,
3415
3425
  S: this,
3416
3426
  C: (f, a) => f(...a)
3417
3427
  });
3418
3428
  this.stateUpdate.emit();
3419
3429
  }
3420
3430
  };
3431
+ _ts_decorate4([
3432
+ trace6.info()
3433
+ ], DataSpace.prototype, "_inner", void 0);
3434
+ _ts_decorate4([
3435
+ trace6.info()
3436
+ ], DataSpace.prototype, "key", null);
3437
+ _ts_decorate4([
3438
+ trace6.info({
3439
+ enum: SpaceState
3440
+ })
3441
+ ], DataSpace.prototype, "state", null);
3442
+ _ts_decorate4([
3443
+ trace6.info({
3444
+ depth: null
3445
+ })
3446
+ ], DataSpace.prototype, "_automergeInfo", null);
3421
3447
  _ts_decorate4([
3422
3448
  synchronized
3423
3449
  ], DataSpace.prototype, "open", null);
@@ -3444,7 +3470,8 @@ _ts_decorate4([
3444
3470
  synchronized
3445
3471
  ], DataSpace.prototype, "deactivate", null);
3446
3472
  DataSpace = _ts_decorate4([
3447
- trackLeaks("open", "close")
3473
+ trackLeaks("open", "close"),
3474
+ trace6.resource()
3448
3475
  ], DataSpace);
3449
3476
 
3450
3477
  // packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
@@ -4389,7 +4416,7 @@ var ServiceRegistry = class {
4389
4416
  };
4390
4417
 
4391
4418
  // packages/sdk/client-services/src/packlets/locks/browser.ts
4392
- import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
4419
+ import { asyncTimeout as asyncTimeout2, Trigger as Trigger6 } from "@dxos/async";
4393
4420
  import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
4394
4421
  import { log as log14, logInfo } from "@dxos/log";
4395
4422
  function _ts_decorate7(decorators, target, key, desc) {
@@ -4430,7 +4457,7 @@ var Lock = class {
4430
4457
  S: this,
4431
4458
  C: (f, a) => f(...a)
4432
4459
  });
4433
- await asyncTimeout(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
4460
+ await asyncTimeout2(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
4434
4461
  log14("acquired lock", void 0, {
4435
4462
  F: __dxlog_file16,
4436
4463
  L: 44,
@@ -4577,7 +4604,7 @@ import { createSimplePeerTransportFactory, NetworkManager } from "@dxos/network-
4577
4604
  import { trace as trace9 } from "@dxos/protocols";
4578
4605
  import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
4579
4606
  import { TextModel } from "@dxos/text-model";
4580
- import { TRACE_PROCESSOR, trace as Trace3 } from "@dxos/tracing";
4607
+ import { TRACE_PROCESSOR as TRACE_PROCESSOR2, trace as Trace3 } from "@dxos/tracing";
4581
4608
  import { WebsocketRpcClient } from "@dxos/websocket-rpc";
4582
4609
 
4583
4610
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
@@ -4753,6 +4780,7 @@ var NetworkServiceImpl = class {
4753
4780
  const update = () => {
4754
4781
  next({
4755
4782
  swarm: this.networkManager.connectionState,
4783
+ connectionInfo: this.networkManager.connectionLog?.swarms,
4756
4784
  signaling: this.signalManager.getStatus().map(({ host, state }) => ({
4757
4785
  server: host,
4758
4786
  state
@@ -4802,6 +4830,9 @@ var SystemServiceImpl = class {
4802
4830
  })))
4803
4831
  };
4804
4832
  }
4833
+ async getPlatform() {
4834
+ return getPlatform();
4835
+ }
4805
4836
  async updateStatus({ status }) {
4806
4837
  await this._onUpdateStatus(status);
4807
4838
  }
@@ -4865,7 +4896,7 @@ var ClientServicesHost = class {
4865
4896
  lockKey,
4866
4897
  callbacks
4867
4898
  } = {}) {
4868
- this._tracingService = TRACE_PROCESSOR.createTraceSender();
4899
+ this._tracingService = TRACE_PROCESSOR2.createTraceSender();
4869
4900
  this._statusUpdate = new Event8();
4870
4901
  this._opening = false;
4871
4902
  this._open = false;
@@ -5263,4 +5294,4 @@ export {
5263
5294
  createDefaultModelFactory,
5264
5295
  ClientServicesHost
5265
5296
  };
5266
- //# sourceMappingURL=chunk-4ZZIUZXZ.mjs.map
5297
+ //# sourceMappingURL=chunk-ESWBGQCJ.mjs.map