@dxos/client-services 0.6.2-main.d448994 → 0.6.2-main.f3edf77

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.
@@ -359,7 +359,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
359
359
  import { TRACE_PROCESSOR } from "@dxos/tracing";
360
360
 
361
361
  // packages/sdk/client-services/src/version.ts
362
- var DXOS_VERSION = "0.6.2-main.d448994";
362
+ var DXOS_VERSION = "0.6.2-main.f3edf77";
363
363
 
364
364
  // packages/sdk/client-services/src/packlets/services/platform.ts
365
365
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -1812,6 +1812,7 @@ import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleEr
1812
1812
  import { Invitation as Invitation4 } from "@dxos/protocols/proto/dxos/client/services";
1813
1813
  import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protocols/proto/dxos/halo/invitations";
1814
1814
  import { Options as Options4 } from "@dxos/protocols/proto/dxos/halo/invitations";
1815
+ import { trace as _trace } from "@dxos/tracing";
1815
1816
  import { ComplexSet as ComplexSet3 } from "@dxos/util";
1816
1817
 
1817
1818
  // packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts
@@ -2390,6 +2391,7 @@ var InvitationTopology = class {
2390
2391
 
2391
2392
  // packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
2392
2393
  var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
2394
+ var metrics = _trace.metrics;
2393
2395
  var MAX_DELEGATED_INVITATION_HOST_TRIES = 3;
2394
2396
  var InvitationsHandler = class {
2395
2397
  /**
@@ -2400,6 +2402,7 @@ var InvitationsHandler = class {
2400
2402
  this._defaultTeleportParams = _defaultTeleportParams;
2401
2403
  }
2402
2404
  handleInvitationFlow(ctx, stream, protocol, invitation) {
2405
+ metrics.increment("invitation.created");
2403
2406
  const guardedState = this._createGuardedState(ctx, invitation, stream);
2404
2407
  const createExtension = () => {
2405
2408
  const extension = new InvitationHostExtension(guardedState.mutex, {
@@ -2415,7 +2418,7 @@ var InvitationsHandler = class {
2415
2418
  const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
2416
2419
  invariant9(deviceKey, void 0, {
2417
2420
  F: __dxlog_file13,
2418
- L: 90,
2421
+ L: 93,
2419
2422
  S: this,
2420
2423
  A: [
2421
2424
  "deviceKey",
@@ -2444,7 +2447,7 @@ var InvitationsHandler = class {
2444
2447
  id: traceId
2445
2448
  }), {
2446
2449
  F: __dxlog_file13,
2447
- L: 115,
2450
+ L: 118,
2448
2451
  S: this,
2449
2452
  C: (f, a) => f(...a)
2450
2453
  });
@@ -2452,7 +2455,7 @@ var InvitationsHandler = class {
2452
2455
  ...protocol.toJSON()
2453
2456
  }, {
2454
2457
  F: __dxlog_file13,
2455
- L: 116,
2458
+ L: 119,
2456
2459
  S: this,
2457
2460
  C: (f, a) => f(...a)
2458
2461
  });
@@ -2464,16 +2467,17 @@ var InvitationsHandler = class {
2464
2467
  ...protocol.toJSON()
2465
2468
  }, {
2466
2469
  F: __dxlog_file13,
2467
- L: 118,
2470
+ L: 121,
2468
2471
  S: this,
2469
2472
  C: (f, a) => f(...a)
2470
2473
  });
2471
2474
  guardedState.set(extension, Invitation4.State.SUCCESS);
2475
+ metrics.increment("invitation.success");
2472
2476
  log10.trace("dxos.sdk.invitations-handler.host.onOpen", trace5.end({
2473
2477
  id: traceId
2474
2478
  }), {
2475
2479
  F: __dxlog_file13,
2476
- L: 120,
2480
+ L: 124,
2477
2481
  S: this,
2478
2482
  C: (f, a) => f(...a)
2479
2483
  });
@@ -2484,20 +2488,22 @@ var InvitationsHandler = class {
2484
2488
  } catch (err) {
2485
2489
  if (err instanceof TimeoutError) {
2486
2490
  if (guardedState.set(extension, Invitation4.State.TIMEOUT)) {
2491
+ metrics.increment("invitation.timeout");
2487
2492
  log10("timeout", {
2488
2493
  ...protocol.toJSON()
2489
2494
  }, {
2490
2495
  F: __dxlog_file13,
2491
- L: 129,
2496
+ L: 134,
2492
2497
  S: this,
2493
2498
  C: (f, a) => f(...a)
2494
2499
  });
2495
2500
  }
2496
2501
  } else {
2497
2502
  if (guardedState.error(extension, err)) {
2503
+ metrics.increment("invitation.failed");
2498
2504
  log10.error("failed", err, {
2499
2505
  F: __dxlog_file13,
2500
- L: 133,
2506
+ L: 139,
2501
2507
  S: this,
2502
2508
  C: (f, a) => f(...a)
2503
2509
  });
@@ -2508,7 +2514,7 @@ var InvitationsHandler = class {
2508
2514
  error: err
2509
2515
  }), {
2510
2516
  F: __dxlog_file13,
2511
- L: 136,
2517
+ L: 142,
2512
2518
  S: this,
2513
2519
  C: (f, a) => f(...a)
2514
2520
  });
@@ -2522,7 +2528,7 @@ var InvitationsHandler = class {
2522
2528
  ...err.context
2523
2529
  }, {
2524
2530
  F: __dxlog_file13,
2525
- L: 144,
2531
+ L: 150,
2526
2532
  S: this,
2527
2533
  C: (f, a) => f(...a)
2528
2534
  });
@@ -2530,20 +2536,22 @@ var InvitationsHandler = class {
2530
2536
  }
2531
2537
  if (err instanceof TimeoutError) {
2532
2538
  if (guardedState.set(extension, Invitation4.State.TIMEOUT)) {
2539
+ metrics.increment("invitation.timeout");
2533
2540
  log10("timeout", {
2534
2541
  err
2535
2542
  }, {
2536
2543
  F: __dxlog_file13,
2537
- L: 149,
2544
+ L: 156,
2538
2545
  S: this,
2539
2546
  C: (f, a) => f(...a)
2540
2547
  });
2541
2548
  }
2542
2549
  } else {
2543
2550
  if (guardedState.error(extension, err)) {
2551
+ metrics.increment("invitation.failed");
2544
2552
  log10.error("failed", err, {
2545
2553
  F: __dxlog_file13,
2546
- L: 153,
2554
+ L: 161,
2547
2555
  S: this,
2548
2556
  C: (f, a) => f(...a)
2549
2557
  });
@@ -2557,7 +2565,7 @@ var InvitationsHandler = class {
2557
2565
  if (invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
2558
2566
  log10.warn("invitation has already expired", void 0, {
2559
2567
  F: __dxlog_file13,
2560
- L: 164,
2568
+ L: 172,
2561
2569
  S: this,
2562
2570
  C: (f, a) => f(...a)
2563
2571
  });
@@ -2565,6 +2573,7 @@ var InvitationsHandler = class {
2565
2573
  scheduleTask3(ctx, async () => {
2566
2574
  await swarmConnection.close();
2567
2575
  guardedState.set(null, Invitation4.State.EXPIRED);
2576
+ metrics.increment("invitation.expired");
2568
2577
  await ctx.dispose();
2569
2578
  }, invitation.created.getTime() + invitation.lifetime * 1e3 - Date.now());
2570
2579
  }
@@ -2580,7 +2589,7 @@ var InvitationsHandler = class {
2580
2589
  if (deviceProfile) {
2581
2590
  invariant9(invitation.kind === Invitation4.Kind.DEVICE, "deviceProfile provided for non-device invitation", {
2582
2591
  F: __dxlog_file13,
2583
- L: 197,
2592
+ L: 206,
2584
2593
  S: this,
2585
2594
  A: [
2586
2595
  "invitation.kind === Invitation.Kind.DEVICE",
@@ -2598,7 +2607,7 @@ var InvitationsHandler = class {
2598
2607
  triedPeers: triedPeersIds.size
2599
2608
  }, {
2600
2609
  F: __dxlog_file13,
2601
- L: 205,
2610
+ L: 214,
2602
2611
  S: this,
2603
2612
  C: (f, a) => f(...a)
2604
2613
  });
@@ -2625,7 +2634,7 @@ var InvitationsHandler = class {
2625
2634
  currentState: guardedState.current.state
2626
2635
  }, {
2627
2636
  F: __dxlog_file13,
2628
- L: 233,
2637
+ L: 242,
2629
2638
  S: this,
2630
2639
  C: (f, a) => f(...a)
2631
2640
  });
@@ -2643,7 +2652,7 @@ var InvitationsHandler = class {
2643
2652
  id: traceId
2644
2653
  }), {
2645
2654
  F: __dxlog_file13,
2646
- L: 245,
2655
+ L: 254,
2647
2656
  S: this,
2648
2657
  C: (f, a) => f(...a)
2649
2658
  });
@@ -2655,7 +2664,7 @@ var InvitationsHandler = class {
2655
2664
  ...protocol.toJSON()
2656
2665
  }, {
2657
2666
  F: __dxlog_file13,
2658
- L: 256,
2667
+ L: 265,
2659
2668
  S: this,
2660
2669
  C: (f, a) => f(...a)
2661
2670
  });
@@ -2664,7 +2673,7 @@ var InvitationsHandler = class {
2664
2673
  ...protocol.toJSON()
2665
2674
  }, {
2666
2675
  F: __dxlog_file13,
2667
- L: 260,
2676
+ L: 269,
2668
2677
  S: this,
2669
2678
  C: (f, a) => f(...a)
2670
2679
  });
@@ -2677,7 +2686,7 @@ var InvitationsHandler = class {
2677
2686
  response: introductionResponse
2678
2687
  }, {
2679
2688
  F: __dxlog_file13,
2680
- L: 265,
2689
+ L: 274,
2681
2690
  S: this,
2682
2691
  C: (f, a) => f(...a)
2683
2692
  });
@@ -2698,7 +2707,7 @@ var InvitationsHandler = class {
2698
2707
  ...protocol.toJSON()
2699
2708
  }, {
2700
2709
  F: __dxlog_file13,
2701
- L: 291,
2710
+ L: 300,
2702
2711
  S: this,
2703
2712
  C: (f, a) => f(...a)
2704
2713
  });
@@ -2710,7 +2719,7 @@ var InvitationsHandler = class {
2710
2719
  ...protocol.toJSON()
2711
2720
  }, {
2712
2721
  F: __dxlog_file13,
2713
- L: 302,
2722
+ L: 311,
2714
2723
  S: this,
2715
2724
  C: (f, a) => f(...a)
2716
2725
  });
@@ -2723,7 +2732,7 @@ var InvitationsHandler = class {
2723
2732
  id: traceId
2724
2733
  }), {
2725
2734
  F: __dxlog_file13,
2726
- L: 308,
2735
+ L: 317,
2727
2736
  S: this,
2728
2737
  C: (f, a) => f(...a)
2729
2738
  });
@@ -2733,7 +2742,7 @@ var InvitationsHandler = class {
2733
2742
  ...protocol.toJSON()
2734
2743
  }, {
2735
2744
  F: __dxlog_file13,
2736
- L: 311,
2745
+ L: 320,
2737
2746
  S: this,
2738
2747
  C: (f, a) => f(...a)
2739
2748
  });
@@ -2741,7 +2750,7 @@ var InvitationsHandler = class {
2741
2750
  } else {
2742
2751
  log10("auth failed", err, {
2743
2752
  F: __dxlog_file13,
2744
- L: 314,
2753
+ L: 323,
2745
2754
  S: this,
2746
2755
  C: (f, a) => f(...a)
2747
2756
  });
@@ -2753,7 +2762,7 @@ var InvitationsHandler = class {
2753
2762
  error: err
2754
2763
  }), {
2755
2764
  F: __dxlog_file13,
2756
- L: 318,
2765
+ L: 327,
2757
2766
  S: this,
2758
2767
  C: (f, a) => f(...a)
2759
2768
  });
@@ -2769,7 +2778,7 @@ var InvitationsHandler = class {
2769
2778
  ...protocol.toJSON()
2770
2779
  }, {
2771
2780
  F: __dxlog_file13,
2772
- L: 327,
2781
+ L: 336,
2773
2782
  S: this,
2774
2783
  C: (f, a) => f(...a)
2775
2784
  });
@@ -2777,7 +2786,7 @@ var InvitationsHandler = class {
2777
2786
  } else {
2778
2787
  log10("auth failed", err, {
2779
2788
  F: __dxlog_file13,
2780
- L: 330,
2789
+ L: 339,
2781
2790
  S: this,
2782
2791
  C: (f, a) => f(...a)
2783
2792
  });
@@ -2795,7 +2804,7 @@ var InvitationsHandler = class {
2795
2804
  } else {
2796
2805
  invariant9(invitation.swarmKey, void 0, {
2797
2806
  F: __dxlog_file13,
2798
- L: 345,
2807
+ L: 354,
2799
2808
  S: this,
2800
2809
  A: [
2801
2810
  "invitation.swarmKey",
@@ -2895,7 +2904,7 @@ var InvitationsHandler = class {
2895
2904
  oldState: stateToString(invitation.state)
2896
2905
  }, {
2897
2906
  F: __dxlog_file13,
2898
- L: 439,
2907
+ L: 448,
2899
2908
  S: this,
2900
2909
  C: (f, a) => f(...a)
2901
2910
  });
@@ -2906,7 +2915,7 @@ var InvitationsHandler = class {
2906
2915
  oldState: stateToString(invitation.state)
2907
2916
  }, {
2908
2917
  F: __dxlog_file13,
2909
- L: 445,
2918
+ L: 454,
2910
2919
  S: this,
2911
2920
  C: (f, a) => f(...a)
2912
2921
  });
@@ -2925,7 +2934,7 @@ var InvitationsHandler = class {
2925
2934
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
2926
2935
  log10("guest waiting for authentication code...", void 0, {
2927
2936
  F: __dxlog_file13,
2928
- L: 470,
2937
+ L: 479,
2929
2938
  S: this,
2930
2939
  C: (f, a) => f(...a)
2931
2940
  });
@@ -2933,7 +2942,7 @@ var InvitationsHandler = class {
2933
2942
  const authCode = await authenticated.wait(options);
2934
2943
  log10("sending authentication request", void 0, {
2935
2944
  F: __dxlog_file13,
2936
- L: 474,
2945
+ L: 483,
2937
2946
  S: this,
2938
2947
  C: (f, a) => f(...a)
2939
2948
  });
@@ -2952,7 +2961,7 @@ var InvitationsHandler = class {
2952
2961
  attempt
2953
2962
  }, {
2954
2963
  F: __dxlog_file13,
2955
- L: 485,
2964
+ L: 494,
2956
2965
  S: this,
2957
2966
  C: (f, a) => f(...a)
2958
2967
  });
@@ -2970,7 +2979,7 @@ var InvitationsHandler = class {
2970
2979
  }
2971
2980
  log10("sending authentication request", void 0, {
2972
2981
  F: __dxlog_file13,
2973
- L: 504,
2982
+ L: 513,
2974
2983
  S: this,
2975
2984
  C: (f, a) => f(...a)
2976
2985
  });
@@ -6736,7 +6745,7 @@ var LoggingServiceImpl = class {
6736
6745
  };
6737
6746
  return new Stream13(({ next }) => {
6738
6747
  const update = () => {
6739
- const metrics = {
6748
+ const metrics2 = {
6740
6749
  timestamp: /* @__PURE__ */ new Date(),
6741
6750
  values: [
6742
6751
  getNumericalValues("dxos.echo.pipeline.control"),
@@ -6745,7 +6754,7 @@ var LoggingServiceImpl = class {
6745
6754
  };
6746
6755
  next({
6747
6756
  timestamp: /* @__PURE__ */ new Date(),
6748
- metrics
6757
+ metrics: metrics2
6749
6758
  });
6750
6759
  };
6751
6760
  update();
@@ -7323,4 +7332,4 @@ export {
7323
7332
  ClientServicesProviderResource,
7324
7333
  DiagnosticsCollector
7325
7334
  };
7326
- //# sourceMappingURL=chunk-5RZ5MKRJ.mjs.map
7335
+ //# sourceMappingURL=chunk-PZFE4R5R.mjs.map