@dxos/echo-pipeline 0.3.11-main.e19f39d → 0.3.11-main.e26c0a5

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.
@@ -2209,7 +2209,7 @@ var Space = class {
2209
2209
  this._isOpen = false;
2210
2210
  invariant9(params.spaceKey && params.feedProvider, void 0, {
2211
2211
  F: __dxlog_file11,
2212
- L: 73,
2212
+ L: 78,
2213
2213
  S: this,
2214
2214
  A: [
2215
2215
  "params.spaceKey && params.feedProvider",
@@ -2253,7 +2253,7 @@ var Space = class {
2253
2253
  credential
2254
2254
  }, {
2255
2255
  F: __dxlog_file11,
2256
- L: 111,
2256
+ L: 116,
2257
2257
  S: this,
2258
2258
  C: (f, a) => f(...a)
2259
2259
  });
@@ -2318,7 +2318,7 @@ var Space = class {
2318
2318
  setControlFeed(feed) {
2319
2319
  invariant9(!this._controlFeed, "Control feed already set.", {
2320
2320
  F: __dxlog_file11,
2321
- L: 186,
2321
+ L: 191,
2322
2322
  S: this,
2323
2323
  A: [
2324
2324
  "!this._controlFeed",
@@ -2332,7 +2332,7 @@ var Space = class {
2332
2332
  setDataFeed(feed) {
2333
2333
  invariant9(!this._dataFeed, "Data feed already set.", {
2334
2334
  F: __dxlog_file11,
2335
- L: 193,
2335
+ L: 198,
2336
2336
  S: this,
2337
2337
  A: [
2338
2338
  "!this._dataFeed",
@@ -2358,7 +2358,7 @@ var Space = class {
2358
2358
  async open(ctx) {
2359
2359
  log10("opening...", void 0, {
2360
2360
  F: __dxlog_file11,
2361
- L: 215,
2361
+ L: 220,
2362
2362
  S: this,
2363
2363
  C: (f, a) => f(...a)
2364
2364
  });
@@ -2371,7 +2371,7 @@ var Space = class {
2371
2371
  this._isOpen = true;
2372
2372
  log10("opened", void 0, {
2373
2373
  F: __dxlog_file11,
2374
- L: 226,
2374
+ L: 231,
2375
2375
  S: this,
2376
2376
  C: (f, a) => f(...a)
2377
2377
  });
@@ -2381,7 +2381,7 @@ var Space = class {
2381
2381
  key: this._key
2382
2382
  }, {
2383
2383
  F: __dxlog_file11,
2384
- L: 231,
2384
+ L: 236,
2385
2385
  S: this,
2386
2386
  C: (f, a) => f(...a)
2387
2387
  });
@@ -2395,7 +2395,7 @@ var Space = class {
2395
2395
  this._isOpen = false;
2396
2396
  log10("closed", void 0, {
2397
2397
  F: __dxlog_file11,
2398
- L: 244,
2398
+ L: 249,
2399
2399
  S: this,
2400
2400
  C: (f, a) => f(...a)
2401
2401
  });
@@ -2403,13 +2403,13 @@ var Space = class {
2403
2403
  async initializeDataPipeline() {
2404
2404
  log10("initializeDataPipeline", void 0, {
2405
2405
  F: __dxlog_file11,
2406
- L: 249,
2406
+ L: 254,
2407
2407
  S: this,
2408
2408
  C: (f, a) => f(...a)
2409
2409
  });
2410
2410
  invariant9(this._isOpen, "Space must be open to initialize data pipeline.", {
2411
2411
  F: __dxlog_file11,
2412
- L: 250,
2412
+ L: 255,
2413
2413
  S: this,
2414
2414
  A: [
2415
2415
  "this._isOpen",
@@ -2419,6 +2419,15 @@ var Space = class {
2419
2419
  await this._dataPipeline.open();
2420
2420
  }
2421
2421
  };
2422
+ _ts_decorate6([
2423
+ trace3.info()
2424
+ ], Space.prototype, "protocol", void 0);
2425
+ _ts_decorate6([
2426
+ trace3.info()
2427
+ ], Space.prototype, "_controlPipeline", void 0);
2428
+ _ts_decorate6([
2429
+ trace3.info()
2430
+ ], Space.prototype, "_dataPipeline", void 0);
2422
2431
  _ts_decorate6([
2423
2432
  logInfo,
2424
2433
  trace3.info()
@@ -2446,6 +2455,7 @@ import { MMSTTopology } from "@dxos/network-manager";
2446
2455
  import { Teleport } from "@dxos/teleport";
2447
2456
  import { BlobSync } from "@dxos/teleport-extension-object-sync";
2448
2457
  import { ReplicatorExtension } from "@dxos/teleport-extension-replicator";
2458
+ import { trace as trace4 } from "@dxos/tracing";
2449
2459
  import { ComplexMap as ComplexMap5 } from "@dxos/util";
2450
2460
  function _ts_decorate7(decorators, target, key, desc) {
2451
2461
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -2489,7 +2499,7 @@ var SpaceProtocol = class {
2489
2499
  key: feed.key
2490
2500
  }, {
2491
2501
  F: __dxlog_file12,
2492
- L: 99,
2502
+ L: 103,
2493
2503
  S: this,
2494
2504
  C: (f, a) => f(...a)
2495
2505
  });
@@ -2512,7 +2522,7 @@ var SpaceProtocol = class {
2512
2522
  await this.blobSync.open();
2513
2523
  log11("starting...", void 0, {
2514
2524
  F: __dxlog_file12,
2515
- L: 125,
2525
+ L: 129,
2516
2526
  S: this,
2517
2527
  C: (f, a) => f(...a)
2518
2528
  });
@@ -2526,7 +2536,7 @@ var SpaceProtocol = class {
2526
2536
  });
2527
2537
  log11("started", void 0, {
2528
2538
  F: __dxlog_file12,
2529
- L: 135,
2539
+ L: 139,
2530
2540
  S: this,
2531
2541
  C: (f, a) => f(...a)
2532
2542
  });
@@ -2536,14 +2546,14 @@ var SpaceProtocol = class {
2536
2546
  if (this._connection) {
2537
2547
  log11("stopping...", void 0, {
2538
2548
  F: __dxlog_file12,
2539
- L: 142,
2549
+ L: 146,
2540
2550
  S: this,
2541
2551
  C: (f, a) => f(...a)
2542
2552
  });
2543
2553
  await this._connection.close();
2544
2554
  log11("stopped", void 0, {
2545
2555
  F: __dxlog_file12,
2546
- L: 144,
2556
+ L: 148,
2547
2557
  S: this,
2548
2558
  C: (f, a) => f(...a)
2549
2559
  });
@@ -2567,11 +2577,18 @@ var SpaceProtocol = class {
2567
2577
  }
2568
2578
  };
2569
2579
  _ts_decorate7([
2570
- logInfo2
2580
+ logInfo2,
2581
+ trace4.info()
2571
2582
  ], SpaceProtocol.prototype, "_topic", void 0);
2583
+ _ts_decorate7([
2584
+ trace4.info()
2585
+ ], SpaceProtocol.prototype, "_spaceKey", void 0);
2572
2586
  _ts_decorate7([
2573
2587
  logInfo2
2574
2588
  ], SpaceProtocol.prototype, "_ownPeerKey", null);
2589
+ SpaceProtocol = _ts_decorate7([
2590
+ trace4.resource()
2591
+ ], SpaceProtocol);
2575
2592
  var AuthStatus;
2576
2593
  (function(AuthStatus2) {
2577
2594
  AuthStatus2["INITIAL"] = "INITIAL";
@@ -2610,7 +2627,7 @@ var SpaceProtocolSession = class {
2610
2627
  onAuthSuccess: () => {
2611
2628
  log11("Peer authenticated", void 0, {
2612
2629
  F: __dxlog_file12,
2613
- L: 241,
2630
+ L: 245,
2614
2631
  S: this,
2615
2632
  C: (f, a) => f(...a)
2616
2633
  });
@@ -2628,7 +2645,7 @@ var SpaceProtocolSession = class {
2628
2645
  async close() {
2629
2646
  log11("close", void 0, {
2630
2647
  F: __dxlog_file12,
2631
- L: 257,
2648
+ L: 261,
2632
2649
  S: this,
2633
2650
  C: (f, a) => f(...a)
2634
2651
  });
@@ -2650,7 +2667,7 @@ import { synchronized as synchronized5, trackLeaks as trackLeaks4 } from "@dxos/
2650
2667
  import { failUndefined as failUndefined2 } from "@dxos/debug";
2651
2668
  import { PublicKey as PublicKey7 } from "@dxos/keys";
2652
2669
  import { log as log12 } from "@dxos/log";
2653
- import { trace as trace4 } from "@dxos/protocols";
2670
+ import { trace as trace5 } from "@dxos/protocols";
2654
2671
  import { ComplexMap as ComplexMap6 } from "@dxos/util";
2655
2672
  function _ts_decorate8(decorators, target, key, desc) {
2656
2673
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -2686,7 +2703,7 @@ var SpaceManager = class {
2686
2703
  ].map((space) => space.close()));
2687
2704
  }
2688
2705
  async constructSpace({ metadata, swarmIdentity, onAuthorizedConnection, onAuthFailure, memberKey }) {
2689
- log12.trace("dxos.echo.space-manager.construct-space", trace4.begin({
2706
+ log12.trace("dxos.echo.space-manager.construct-space", trace5.begin({
2690
2707
  id: this._instanceId
2691
2708
  }), {
2692
2709
  F: __dxlog_file13,
@@ -2724,7 +2741,7 @@ var SpaceManager = class {
2724
2741
  memberKey
2725
2742
  });
2726
2743
  this._spaces.set(space.key, space);
2727
- log12.trace("dxos.echo.space-manager.construct-space", trace4.end({
2744
+ log12.trace("dxos.echo.space-manager.construct-space", trace5.end({
2728
2745
  id: this._instanceId
2729
2746
  }), {
2730
2747
  F: __dxlog_file13,
@@ -2747,6 +2764,7 @@ SpaceManager = _ts_decorate8([
2747
2764
 
2748
2765
  // packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts
2749
2766
  import { Trigger as Trigger2 } from "@dxos/async";
2767
+ import { next as automerge } from "@dxos/automerge/automerge";
2750
2768
  import { Repo, NetworkAdapter, StorageAdapter, cbor } from "@dxos/automerge/automerge-repo";
2751
2769
  import { IndexedDBStorageAdapter } from "@dxos/automerge/automerge-repo-storage-indexeddb";
2752
2770
  import { Stream as Stream2 } from "@dxos/codec-protobuf";
@@ -2755,7 +2773,18 @@ import { PublicKey as PublicKey8 } from "@dxos/keys";
2755
2773
  import { log as log13 } from "@dxos/log";
2756
2774
  import { StorageType } from "@dxos/random-access-storage";
2757
2775
  import { AutomergeReplicator } from "@dxos/teleport-extension-automerge-replicator";
2758
- import { ComplexMap as ComplexMap7, ComplexSet, arrayToBuffer as arrayToBuffer2, bufferToArray, defaultMap } from "@dxos/util";
2776
+ import { trace as trace6 } from "@dxos/tracing";
2777
+ import { ComplexMap as ComplexMap7, ComplexSet, arrayToBuffer as arrayToBuffer2, bufferToArray, defaultMap, mapValues } from "@dxos/util";
2778
+ function _ts_decorate9(decorators, target, key, desc) {
2779
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2780
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2781
+ r = Reflect.decorate(decorators, target, key, desc);
2782
+ else
2783
+ for (var i = decorators.length - 1; i >= 0; i--)
2784
+ if (d = decorators[i])
2785
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2786
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2787
+ }
2759
2788
  var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts";
2760
2789
  var AutomergeHost = class {
2761
2790
  constructor(storageDirectory) {
@@ -2789,7 +2818,7 @@ var AutomergeHost = class {
2789
2818
  documentId
2790
2819
  }, {
2791
2820
  F: __dxlog_file14,
2792
- L: 65,
2821
+ L: 68,
2793
2822
  S: this,
2794
2823
  C: (f, a) => f(...a)
2795
2824
  });
@@ -2802,7 +2831,7 @@ var AutomergeHost = class {
2802
2831
  documentId
2803
2832
  }, {
2804
2833
  F: __dxlog_file14,
2805
- L: 71,
2834
+ L: 74,
2806
2835
  S: this,
2807
2836
  C: (f, a) => f(...a)
2808
2837
  });
@@ -2817,7 +2846,7 @@ var AutomergeHost = class {
2817
2846
  documentId
2818
2847
  }, {
2819
2848
  F: __dxlog_file14,
2820
- L: 81,
2849
+ L: 84,
2821
2850
  S: this,
2822
2851
  C: (f, a) => f(...a)
2823
2852
  });
@@ -2833,7 +2862,7 @@ var AutomergeHost = class {
2833
2862
  isAuthorized
2834
2863
  }, {
2835
2864
  F: __dxlog_file14,
2836
- L: 87,
2865
+ L: 90,
2837
2866
  S: this,
2838
2867
  C: (f, a) => f(...a)
2839
2868
  });
@@ -2841,7 +2870,7 @@ var AutomergeHost = class {
2841
2870
  } catch (err) {
2842
2871
  log13.catch(err, void 0, {
2843
2872
  F: __dxlog_file14,
2844
- L: 90,
2873
+ L: 93,
2845
2874
  S: this,
2846
2875
  C: (f, a) => f(...a)
2847
2876
  });
@@ -2855,6 +2884,16 @@ var AutomergeHost = class {
2855
2884
  get repo() {
2856
2885
  return this._repo;
2857
2886
  }
2887
+ _automergeDocs() {
2888
+ return mapValues(this._repo.handles, (handle) => ({
2889
+ state: handle.state,
2890
+ hasDoc: !!handle.docSync(),
2891
+ heads: handle.docSync() ? automerge.getHeads(handle.docSync()) : null
2892
+ }));
2893
+ }
2894
+ _automergePeers() {
2895
+ return this._repo.peers;
2896
+ }
2858
2897
  async close() {
2859
2898
  this._storage instanceof AutomergeStorageAdapter && await this._storage.close();
2860
2899
  await this._clientNetwork.close();
@@ -2881,6 +2920,19 @@ var AutomergeHost = class {
2881
2920
  defaultMap(this._authorizedDevices, spaceKey, () => new ComplexSet(PublicKey8.hash)).add(deviceKey);
2882
2921
  }
2883
2922
  };
2923
+ _ts_decorate9([
2924
+ trace6.info({
2925
+ depth: null
2926
+ })
2927
+ ], AutomergeHost.prototype, "_automergeDocs", null);
2928
+ _ts_decorate9([
2929
+ trace6.info({
2930
+ depth: null
2931
+ })
2932
+ ], AutomergeHost.prototype, "_automergePeers", null);
2933
+ AutomergeHost = _ts_decorate9([
2934
+ trace6.resource()
2935
+ ], AutomergeHost);
2884
2936
  var LocalHostNetworkAdapter = class extends NetworkAdapter {
2885
2937
  constructor() {
2886
2938
  super(...arguments);
@@ -2903,7 +2955,7 @@ var LocalHostNetworkAdapter = class extends NetworkAdapter {
2903
2955
  const peer = this._peers.get(message.targetId);
2904
2956
  invariant10(peer, "Peer not found.", {
2905
2957
  F: __dxlog_file14,
2906
- L: 170,
2958
+ L: 187,
2907
2959
  S: this,
2908
2960
  A: [
2909
2961
  "peer",
@@ -2923,7 +2975,7 @@ var LocalHostNetworkAdapter = class extends NetworkAdapter {
2923
2975
  return new Stream2(({ next, close }) => {
2924
2976
  invariant10(!this._peers.has(peerId), "Peer already connected.", {
2925
2977
  F: __dxlog_file14,
2926
- L: 188,
2978
+ L: 205,
2927
2979
  S: this,
2928
2980
  A: [
2929
2981
  "!this._peers.has(peerId)",
@@ -2954,7 +3006,7 @@ var LocalHostNetworkAdapter = class extends NetworkAdapter {
2954
3006
  });
2955
3007
  }).catch((err) => log13.catch(err, void 0, {
2956
3008
  F: __dxlog_file14,
2957
- L: 213,
3009
+ L: 230,
2958
3010
  S: this,
2959
3011
  C: (f, a) => f(...a)
2960
3012
  }));
@@ -2973,7 +3025,7 @@ var LocalHostNetworkAdapter = class extends NetworkAdapter {
2973
3025
  });
2974
3026
  invariant10(this.peerId, "Peer id not set.", {
2975
3027
  F: __dxlog_file14,
2976
- L: 225,
3028
+ L: 242,
2977
3029
  S: this,
2978
3030
  A: [
2979
3031
  "this.peerId",
@@ -3009,7 +3061,7 @@ var MeshNetworkAdapter = class extends NetworkAdapter {
3009
3061
  const extension = this._extensions.get(receiverId);
3010
3062
  invariant10(extension, "Extension not found.", {
3011
3063
  F: __dxlog_file14,
3012
- L: 260,
3064
+ L: 277,
3013
3065
  S: this,
3014
3066
  A: [
3015
3067
  "extension",
@@ -3020,7 +3072,7 @@ var MeshNetworkAdapter = class extends NetworkAdapter {
3020
3072
  payload: cbor.encode(message)
3021
3073
  }).catch((err) => log13.catch(err, void 0, {
3022
3074
  F: __dxlog_file14,
3023
- L: 261,
3075
+ L: 278,
3024
3076
  S: this,
3025
3077
  C: (f, a) => f(...a)
3026
3078
  }));
@@ -3030,7 +3082,7 @@ var MeshNetworkAdapter = class extends NetworkAdapter {
3030
3082
  createExtension() {
3031
3083
  invariant10(this.peerId, "Peer id not set.", {
3032
3084
  F: __dxlog_file14,
3033
- L: 269,
3085
+ L: 286,
3034
3086
  S: this,
3035
3087
  A: [
3036
3088
  "this.peerId",
@@ -3174,4 +3226,4 @@ export {
3174
3226
  SpaceManager,
3175
3227
  AutomergeHost
3176
3228
  };
3177
- //# sourceMappingURL=chunk-PB5T4DLC.mjs.map
3229
+ //# sourceMappingURL=chunk-CTE522SL.mjs.map