@dxos/echo-pipeline 0.1.55 → 0.1.56-main.09ca29d

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 (33) hide show
  1. package/dist/lib/browser/{chunk-4VJRJ4SY.mjs → chunk-7RPTJNLX.mjs} +469 -163
  2. package/dist/lib/browser/chunk-7RPTJNLX.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/index.cjs +468 -162
  7. package/dist/lib/node/index.cjs.map +3 -3
  8. package/dist/lib/node/meta.json +1 -1
  9. package/dist/lib/node/testing/index.cjs +456 -150
  10. package/dist/lib/node/testing/index.cjs.map +3 -3
  11. package/dist/types/src/common/feeds.d.ts.map +1 -1
  12. package/dist/types/src/db-host/data-service-host.d.ts.map +1 -1
  13. package/dist/types/src/db-host/data-service.d.ts.map +1 -1
  14. package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
  15. package/dist/types/src/pipeline/message-selector.d.ts.map +1 -1
  16. package/dist/types/src/pipeline/pipeline.d.ts.map +1 -1
  17. package/dist/types/src/space/auth.d.ts.map +1 -1
  18. package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
  19. package/dist/types/src/space/space-protocol.d.ts.map +1 -1
  20. package/dist/types/src/space/space.d.ts.map +1 -1
  21. package/package.json +31 -31
  22. package/src/common/feeds.ts +1 -2
  23. package/src/db-host/data-service-host.ts +1 -2
  24. package/src/db-host/data-service.ts +1 -2
  25. package/src/metadata/metadata-store.ts +1 -1
  26. package/src/pipeline/message-selector.ts +1 -2
  27. package/src/pipeline/pipeline.ts +1 -2
  28. package/src/space/auth.ts +1 -2
  29. package/src/space/data-pipeline.ts +1 -2
  30. package/src/space/space-protocol.ts +3 -2
  31. package/src/space/space.test.ts +8 -8
  32. package/src/space/space.ts +1 -2
  33. package/dist/lib/browser/chunk-4VJRJ4SY.mjs.map +0 -7
