@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
@@ -55,13 +55,13 @@ var import_teleport_extension_object_sync2 = require("@dxos/teleport-extension-o
55
55
  var import_util10 = require("@dxos/util");
56
56
 
57
57
  // packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts
58
- var import_tiny_invariant = __toESM(require("tiny-invariant"));
59
58
  var import_codec_protobuf = require("@dxos/codec-protobuf");
60
59
  var import_context = require("@dxos/context");
61
60
  var import_echo_db = require("@dxos/echo-db");
61
+ var import_invariant = require("@dxos/invariant");
62
62
  var import_log = require("@dxos/log");
63
63
  var import_util = require("@dxos/util");
64
- var __dxlog_file = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
64
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
65
65
  var DataServiceHost = class {
66
66
  constructor(_itemManager, _itemDemuxer, _writeStream) {
67
67
  this._itemManager = _itemManager;
@@ -90,13 +90,21 @@ var DataServiceHost = class {
90
90
  this._itemDemuxer.mutation.on(ctx, (message) => {
91
91
  var _a;
92
92
  const { batch, meta } = message;
93
- (0, import_tiny_invariant.default)(!meta.clientTag, "Unexpected client tag in mutation message");
93
+ (0, import_invariant.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
94
+ F: __dxlog_file,
95
+ L: 61,
96
+ S: this,
97
+ A: [
98
+ "!(meta as any).clientTag",
99
+ "'Unexpected client tag in mutation message'"
100
+ ]
101
+ });
94
102
  (0, import_log.log)("message", {
95
103
  batch,
96
104
  meta
97
105
  }, {
98
106
  F: __dxlog_file,
99
- L: 63,
107
+ L: 62,
100
108
  S: this,
101
109
  C: (f, a) => f(...a)
102
110
  });
@@ -123,14 +131,30 @@ var DataServiceHost = class {
123
131
  }
124
132
  async write(request) {
125
133
  var _a, _b;
126
- (0, import_tiny_invariant.default)(!this._ctx.disposed, "Cannot write to closed DataServiceHost");
127
- (0, import_tiny_invariant.default)(this._writeStream, "Cannot write mutations in readonly mode");
134
+ (0, import_invariant.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
135
+ F: __dxlog_file,
136
+ L: 88,
137
+ S: this,
138
+ A: [
139
+ "!this._ctx.disposed",
140
+ "'Cannot write to closed DataServiceHost'"
141
+ ]
142
+ });
143
+ (0, import_invariant.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
144
+ F: __dxlog_file,
145
+ L: 89,
146
+ S: this,
147
+ A: [
148
+ "this._writeStream",
149
+ "'Cannot write mutations in readonly mode'"
150
+ ]
151
+ });
128
152
  (0, import_log.log)("write", {
129
153
  clientTag: request.clientTag,
130
154
  objectCount: (_b = (_a = request.batch.objects) == null ? void 0 : _a.length) != null ? _b : 0
131
155
  }, {
132
156
  F: __dxlog_file,
133
- L: 92,
157
+ L: 91,
134
158
  S: this,
135
159
  C: (f, a) => f(...a)
136
160
  });
@@ -144,7 +168,7 @@ var DataServiceHost = class {
144
168
  seq: receipt2.seq
145
169
  }, {
146
170
  F: __dxlog_file,
147
- L: 101,
171
+ L: 100,
148
172
  S: this,
149
173
  C: (f, a) => f(...a)
150
174
  });
@@ -311,12 +335,12 @@ var SnapshotStore = class {
311
335
  };
312
336
 
313
337
  // packages/core/echo/echo-pipeline/src/db-host/data-service.ts
314
- var import_tiny_invariant2 = __toESM(require("tiny-invariant"));
315
338
  var import_debug2 = require("@dxos/debug");
339
+ var import_invariant2 = require("@dxos/invariant");
316
340
  var import_keys2 = require("@dxos/keys");
317
341
  var import_log2 = require("@dxos/log");
318
342
  var import_util2 = require("@dxos/util");
319
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
343
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
320
344
  var DataServiceSubscriptions = class {
321
345
  constructor() {
322
346
  this._spaces = new import_util2.ComplexMap(import_keys2.PublicKey.hash);
@@ -329,11 +353,19 @@ var DataServiceSubscriptions = class {
329
353
  spaceKey
330
354
  }, {
331
355
  F: __dxlog_file2,
332
- L: 31,
356
+ L: 30,
333
357
  S: this,
334
358
  C: (f, a) => f(...a)
335
359
  });
336
- (0, import_tiny_invariant2.default)(!this._spaces.has(spaceKey));
360
+ (0, import_invariant2.invariant)(!this._spaces.has(spaceKey), void 0, {
361
+ F: __dxlog_file2,
362
+ L: 31,
363
+ S: this,
364
+ A: [
365
+ "!this._spaces.has(spaceKey)",
366
+ ""
367
+ ]
368
+ });
337
369
  await host.open();
338
370
  this._spaces.set(spaceKey, host);
339
371
  }
@@ -342,7 +374,7 @@ var DataServiceSubscriptions = class {
342
374
  spaceKey
343
375
  }, {
344
376
  F: __dxlog_file2,
345
- L: 38,
377
+ L: 37,
346
378
  S: this,
347
379
  C: (f, a) => f(...a)
348
380
  });
@@ -360,14 +392,38 @@ var DataServiceImpl = class {
360
392
  }
361
393
  subscribe(request) {
362
394
  var _a;
363
- (0, import_tiny_invariant2.default)(request.spaceKey);
395
+ (0, import_invariant2.invariant)(request.spaceKey, void 0, {
396
+ F: __dxlog_file2,
397
+ L: 56,
398
+ S: this,
399
+ A: [
400
+ "request.spaceKey",
401
+ ""
402
+ ]
403
+ });
364
404
  const host = (_a = this._subscriptions.getDataService(request.spaceKey)) != null ? _a : (0, import_debug2.raise)(new Error(`space not found: ${request.spaceKey}`));
365
405
  return host.subscribe();
366
406
  }
367
407
  write(request) {
368
408
  var _a;
369
- (0, import_tiny_invariant2.default)(request.spaceKey);
370
- (0, import_tiny_invariant2.default)(request.batch);
409
+ (0, import_invariant2.invariant)(request.spaceKey, void 0, {
410
+ F: __dxlog_file2,
411
+ L: 63,
412
+ S: this,
413
+ A: [
414
+ "request.spaceKey",
415
+ ""
416
+ ]
417
+ });
418
+ (0, import_invariant2.invariant)(request.batch, void 0, {
419
+ F: __dxlog_file2,
420
+ L: 64,
421
+ S: this,
422
+ A: [
423
+ "request.batch",
424
+ ""
425
+ ]
426
+ });
371
427
  const host = (_a = this._subscriptions.getDataService(request.spaceKey)) != null ? _a : (0, import_debug2.raise)(new Error(`space not found: ${request.spaceKey}`));
372
428
  return host.write(request);
373
429
  }
@@ -375,9 +431,9 @@ var DataServiceImpl = class {
375
431
 
376
432
  // packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
377
433
  var import_crc_32 = __toESM(require("crc-32"));
378
- var import_tiny_invariant3 = __toESM(require("tiny-invariant"));
379
434
  var import_async2 = require("@dxos/async");
380
435
  var import_errors = require("@dxos/errors");
436
+ var import_invariant3 = require("@dxos/invariant");
381
437
  var import_log3 = require("@dxos/log");
382
438
  var import_protocols3 = require("@dxos/protocols");
383
439
  var import_services = require("@dxos/protocols/proto/dxos/client/services");
@@ -392,7 +448,7 @@ function _ts_decorate2(decorators, target, key, desc) {
392
448
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
393
449
  return c > 3 && r && Object.defineProperty(target, key, r), r;
394
450
  }
395
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
451
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
396
452
  var emptyEchoMetadata = () => ({
397
453
  version: import_protocols3.STORAGE_VERSION,
398
454
  spaces: [],
@@ -508,7 +564,15 @@ var MetadataStore = class {
508
564
  return this._metadata.identity.haloSpace;
509
565
  }
510
566
  const space = this.spaces.find((space2) => space2.key === spaceKey);
511
- (0, import_tiny_invariant3.default)(space, "Space not found");
567
+ (0, import_invariant3.invariant)(space, "Space not found", {
568
+ F: __dxlog_file3,
569
+ L: 137,
570
+ S: this,
571
+ A: [
572
+ "space",
573
+ "'Space not found'"
574
+ ]
575
+ });
512
576
  return space;
513
577
  }
514
578
  /**
@@ -528,13 +592,29 @@ var MetadataStore = class {
528
592
  return this._metadata.identity;
529
593
  }
530
594
  async setIdentityRecord(record) {
531
- (0, import_tiny_invariant3.default)(!this._metadata.identity, "Cannot overwrite existing identity in metadata");
595
+ (0, import_invariant3.invariant)(!this._metadata.identity, "Cannot overwrite existing identity in metadata", {
596
+ F: __dxlog_file3,
597
+ L: 155,
598
+ S: this,
599
+ A: [
600
+ "!this._metadata.identity",
601
+ "'Cannot overwrite existing identity in metadata'"
602
+ ]
603
+ });
532
604
  this._metadata.identity = record;
533
605
  await this._save();
534
606
  }
535
607
  async addSpace(record) {
536
608
  var _a, _b, _c;
537
- (0, import_tiny_invariant3.default)(!((_a = this._metadata.spaces) != null ? _a : []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata");
609
+ (0, import_invariant3.invariant)(!((_a = this._metadata.spaces) != null ? _a : []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata", {
610
+ F: __dxlog_file3,
611
+ L: 162,
612
+ S: this,
613
+ A: [
614
+ "!(this._metadata.spaces ?? []).find((space) => space.key === record.key)",
615
+ "'Cannot overwrite existing space in metadata'"
616
+ ]
617
+ });
538
618
  ((_c = (_b = this._metadata).spaces) != null ? _c : _b.spaces = []).push(record);
539
619
  await this._save();
540
620
  }
@@ -570,14 +650,14 @@ _ts_decorate2([
570
650
  var fromBytesInt32 = (buf) => buf.readInt32LE(0);
571
651
 
572
652
  // packages/core/echo/echo-pipeline/src/space/auth.ts
573
- var import_tiny_invariant4 = __toESM(require("tiny-invariant"));
574
653
  var import_async3 = require("@dxos/async");
575
654
  var import_context3 = require("@dxos/context");
576
655
  var import_crypto2 = require("@dxos/crypto");
656
+ var import_invariant4 = require("@dxos/invariant");
577
657
  var import_log4 = require("@dxos/log");
578
658
  var import_protocols4 = require("@dxos/protocols");
579
659
  var import_teleport = require("@dxos/teleport");
580
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/auth.ts";
660
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/auth.ts";
581
661
  var AuthExtension = class extends import_teleport.RpcExtension {
582
662
  constructor(_authParams) {
583
663
  super({
@@ -594,7 +674,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
594
674
  onError: (err) => {
595
675
  import_log4.log.catch(err, void 0, {
596
676
  F: __dxlog_file4,
597
- L: 29,
677
+ L: 28,
598
678
  S: this,
599
679
  C: (f, a) => f(...a)
600
680
  });
@@ -616,7 +696,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
616
696
  } catch (err) {
617
697
  import_log4.log.error("failed to generate auth credentials", err, {
618
698
  F: __dxlog_file4,
619
- L: 56,
699
+ L: 55,
620
700
  S: this,
621
701
  C: (f, a) => f(...a)
622
702
  });
@@ -634,14 +714,30 @@ var AuthExtension = class extends import_teleport.RpcExtension {
634
714
  const { credential } = await this.rpc.AuthService.authenticate({
635
715
  challenge
636
716
  });
637
- (0, import_tiny_invariant4.default)((credential == null ? void 0 : credential.length) > 0, "invalid credential");
717
+ (0, import_invariant4.invariant)((credential == null ? void 0 : credential.length) > 0, "invalid credential", {
718
+ F: __dxlog_file4,
719
+ L: 69,
720
+ S: this,
721
+ A: [
722
+ "credential?.length > 0",
723
+ "'invalid credential'"
724
+ ]
725
+ });
638
726
  const success = await this._authParams.verifier(challenge, credential);
639
- (0, import_tiny_invariant4.default)(success, "credential not verified");
727
+ (0, import_invariant4.invariant)(success, "credential not verified", {
728
+ F: __dxlog_file4,
729
+ L: 71,
730
+ S: this,
731
+ A: [
732
+ "success",
733
+ "'credential not verified'"
734
+ ]
735
+ });
640
736
  (0, import_async3.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
641
737
  } catch (err) {
642
738
  (0, import_log4.log)("auth failed", err, {
643
739
  F: __dxlog_file4,
644
- L: 75,
740
+ L: 74,
645
741
  S: this,
646
742
  C: (f, a) => f(...a)
647
743
  });
@@ -657,8 +753,8 @@ var AuthExtension = class extends import_teleport.RpcExtension {
657
753
  };
658
754
 
659
755
  // packages/core/echo/echo-pipeline/src/space/space.ts
660
- var import_tiny_invariant9 = __toESM(require("tiny-invariant"));
661
756
  var import_async7 = require("@dxos/async");
757
+ var import_invariant9 = require("@dxos/invariant");
662
758
  var import_log10 = require("@dxos/log");
663
759
  var import_credentials4 = require("@dxos/protocols/proto/dxos/halo/credentials");
664
760
  var import_util7 = require("@dxos/util");
@@ -672,11 +768,11 @@ var import_timeframe3 = require("@dxos/timeframe");
672
768
  var import_util5 = require("@dxos/util");
673
769
 
674
770
  // packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
675
- var import_tiny_invariant7 = __toESM(require("tiny-invariant"));
676
771
  var import_async5 = require("@dxos/async");
677
772
  var import_context4 = require("@dxos/context");
678
773
  var import_debug4 = require("@dxos/debug");
679
774
  var import_feed_store = require("@dxos/feed-store");
775
+ var import_invariant7 = require("@dxos/invariant");
680
776
  var import_keys3 = require("@dxos/keys");
681
777
  var import_log7 = require("@dxos/log");
682
778
  var import_timeframe2 = require("@dxos/timeframe");
@@ -689,31 +785,56 @@ var codec = import_protocols5.schema.getCodecForType("dxos.echo.feed.FeedMessage
689
785
  var valueEncoding = (0, import_hypercore.createCodecEncoding)(codec);
690
786
 
691
787
  // packages/core/echo/echo-pipeline/src/common/feeds.ts
692
- var import_tiny_invariant5 = __toESM(require("tiny-invariant"));
788
+ var import_invariant5 = require("@dxos/invariant");
789
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/common/feeds.ts";
693
790
  var createMappedFeedWriter = (mapper, writer) => {
694
- (0, import_tiny_invariant5.default)(mapper);
695
- (0, import_tiny_invariant5.default)(writer);
791
+ (0, import_invariant5.invariant)(mapper, void 0, {
792
+ F: __dxlog_file5,
793
+ L: 16,
794
+ S: void 0,
795
+ A: [
796
+ "mapper",
797
+ ""
798
+ ]
799
+ });
800
+ (0, import_invariant5.invariant)(writer, void 0, {
801
+ F: __dxlog_file5,
802
+ L: 17,
803
+ S: void 0,
804
+ A: [
805
+ "writer",
806
+ ""
807
+ ]
808
+ });
696
809
  return {
697
810
  write: async (data, options) => await writer.write(await mapper(data), options)
698
811
  };
699
812
  };
700
813
 
701
814
  // packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts
702
- var import_tiny_invariant6 = __toESM(require("tiny-invariant"));
815
+ var import_invariant6 = require("@dxos/invariant");
703
816
  var import_log5 = require("@dxos/log");
704
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts";
817
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts";
705
818
  var createMessageSelector = (timeframeClock) => {
706
819
  return (messages) => {
707
820
  for (let i = 0; i < messages.length; i++) {
708
821
  const { data: { timeframe } } = messages[i];
709
- (0, import_tiny_invariant6.default)(timeframe);
822
+ (0, import_invariant6.invariant)(timeframe, void 0, {
823
+ F: __dxlog_file6,
824
+ L: 25,
825
+ S: void 0,
826
+ A: [
827
+ "timeframe",
828
+ ""
829
+ ]
830
+ });
710
831
  if (!timeframeClock.hasGaps(timeframe)) {
711
832
  return i;
712
833
  }
713
834
  }
714
835
  (0, import_log5.log)("Skipping...", void 0, {
715
- F: __dxlog_file5,
716
- L: 34,
836
+ F: __dxlog_file6,
837
+ L: 33,
717
838
  S: void 0,
718
839
  C: (f, a) => f(...a)
719
840
  });
@@ -735,7 +856,7 @@ function _ts_decorate3(decorators, target, key, desc) {
735
856
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
736
857
  return c > 3 && r && Object.defineProperty(target, key, r), r;
737
858
  }
738
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts";
859
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts";
739
860
  var mapFeedIndexesToTimeframe = (indexes) => new import_timeframe.Timeframe(indexes.map(({ feedKey, index }) => [
740
861
  feedKey,
741
862
  index
@@ -790,7 +911,7 @@ var TimeframeClock = class {
790
911
  target,
791
912
  current: this._timeframe
792
913
  }, {
793
- F: __dxlog_file6,
914
+ F: __dxlog_file7,
794
915
  L: 73,
795
916
  S: this,
796
917
  C: (f, a) => f(...a)
@@ -801,7 +922,7 @@ var TimeframeClock = class {
801
922
  current: this._timeframe,
802
923
  deps: import_timeframe.Timeframe.dependencies(target, this._timeframe)
803
924
  }, {
804
- F: __dxlog_file6,
925
+ F: __dxlog_file7,
805
926
  L: 75,
806
927
  S: this,
807
928
  C: (f, a) => f(...a)
@@ -825,7 +946,7 @@ function _ts_decorate4(decorators, target, key, desc) {
825
946
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
826
947
  return c > 3 && r && Object.defineProperty(target, key, r), r;
827
948
  }
828
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
949
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
829
950
  var PipelineState = class {
830
951
  // prettier-ignore
831
952
  constructor(_feeds, _timeframeClock) {
@@ -882,8 +1003,8 @@ var PipelineState = class {
882
1003
  current: this.timeframe,
883
1004
  target: this.targetTimeframe
884
1005
  }, {
885
- F: __dxlog_file7,
886
- L: 126,
1006
+ F: __dxlog_file8,
1007
+ L: 125,
887
1008
  S: this,
888
1009
  C: (f, a) => f(...a)
889
1010
  });
@@ -913,8 +1034,8 @@ var PipelineState = class {
913
1034
  target: this.targetTimeframe,
914
1035
  dependencies: import_timeframe2.Timeframe.dependencies(this.targetTimeframe, this.timeframe)
915
1036
  }, {
916
- F: __dxlog_file7,
917
- L: 153,
1037
+ F: __dxlog_file8,
1038
+ L: 152,
918
1039
  S: this,
919
1040
  C: (f, a) => f(...a)
920
1041
  });
@@ -943,7 +1064,15 @@ var Pipeline = class {
943
1064
  return this._state;
944
1065
  }
945
1066
  get writer() {
946
- (0, import_tiny_invariant7.default)(this._writer, "Writer not set.");
1067
+ (0, import_invariant7.invariant)(this._writer, "Writer not set.", {
1068
+ F: __dxlog_file8,
1069
+ L: 230,
1070
+ S: this,
1071
+ A: [
1072
+ "this._writer",
1073
+ "'Writer not set.'"
1074
+ ]
1075
+ });
947
1076
  return this._writer;
948
1077
  }
949
1078
  hasFeed(feedKey) {
@@ -962,8 +1091,24 @@ var Pipeline = class {
962
1091
  this._setFeedDownloadState(feed);
963
1092
  }
964
1093
  setWriteFeed(feed) {
965
- (0, import_tiny_invariant7.default)(!this._writer, "Writer already set.");
966
- (0, import_tiny_invariant7.default)(feed.properties.writable, "Feed must be writable.");
1094
+ (0, import_invariant7.invariant)(!this._writer, "Writer already set.", {
1095
+ F: __dxlog_file8,
1096
+ L: 253,
1097
+ S: this,
1098
+ A: [
1099
+ "!this._writer",
1100
+ "'Writer already set.'"
1101
+ ]
1102
+ });
1103
+ (0, import_invariant7.invariant)(feed.properties.writable, "Feed must be writable.", {
1104
+ F: __dxlog_file8,
1105
+ L: 254,
1106
+ S: this,
1107
+ A: [
1108
+ "feed.properties.writable",
1109
+ "'Feed must be writable.'"
1110
+ ]
1111
+ });
967
1112
  this._writer = createMappedFeedWriter((payload) => ({
968
1113
  timeframe: this._timeframeClock.timeframe,
969
1114
  payload
@@ -971,8 +1116,8 @@ var Pipeline = class {
971
1116
  }
972
1117
  async start() {
973
1118
  (0, import_log7.log)("starting...", void 0, {
974
- F: __dxlog_file7,
975
- L: 268,
1119
+ F: __dxlog_file8,
1120
+ L: 267,
976
1121
  S: this,
977
1122
  C: (f, a) => f(...a)
978
1123
  });
@@ -980,8 +1125,8 @@ var Pipeline = class {
980
1125
  await this._feedSetIterator.open();
981
1126
  this._isStarted = true;
982
1127
  (0, import_log7.log)("started", void 0, {
983
- F: __dxlog_file7,
984
- L: 272,
1128
+ F: __dxlog_file8,
1129
+ L: 271,
985
1130
  S: this,
986
1131
  C: (f, a) => f(...a)
987
1132
  });
@@ -989,8 +1134,8 @@ var Pipeline = class {
989
1134
  async stop() {
990
1135
  var _a;
991
1136
  (0, import_log7.log)("stopping...", void 0, {
992
- F: __dxlog_file7,
993
- L: 277,
1137
+ F: __dxlog_file8,
1138
+ L: 276,
994
1139
  S: this,
995
1140
  C: (f, a) => f(...a)
996
1141
  });
@@ -1002,8 +1147,8 @@ var Pipeline = class {
1002
1147
  this._state._reachedTargetPromise = void 0;
1003
1148
  this._isStarted = false;
1004
1149
  (0, import_log7.log)("stopped", void 0, {
1005
- F: __dxlog_file7,
1006
- L: 285,
1150
+ F: __dxlog_file8,
1151
+ L: 284,
1007
1152
  S: this,
1008
1153
  C: (f, a) => f(...a)
1009
1154
  });
@@ -1013,7 +1158,15 @@ var Pipeline = class {
1013
1158
  * The pipeline will start processing messages AFTER this timeframe.
1014
1159
  */
1015
1160
  async setCursor(timeframe) {
1016
- (0, import_tiny_invariant7.default)(!this._isStarted || this._isPaused, "Invalid state.");
1161
+ (0, import_invariant7.invariant)(!this._isStarted || this._isPaused, "Invalid state.", {
1162
+ F: __dxlog_file8,
1163
+ L: 293,
1164
+ S: this,
1165
+ A: [
1166
+ "!this._isStarted || this._isPaused",
1167
+ "'Invalid state.'"
1168
+ ]
1169
+ });
1017
1170
  this._state._startTimeframe = timeframe;
1018
1171
  this._timeframeClock.setTimeframe(timeframe);
1019
1172
  for (const feed of this._feeds.values()) {
@@ -1029,7 +1182,15 @@ var Pipeline = class {
1029
1182
  * Calling pause while processing will cause a deadlock.
1030
1183
  */
1031
1184
  async pause() {
1032
- (0, import_tiny_invariant7.default)(this._isStarted, "Pipeline is not open.");
1185
+ (0, import_invariant7.invariant)(this._isStarted, "Pipeline is not open.", {
1186
+ F: __dxlog_file8,
1187
+ L: 315,
1188
+ S: this,
1189
+ A: [
1190
+ "this._isStarted",
1191
+ "'Pipeline is not open.'"
1192
+ ]
1193
+ });
1033
1194
  if (this._isPaused) {
1034
1195
  return;
1035
1196
  }
@@ -1038,8 +1199,24 @@ var Pipeline = class {
1038
1199
  this._isPaused = true;
1039
1200
  }
1040
1201
  async unpause() {
1041
- (0, import_tiny_invariant7.default)(this._isStarted, "Pipeline is not open.");
1042
- (0, import_tiny_invariant7.default)(this._isPaused, "Pipeline is not paused.");
1202
+ (0, import_invariant7.invariant)(this._isStarted, "Pipeline is not open.", {
1203
+ F: __dxlog_file8,
1204
+ L: 327,
1205
+ S: this,
1206
+ A: [
1207
+ "this._isStarted",
1208
+ "'Pipeline is not open.'"
1209
+ ]
1210
+ });
1211
+ (0, import_invariant7.invariant)(this._isPaused, "Pipeline is not paused.", {
1212
+ F: __dxlog_file8,
1213
+ L: 328,
1214
+ S: this,
1215
+ A: [
1216
+ "this._isPaused",
1217
+ "'Pipeline is not paused.'"
1218
+ ]
1219
+ });
1043
1220
  this._pauseTrigger.wake();
1044
1221
  this._isPaused = false;
1045
1222
  }
@@ -1048,15 +1225,39 @@ var Pipeline = class {
1048
1225
  * Updates the timeframe clock after the message has bee processed.
1049
1226
  */
1050
1227
  async *consume() {
1051
- (0, import_tiny_invariant7.default)(!this._isOpen, "Pipeline is already being consumed.");
1228
+ (0, import_invariant7.invariant)(!this._isOpen, "Pipeline is already being consumed.", {
1229
+ F: __dxlog_file8,
1230
+ L: 339,
1231
+ S: this,
1232
+ A: [
1233
+ "!this._isOpen",
1234
+ "'Pipeline is already being consumed.'"
1235
+ ]
1236
+ });
1052
1237
  this._isOpen = true;
1053
- (0, import_tiny_invariant7.default)(this._feedSetIterator, "Iterator not initialized.");
1238
+ (0, import_invariant7.invariant)(this._feedSetIterator, "Iterator not initialized.", {
1239
+ F: __dxlog_file8,
1240
+ L: 342,
1241
+ S: this,
1242
+ A: [
1243
+ "this._feedSetIterator",
1244
+ "'Iterator not initialized.'"
1245
+ ]
1246
+ });
1054
1247
  let lastFeedSetIterator = this._feedSetIterator;
1055
1248
  let iterable = lastFeedSetIterator[Symbol.asyncIterator]();
1056
1249
  while (!this._isStopping) {
1057
1250
  await this._pauseTrigger.wait();
1058
1251
  if (lastFeedSetIterator !== this._feedSetIterator) {
1059
- (0, import_tiny_invariant7.default)(this._feedSetIterator, "Iterator not initialized.");
1252
+ (0, import_invariant7.invariant)(this._feedSetIterator, "Iterator not initialized.", {
1253
+ F: __dxlog_file8,
1254
+ L: 351,
1255
+ S: this,
1256
+ A: [
1257
+ "this._feedSetIterator",
1258
+ "'Iterator not initialized.'"
1259
+ ]
1260
+ });
1060
1261
  lastFeedSetIterator = this._feedSetIterator;
1061
1262
  iterable = lastFeedSetIterator[Symbol.asyncIterator]();
1062
1263
  }
@@ -1078,8 +1279,8 @@ var Pipeline = class {
1078
1279
  const seq = (_a = timeframe.get(feed.key)) != null ? _a : 0;
1079
1280
  feed.undownload({
1080
1281
  callback: () => (0, import_log7.log)("undownload", void 0, {
1081
- F: __dxlog_file7,
1082
- L: 376,
1282
+ F: __dxlog_file8,
1283
+ L: 375,
1083
1284
  S: this,
1084
1285
  C: (f, a) => f(...a)
1085
1286
  })
@@ -1091,8 +1292,8 @@ var Pipeline = class {
1091
1292
  (0, import_log7.log)("failed to download feed", {
1092
1293
  err
1093
1294
  }, {
1094
- F: __dxlog_file7,
1095
- L: 378,
1295
+ F: __dxlog_file8,
1296
+ L: 377,
1096
1297
  S: this,
1097
1298
  C: (f, a) => f(...a)
1098
1299
  });
@@ -1105,8 +1306,8 @@ var Pipeline = class {
1105
1306
  });
1106
1307
  this._feedSetIterator.stalled.on((iterator) => {
1107
1308
  import_log7.log.warn(`Stalled after ${iterator.options.stallTimeout}ms with ${iterator.size} feeds.`, void 0, {
1108
- F: __dxlog_file7,
1109
- L: 389,
1309
+ F: __dxlog_file8,
1310
+ L: 388,
1110
1311
  S: this,
1111
1312
  C: (f, a) => f(...a)
1112
1313
  });
@@ -1134,7 +1335,7 @@ _ts_decorate4([
1134
1335
  ], Pipeline.prototype, "unpause", null);
1135
1336
 
1136
1337
  // packages/core/echo/echo-pipeline/src/space/control-pipeline.ts
1137
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/control-pipeline.ts";
1338
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/control-pipeline.ts";
1138
1339
  var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL = 500;
1139
1340
  var ControlPipeline = class {
1140
1341
  constructor({ spaceKey, genesisFeed, feedProvider, metadataStore }) {
@@ -1149,7 +1350,7 @@ var ControlPipeline = class {
1149
1350
  (0, import_log8.log)("feed admitted", {
1150
1351
  key: info.key
1151
1352
  }, {
1152
- F: __dxlog_file8,
1353
+ F: __dxlog_file9,
1153
1354
  L: 51,
1154
1355
  S: this,
1155
1356
  C: (f, a) => f(...a)
@@ -1160,7 +1361,7 @@ var ControlPipeline = class {
1160
1361
  await this._pipeline.addFeed(feed);
1161
1362
  } catch (err) {
1162
1363
  import_log8.log.catch(err, void 0, {
1163
- F: __dxlog_file8,
1364
+ F: __dxlog_file9,
1164
1365
  L: 59,
1165
1366
  S: this,
1166
1367
  C: (f, a) => f(...a)
@@ -1183,7 +1384,7 @@ var ControlPipeline = class {
1183
1384
  }
1184
1385
  async start() {
1185
1386
  (0, import_log8.log)("starting...", void 0, {
1186
- F: __dxlog_file8,
1387
+ F: __dxlog_file9,
1187
1388
  L: 83,
1188
1389
  S: this,
1189
1390
  C: (f, a) => f(...a)
@@ -1195,7 +1396,7 @@ var ControlPipeline = class {
1195
1396
  key: msg.feedKey,
1196
1397
  seq: msg.seq
1197
1398
  }, {
1198
- F: __dxlog_file8,
1399
+ F: __dxlog_file9,
1199
1400
  L: 88,
1200
1401
  S: this,
1201
1402
  C: (f, a) => f(...a)
@@ -1208,7 +1409,7 @@ var ControlPipeline = class {
1208
1409
  import_log8.log.warn("processing failed", {
1209
1410
  msg
1210
1411
  }, {
1211
- F: __dxlog_file8,
1412
+ F: __dxlog_file9,
1212
1413
  L: 98,
1213
1414
  S: this,
1214
1415
  C: (f, a) => f(...a)
@@ -1219,7 +1420,7 @@ var ControlPipeline = class {
1219
1420
  }
1220
1421
  } catch (err) {
1221
1422
  import_log8.log.catch(err, void 0, {
1222
- F: __dxlog_file8,
1423
+ F: __dxlog_file9,
1223
1424
  L: 104,
1224
1425
  S: this,
1225
1426
  C: (f, a) => f(...a)
@@ -1229,7 +1430,7 @@ var ControlPipeline = class {
1229
1430
  });
1230
1431
  await this._pipeline.start();
1231
1432
  (0, import_log8.log)("started", void 0, {
1232
- F: __dxlog_file8,
1433
+ F: __dxlog_file9,
1233
1434
  L: 110,
1234
1435
  S: this,
1235
1436
  C: (f, a) => f(...a)
@@ -1243,7 +1444,7 @@ var ControlPipeline = class {
1243
1444
  }
1244
1445
  async stop() {
1245
1446
  (0, import_log8.log)("stopping...", void 0, {
1246
- F: __dxlog_file8,
1447
+ F: __dxlog_file9,
1247
1448
  L: 124,
1248
1449
  S: this,
1249
1450
  C: (f, a) => f(...a)
@@ -1251,7 +1452,7 @@ var ControlPipeline = class {
1251
1452
  await this._pipeline.stop();
1252
1453
  await this._saveTargetTimeframe(this._pipeline.state.timeframe);
1253
1454
  (0, import_log8.log)("stopped", void 0, {
1254
- F: __dxlog_file8,
1455
+ F: __dxlog_file9,
1255
1456
  L: 127,
1256
1457
  S: this,
1257
1458
  C: (f, a) => f(...a)
@@ -1265,7 +1466,7 @@ var ControlPipeline = class {
1265
1466
  this._targetTimeframe = newTimeframe;
1266
1467
  } catch (err) {
1267
1468
  (0, import_log8.log)(err, void 0, {
1268
- F: __dxlog_file8,
1469
+ F: __dxlog_file9,
1269
1470
  L: 136,
1270
1471
  S: this,
1271
1472
  C: (f, a) => f(...a)
@@ -1275,12 +1476,12 @@ var ControlPipeline = class {
1275
1476
  };
1276
1477
 
1277
1478
  // packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
1278
- var import_tiny_invariant8 = __toESM(require("tiny-invariant"));
1279
1479
  var import_async6 = require("@dxos/async");
1280
1480
  var import_context5 = require("@dxos/context");
1281
1481
  var import_credentials3 = require("@dxos/credentials");
1282
1482
  var import_echo_db3 = require("@dxos/echo-db");
1283
1483
  var import_errors2 = require("@dxos/errors");
1484
+ var import_invariant8 = require("@dxos/invariant");
1284
1485
  var import_log9 = require("@dxos/log");
1285
1486
  var import_timeframe4 = require("@dxos/timeframe");
1286
1487
  var import_util6 = require("@dxos/util");
@@ -1294,7 +1495,7 @@ function _ts_decorate5(decorators, target, key, desc) {
1294
1495
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1295
1496
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1296
1497
  }
1297
- var __dxlog_file9 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/data-pipeline.ts";
1498
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/data-pipeline.ts";
1298
1499
  var MESSAGES_PER_SNAPSHOT = 10;
1299
1500
  var AUTOMATIC_SNAPSHOT_DEBOUNCE_INTERVAL = 5e3;
1300
1501
  var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL2 = 500;
@@ -1350,8 +1551,24 @@ var DataPipeline = class DataPipeline2 {
1350
1551
  }
1351
1552
  const feedWriter = {
1352
1553
  write: (data, options) => {
1353
- (0, import_tiny_invariant8.default)(this._pipeline, "Pipeline is not initialized.");
1354
- (0, import_tiny_invariant8.default)(this.currentEpoch, "Epoch is not initialized.");
1554
+ (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1555
+ F: __dxlog_file10,
1556
+ L: 145,
1557
+ S: this,
1558
+ A: [
1559
+ "this._pipeline",
1560
+ "'Pipeline is not initialized.'"
1561
+ ]
1562
+ });
1563
+ (0, import_invariant8.invariant)(this.currentEpoch, "Epoch is not initialized.", {
1564
+ F: __dxlog_file10,
1565
+ L: 146,
1566
+ S: this,
1567
+ A: [
1568
+ "this.currentEpoch",
1569
+ "'Epoch is not initialized.'"
1570
+ ]
1571
+ });
1355
1572
  return this._pipeline.writer.write({
1356
1573
  data
1357
1574
  }, options);
@@ -1371,8 +1588,8 @@ var DataPipeline = class DataPipeline2 {
1371
1588
  return;
1372
1589
  }
1373
1590
  (0, import_log9.log)("close", void 0, {
1374
- F: __dxlog_file9,
1375
- L: 171,
1591
+ F: __dxlog_file10,
1592
+ L: 170,
1376
1593
  S: this,
1377
1594
  C: (f, a) => f(...a)
1378
1595
  });
@@ -1386,8 +1603,8 @@ var DataPipeline = class DataPipeline2 {
1386
1603
  }
1387
1604
  } catch (err) {
1388
1605
  import_log9.log.catch(err, void 0, {
1389
- F: __dxlog_file9,
1390
- L: 184,
1606
+ F: __dxlog_file10,
1607
+ L: 183,
1391
1608
  S: this,
1392
1609
  C: (f, a) => f(...a)
1393
1610
  });
@@ -1409,15 +1626,23 @@ var DataPipeline = class DataPipeline2 {
1409
1626
  await this._processEpochInSeparateTask(this.currentEpoch);
1410
1627
  await waitForOneEpoch;
1411
1628
  }
1412
- (0, import_tiny_invariant8.default)(this._pipeline, "Pipeline is not initialized.");
1629
+ (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1630
+ F: __dxlog_file10,
1631
+ L: 206,
1632
+ S: this,
1633
+ A: [
1634
+ "this._pipeline",
1635
+ "'Pipeline is not initialized.'"
1636
+ ]
1637
+ });
1413
1638
  for await (const msg of this._pipeline.consume()) {
1414
1639
  const { feedKey, seq, data } = msg;
1415
1640
  (0, import_log9.log)("processing message", {
1416
1641
  feedKey,
1417
1642
  seq
1418
1643
  }, {
1419
- F: __dxlog_file9,
1420
- L: 210,
1644
+ F: __dxlog_file10,
1645
+ L: 209,
1421
1646
  S: this,
1422
1647
  C: (f, a) => f(...a)
1423
1648
  });
@@ -1428,8 +1653,8 @@ var DataPipeline = class DataPipeline2 {
1428
1653
  import_log9.log.warn("Could not find feed", {
1429
1654
  feedKey
1430
1655
  }, {
1431
- F: __dxlog_file9,
1432
- L: 216,
1656
+ F: __dxlog_file10,
1657
+ L: 215,
1433
1658
  S: this,
1434
1659
  C: (f, a) => f(...a)
1435
1660
  });
@@ -1451,8 +1676,8 @@ var DataPipeline = class DataPipeline2 {
1451
1676
  seq,
1452
1677
  spaceKey: this._params.spaceKey.toHex()
1453
1678
  }, {
1454
- F: __dxlog_file9,
1455
- L: 233,
1679
+ F: __dxlog_file10,
1680
+ L: 232,
1456
1681
  S: this,
1457
1682
  C: (f, a) => f(...a)
1458
1683
  });
@@ -1460,8 +1685,8 @@ var DataPipeline = class DataPipeline2 {
1460
1685
  }
1461
1686
  } catch (err) {
1462
1687
  import_log9.log.catch(err, void 0, {
1463
- F: __dxlog_file9,
1464
- L: 243,
1688
+ F: __dxlog_file10,
1689
+ L: 242,
1465
1690
  S: this,
1466
1691
  C: (f, a) => f(...a)
1467
1692
  });
@@ -1469,7 +1694,15 @@ var DataPipeline = class DataPipeline2 {
1469
1694
  }
1470
1695
  }
1471
1696
  _createSnapshot() {
1472
- (0, import_tiny_invariant8.default)(this.databaseHost, "Database backend is not initialized.");
1697
+ (0, import_invariant8.invariant)(this.databaseHost, "Database backend is not initialized.", {
1698
+ F: __dxlog_file10,
1699
+ L: 248,
1700
+ S: this,
1701
+ A: [
1702
+ "this.databaseHost",
1703
+ "'Database backend is not initialized.'"
1704
+ ]
1705
+ });
1473
1706
  return {
1474
1707
  spaceKey: this._params.spaceKey.asUint8Array(),
1475
1708
  timeframe: this._pipeline.state.timeframe,
@@ -1495,8 +1728,8 @@ var DataPipeline = class DataPipeline2 {
1495
1728
  }
1496
1729
  } catch (err) {
1497
1730
  import_log9.log.warn("Failed to cache properties", err, {
1498
- F: __dxlog_file9,
1499
- L: 278,
1731
+ F: __dxlog_file10,
1732
+ L: 277,
1500
1733
  S: this,
1501
1734
  C: (f, a) => f(...a)
1502
1735
  });
@@ -1522,15 +1755,15 @@ var DataPipeline = class DataPipeline2 {
1522
1755
  onError: (err) => {
1523
1756
  if (err instanceof import_errors2.CancelledError) {
1524
1757
  (0, import_log9.log)("Epoch processing cancelled.", void 0, {
1525
- F: __dxlog_file9,
1526
- L: 310,
1758
+ F: __dxlog_file10,
1759
+ L: 309,
1527
1760
  S: this,
1528
1761
  C: (f, a) => f(...a)
1529
1762
  });
1530
1763
  } else {
1531
1764
  import_log9.log.catch(err, void 0, {
1532
- F: __dxlog_file9,
1533
- L: 312,
1765
+ F: __dxlog_file10,
1766
+ L: 311,
1534
1767
  S: this,
1535
1768
  C: (f, a) => f(...a)
1536
1769
  });
@@ -1545,8 +1778,8 @@ var DataPipeline = class DataPipeline2 {
1545
1778
  (0, import_log9.log)("process epoch", {
1546
1779
  epoch
1547
1780
  }, {
1548
- F: __dxlog_file9,
1549
- L: 322,
1781
+ F: __dxlog_file10,
1782
+ L: 321,
1550
1783
  S: this,
1551
1784
  C: (f, a) => f(...a)
1552
1785
  });
@@ -1556,14 +1789,30 @@ var DataPipeline = class DataPipeline2 {
1556
1789
  });
1557
1790
  }
1558
1791
  async _processEpoch(ctx, epoch) {
1559
- (0, import_tiny_invariant8.default)(this._isOpen, "Space is closed.");
1560
- (0, import_tiny_invariant8.default)(this._pipeline);
1792
+ (0, import_invariant8.invariant)(this._isOpen, "Space is closed.", {
1793
+ F: __dxlog_file10,
1794
+ L: 331,
1795
+ S: this,
1796
+ A: [
1797
+ "this._isOpen",
1798
+ "'Space is closed.'"
1799
+ ]
1800
+ });
1801
+ (0, import_invariant8.invariant)(this._pipeline, void 0, {
1802
+ F: __dxlog_file10,
1803
+ L: 332,
1804
+ S: this,
1805
+ A: [
1806
+ "this._pipeline",
1807
+ ""
1808
+ ]
1809
+ });
1561
1810
  this._lastProcessedEpoch = epoch.number;
1562
1811
  (0, import_log9.log)("Processing epoch", {
1563
1812
  epoch
1564
1813
  }, {
1565
- F: __dxlog_file9,
1566
- L: 336,
1814
+ F: __dxlog_file10,
1815
+ L: 335,
1567
1816
  S: this,
1568
1817
  C: (f, a) => f(...a)
1569
1818
  });
@@ -1572,8 +1821,8 @@ var DataPipeline = class DataPipeline2 {
1572
1821
  this.databaseHost._itemDemuxer.restoreFromSnapshot(snapshot.database);
1573
1822
  }
1574
1823
  (0, import_log9.log)("restarting pipeline for epoch", void 0, {
1575
- F: __dxlog_file9,
1576
- L: 344,
1824
+ F: __dxlog_file10,
1825
+ L: 343,
1577
1826
  S: this,
1578
1827
  C: (f, a) => f(...a)
1579
1828
  });
@@ -1582,12 +1831,36 @@ var DataPipeline = class DataPipeline2 {
1582
1831
  await this._pipeline.unpause();
1583
1832
  }
1584
1833
  async waitUntilTimeframe(timeframe) {
1585
- (0, import_tiny_invariant8.default)(this._pipeline, "Pipeline is not initialized.");
1834
+ (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1835
+ F: __dxlog_file10,
1836
+ L: 351,
1837
+ S: this,
1838
+ A: [
1839
+ "this._pipeline",
1840
+ "'Pipeline is not initialized.'"
1841
+ ]
1842
+ });
1586
1843
  await this._pipeline.state.waitUntilTimeframe(timeframe);
1587
1844
  }
1588
1845
  async createEpoch() {
1589
- (0, import_tiny_invariant8.default)(this._pipeline);
1590
- (0, import_tiny_invariant8.default)(this.currentEpoch);
1846
+ (0, import_invariant8.invariant)(this._pipeline, void 0, {
1847
+ F: __dxlog_file10,
1848
+ L: 357,
1849
+ S: this,
1850
+ A: [
1851
+ "this._pipeline",
1852
+ ""
1853
+ ]
1854
+ });
1855
+ (0, import_invariant8.invariant)(this.currentEpoch, void 0, {
1856
+ F: __dxlog_file10,
1857
+ L: 358,
1858
+ S: this,
1859
+ A: [
1860
+ "this.currentEpoch",
1861
+ ""
1862
+ ]
1863
+ });
1591
1864
  await this._pipeline.pause();
1592
1865
  const snapshot = await this._createSnapshot();
1593
1866
  const snapshotCid = await this._params.snapshotManager.store(snapshot);
@@ -1631,14 +1904,22 @@ function _ts_decorate6(decorators, target, key, desc) {
1631
1904
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1632
1905
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1633
1906
  }
1634
- var __dxlog_file10 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space.ts";
1907
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
1635
1908
  var Space = class Space2 {
1636
1909
  constructor(params) {
1637
1910
  this._addFeedLock = new import_async7.Lock();
1638
1911
  this.onCredentialProcessed = new import_util7.Callback();
1639
1912
  this.stateUpdate = new import_async7.Event();
1640
1913
  this._isOpen = false;
1641
- (0, import_tiny_invariant9.default)(params.spaceKey && params.feedProvider);
1914
+ (0, import_invariant9.invariant)(params.spaceKey && params.feedProvider, void 0, {
1915
+ F: __dxlog_file11,
1916
+ L: 70,
1917
+ S: this,
1918
+ A: [
1919
+ "params.spaceKey && params.feedProvider",
1920
+ ""
1921
+ ]
1922
+ });
1642
1923
  this._key = params.spaceKey;
1643
1924
  this._genesisFeedKey = params.genesisFeed.key;
1644
1925
  this._feedProvider = params.feedProvider;
@@ -1673,8 +1954,8 @@ var Space = class Space2 {
1673
1954
  (0, import_log10.log)("onCredentialProcessed", {
1674
1955
  credential
1675
1956
  }, {
1676
- F: __dxlog_file10,
1677
- L: 107,
1957
+ F: __dxlog_file11,
1958
+ L: 106,
1678
1959
  S: this,
1679
1960
  C: (f, a) => f(...a)
1680
1961
  });
@@ -1739,14 +2020,30 @@ var Space = class Space2 {
1739
2020
  return this._snapshotManager;
1740
2021
  }
1741
2022
  setControlFeed(feed) {
1742
- (0, import_tiny_invariant9.default)(!this._controlFeed, "Control feed already set.");
2023
+ (0, import_invariant9.invariant)(!this._controlFeed, "Control feed already set.", {
2024
+ F: __dxlog_file11,
2025
+ L: 180,
2026
+ S: this,
2027
+ A: [
2028
+ "!this._controlFeed",
2029
+ "'Control feed already set.'"
2030
+ ]
2031
+ });
1743
2032
  this._controlFeed = feed;
1744
2033
  this._controlPipeline.setWriteFeed(feed);
1745
2034
  return this;
1746
2035
  }
1747
2036
  setDataFeed(feed) {
1748
2037
  var _a;
1749
- (0, import_tiny_invariant9.default)(!this._dataFeed, "Data feed already set.");
2038
+ (0, import_invariant9.invariant)(!this._dataFeed, "Data feed already set.", {
2039
+ F: __dxlog_file11,
2040
+ L: 187,
2041
+ S: this,
2042
+ A: [
2043
+ "!this._dataFeed",
2044
+ "'Data feed already set.'"
2045
+ ]
2046
+ });
1750
2047
  this._dataFeed = feed;
1751
2048
  (_a = this._dataPipeline.pipeline) == null ? void 0 : _a.setWriteFeed(feed);
1752
2049
  return this;
@@ -1765,8 +2062,8 @@ var Space = class Space2 {
1765
2062
  // }
1766
2063
  async open() {
1767
2064
  (0, import_log10.log)("opening...", void 0, {
1768
- F: __dxlog_file10,
1769
- L: 209,
2065
+ F: __dxlog_file11,
2066
+ L: 208,
1770
2067
  S: this,
1771
2068
  C: (f, a) => f(...a)
1772
2069
  });
@@ -1778,8 +2075,8 @@ var Space = class Space2 {
1778
2075
  await this._controlPipeline.spaceState.addCredentialProcessor(this._dataPipeline);
1779
2076
  this._isOpen = true;
1780
2077
  (0, import_log10.log)("opened", void 0, {
1781
- F: __dxlog_file10,
1782
- L: 220,
2078
+ F: __dxlog_file11,
2079
+ L: 219,
1783
2080
  S: this,
1784
2081
  C: (f, a) => f(...a)
1785
2082
  });
@@ -1788,8 +2085,8 @@ var Space = class Space2 {
1788
2085
  (0, import_log10.log)("closing...", {
1789
2086
  key: this._key
1790
2087
  }, {
1791
- F: __dxlog_file10,
1792
- L: 225,
2088
+ F: __dxlog_file11,
2089
+ L: 224,
1793
2090
  S: this,
1794
2091
  C: (f, a) => f(...a)
1795
2092
  });
@@ -1802,20 +2099,28 @@ var Space = class Space2 {
1802
2099
  await this._controlPipeline.stop();
1803
2100
  this._isOpen = false;
1804
2101
  (0, import_log10.log)("closed", void 0, {
1805
- F: __dxlog_file10,
1806
- L: 238,
2102
+ F: __dxlog_file11,
2103
+ L: 237,
1807
2104
  S: this,
1808
2105
  C: (f, a) => f(...a)
1809
2106
  });
1810
2107
  }
1811
2108
  async initializeDataPipeline() {
1812
2109
  (0, import_log10.log)("initializeDataPipeline", void 0, {
1813
- F: __dxlog_file10,
1814
- L: 243,
2110
+ F: __dxlog_file11,
2111
+ L: 242,
1815
2112
  S: this,
1816
2113
  C: (f, a) => f(...a)
1817
2114
  });
1818
- (0, import_tiny_invariant9.default)(this._isOpen, "Space must be open to initialize data pipeline.");
2115
+ (0, import_invariant9.invariant)(this._isOpen, "Space must be open to initialize data pipeline.", {
2116
+ F: __dxlog_file11,
2117
+ L: 243,
2118
+ S: this,
2119
+ A: [
2120
+ "this._isOpen",
2121
+ "'Space must be open to initialize data pipeline.'"
2122
+ ]
2123
+ });
1819
2124
  await this._dataPipeline.open();
1820
2125
  }
1821
2126
  };
@@ -1862,7 +2167,7 @@ function _ts_decorate7(decorators, target, key, desc) {
1862
2167
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1863
2168
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1864
2169
  }
1865
- var __dxlog_file11 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space-protocol.ts";
2170
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space-protocol.ts";
1866
2171
  var MOCK_AUTH_PROVIDER = async (nonce) => Buffer.from("mock");
1867
2172
  var MOCK_AUTH_VERIFIER = async (nonce, credential) => true;
1868
2173
  var SpaceProtocol = class {
@@ -1892,7 +2197,7 @@ var SpaceProtocol = class {
1892
2197
  (0, import_log11.log)("addFeed", {
1893
2198
  key: feed.key
1894
2199
  }, {
1895
- F: __dxlog_file11,
2200
+ F: __dxlog_file12,
1896
2201
  L: 95,
1897
2202
  S: this,
1898
2203
  C: (f, a) => f(...a)
@@ -1914,21 +2219,22 @@ var SpaceProtocol = class {
1914
2219
  };
1915
2220
  await this.blobSync.open();
1916
2221
  (0, import_log11.log)("starting...", void 0, {
1917
- F: __dxlog_file11,
2222
+ F: __dxlog_file12,
1918
2223
  L: 120,
1919
2224
  S: this,
1920
2225
  C: (f, a) => f(...a)
1921
2226
  });
2227
+ const topic = await this._topic;
1922
2228
  this._connection = await this._networkManager.joinSwarm({
1923
2229
  protocolProvider: this._createProtocolProvider(credentials),
1924
2230
  peerId: this._swarmIdentity.peerKey,
1925
- topic: await this._topic,
2231
+ topic,
1926
2232
  topology: new import_network_manager.MMSTTopology(topologyConfig),
1927
- label: `Protocol swarm: ${this._topic}`
2233
+ label: `Protocol swarm: ${topic}`
1928
2234
  });
1929
2235
  (0, import_log11.log)("started", void 0, {
1930
- F: __dxlog_file11,
1931
- L: 129,
2236
+ F: __dxlog_file12,
2237
+ L: 130,
1932
2238
  S: this,
1933
2239
  C: (f, a) => f(...a)
1934
2240
  });
@@ -1937,15 +2243,15 @@ var SpaceProtocol = class {
1937
2243
  await this.blobSync.close();
1938
2244
  if (this._connection) {
1939
2245
  (0, import_log11.log)("stopping...", void 0, {
1940
- F: __dxlog_file11,
1941
- L: 136,
2246
+ F: __dxlog_file12,
2247
+ L: 137,
1942
2248
  S: this,
1943
2249
  C: (f, a) => f(...a)
1944
2250
  });
1945
2251
  await this._connection.close();
1946
2252
  (0, import_log11.log)("stopped", void 0, {
1947
- F: __dxlog_file11,
1948
- L: 138,
2253
+ F: __dxlog_file12,
2254
+ L: 139,
1949
2255
  S: this,
1950
2256
  C: (f, a) => f(...a)
1951
2257
  });
@@ -2012,8 +2318,8 @@ var SpaceProtocolSession = class {
2012
2318
  onAuthSuccess: () => {
2013
2319
  var _a;
2014
2320
  (0, import_log11.log)("Peer authenticated", void 0, {
2015
- F: __dxlog_file11,
2016
- L: 235,
2321
+ F: __dxlog_file12,
2322
+ L: 236,
2017
2323
  S: this,
2018
2324
  C: (f, a) => f(...a)
2019
2325
  });
@@ -2051,7 +2357,7 @@ function _ts_decorate8(decorators, target, key, desc) {
2051
2357
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2052
2358
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2053
2359
  }
2054
- var __dxlog_file12 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space-manager.ts";
2360
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space-manager.ts";
2055
2361
  var SpaceManager = class SpaceManager2 {
2056
2362
  constructor({ feedStore, networkManager, modelFactory, metadataStore, snapshotStore, blobStore }) {
2057
2363
  this._spaces = new import_util9.ComplexMap(import_keys6.PublicKey.hash);
@@ -2079,7 +2385,7 @@ var SpaceManager = class SpaceManager2 {
2079
2385
  import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols6.trace.begin({
2080
2386
  id: this._instanceId
2081
2387
  }), {
2082
- F: __dxlog_file12,
2388
+ F: __dxlog_file13,
2083
2389
  L: 97,
2084
2390
  S: this,
2085
2391
  C: (f, a) => f(...a)
@@ -2087,7 +2393,7 @@ var SpaceManager = class SpaceManager2 {
2087
2393
  (0, import_log12.log)("constructing space...", {
2088
2394
  spaceKey: metadata.genesisFeedKey
2089
2395
  }, {
2090
- F: __dxlog_file12,
2396
+ F: __dxlog_file13,
2091
2397
  L: 98,
2092
2398
  S: this,
2093
2399
  C: (f, a) => f(...a)
@@ -2117,7 +2423,7 @@ var SpaceManager = class SpaceManager2 {
2117
2423
  import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols6.trace.end({
2118
2424
  id: this._instanceId
2119
2425
  }), {
2120
- F: __dxlog_file12,
2426
+ F: __dxlog_file13,
2121
2427
  L: 125,
2122
2428
  S: this,
2123
2429
  C: (f, a) => f(...a)