@@ -71,23 +71,40 @@ var codec = import_protocols.schema.getCodecForType("dxos.echo.feed.FeedMessage"
71
71
  var valueEncoding = (0, import_hypercore.createCodecEncoding)(codec);
72
72
 
73
73
  // packages/core/echo/echo-pipeline/src/common/feeds.ts
74
- var import_tiny_invariant = __toESM(require("tiny-invariant"));
74
+ var import_invariant = require("@dxos/invariant");
75
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/common/feeds.ts";
75
76
  var createMappedFeedWriter = (mapper, writer) => {
76
- (0, import_tiny_invariant.default)(mapper);
77
- (0, import_tiny_invariant.default)(writer);
77
+ (0, import_invariant.invariant)(mapper, void 0, {
78
+ F: __dxlog_file,
79
+ L: 16,
80
+ S: void 0,
81
+ A: [
82
+ "mapper",
83
+ ""
84
+ ]
85
+ });
86
+ (0, import_invariant.invariant)(writer, void 0, {
87
+ F: __dxlog_file,
88
+ L: 17,
89
+ S: void 0,
90
+ A: [
91
+ "writer",
92
+ ""
93
+ ]
94
+ });
78
95
  return {
79
96
  write: async (data, options) => await writer.write(await mapper(data), options)
80
97
  };
81
98
  };
82
99
 
83
100
  // packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts
84
- var import_tiny_invariant2 = __toESM(require("tiny-invariant"));
85
101
  var import_codec_protobuf = require("@dxos/codec-protobuf");
86
102
  var import_context = require("@dxos/context");
87
103
  var import_echo_db = require("@dxos/echo-db");
104
+ var import_invariant2 = require("@dxos/invariant");
88
105
  var import_log = require("@dxos/log");
89
106
  var import_util = require("@dxos/util");
90
- var __dxlog_file = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
107
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
91
108
  var DataServiceHost = class {
92
109
  constructor(_itemManager, _itemDemuxer, _writeStream) {
93
110
  this._itemManager = _itemManager;
@@ -116,13 +133,21 @@ var DataServiceHost = class {
116
133
  this._itemDemuxer.mutation.on(ctx, (message) => {
117
134
  var _a;
118
135
  const { batch, meta } = message;
119
- (0, import_tiny_invariant2.default)(!meta.clientTag, "Unexpected client tag in mutation message");
136
+ (0, import_invariant2.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
137
+ F: __dxlog_file2,
138
+ L: 61,
139
+ S: this,
140
+ A: [
141
+ "!(meta as any).clientTag",
142
+ "'Unexpected client tag in mutation message'"
143
+ ]
144
+ });
120
145
  (0, import_log.log)("message", {
121
146
  batch,
122
147
  meta
123
148
  }, {
124
- F: __dxlog_file,
125
- L: 63,
149
+ F: __dxlog_file2,
150
+ L: 62,
126
151
  S: this,
127
152
  C: (f, a) => f(...a)
128
153
  });
@@ -149,14 +174,30 @@ var DataServiceHost = class {
149
174
  }
150
175
  async write(request) {
151
176
  var _a, _b;
152
- (0, import_tiny_invariant2.default)(!this._ctx.disposed, "Cannot write to closed DataServiceHost");
153
- (0, import_tiny_invariant2.default)(this._writeStream, "Cannot write mutations in readonly mode");
177
+ (0, import_invariant2.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
178
+ F: __dxlog_file2,
179
+ L: 88,
180
+ S: this,
181
+ A: [
182
+ "!this._ctx.disposed",
183
+ "'Cannot write to closed DataServiceHost'"
184
+ ]
185
+ });
186
+ (0, import_invariant2.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
187
+ F: __dxlog_file2,
188
+ L: 89,
189
+ S: this,
190
+ A: [
191
+ "this._writeStream",
192
+ "'Cannot write mutations in readonly mode'"
193
+ ]
194
+ });
154
195
  (0, import_log.log)("write", {
155
196
  clientTag: request.clientTag,
156
197
  objectCount: (_b = (_a = request.batch.objects) == null ? void 0 : _a.length) != null ? _b : 0
157
198
  }, {
158
- F: __dxlog_file,
159
- L: 92,
199
+ F: __dxlog_file2,
200
+ L: 91,
160
201
  S: this,
161
202
  C: (f, a) => f(...a)
162
203
  });
@@ -169,8 +210,8 @@ var DataServiceHost = class {
169
210
  feedKey: receipt2.feedKey,
170
211
  seq: receipt2.seq
171
212
  }, {
172
- F: __dxlog_file,
173
- L: 101,
213
+ F: __dxlog_file2,
214
+ L: 100,
174
215
  S: this,
175
216
  C: (f, a) => f(...a)
176
217
  });
@@ -337,12 +378,12 @@ var SnapshotStore = class {
337
378
  };
338
379
 
339
380
  // packages/core/echo/echo-pipeline/src/db-host/data-service.ts
340
- var import_tiny_invariant3 = __toESM(require("tiny-invariant"));
341
381
  var import_debug2 = require("@dxos/debug");
382
+ var import_invariant3 = require("@dxos/invariant");
342
383
  var import_keys2 = require("@dxos/keys");
343
384
  var import_log2 = require("@dxos/log");
344
385
  var import_util2 = require("@dxos/util");
345
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
386
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
346
387
  var DataServiceSubscriptions = class {
347
388
  constructor() {
348
389
  this._spaces = new import_util2.ComplexMap(import_keys2.PublicKey.hash);
@@ -354,12 +395,20 @@ var DataServiceSubscriptions = class {
354
395
  (0, import_log2.log)("Registering space", {
355
396
  spaceKey
356
397
  }, {
357
- F: __dxlog_file2,
358
- L: 31,
398
+ F: __dxlog_file3,
399
+ L: 30,
359
400
  S: this,
360
401
  C: (f, a) => f(...a)
361
402
  });
362
- (0, import_tiny_invariant3.default)(!this._spaces.has(spaceKey));
403
+ (0, import_invariant3.invariant)(!this._spaces.has(spaceKey), void 0, {
404
+ F: __dxlog_file3,
405
+ L: 31,
406
+ S: this,
407
+ A: [
408
+ "!this._spaces.has(spaceKey)",
409
+ ""
410
+ ]
411
+ });
363
412
  await host.open();
364
413
  this._spaces.set(spaceKey, host);
365
414
  }
@@ -367,8 +416,8 @@ var DataServiceSubscriptions = class {
367
416
  (0, import_log2.log)("Unregistering space", {
368
417
  spaceKey
369
418
  }, {
370
- F: __dxlog_file2,
371
- L: 38,
419
+ F: __dxlog_file3,
420
+ L: 37,
372
421
  S: this,
373
422
  C: (f, a) => f(...a)
374
423
  });
@@ -386,14 +435,38 @@ var DataServiceImpl = class {
386
435
  }
387
436
  subscribe(request) {
388
437
  var _a;
389
- (0, import_tiny_invariant3.default)(request.spaceKey);
438
+ (0, import_invariant3.invariant)(request.spaceKey, void 0, {
439
+ F: __dxlog_file3,
440
+ L: 56,
441
+ S: this,
442
+ A: [
443
+ "request.spaceKey",
444
+ ""
445
+ ]
446
+ });
390
447
  const host = (_a = this._subscriptions.getDataService(request.spaceKey)) != null ? _a : (0, import_debug2.raise)(new Error(`space not found: ${request.spaceKey}`));
391
448
  return host.subscribe();
392
449
  }
393
450
  write(request) {
394
451
  var _a;
395
- (0, import_tiny_invariant3.default)(request.spaceKey);
396
- (0, import_tiny_invariant3.default)(request.batch);
452
+ (0, import_invariant3.invariant)(request.spaceKey, void 0, {
453
+ F: __dxlog_file3,
454
+ L: 63,
455
+ S: this,
456
+ A: [
457
+ "request.spaceKey",
458
+ ""
459
+ ]
460
+ });
461
+ (0, import_invariant3.invariant)(request.batch, void 0, {
462
+ F: __dxlog_file3,
463
+ L: 64,
464
+ S: this,
465
+ A: [
466
+ "request.batch",
467
+ ""
468
+ ]
469
+ });
397
470
  const host = (_a = this._subscriptions.getDataService(request.spaceKey)) != null ? _a : (0, import_debug2.raise)(new Error(`space not found: ${request.spaceKey}`));
398
471
  return host.write(request);
399
472
  }
@@ -450,9 +523,9 @@ var UnknownModelError = class extends DBError {
450
523
 
451
524
  // packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
452
525
  var import_crc_32 = __toESM(require("crc-32"));
453
- var import_tiny_invariant4 = __toESM(require("tiny-invariant"));
454
526
  var import_async2 = require("@dxos/async");
455
527
  var import_errors = require("@dxos/errors");
528
+ var import_invariant4 = require("@dxos/invariant");
456
529
  var import_log3 = require("@dxos/log");
457
530
  var import_protocols4 = require("@dxos/protocols");
458
531
  var import_services = require("@dxos/protocols/proto/dxos/client/services");
@@ -467,7 +540,7 @@ function _ts_decorate2(decorators, target, key, desc) {
467
540
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
468
541
  return c > 3 && r && Object.defineProperty(target, key, r), r;
469
542
  }
470
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
543
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
471
544
  var emptyEchoMetadata = () => ({
472
545
  version: import_protocols4.STORAGE_VERSION,
473
546
  spaces: [],
@@ -514,7 +587,7 @@ var MetadataStore = class {
514
587
  size: dataSize,
515
588
  checksum
516
589
  }, {
517
- F: __dxlog_file3,
590
+ F: __dxlog_file4,
518
591
  L: 72,
519
592
  S: this,
520
593
  C: (f, a) => f(...a)
@@ -536,7 +609,7 @@ var MetadataStore = class {
536
609
  import_log3.log.error("failed to load metadata", {
537
610
  err
538
611
  }, {
539
- F: __dxlog_file3,
612
+ F: __dxlog_file4,
540
613
  L: 92,
541
614
  S: this,
542
615
  C: (f, a) => f(...a)
@@ -568,7 +641,7 @@ var MetadataStore = class {
568
641
  size: encoded.length,
569
642
  checksum
570
643
  }, {
571
- F: __dxlog_file3,
644
+ F: __dxlog_file4,
572
645
  L: 124,
573
646
  S: this,
574
647
  C: (f, a) => f(...a)
@@ -583,7 +656,15 @@ var MetadataStore = class {
583
656
  return this._metadata.identity.haloSpace;
584
657
  }
585
658
  const space = this.spaces.find((space2) => space2.key === spaceKey);
586
- (0, import_tiny_invariant4.default)(space, "Space not found");
659
+ (0, import_invariant4.invariant)(space, "Space not found", {
660
+ F: __dxlog_file4,
661
+ L: 137,
662
+ S: this,
663
+ A: [
664
+ "space",
665
+ "'Space not found'"
666
+ ]
667
+ });
587
668
  return space;
588
669
  }
589
670
  /**
@@ -591,7 +672,7 @@ var MetadataStore = class {
591
672
  */
592
673
  async clear() {
593
674
  (0, import_log3.log)("clearing all metadata", void 0, {
594
- F: __dxlog_file3,
675
+ F: __dxlog_file4,
595
676
  L: 145,
596
677
  S: this,
597
678
  C: (f, a) => f(...a)
@@ -603,13 +684,29 @@ var MetadataStore = class {
603
684
  return this._metadata.identity;
604
685
  }
605
686
  async setIdentityRecord(record) {
606
- (0, import_tiny_invariant4.default)(!this._metadata.identity, "Cannot overwrite existing identity in metadata");
687
+ (0, import_invariant4.invariant)(!this._metadata.identity, "Cannot overwrite existing identity in metadata", {
688
+ F: __dxlog_file4,
689
+ L: 155,
690
+ S: this,
691
+ A: [
692
+ "!this._metadata.identity",
693
+ "'Cannot overwrite existing identity in metadata'"
694
+ ]
695
+ });
607
696
  this._metadata.identity = record;
608
697
  await this._save();
609
698
  }
610
699
  async addSpace(record) {
611
700
  var _a, _b, _c;
612
- (0, import_tiny_invariant4.default)(!((_a = this._metadata.spaces) != null ? _a : []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata");
701
+ (0, import_invariant4.invariant)(!((_a = this._metadata.spaces) != null ? _a : []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata", {
702
+ F: __dxlog_file4,
703
+ L: 162,
704
+ S: this,
705
+ A: [
706
+ "!(this._metadata.spaces ?? []).find((space) => space.key === record.key)",
707
+ "'Cannot overwrite existing space in metadata'"
708
+ ]
709
+ });
613
710
  ((_c = (_b = this._metadata).spaces) != null ? _c : _b.spaces = []).push(record);
614
711
  await this._save();
615
712
  }
@@ -645,32 +742,40 @@ _ts_decorate2([
645
742
  var fromBytesInt32 = (buf) => buf.readInt32LE(0);
646
743
 
647
744
  // packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
648
- var import_tiny_invariant6 = __toESM(require("tiny-invariant"));
649
745
  var import_async4 = require("@dxos/async");
650
746
  var import_context3 = require("@dxos/context");
651
747
  var import_debug4 = require("@dxos/debug");
652
748
  var import_feed_store = require("@dxos/feed-store");
749
+ var import_invariant6 = require("@dxos/invariant");
653
750
  var import_keys3 = require("@dxos/keys");
654
751
  var import_log6 = require("@dxos/log");
655
752
  var import_timeframe2 = require("@dxos/timeframe");
656
753
  var import_util4 = require("@dxos/util");
657
754
 
658
755
  // packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts
659
- var import_tiny_invariant5 = __toESM(require("tiny-invariant"));
756
+ var import_invariant5 = require("@dxos/invariant");
660
757
  var import_log4 = require("@dxos/log");
661
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts";
758
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts";
662
759
  var createMessageSelector = (timeframeClock) => {
663
760
  return (messages) => {
664
761
  for (let i = 0; i < messages.length; i++) {
665
762
  const { data: { timeframe } } = messages[i];
666
- (0, import_tiny_invariant5.default)(timeframe);
763
+ (0, import_invariant5.invariant)(timeframe, void 0, {
764
+ F: __dxlog_file5,
765
+ L: 25,
766
+ S: void 0,
767
+ A: [
768
+ "timeframe",
769
+ ""
770
+ ]
771
+ });
667
772
  if (!timeframeClock.hasGaps(timeframe)) {
668
773
  return i;
669
774
  }
670
775
  }
671
776
  (0, import_log4.log)("Skipping...", void 0, {
672
- F: __dxlog_file4,
673
- L: 34,
777
+ F: __dxlog_file5,
778
+ L: 33,
674
779
  S: void 0,
675
780
  C: (f, a) => f(...a)
676
781
  });
@@ -692,7 +797,7 @@ function _ts_decorate3(decorators, target, key, desc) {
692
797
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
693
798
  return c > 3 && r && Object.defineProperty(target, key, r), r;
694
799
  }
695
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts";
800
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts";
696
801
  var mapTimeframeToFeedIndexes = (timeframe) => timeframe.frames().map(([feedKey, index]) => ({
697
802
  feedKey,
698
803
  index
@@ -751,7 +856,7 @@ var TimeframeClock = class {
751
856
  target,
752
857
  current: this._timeframe
753
858
  }, {
754
- F: __dxlog_file5,
859
+ F: __dxlog_file6,
755
860
  L: 73,
756
861
  S: this,
757
862
  C: (f, a) => f(...a)
@@ -762,7 +867,7 @@ var TimeframeClock = class {
762
867
  current: this._timeframe,
763
868
  deps: import_timeframe.Timeframe.dependencies(target, this._timeframe)
764
869
  }, {
765
- F: __dxlog_file5,
870
+ F: __dxlog_file6,
766
871
  L: 75,
767
872
  S: this,
768
873
  C: (f, a) => f(...a)
@@ -786,7 +891,7 @@ function _ts_decorate4(decorators, target, key, desc) {
786
891
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
787
892
  return c > 3 && r && Object.defineProperty(target, key, r), r;
788
893
  }
789
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
894
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
790
895
  var PipelineState = class {
791
896
  // prettier-ignore
792
897
  constructor(_feeds, _timeframeClock) {
@@ -843,8 +948,8 @@ var PipelineState = class {
843
948
  current: this.timeframe,
844
949
  target: this.targetTimeframe
845
950
  }, {
846
- F: __dxlog_file6,
847
- L: 126,
951
+ F: __dxlog_file7,
952
+ L: 125,
848
953
  S: this,
849
954
  C: (f, a) => f(...a)
850
955
  });
@@ -874,8 +979,8 @@ var PipelineState = class {
874
979
  target: this.targetTimeframe,
875
980
  dependencies: import_timeframe2.Timeframe.dependencies(this.targetTimeframe, this.timeframe)
876
981
  }, {
877
- F: __dxlog_file6,
878
- L: 153,
982
+ F: __dxlog_file7,
983
+ L: 152,
879
984
  S: this,
880
985
  C: (f, a) => f(...a)
881
986
  });
@@ -904,7 +1009,15 @@ var Pipeline = class {
904
1009
  return this._state;
905
1010
  }
906
1011
  get writer() {
907
- (0, import_tiny_invariant6.default)(this._writer, "Writer not set.");
1012
+ (0, import_invariant6.invariant)(this._writer, "Writer not set.", {
1013
+ F: __dxlog_file7,
1014
+ L: 230,
1015
+ S: this,
1016
+ A: [
1017
+ "this._writer",
1018
+ "'Writer not set.'"
1019
+ ]
1020
+ });
908
1021
  return this._writer;
909
1022
  }
910
1023
  hasFeed(feedKey) {
@@ -923,8 +1036,24 @@ var Pipeline = class {
923
1036
  this._setFeedDownloadState(feed);
924
1037
  }
925
1038
  setWriteFeed(feed) {
926
- (0, import_tiny_invariant6.default)(!this._writer, "Writer already set.");
927
- (0, import_tiny_invariant6.default)(feed.properties.writable, "Feed must be writable.");
1039
+ (0, import_invariant6.invariant)(!this._writer, "Writer already set.", {
1040
+ F: __dxlog_file7,
1041
+ L: 253,
1042
+ S: this,
1043
+ A: [
1044
+ "!this._writer",
1045
+ "'Writer already set.'"
1046
+ ]
1047
+ });
1048
+ (0, import_invariant6.invariant)(feed.properties.writable, "Feed must be writable.", {
1049
+ F: __dxlog_file7,
1050
+ L: 254,
1051
+ S: this,
1052
+ A: [
1053
+ "feed.properties.writable",
1054
+ "'Feed must be writable.'"
1055
+ ]
1056
+ });
928
1057
  this._writer = createMappedFeedWriter((payload) => ({
929
1058
  timeframe: this._timeframeClock.timeframe,
930
1059
  payload
@@ -932,8 +1061,8 @@ var Pipeline = class {
932
1061
  }
933
1062
  async start() {
934
1063
  (0, import_log6.log)("starting...", void 0, {
935
- F: __dxlog_file6,
936
- L: 268,
1064
+ F: __dxlog_file7,
1065
+ L: 267,
937
1066
  S: this,
938
1067
  C: (f, a) => f(...a)
939
1068
  });
@@ -941,8 +1070,8 @@ var Pipeline = class {
941
1070
  await this._feedSetIterator.open();
942
1071
  this._isStarted = true;
943
1072
  (0, import_log6.log)("started", void 0, {
944
- F: __dxlog_file6,
945
- L: 272,
1073
+ F: __dxlog_file7,
1074
+ L: 271,
946
1075
  S: this,
947
1076
  C: (f, a) => f(...a)
948
1077
  });
@@ -950,8 +1079,8 @@ var Pipeline = class {
950
1079
  async stop() {
951
1080
  var _a;
952
1081
  (0, import_log6.log)("stopping...", void 0, {
953
- F: __dxlog_file6,
954
- L: 277,
1082
+ F: __dxlog_file7,
1083
+ L: 276,
955
1084
  S: this,
956
1085
  C: (f, a) => f(...a)
957
1086
  });
@@ -963,8 +1092,8 @@ var Pipeline = class {
963
1092
  this._state._reachedTargetPromise = void 0;
964
1093
  this._isStarted = false;
965
1094
  (0, import_log6.log)("stopped", void 0, {
966
- F: __dxlog_file6,
967
- L: 285,
1095
+ F: __dxlog_file7,
1096
+ L: 284,
968
1097
  S: this,
969
1098
  C: (f, a) => f(...a)
970
1099
  });
@@ -974,7 +1103,15 @@ var Pipeline = class {
974
1103
  * The pipeline will start processing messages AFTER this timeframe.
975
1104
  */
976
1105
  async setCursor(timeframe) {
977
- (0, import_tiny_invariant6.default)(!this._isStarted || this._isPaused, "Invalid state.");
1106
+ (0, import_invariant6.invariant)(!this._isStarted || this._isPaused, "Invalid state.", {
1107
+ F: __dxlog_file7,
1108
+ L: 293,
1109
+ S: this,
1110
+ A: [
1111
+ "!this._isStarted || this._isPaused",
1112
+ "'Invalid state.'"
1113
+ ]
1114
+ });
978
1115
  this._state._startTimeframe = timeframe;
979
1116
  this._timeframeClock.setTimeframe(timeframe);
980
1117
  for (const feed of this._feeds.values()) {
@@ -990,7 +1127,15 @@ var Pipeline = class {
990
1127
  * Calling pause while processing will cause a deadlock.
991
1128
  */
992
1129
  async pause() {
993
- (0, import_tiny_invariant6.default)(this._isStarted, "Pipeline is not open.");
1130
+ (0, import_invariant6.invariant)(this._isStarted, "Pipeline is not open.", {
1131
+ F: __dxlog_file7,
1132
+ L: 315,
1133
+ S: this,
1134
+ A: [
1135
+ "this._isStarted",
1136
+ "'Pipeline is not open.'"
1137
+ ]
1138
+ });
994
1139
  if (this._isPaused) {
995
1140
  return;
996
1141
  }
@@ -999,8 +1144,24 @@ var Pipeline = class {
999
1144
  this._isPaused = true;
1000
1145
  }
1001
1146
  async unpause() {
1002
- (0, import_tiny_invariant6.default)(this._isStarted, "Pipeline is not open.");
1003
- (0, import_tiny_invariant6.default)(this._isPaused, "Pipeline is not paused.");
1147
+ (0, import_invariant6.invariant)(this._isStarted, "Pipeline is not open.", {
1148
+ F: __dxlog_file7,
1149
+ L: 327,
1150
+ S: this,
1151
+ A: [
1152
+ "this._isStarted",
1153
+ "'Pipeline is not open.'"
1154
+ ]
1155
+ });
1156
+ (0, import_invariant6.invariant)(this._isPaused, "Pipeline is not paused.", {
1157
+ F: __dxlog_file7,
1158
+ L: 328,
1159
+ S: this,
1160
+ A: [
1161
+ "this._isPaused",
1162
+ "'Pipeline is not paused.'"
1163
+ ]
1164
+ });
1004
1165
  this._pauseTrigger.wake();
1005
1166
  this._isPaused = false;
1006
1167
  }
@@ -1009,15 +1170,39 @@ var Pipeline = class {
1009
1170
  * Updates the timeframe clock after the message has bee processed.
1010
1171
  */
1011
1172
  async *consume() {
1012
- (0, import_tiny_invariant6.default)(!this._isOpen, "Pipeline is already being consumed.");
1173
+ (0, import_invariant6.invariant)(!this._isOpen, "Pipeline is already being consumed.", {
1174
+ F: __dxlog_file7,
1175
+ L: 339,
1176
+ S: this,
1177
+ A: [
1178
+ "!this._isOpen",
1179
+ "'Pipeline is already being consumed.'"
1180
+ ]
1181
+ });
1013
1182
  this._isOpen = true;
1014
- (0, import_tiny_invariant6.default)(this._feedSetIterator, "Iterator not initialized.");
1183
+ (0, import_invariant6.invariant)(this._feedSetIterator, "Iterator not initialized.", {
1184
+ F: __dxlog_file7,
1185
+ L: 342,
1186
+ S: this,
1187
+ A: [
1188
+ "this._feedSetIterator",
1189
+ "'Iterator not initialized.'"
1190
+ ]
1191
+ });
1015
1192
  let lastFeedSetIterator = this._feedSetIterator;
1016
1193
  let iterable = lastFeedSetIterator[Symbol.asyncIterator]();
1017
1194
  while (!this._isStopping) {
1018
1195
  await this._pauseTrigger.wait();
1019
1196
  if (lastFeedSetIterator !== this._feedSetIterator) {
1020
- (0, import_tiny_invariant6.default)(this._feedSetIterator, "Iterator not initialized.");
1197
+ (0, import_invariant6.invariant)(this._feedSetIterator, "Iterator not initialized.", {
1198
+ F: __dxlog_file7,
1199
+ L: 351,
1200
+ S: this,
1201
+ A: [
1202
+ "this._feedSetIterator",
1203
+ "'Iterator not initialized.'"
1204
+ ]
1205
+ });
1021
1206
  lastFeedSetIterator = this._feedSetIterator;
1022
1207
  iterable = lastFeedSetIterator[Symbol.asyncIterator]();
1023
1208
  }
@@ -1039,8 +1224,8 @@ var Pipeline = class {
1039
1224
  const seq = (_a = timeframe.get(feed.key)) != null ? _a : 0;
1040
1225
  feed.undownload({
1041
1226
  callback: () => (0, import_log6.log)("undownload", void 0, {
1042
- F: __dxlog_file6,
1043
- L: 376,
1227
+ F: __dxlog_file7,
1228
+ L: 375,
1044
1229
  S: this,
1045
1230
  C: (f, a) => f(...a)
1046
1231
  })
@@ -1052,8 +1237,8 @@ var Pipeline = class {
1052
1237
  (0, import_log6.log)("failed to download feed", {
1053
1238
  err
1054
1239
  }, {
1055
- F: __dxlog_file6,
1056
- L: 378,
1240
+ F: __dxlog_file7,
1241
+ L: 377,
1057
1242
  S: this,
1058
1243
  C: (f, a) => f(...a)
1059
1244
  });
@@ -1066,8 +1251,8 @@ var Pipeline = class {
1066
1251
  });
1067
1252
  this._feedSetIterator.stalled.on((iterator) => {
1068
1253
  import_log6.log.warn(`Stalled after ${iterator.options.stallTimeout}ms with ${iterator.size} feeds.`, void 0, {
1069
- F: __dxlog_file6,
1070
- L: 389,
1254
+ F: __dxlog_file7,
1255
+ L: 388,
1071
1256
  S: this,
1072
1257
  C: (f, a) => f(...a)
1073
1258
  });
@@ -1095,14 +1280,14 @@ _ts_decorate4([
1095
1280
  ], Pipeline.prototype, "unpause", null);
1096
1281
 
1097
1282
  // packages/core/echo/echo-pipeline/src/space/auth.ts
1098
- var import_tiny_invariant7 = __toESM(require("tiny-invariant"));
1099
1283
  var import_async5 = require("@dxos/async");
1100
1284
  var import_context4 = require("@dxos/context");
1101
1285
  var import_crypto2 = require("@dxos/crypto");
1286
+ var import_invariant7 = require("@dxos/invariant");
1102
1287
  var import_log7 = require("@dxos/log");
1103
1288
  var import_protocols5 = require("@dxos/protocols");
1104
1289
  var import_teleport = require("@dxos/teleport");
1105
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/auth.ts";
1290
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/auth.ts";
1106
1291
  var AuthExtension = class extends import_teleport.RpcExtension {
1107
1292
  constructor(_authParams) {
1108
1293
  super({
@@ -1118,8 +1303,8 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1118
1303
  this._ctx = new import_context4.Context({
1119
1304
  onError: (err) => {
1120
1305
  import_log7.log.catch(err, void 0, {
1121
- F: __dxlog_file7,
1122
- L: 29,
1306
+ F: __dxlog_file8,
1307
+ L: 28,
1123
1308
  S: this,
1124
1309
  C: (f, a) => f(...a)
1125
1310
  });
@@ -1140,8 +1325,8 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1140
1325
  };
1141
1326
  } catch (err) {
1142
1327
  import_log7.log.error("failed to generate auth credentials", err, {
1143
- F: __dxlog_file7,
1144
- L: 56,
1328
+ F: __dxlog_file8,
1329
+ L: 55,
1145
1330
  S: this,
1146
1331
  C: (f, a) => f(...a)
1147
1332
  });
@@ -1159,14 +1344,30 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1159
1344
  const { credential } = await this.rpc.AuthService.authenticate({
1160
1345
  challenge
1161
1346
  });
1162
- (0, import_tiny_invariant7.default)((credential == null ? void 0 : credential.length) > 0, "invalid credential");
1347
+ (0, import_invariant7.invariant)((credential == null ? void 0 : credential.length) > 0, "invalid credential", {
1348
+ F: __dxlog_file8,
1349
+ L: 69,
1350
+ S: this,
1351
+ A: [
1352
+ "credential?.length > 0",
1353
+ "'invalid credential'"
1354
+ ]
1355
+ });
1163
1356
  const success = await this._authParams.verifier(challenge, credential);
1164
- (0, import_tiny_invariant7.default)(success, "credential not verified");
1357
+ (0, import_invariant7.invariant)(success, "credential not verified", {
1358
+ F: __dxlog_file8,
1359
+ L: 71,
1360
+ S: this,
1361
+ A: [
1362
+ "success",
1363
+ "'credential not verified'"
1364
+ ]
1365
+ });
1165
1366
  (0, import_async5.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
1166
1367
  } catch (err) {
1167
1368
  (0, import_log7.log)("auth failed", err, {
1168
- F: __dxlog_file7,
1169
- L: 75,
1369
+ F: __dxlog_file8,
1370
+ L: 74,
1170
1371
  S: this,
1171
1372
  C: (f, a) => f(...a)
1172
1373
  });
@@ -1182,8 +1383,8 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1182
1383
  };
1183
1384
 
1184
1385
  // packages/core/echo/echo-pipeline/src/space/space.ts
1185
- var import_tiny_invariant9 = __toESM(require("tiny-invariant"));
1186
1386
  var import_async7 = require("@dxos/async");
1387
+ var import_invariant9 = require("@dxos/invariant");
1187
1388
  var import_log10 = require("@dxos/log");
1188
1389
  var import_credentials4 = require("@dxos/protocols/proto/dxos/halo/credentials");
1189
1390
  var import_util7 = require("@dxos/util");
@@ -1195,7 +1396,7 @@ var import_log8 = require("@dxos/log");
1195
1396
  var import_credentials2 = require("@dxos/protocols/proto/dxos/halo/credentials");
1196
1397
  var import_timeframe3 = require("@dxos/timeframe");
1197
1398
  var import_util5 = require("@dxos/util");
1198
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/control-pipeline.ts";
1399
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/control-pipeline.ts";
1199
1400
  var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL = 500;
1200
1401
  var ControlPipeline = class {
1201
1402
  constructor({ spaceKey, genesisFeed, feedProvider, metadataStore }) {
@@ -1210,7 +1411,7 @@ var ControlPipeline = class {
1210
1411
  (0, import_log8.log)("feed admitted", {
1211
1412
  key: info.key
1212
1413
  }, {
1213
- F: __dxlog_file8,
1414
+ F: __dxlog_file9,
1214
1415
  L: 51,
1215
1416
  S: this,
1216
1417
  C: (f, a) => f(...a)
@@ -1221,7 +1422,7 @@ var ControlPipeline = class {
1221
1422
  await this._pipeline.addFeed(feed);
1222
1423
  } catch (err) {
1223
1424
  import_log8.log.catch(err, void 0, {
1224
- F: __dxlog_file8,
1425
+ F: __dxlog_file9,
1225
1426
  L: 59,
1226
1427
  S: this,
1227
1428
  C: (f, a) => f(...a)
@@ -1244,7 +1445,7 @@ var ControlPipeline = class {
1244
1445
  }
1245
1446
  async start() {
1246
1447
  (0, import_log8.log)("starting...", void 0, {
1247
- F: __dxlog_file8,
1448
+ F: __dxlog_file9,
1248
1449
  L: 83,
1249
1450
  S: this,
1250
1451
  C: (f, a) => f(...a)
@@ -1256,7 +1457,7 @@ var ControlPipeline = class {
1256
1457
  key: msg.feedKey,
1257
1458
  seq: msg.seq
1258
1459
  }, {
1259
- F: __dxlog_file8,
1460
+ F: __dxlog_file9,
1260
1461
  L: 88,
1261
1462
  S: this,
1262
1463
  C: (f, a) => f(...a)
@@ -1269,7 +1470,7 @@ var ControlPipeline = class {
1269
1470
  import_log8.log.warn("processing failed", {
1270
1471
  msg
1271
1472
  }, {
1272
- F: __dxlog_file8,
1473
+ F: __dxlog_file9,
1273
1474
  L: 98,
1274
1475
  S: this,
1275
1476
  C: (f, a) => f(...a)
@@ -1280,7 +1481,7 @@ var ControlPipeline = class {
1280
1481
  }
1281
1482
  } catch (err) {
1282
1483
  import_log8.log.catch(err, void 0, {
1283
- F: __dxlog_file8,
1484
+ F: __dxlog_file9,
1284
1485
  L: 104,
1285
1486
  S: this,
1286
1487
  C: (f, a) => f(...a)
@@ -1290,7 +1491,7 @@ var ControlPipeline = class {
1290
1491
  });
1291
1492
  await this._pipeline.start();
1292
1493
  (0, import_log8.log)("started", void 0, {
1293
- F: __dxlog_file8,
1494
+ F: __dxlog_file9,
1294
1495
  L: 110,
1295
1496
  S: this,
1296
1497
  C: (f, a) => f(...a)
@@ -1304,7 +1505,7 @@ var ControlPipeline = class {
1304
1505
  }
1305
1506
  async stop() {
1306
1507
  (0, import_log8.log)("stopping...", void 0, {
1307
- F: __dxlog_file8,
1508
+ F: __dxlog_file9,
1308
1509
  L: 124,
1309
1510
  S: this,
1310
1511
  C: (f, a) => f(...a)
@@ -1312,7 +1513,7 @@ var ControlPipeline = class {
1312
1513
  await this._pipeline.stop();
1313
1514
  await this._saveTargetTimeframe(this._pipeline.state.timeframe);
1314
1515
  (0, import_log8.log)("stopped", void 0, {
1315
- F: __dxlog_file8,
1516
+ F: __dxlog_file9,
1316
1517
  L: 127,
1317
1518
  S: this,
1318
1519
  C: (f, a) => f(...a)
@@ -1326,7 +1527,7 @@ var ControlPipeline = class {
1326
1527
  this._targetTimeframe = newTimeframe;
1327
1528
  } catch (err) {
1328
1529
  (0, import_log8.log)(err, void 0, {
1329
- F: __dxlog_file8,
1530
+ F: __dxlog_file9,
1330
1531
  L: 136,
1331
1532
  S: this,
1332
1533
  C: (f, a) => f(...a)
@@ -1336,12 +1537,12 @@ var ControlPipeline = class {
1336
1537
  };
1337
1538
 
1338
1539
  // packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
1339
- var import_tiny_invariant8 = __toESM(require("tiny-invariant"));
1340
1540
  var import_async6 = require("@dxos/async");
1341
1541
  var import_context5 = require("@dxos/context");
1342
1542
  var import_credentials3 = require("@dxos/credentials");
1343
1543
  var import_echo_db3 = require("@dxos/echo-db");
1344
1544
  var import_errors2 = require("@dxos/errors");
1545
+ var import_invariant8 = require("@dxos/invariant");
1345
1546
  var import_log9 = require("@dxos/log");
1346
1547
  var import_timeframe4 = require("@dxos/timeframe");
1347
1548
  var import_util6 = require("@dxos/util");
@@ -1355,7 +1556,7 @@ function _ts_decorate5(decorators, target, key, desc) {
1355
1556
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1356
1557
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1357
1558
  }
1358
- var __dxlog_file9 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/data-pipeline.ts";
1559
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/data-pipeline.ts";
1359
1560
  var MESSAGES_PER_SNAPSHOT = 10;
1360
1561
  var AUTOMATIC_SNAPSHOT_DEBOUNCE_INTERVAL = 5e3;
1361
1562
  var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL2 = 500;
@@ -1411,8 +1612,24 @@ var DataPipeline = class DataPipeline2 {
1411
1612
  }
1412
1613
  const feedWriter = {
1413
1614
  write: (data, options) => {
1414
- (0, import_tiny_invariant8.default)(this._pipeline, "Pipeline is not initialized.");
1415
- (0, import_tiny_invariant8.default)(this.currentEpoch, "Epoch is not initialized.");
1615
+ (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1616
+ F: __dxlog_file10,
1617
+ L: 145,
1618
+ S: this,
1619
+ A: [
1620
+ "this._pipeline",
1621
+ "'Pipeline is not initialized.'"
1622
+ ]
1623
+ });
1624
+ (0, import_invariant8.invariant)(this.currentEpoch, "Epoch is not initialized.", {
1625
+ F: __dxlog_file10,
1626
+ L: 146,
1627
+ S: this,
1628
+ A: [
1629
+ "this.currentEpoch",
1630
+ "'Epoch is not initialized.'"
1631
+ ]
1632
+ });
1416
1633
  return this._pipeline.writer.write({
1417
1634
  data
1418
1635
  }, options);
@@ -1432,8 +1649,8 @@ var DataPipeline = class DataPipeline2 {
1432
1649
  return;
1433
1650
  }
1434
1651
  (0, import_log9.log)("close", void 0, {
1435
- F: __dxlog_file9,
1436
- L: 171,
1652
+ F: __dxlog_file10,
1653
+ L: 170,
1437
1654
  S: this,
1438
1655
  C: (f, a) => f(...a)
1439
1656
  });
@@ -1447,8 +1664,8 @@ var DataPipeline = class DataPipeline2 {
1447
1664
  }
1448
1665
  } catch (err) {
1449
1666
  import_log9.log.catch(err, void 0, {
1450
- F: __dxlog_file9,
1451
- L: 184,
1667
+ F: __dxlog_file10,
1668
+ L: 183,
1452
1669
  S: this,
1453
1670
  C: (f, a) => f(...a)
1454
1671
  });
@@ -1470,15 +1687,23 @@ var DataPipeline = class DataPipeline2 {
1470
1687
  await this._processEpochInSeparateTask(this.currentEpoch);
1471
1688
  await waitForOneEpoch;
1472
1689
  }
1473
- (0, import_tiny_invariant8.default)(this._pipeline, "Pipeline is not initialized.");
1690
+ (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1691
+ F: __dxlog_file10,
1692
+ L: 206,
1693
+ S: this,
1694
+ A: [
1695
+ "this._pipeline",
1696
+ "'Pipeline is not initialized.'"
1697
+ ]
1698
+ });
1474
1699
  for await (const msg of this._pipeline.consume()) {
1475
1700
  const { feedKey, seq, data } = msg;
1476
1701
  (0, import_log9.log)("processing message", {
1477
1702
  feedKey,
1478
1703
  seq
1479
1704
  }, {
1480
- F: __dxlog_file9,
1481
- L: 210,
1705
+ F: __dxlog_file10,
1706
+ L: 209,
1482
1707
  S: this,
1483
1708
  C: (f, a) => f(...a)
1484
1709
  });
@@ -1489,8 +1714,8 @@ var DataPipeline = class DataPipeline2 {
1489
1714
  import_log9.log.warn("Could not find feed", {
1490
1715
  feedKey
1491
1716
  }, {
1492
- F: __dxlog_file9,
1493
- L: 216,
1717
+ F: __dxlog_file10,
1718
+ L: 215,
1494
1719
  S: this,
1495
1720
  C: (f, a) => f(...a)
1496
1721
  });
@@ -1512,8 +1737,8 @@ var DataPipeline = class DataPipeline2 {
1512
1737
  seq,
1513
1738
  spaceKey: this._params.spaceKey.toHex()
1514
1739
  }, {
1515
- F: __dxlog_file9,
1516
- L: 233,
1740
+ F: __dxlog_file10,
1741
+ L: 232,
1517
1742
  S: this,
1518
1743
  C: (f, a) => f(...a)
1519
1744
  });
@@ -1521,8 +1746,8 @@ var DataPipeline = class DataPipeline2 {
1521
1746
  }
1522
1747
  } catch (err) {
1523
1748
  import_log9.log.catch(err, void 0, {
1524
- F: __dxlog_file9,
1525
- L: 243,
1749
+ F: __dxlog_file10,
1750
+ L: 242,
1526
1751
  S: this,
1527
1752
  C: (f, a) => f(...a)
1528
1753
  });
@@ -1530,7 +1755,15 @@ var DataPipeline = class DataPipeline2 {
1530
1755
  }
1531
1756
  }
1532
1757
  _createSnapshot() {
1533
- (0, import_tiny_invariant8.default)(this.databaseHost, "Database backend is not initialized.");
1758
+ (0, import_invariant8.invariant)(this.databaseHost, "Database backend is not initialized.", {
1759
+ F: __dxlog_file10,
1760
+ L: 248,
1761
+ S: this,
1762
+ A: [
1763
+ "this.databaseHost",
1764
+ "'Database backend is not initialized.'"
1765
+ ]
1766
+ });
1534
1767
  return {
1535
1768
  spaceKey: this._params.spaceKey.asUint8Array(),
1536
1769
  timeframe: this._pipeline.state.timeframe,
@@ -1556,8 +1789,8 @@ var DataPipeline = class DataPipeline2 {
1556
1789
  }
1557
1790
  } catch (err) {
1558
1791
  import_log9.log.warn("Failed to cache properties", err, {
1559
- F: __dxlog_file9,
1560
- L: 278,
1792
+ F: __dxlog_file10,
1793
+ L: 277,
1561
1794
  S: this,
1562
1795
  C: (f, a) => f(...a)
1563
1796
  });
@@ -1583,15 +1816,15 @@ var DataPipeline = class DataPipeline2 {
1583
1816
  onError: (err) => {
1584
1817
  if (err instanceof import_errors2.CancelledError) {
1585
1818
  (0, import_log9.log)("Epoch processing cancelled.", void 0, {
1586
- F: __dxlog_file9,
1587
- L: 310,
1819
+ F: __dxlog_file10,
1820
+ L: 309,
1588
1821
  S: this,
1589
1822
  C: (f, a) => f(...a)
1590
1823
  });
1591
1824
  } else {
1592
1825
  import_log9.log.catch(err, void 0, {
1593
- F: __dxlog_file9,
1594
- L: 312,
1826
+ F: __dxlog_file10,
1827
+ L: 311,
1595
1828
  S: this,
1596
1829
  C: (f, a) => f(...a)
1597
1830
  });
@@ -1606,8 +1839,8 @@ var DataPipeline = class DataPipeline2 {
1606
1839
  (0, import_log9.log)("process epoch", {
1607
1840
  epoch
1608
1841
  }, {
1609
- F: __dxlog_file9,
1610
- L: 322,
1842
+ F: __dxlog_file10,
1843
+ L: 321,
1611
1844
  S: this,
1612
1845
  C: (f, a) => f(...a)
1613
1846
  });
@@ -1617,14 +1850,30 @@ var DataPipeline = class DataPipeline2 {
1617
1850
  });
1618
1851
  }
1619
1852
  async _processEpoch(ctx, epoch) {
1620
- (0, import_tiny_invariant8.default)(this._isOpen, "Space is closed.");
1621
- (0, import_tiny_invariant8.default)(this._pipeline);
1853
+ (0, import_invariant8.invariant)(this._isOpen, "Space is closed.", {
1854
+ F: __dxlog_file10,
1855
+ L: 331,
1856
+ S: this,
1857
+ A: [
1858
+ "this._isOpen",
1859
+ "'Space is closed.'"
1860
+ ]
1861
+ });
1862
+ (0, import_invariant8.invariant)(this._pipeline, void 0, {
1863
+ F: __dxlog_file10,
1864
+ L: 332,
1865
+ S: this,
1866
+ A: [
1867
+ "this._pipeline",
1868
+ ""
1869
+ ]
1870
+ });
1622
1871
  this._lastProcessedEpoch = epoch.number;
1623
1872
  (0, import_log9.log)("Processing epoch", {
1624
1873
  epoch
1625
1874
  }, {
1626
- F: __dxlog_file9,
1627
- L: 336,
1875
+ F: __dxlog_file10,
1876
+ L: 335,
1628
1877
  S: this,
1629
1878
  C: (f, a) => f(...a)
1630
1879
  });
@@ -1633,8 +1882,8 @@ var DataPipeline = class DataPipeline2 {
1633
1882
  this.databaseHost._itemDemuxer.restoreFromSnapshot(snapshot.database);
1634
1883
  }
1635
1884
  (0, import_log9.log)("restarting pipeline for epoch", void 0, {
1636
- F: __dxlog_file9,
1637
- L: 344,
1885
+ F: __dxlog_file10,
1886
+ L: 343,
1638
1887
  S: this,
1639
1888
  C: (f, a) => f(...a)
1640
1889
  });
@@ -1643,12 +1892,36 @@ var DataPipeline = class DataPipeline2 {
1643
1892
  await this._pipeline.unpause();
1644
1893
  }
1645
1894
  async waitUntilTimeframe(timeframe) {
1646
- (0, import_tiny_invariant8.default)(this._pipeline, "Pipeline is not initialized.");
1895
+ (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1896
+ F: __dxlog_file10,
1897
+ L: 351,
1898
+ S: this,
1899
+ A: [
1900
+ "this._pipeline",
1901
+ "'Pipeline is not initialized.'"
1902
+ ]
1903
+ });
1647
1904
  await this._pipeline.state.waitUntilTimeframe(timeframe);
1648
1905
  }
1649
1906
  async createEpoch() {
1650
- (0, import_tiny_invariant8.default)(this._pipeline);
1651
- (0, import_tiny_invariant8.default)(this.currentEpoch);
1907
+ (0, import_invariant8.invariant)(this._pipeline, void 0, {
1908
+ F: __dxlog_file10,
1909
+ L: 357,
1910
+ S: this,
1911
+ A: [
1912
+ "this._pipeline",
1913
+ ""
1914
+ ]
1915
+ });
1916
+ (0, import_invariant8.invariant)(this.currentEpoch, void 0, {
1917
+ F: __dxlog_file10,
1918
+ L: 358,
1919
+ S: this,
1920
+ A: [
1921
+ "this.currentEpoch",
1922
+ ""
1923
+ ]
1924
+ });
1652
1925
  await this._pipeline.pause();
1653
1926
  const snapshot = await this._createSnapshot();
1654
1927
  const snapshotCid = await this._params.snapshotManager.store(snapshot);
@@ -1692,14 +1965,22 @@ function _ts_decorate6(decorators, target, key, desc) {
1692
1965
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1693
1966
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1694
1967
  }
1695
- var __dxlog_file10 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space.ts";
1968
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
1696
1969
  var Space = class Space2 {
1697
1970
  constructor(params) {
1698
1971
  this._addFeedLock = new import_async7.Lock();
1699
1972
  this.onCredentialProcessed = new import_util7.Callback();
1700
1973
  this.stateUpdate = new import_async7.Event();
1701
1974
  this._isOpen = false;
1702
- (0, import_tiny_invariant9.default)(params.spaceKey && params.feedProvider);
1975
+ (0, import_invariant9.invariant)(params.spaceKey && params.feedProvider, void 0, {
1976
+ F: __dxlog_file11,
1977
+ L: 70,
1978
+ S: this,
1979
+ A: [
1980
+ "params.spaceKey && params.feedProvider",
1981
+ ""
1982
+ ]
1983
+ });
1703
1984
  this._key = params.spaceKey;
1704
1985
  this._genesisFeedKey = params.genesisFeed.key;
1705
1986
  this._feedProvider = params.feedProvider;
@@ -1734,8 +2015,8 @@ var Space = class Space2 {
1734
2015
  (0, import_log10.log)("onCredentialProcessed", {
1735
2016
  credential
1736
2017
  }, {
1737
- F: __dxlog_file10,
1738
- L: 107,
2018
+ F: __dxlog_file11,
2019
+ L: 106,
1739
2020
  S: this,
1740
2021
  C: (f, a) => f(...a)
1741
2022
  });
@@ -1800,14 +2081,30 @@ var Space = class Space2 {
1800
2081
  return this._snapshotManager;
1801
2082
  }
1802
2083
  setControlFeed(feed) {
1803
- (0, import_tiny_invariant9.default)(!this._controlFeed, "Control feed already set.");
2084
+ (0, import_invariant9.invariant)(!this._controlFeed, "Control feed already set.", {
2085
+ F: __dxlog_file11,
2086
+ L: 180,
2087
+ S: this,
2088
+ A: [
2089
+ "!this._controlFeed",
2090
+ "'Control feed already set.'"
2091
+ ]
2092
+ });
1804
2093
  this._controlFeed = feed;
1805
2094
  this._controlPipeline.setWriteFeed(feed);
1806
2095
  return this;
1807
2096
  }
1808
2097
  setDataFeed(feed) {
1809
2098
  var _a;
1810
- (0, import_tiny_invariant9.default)(!this._dataFeed, "Data feed already set.");
2099
+ (0, import_invariant9.invariant)(!this._dataFeed, "Data feed already set.", {
2100
+ F: __dxlog_file11,
2101
+ L: 187,
2102
+ S: this,
2103
+ A: [
2104
+ "!this._dataFeed",
2105
+ "'Data feed already set.'"
2106
+ ]
2107
+ });
1811
2108
  this._dataFeed = feed;
1812
2109
  (_a = this._dataPipeline.pipeline) == null ? void 0 : _a.setWriteFeed(feed);
1813
2110
  return this;
@@ -1826,8 +2123,8 @@ var Space = class Space2 {
1826
2123
  // }
1827
2124
  async open() {
1828
2125
  (0, import_log10.log)("opening...", void 0, {
1829
- F: __dxlog_file10,
1830
- L: 209,
2126
+ F: __dxlog_file11,
2127
+ L: 208,
1831
2128
  S: this,
1832
2129
  C: (f, a) => f(...a)
1833
2130
  });
@@ -1839,8 +2136,8 @@ var Space = class Space2 {
1839
2136
  await this._controlPipeline.spaceState.addCredentialProcessor(this._dataPipeline);
1840
2137
  this._isOpen = true;
1841
2138
  (0, import_log10.log)("opened", void 0, {
1842
- F: __dxlog_file10,
1843
- L: 220,
2139
+ F: __dxlog_file11,
2140
+ L: 219,
1844
2141
  S: this,
1845
2142
  C: (f, a) => f(...a)
1846
2143
  });
@@ -1849,8 +2146,8 @@ var Space = class Space2 {
1849
2146
  (0, import_log10.log)("closing...", {
1850
2147
  key: this._key
1851
2148
  }, {
1852
- F: __dxlog_file10,
1853
- L: 225,
2149
+ F: __dxlog_file11,
2150
+ L: 224,
1854
2151
  S: this,
1855
2152
  C: (f, a) => f(...a)
1856
2153
  });
@@ -1863,20 +2160,28 @@ var Space = class Space2 {
1863
2160
  await this._controlPipeline.stop();
1864
2161
  this._isOpen = false;
1865
2162
  (0, import_log10.log)("closed", void 0, {
1866
- F: __dxlog_file10,
1867
- L: 238,
2163
+ F: __dxlog_file11,
2164
+ L: 237,
1868
2165
  S: this,
1869
2166
  C: (f, a) => f(...a)
1870
2167
  });
1871
2168
  }
1872
2169
  async initializeDataPipeline() {
1873
2170
  (0, import_log10.log)("initializeDataPipeline", void 0, {
1874
- F: __dxlog_file10,
1875
- L: 243,
2171
+ F: __dxlog_file11,
2172
+ L: 242,
1876
2173
  S: this,
1877
2174
  C: (f, a) => f(...a)
1878
2175
  });
1879
- (0, import_tiny_invariant9.default)(this._isOpen, "Space must be open to initialize data pipeline.");
2176
+ (0, import_invariant9.invariant)(this._isOpen, "Space must be open to initialize data pipeline.", {
2177
+ F: __dxlog_file11,
2178
+ L: 243,
2179
+ S: this,
2180
+ A: [
2181
+ "this._isOpen",
2182
+ "'Space must be open to initialize data pipeline.'"
2183
+ ]
2184
+ });
1880
2185
  await this._dataPipeline.open();
1881
2186
  }
1882
2187
  };
@@ -1923,7 +2228,7 @@ function _ts_decorate7(decorators, target, key, desc) {
1923
2228
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1924
2229
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1925
2230
  }
1926
- var __dxlog_file11 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space-protocol.ts";
2231
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space-protocol.ts";
1927
2232
  var MOCK_AUTH_PROVIDER = async (nonce) => Buffer.from("mock");
1928
2233
  var MOCK_AUTH_VERIFIER = async (nonce, credential) => true;
1929
2234
  var SpaceProtocol = class {
@@ -1953,7 +2258,7 @@ var SpaceProtocol = class {
1953
2258
  (0, import_log11.log)("addFeed", {
1954
2259
  key: feed.key
1955
2260
  }, {
1956
- F: __dxlog_file11,
2261
+ F: __dxlog_file12,
1957
2262
  L: 95,
1958
2263
  S: this,
1959
2264
  C: (f, a) => f(...a)
@@ -1975,21 +2280,22 @@ var SpaceProtocol = class {
1975
2280
  };
1976
2281
  await this.blobSync.open();
1977
2282
  (0, import_log11.log)("starting...", void 0, {
1978
- F: __dxlog_file11,
2283
+ F: __dxlog_file12,
1979
2284
  L: 120,
1980
2285
  S: this,
1981
2286
  C: (f, a) => f(...a)
1982
2287
  });
2288
+ const topic = await this._topic;
1983
2289
  this._connection = await this._networkManager.joinSwarm({
1984
2290
  protocolProvider: this._createProtocolProvider(credentials),
1985
2291
  peerId: this._swarmIdentity.peerKey,
1986
- topic: await this._topic,
2292
+ topic,
1987
2293
  topology: new import_network_manager.MMSTTopology(topologyConfig),
1988
- label: `Protocol swarm: ${this._topic}`
2294
+ label: `Protocol swarm: ${topic}`
1989
2295
  });
1990
2296
  (0, import_log11.log)("started", void 0, {
1991
- F: __dxlog_file11,
1992
- L: 129,
2297
+ F: __dxlog_file12,
2298
+ L: 130,
1993
2299
  S: this,
1994
2300
  C: (f, a) => f(...a)
1995
2301
  });
@@ -1998,15 +2304,15 @@ var SpaceProtocol = class {
1998
2304
  await this.blobSync.close();
1999
2305
  if (this._connection) {
2000
2306
  (0, import_log11.log)("stopping...", void 0, {
2001
- F: __dxlog_file11,
2002
- L: 136,
2307
+ F: __dxlog_file12,
2308
+ L: 137,
2003
2309
  S: this,
2004
2310
  C: (f, a) => f(...a)
2005
2311
  });
2006
2312
  await this._connection.close();
2007
2313
  (0, import_log11.log)("stopped", void 0, {
2008
- F: __dxlog_file11,
2009
- L: 138,
2314
+ F: __dxlog_file12,
2315
+ L: 139,
2010
2316
  S: this,
2011
2317
  C: (f, a) => f(...a)
2012
2318
  });
@@ -2073,8 +2379,8 @@ var SpaceProtocolSession = class {
2073
2379
  onAuthSuccess: () => {
2074
2380
  var _a;
2075
2381
  (0, import_log11.log)("Peer authenticated", void 0, {
2076
- F: __dxlog_file11,
2077
- L: 235,
2382
+ F: __dxlog_file12,
2383
+ L: 236,
2078
2384
  S: this,
2079
2385
  C: (f, a) => f(...a)
2080
2386
  });
@@ -2112,7 +2418,7 @@ function _ts_decorate8(decorators, target, key, desc) {
2112
2418
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2113
2419
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2114
2420
  }
2115
- var __dxlog_file12 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space-manager.ts";
2421
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space-manager.ts";
2116
2422
  var SpaceManager = class SpaceManager2 {
2117
2423
  constructor({ feedStore, networkManager, modelFactory, metadataStore, snapshotStore, blobStore }) {
2118
2424
  this._spaces = new import_util9.ComplexMap(import_keys6.PublicKey.hash);
@@ -2140,7 +2446,7 @@ var SpaceManager = class SpaceManager2 {
2140
2446
  import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols6.trace.begin({
2141
2447
  id: this._instanceId
2142
2448
  }), {
2143
- F: __dxlog_file12,
2449
+ F: __dxlog_file13,
2144
2450
  L: 97,
2145
2451
  S: this,
2146
2452
  C: (f, a) => f(...a)
@@ -2148,7 +2454,7 @@ var SpaceManager = class SpaceManager2 {
2148
2454
  (0, import_log12.log)("constructing space...", {
2149
2455
  spaceKey: metadata.genesisFeedKey
2150
2456
  }, {
2151
- F: __dxlog_file12,
2457
+ F: __dxlog_file13,
2152
2458
  L: 98,
2153
2459
  S: this,
2154
2460
  C: (f, a) => f(...a)
@@ -2178,7 +2484,7 @@ var SpaceManager = class SpaceManager2 {
2178
2484
  import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols6.trace.end({
2179
2485
  id: this._instanceId
2180
2486
  }), {
2181
- F: __dxlog_file12,
2487
+ F: __dxlog_file13,
2182
2488
  L: 125,
2183
2489
  S: this,
2184
2490
  C: (f, a) => f(...a)