@dxos/echo-pipeline 0.1.58-main.4d30760 → 0.1.58-main.4e2a73a

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 (48) hide show
  1. package/dist/lib/browser/{chunk-VYZEP2BZ.mjs → chunk-7ZNBLEKV.mjs} +53 -59
  2. package/dist/lib/browser/chunk-7ZNBLEKV.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -57
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +1 -1
  7. package/dist/lib/browser/testing/index.mjs.map +1 -1
  8. package/dist/lib/node/index.cjs +57 -126
  9. package/dist/lib/node/index.cjs.map +4 -4
  10. package/dist/lib/node/meta.json +1 -1
  11. package/dist/lib/node/testing/index.cjs +162 -166
  12. package/dist/lib/node/testing/index.cjs.map +4 -4
  13. package/dist/types/src/db-host/snapshot-manager.d.ts.map +1 -1
  14. package/dist/types/src/db-host/snapshot-store.d.ts.map +1 -1
  15. package/dist/types/src/index.d.ts +0 -1
  16. package/dist/types/src/index.d.ts.map +1 -1
  17. package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
  18. package/dist/types/src/pipeline/pipeline.d.ts.map +1 -1
  19. package/dist/types/src/pipeline/timeframe-clock.d.ts.map +1 -1
  20. package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
  21. package/dist/types/src/space/space-manager.d.ts +2 -2
  22. package/dist/types/src/space/space-manager.d.ts.map +1 -1
  23. package/dist/types/src/space/space.d.ts +2 -2
  24. package/dist/types/src/space/space.d.ts.map +1 -1
  25. package/dist/types/src/testing/test-agent-builder.d.ts +1 -1
  26. package/dist/types/src/testing/test-agent-builder.d.ts.map +1 -1
  27. package/package.json +31 -32
  28. package/src/db-host/snapshot-manager.ts +1 -3
  29. package/src/db-host/snapshot-store.ts +1 -4
  30. package/src/index.ts +0 -1
  31. package/src/metadata/metadata-store.ts +2 -6
  32. package/src/pipeline/pipeline-stress.test.ts +10 -3
  33. package/src/pipeline/pipeline.test.ts +1 -1
  34. package/src/pipeline/pipeline.ts +3 -4
  35. package/src/pipeline/timeframe-clock.ts +1 -4
  36. package/src/space/control-pipeline.test.ts +1 -1
  37. package/src/space/data-pipeline.ts +1 -2
  38. package/src/space/space-manager.ts +2 -2
  39. package/src/space/space-protocol.test.ts +1 -1
  40. package/src/space/space.ts +3 -3
  41. package/src/testing/test-agent-builder.ts +1 -1
  42. package/dist/lib/browser/chunk-VYZEP2BZ.mjs.map +0 -7
  43. package/dist/types/src/errors/errors.d.ts +0 -26
  44. package/dist/types/src/errors/errors.d.ts.map +0 -1
  45. package/dist/types/src/errors/index.d.ts +0 -2
  46. package/dist/types/src/errors/index.d.ts.map +0 -1
  47. package/src/errors/errors.ts +0 -52
  48. package/src/errors/index.ts +0 -5
@@ -55,15 +55,60 @@ var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip"
55
55
  var import_teleport_extension_object_sync2 = require("@dxos/teleport-extension-object-sync");
56
56
  var import_util10 = require("@dxos/util");
57
57
 
58
+ // packages/core/echo/echo-pipeline/src/testing/test-feed-builder.ts
59
+ var import_testing = require("@dxos/feed-store/testing");
60
+
61
+ // packages/core/echo/echo-pipeline/src/common/codec.ts
62
+ var import_hypercore = require("@dxos/hypercore");
63
+ var import_protocols = require("@dxos/protocols");
64
+ var codec = import_protocols.schema.getCodecForType("dxos.echo.feed.FeedMessage");
65
+ var valueEncoding = (0, import_hypercore.createCodecEncoding)(codec);
66
+
67
+ // packages/core/echo/echo-pipeline/src/common/feeds.ts
68
+ var import_invariant = require("@dxos/invariant");
69
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/common/feeds.ts";
70
+ var createMappedFeedWriter = (mapper, writer) => {
71
+ (0, import_invariant.invariant)(mapper, void 0, {
72
+ F: __dxlog_file,
73
+ L: 16,
74
+ S: void 0,
75
+ A: [
76
+ "mapper",
77
+ ""
78
+ ]
79
+ });
80
+ (0, import_invariant.invariant)(writer, void 0, {
81
+ F: __dxlog_file,
82
+ L: 17,
83
+ S: void 0,
84
+ A: [
85
+ "writer",
86
+ ""
87
+ ]
88
+ });
89
+ return {
90
+ write: async (data, options) => await writer.write(await mapper(data), options)
91
+ };
92
+ };
93
+
94
+ // packages/core/echo/echo-pipeline/src/testing/test-feed-builder.ts
95
+ var TestFeedBuilder = class extends import_testing.TestBuilder {
96
+ constructor() {
97
+ super({
98
+ valueEncoding
99
+ });
100
+ }
101
+ };
102
+
58
103
  // packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts
59
104
  var import_codec_protobuf = require("@dxos/codec-protobuf");
60
105
  var import_context = require("@dxos/context");
61
106
  var import_echo_db = require("@dxos/echo-db");
62
- var import_invariant = require("@dxos/invariant");
107
+ var import_invariant2 = require("@dxos/invariant");
63
108
  var import_log = require("@dxos/log");
64
109
  var import_service = require("@dxos/protocols/proto/dxos/echo/service");
65
110
  var import_util = require("@dxos/util");
66
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
111
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
67
112
  var DataServiceHost = class {
68
113
  constructor(_itemManager, _itemDemuxer, _flush, _writeStream) {
69
114
  this._itemManager = _itemManager;
@@ -100,8 +145,8 @@ var DataServiceHost = class {
100
145
  });
101
146
  this._itemDemuxer.mutation.on(ctx, (message) => {
102
147
  const { batch, meta } = message;
103
- (0, import_invariant.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
104
- F: __dxlog_file,
148
+ (0, import_invariant2.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
149
+ F: __dxlog_file2,
105
150
  L: 69,
106
151
  S: this,
107
152
  A: [
@@ -113,7 +158,7 @@ var DataServiceHost = class {
113
158
  batch: batch.objects?.length,
114
159
  meta
115
160
  }, {
116
- F: __dxlog_file,
161
+ F: __dxlog_file2,
117
162
  L: 70,
118
163
  S: this,
119
164
  C: (f, a) => f(...a)
@@ -140,8 +185,8 @@ var DataServiceHost = class {
140
185
  });
141
186
  }
142
187
  async write(request) {
143
- (0, import_invariant.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
144
- F: __dxlog_file,
188
+ (0, import_invariant2.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
189
+ F: __dxlog_file2,
145
190
  L: 96,
146
191
  S: this,
147
192
  A: [
@@ -149,8 +194,8 @@ var DataServiceHost = class {
149
194
  "'Cannot write to closed DataServiceHost'"
150
195
  ]
151
196
  });
152
- (0, import_invariant.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
153
- F: __dxlog_file,
197
+ (0, import_invariant2.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
198
+ F: __dxlog_file2,
154
199
  L: 97,
155
200
  S: this,
156
201
  A: [
@@ -162,7 +207,7 @@ var DataServiceHost = class {
162
207
  clientTag: request.clientTag,
163
208
  objectCount: request.batch.objects?.length ?? 0
164
209
  }, {
165
- F: __dxlog_file,
210
+ F: __dxlog_file2,
166
211
  L: 99,
167
212
  S: this,
168
213
  C: (f, a) => f(...a)
@@ -176,7 +221,7 @@ var DataServiceHost = class {
176
221
  feedKey: receipt2.feedKey,
177
222
  seq: receipt2.seq
178
223
  }, {
179
- F: __dxlog_file,
224
+ F: __dxlog_file2,
180
225
  L: 108,
181
226
  S: this,
182
227
  C: (f, a) => f(...a)
@@ -243,7 +288,7 @@ var DatabaseHost = class {
243
288
  var import_async = require("@dxos/async");
244
289
  var import_context2 = require("@dxos/context");
245
290
  var import_keys = require("@dxos/keys");
246
- var import_protocols = require("@dxos/protocols");
291
+ var import_protocols2 = require("@dxos/protocols");
247
292
  var import_blob = require("@dxos/protocols/proto/dxos/echo/blob");
248
293
  function _ts_decorate(decorators, target, key, desc) {
249
294
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -255,9 +300,8 @@ function _ts_decorate(decorators, target, key, desc) {
255
300
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
256
301
  return c > 3 && r && Object.defineProperty(target, key, r), r;
257
302
  }
258
- var SpaceSnapshot = import_protocols.schema.getCodecForType("dxos.echo.snapshot.SpaceSnapshot");
303
+ var SpaceSnapshot = import_protocols2.schema.getCodecForType("dxos.echo.snapshot.SpaceSnapshot");
259
304
  var SnapshotManager = class SnapshotManager2 {
260
- // prettier-ignore
261
305
  constructor(_snapshotStore, _blobStore, _blobSync) {
262
306
  this._snapshotStore = _snapshotStore;
263
307
  this._blobStore = _blobStore;
@@ -292,10 +336,9 @@ SnapshotManager = _ts_decorate([
292
336
 
293
337
  // packages/core/echo/echo-pipeline/src/db-host/snapshot-store.ts
294
338
  var import_crypto = require("@dxos/crypto");
295
- var import_protocols2 = require("@dxos/protocols");
296
- var SpaceSnapshot2 = import_protocols2.schema.getCodecForType("dxos.echo.snapshot.SpaceSnapshot");
339
+ var import_protocols3 = require("@dxos/protocols");
340
+ var SpaceSnapshot2 = import_protocols3.schema.getCodecForType("dxos.echo.snapshot.SpaceSnapshot");
297
341
  var SnapshotStore = class {
298
- // prettier-ignore
299
342
  constructor(_directory) {
300
343
  this._directory = _directory;
301
344
  }
@@ -338,11 +381,11 @@ var SnapshotStore = class {
338
381
 
339
382
  // packages/core/echo/echo-pipeline/src/db-host/data-service.ts
340
383
  var import_debug = require("@dxos/debug");
341
- var import_invariant2 = require("@dxos/invariant");
384
+ var import_invariant3 = require("@dxos/invariant");
342
385
  var import_keys2 = require("@dxos/keys");
343
386
  var import_log2 = require("@dxos/log");
344
387
  var import_util2 = require("@dxos/util");
345
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
388
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
346
389
  var DataServiceSubscriptions = class {
347
390
  constructor() {
348
391
  this._spaces = new import_util2.ComplexMap(import_keys2.PublicKey.hash);
@@ -354,13 +397,13 @@ var DataServiceSubscriptions = class {
354
397
  (0, import_log2.log)("Registering space", {
355
398
  spaceKey
356
399
  }, {
357
- F: __dxlog_file2,
400
+ F: __dxlog_file3,
358
401
  L: 31,
359
402
  S: this,
360
403
  C: (f, a) => f(...a)
361
404
  });
362
- (0, import_invariant2.invariant)(!this._spaces.has(spaceKey), void 0, {
363
- F: __dxlog_file2,
405
+ (0, import_invariant3.invariant)(!this._spaces.has(spaceKey), void 0, {
406
+ F: __dxlog_file3,
364
407
  L: 32,
365
408
  S: this,
366
409
  A: [
@@ -375,7 +418,7 @@ var DataServiceSubscriptions = class {
375
418
  (0, import_log2.log)("Unregistering space", {
376
419
  spaceKey
377
420
  }, {
378
- F: __dxlog_file2,
421
+ F: __dxlog_file3,
379
422
  L: 38,
380
423
  S: this,
381
424
  C: (f, a) => f(...a)
@@ -393,8 +436,8 @@ var DataServiceImpl = class {
393
436
  this._subscriptions = _subscriptions;
394
437
  }
395
438
  subscribe(request) {
396
- (0, import_invariant2.invariant)(request.spaceKey, void 0, {
397
- F: __dxlog_file2,
439
+ (0, import_invariant3.invariant)(request.spaceKey, void 0, {
440
+ F: __dxlog_file3,
398
441
  L: 57,
399
442
  S: this,
400
443
  A: [
@@ -406,8 +449,8 @@ var DataServiceImpl = class {
406
449
  return host.subscribe();
407
450
  }
408
451
  write(request) {
409
- (0, import_invariant2.invariant)(request.spaceKey, void 0, {
410
- F: __dxlog_file2,
452
+ (0, import_invariant3.invariant)(request.spaceKey, void 0, {
453
+ F: __dxlog_file3,
411
454
  L: 64,
412
455
  S: this,
413
456
  A: [
@@ -415,8 +458,8 @@ var DataServiceImpl = class {
415
458
  ""
416
459
  ]
417
460
  });
418
- (0, import_invariant2.invariant)(request.batch, void 0, {
419
- F: __dxlog_file2,
461
+ (0, import_invariant3.invariant)(request.batch, void 0, {
462
+ F: __dxlog_file3,
420
463
  L: 65,
421
464
  S: this,
422
465
  A: [
@@ -428,8 +471,8 @@ var DataServiceImpl = class {
428
471
  return host.write(request);
429
472
  }
430
473
  flush(request) {
431
- (0, import_invariant2.invariant)(request.spaceKey, void 0, {
432
- F: __dxlog_file2,
474
+ (0, import_invariant3.invariant)(request.spaceKey, void 0, {
475
+ F: __dxlog_file3,
433
476
  L: 72,
434
477
  S: this,
435
478
  A: [
@@ -445,11 +488,10 @@ var DataServiceImpl = class {
445
488
  // packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
446
489
  var import_crc_32 = __toESM(require("crc-32"));
447
490
  var import_async2 = require("@dxos/async");
448
- var import_errors = require("@dxos/errors");
449
- var import_invariant3 = require("@dxos/invariant");
491
+ var import_invariant4 = require("@dxos/invariant");
450
492
  var import_keys3 = require("@dxos/keys");
451
493
  var import_log3 = require("@dxos/log");
452
- var import_protocols3 = require("@dxos/protocols");
494
+ var import_protocols4 = require("@dxos/protocols");
453
495
  var import_services = require("@dxos/protocols/proto/dxos/client/services");
454
496
  var import_util3 = require("@dxos/util");
455
497
  function _ts_decorate2(decorators, target, key, desc) {
@@ -462,18 +504,17 @@ function _ts_decorate2(decorators, target, key, desc) {
462
504
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
463
505
  return c > 3 && r && Object.defineProperty(target, key, r), r;
464
506
  }
465
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
507
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
466
508
  var emptyEchoMetadata = () => ({
467
- version: import_protocols3.STORAGE_VERSION,
509
+ version: import_protocols4.STORAGE_VERSION,
468
510
  spaces: [],
469
511
  created: /* @__PURE__ */ new Date(),
470
512
  updated: /* @__PURE__ */ new Date()
471
513
  });
472
514
  var emptyLargeSpaceMetadata = () => ({});
473
- var EchoMetadata = import_protocols3.schema.getCodecForType("dxos.echo.metadata.EchoMetadata");
474
- var LargeSpaceMetadata = import_protocols3.schema.getCodecForType("dxos.echo.metadata.LargeSpaceMetadata");
515
+ var EchoMetadata = import_protocols4.schema.getCodecForType("dxos.echo.metadata.EchoMetadata");
516
+ var LargeSpaceMetadata = import_protocols4.schema.getCodecForType("dxos.echo.metadata.LargeSpaceMetadata");
475
517
  var MetadataStore = class {
476
- // prettier-ignore
477
518
  constructor(_directory) {
478
519
  this._directory = _directory;
479
520
  this._metadata = emptyEchoMetadata();
@@ -507,13 +548,13 @@ var MetadataStore = class {
507
548
  checksum,
508
549
  name: file.filename
509
550
  }, {
510
- F: __dxlog_file3,
511
- L: 82,
551
+ F: __dxlog_file4,
552
+ L: 78,
512
553
  S: this,
513
554
  C: (f, a) => f(...a)
514
555
  });
515
556
  if (fileLength < dataSize + 8) {
516
- throw new import_errors.DataCorruptionError("Metadata size is smaller than expected.", {
557
+ throw new import_protocols4.DataCorruptionError("Metadata size is smaller than expected.", {
517
558
  fileLength,
518
559
  dataSize
519
560
  });
@@ -521,7 +562,7 @@ var MetadataStore = class {
521
562
  const data = await file.read(8, dataSize);
522
563
  const calculatedChecksum = import_crc_32.default.buf(data);
523
564
  if (calculatedChecksum !== checksum) {
524
- throw new import_errors.DataCorruptionError("Metadata checksum is invalid.");
565
+ throw new import_protocols4.DataCorruptionError("Metadata checksum is invalid.");
525
566
  }
526
567
  return codec2.decode(data);
527
568
  } finally {
@@ -540,8 +581,8 @@ var MetadataStore = class {
540
581
  size: encoded.length,
541
582
  checksum
542
583
  }, {
543
- F: __dxlog_file3,
544
- L: 114,
584
+ F: __dxlog_file4,
585
+ L: 110,
545
586
  S: this,
546
587
  C: (f, a) => f(...a)
547
588
  });
@@ -572,8 +613,8 @@ var MetadataStore = class {
572
613
  import_log3.log.error("failed to load metadata", {
573
614
  err
574
615
  }, {
575
- F: __dxlog_file3,
576
- L: 145,
616
+ F: __dxlog_file4,
617
+ L: 141,
577
618
  S: this,
578
619
  C: (f, a) => f(...a)
579
620
  });
@@ -589,8 +630,8 @@ var MetadataStore = class {
589
630
  import_log3.log.error("failed to load space large metadata", {
590
631
  err
591
632
  }, {
592
- F: __dxlog_file3,
593
- L: 157,
633
+ F: __dxlog_file4,
634
+ L: 153,
594
635
  S: this,
595
636
  C: (f, a) => f(...a)
596
637
  });
@@ -600,7 +641,7 @@ var MetadataStore = class {
600
641
  async _save() {
601
642
  const data = {
602
643
  ...this._metadata,
603
- version: import_protocols3.STORAGE_VERSION,
644
+ version: import_protocols4.STORAGE_VERSION,
604
645
  created: this._metadata.created ?? /* @__PURE__ */ new Date(),
605
646
  updated: /* @__PURE__ */ new Date()
606
647
  };
@@ -619,8 +660,8 @@ var MetadataStore = class {
619
660
  import_log3.log.error("failed to load space large metadata", {
620
661
  err
621
662
  }, {
622
- F: __dxlog_file3,
623
- L: 186,
663
+ F: __dxlog_file4,
664
+ L: 182,
624
665
  S: this,
625
666
  C: (f, a) => f(...a)
626
667
  });
@@ -639,9 +680,9 @@ var MetadataStore = class {
639
680
  return this._metadata.identity.haloSpace;
640
681
  }
641
682
  const space = this.spaces.find((space2) => space2.key === spaceKey);
642
- (0, import_invariant3.invariant)(space, "Space not found", {
643
- F: __dxlog_file3,
644
- L: 208,
683
+ (0, import_invariant4.invariant)(space, "Space not found", {
684
+ F: __dxlog_file4,
685
+ L: 204,
645
686
  S: this,
646
687
  A: [
647
688
  "space",
@@ -664,8 +705,8 @@ var MetadataStore = class {
664
705
  */
665
706
  async clear() {
666
707
  (0, import_log3.log)("clearing all metadata", void 0, {
667
- F: __dxlog_file3,
668
- L: 227,
708
+ F: __dxlog_file4,
709
+ L: 223,
669
710
  S: this,
670
711
  C: (f, a) => f(...a)
671
712
  });
@@ -676,9 +717,9 @@ var MetadataStore = class {
676
717
  return this._metadata.identity;
677
718
  }
678
719
  async setIdentityRecord(record) {
679
- (0, import_invariant3.invariant)(!this._metadata.identity, "Cannot overwrite existing identity in metadata", {
680
- F: __dxlog_file3,
681
- L: 237,
720
+ (0, import_invariant4.invariant)(!this._metadata.identity, "Cannot overwrite existing identity in metadata", {
721
+ F: __dxlog_file4,
722
+ L: 233,
682
723
  S: this,
683
724
  A: [
684
725
  "!this._metadata.identity",
@@ -690,9 +731,9 @@ var MetadataStore = class {
690
731
  await this.flush();
691
732
  }
692
733
  async addSpace(record) {
693
- (0, import_invariant3.invariant)(!(this._metadata.spaces ?? []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata", {
694
- F: __dxlog_file3,
695
- L: 245,
734
+ (0, import_invariant4.invariant)(!(this._metadata.spaces ?? []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata", {
735
+ F: __dxlog_file4,
736
+ L: 241,
696
737
  S: this,
697
738
  A: [
698
739
  "!(this._metadata.spaces ?? []).find((space) => space.key === record.key)",
@@ -752,19 +793,19 @@ var fromBytesInt32 = (buf) => buf.readInt32LE(0);
752
793
  var import_async3 = require("@dxos/async");
753
794
  var import_context3 = require("@dxos/context");
754
795
  var import_crypto2 = require("@dxos/crypto");
755
- var import_invariant4 = require("@dxos/invariant");
796
+ var import_invariant5 = require("@dxos/invariant");
756
797
  var import_log4 = require("@dxos/log");
757
- var import_protocols4 = require("@dxos/protocols");
798
+ var import_protocols5 = require("@dxos/protocols");
758
799
  var import_teleport = require("@dxos/teleport");
759
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/auth.ts";
800
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/auth.ts";
760
801
  var AuthExtension = class extends import_teleport.RpcExtension {
761
802
  constructor(_authParams) {
762
803
  super({
763
804
  requested: {
764
- AuthService: import_protocols4.schema.getService("dxos.mesh.teleport.auth.AuthService")
805
+ AuthService: import_protocols5.schema.getService("dxos.mesh.teleport.auth.AuthService")
765
806
  },
766
807
  exposed: {
767
- AuthService: import_protocols4.schema.getService("dxos.mesh.teleport.auth.AuthService")
808
+ AuthService: import_protocols5.schema.getService("dxos.mesh.teleport.auth.AuthService")
768
809
  },
769
810
  timeout: 60 * 1e3
770
811
  });
@@ -772,7 +813,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
772
813
  this._ctx = new import_context3.Context({
773
814
  onError: (err) => {
774
815
  import_log4.log.catch(err, void 0, {
775
- F: __dxlog_file4,
816
+ F: __dxlog_file5,
776
817
  L: 28,
777
818
  S: this,
778
819
  C: (f, a) => f(...a)
@@ -794,7 +835,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
794
835
  };
795
836
  } catch (err) {
796
837
  import_log4.log.error("failed to generate auth credentials", err, {
797
- F: __dxlog_file4,
838
+ F: __dxlog_file5,
798
839
  L: 55,
799
840
  S: this,
800
841
  C: (f, a) => f(...a)
@@ -813,8 +854,8 @@ var AuthExtension = class extends import_teleport.RpcExtension {
813
854
  const { credential } = await this.rpc.AuthService.authenticate({
814
855
  challenge
815
856
  });
816
- (0, import_invariant4.invariant)(credential?.length > 0, "invalid credential", {
817
- F: __dxlog_file4,
857
+ (0, import_invariant5.invariant)(credential?.length > 0, "invalid credential", {
858
+ F: __dxlog_file5,
818
859
  L: 69,
819
860
  S: this,
820
861
  A: [
@@ -823,8 +864,8 @@ var AuthExtension = class extends import_teleport.RpcExtension {
823
864
  ]
824
865
  });
825
866
  const success = await this._authParams.verifier(challenge, credential);
826
- (0, import_invariant4.invariant)(success, "credential not verified", {
827
- F: __dxlog_file4,
867
+ (0, import_invariant5.invariant)(success, "credential not verified", {
868
+ F: __dxlog_file5,
828
869
  L: 71,
829
870
  S: this,
830
871
  A: [
@@ -835,7 +876,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
835
876
  (0, import_async3.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
836
877
  } catch (err) {
837
878
  (0, import_log4.log)("auth failed", err, {
838
- F: __dxlog_file4,
879
+ F: __dxlog_file5,
839
880
  L: 74,
840
881
  S: this,
841
882
  C: (f, a) => f(...a)
@@ -885,39 +926,6 @@ var import_log7 = require("@dxos/log");
885
926
  var import_timeframe2 = require("@dxos/timeframe");
886
927
  var import_util4 = require("@dxos/util");
887
928
 
888
- // packages/core/echo/echo-pipeline/src/common/codec.ts
889
- var import_hypercore = require("@dxos/hypercore");
890
- var import_protocols5 = require("@dxos/protocols");
891
- var codec = import_protocols5.schema.getCodecForType("dxos.echo.feed.FeedMessage");
892
- var valueEncoding = (0, import_hypercore.createCodecEncoding)(codec);
893
-
894
- // packages/core/echo/echo-pipeline/src/common/feeds.ts
895
- var import_invariant5 = require("@dxos/invariant");
896
- var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/common/feeds.ts";
897
- var createMappedFeedWriter = (mapper, writer) => {
898
- (0, import_invariant5.invariant)(mapper, void 0, {
899
- F: __dxlog_file5,
900
- L: 16,
901
- S: void 0,
902
- A: [
903
- "mapper",
904
- ""
905
- ]
906
- });
907
- (0, import_invariant5.invariant)(writer, void 0, {
908
- F: __dxlog_file5,
909
- L: 17,
910
- S: void 0,
911
- A: [
912
- "writer",
913
- ""
914
- ]
915
- });
916
- return {
917
- write: async (data, options) => await writer.write(await mapper(data), options)
918
- };
919
- };
920
-
921
929
  // packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts
922
930
  var import_invariant6 = require("@dxos/invariant");
923
931
  var import_log5 = require("@dxos/log");
@@ -973,7 +981,6 @@ var startAfter = (timeframe) => timeframe.frames().map(([feedKey, index]) => ({
973
981
  index: index + 1
974
982
  }));
975
983
  var TimeframeClock = class {
976
- // prettier-ignore
977
984
  constructor(_timeframe = new import_timeframe.Timeframe()) {
978
985
  this._timeframe = _timeframe;
979
986
  this.update = new import_async4.Event();
@@ -1019,7 +1026,7 @@ var TimeframeClock = class {
1019
1026
  current: this._timeframe
1020
1027
  }, {
1021
1028
  F: __dxlog_file7,
1022
- L: 73,
1029
+ L: 70,
1023
1030
  S: this,
1024
1031
  C: (f, a) => f(...a)
1025
1032
  });
@@ -1030,7 +1037,7 @@ var TimeframeClock = class {
1030
1037
  deps: import_timeframe.Timeframe.dependencies(target, this._timeframe)
1031
1038
  }, {
1032
1039
  F: __dxlog_file7,
1033
- L: 75,
1040
+ L: 72,
1034
1041
  S: this,
1035
1042
  C: (f, a) => f(...a)
1036
1043
  });
@@ -1055,7 +1062,6 @@ function _ts_decorate4(decorators, target, key, desc) {
1055
1062
  }
1056
1063
  var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
1057
1064
  var PipelineState = class {
1058
- // prettier-ignore
1059
1065
  constructor(_feeds, _timeframeClock) {
1060
1066
  this._feeds = _feeds;
1061
1067
  this._timeframeClock = _timeframeClock;
@@ -1114,7 +1120,7 @@ var PipelineState = class {
1114
1120
  target: this.targetTimeframe
1115
1121
  }, {
1116
1122
  F: __dxlog_file8,
1117
- L: 134,
1123
+ L: 133,
1118
1124
  S: this,
1119
1125
  C: (f, a) => f(...a)
1120
1126
  });
@@ -1146,7 +1152,7 @@ var PipelineState = class {
1146
1152
  dependencies: import_timeframe2.Timeframe.dependencies(this.targetTimeframe, this.timeframe)
1147
1153
  }, {
1148
1154
  F: __dxlog_file8,
1149
- L: 162,
1155
+ L: 161,
1150
1156
  S: this,
1151
1157
  C: (f, a) => f(...a)
1152
1158
  });
@@ -1179,7 +1185,7 @@ var Pipeline = class {
1179
1185
  get writer() {
1180
1186
  (0, import_invariant7.invariant)(this._writer, "Writer not set.", {
1181
1187
  F: __dxlog_file8,
1182
- L: 243,
1188
+ L: 242,
1183
1189
  S: this,
1184
1190
  A: [
1185
1191
  "this._writer",
@@ -1208,7 +1214,7 @@ var Pipeline = class {
1208
1214
  setWriteFeed(feed) {
1209
1215
  (0, import_invariant7.invariant)(!this._writer, "Writer already set.", {
1210
1216
  F: __dxlog_file8,
1211
- L: 270,
1217
+ L: 269,
1212
1218
  S: this,
1213
1219
  A: [
1214
1220
  "!this._writer",
@@ -1217,7 +1223,7 @@ var Pipeline = class {
1217
1223
  });
1218
1224
  (0, import_invariant7.invariant)(feed.properties.writable, "Feed must be writable.", {
1219
1225
  F: __dxlog_file8,
1220
- L: 271,
1226
+ L: 270,
1221
1227
  S: this,
1222
1228
  A: [
1223
1229
  "feed.properties.writable",
@@ -1232,7 +1238,7 @@ var Pipeline = class {
1232
1238
  async start() {
1233
1239
  (0, import_invariant7.invariant)(!this._isStarted, "Pipeline is already started.", {
1234
1240
  F: __dxlog_file8,
1235
- L: 284,
1241
+ L: 283,
1236
1242
  S: this,
1237
1243
  A: [
1238
1244
  "!this._isStarted",
@@ -1241,7 +1247,7 @@ var Pipeline = class {
1241
1247
  });
1242
1248
  (0, import_log7.log)("starting...", void 0, {
1243
1249
  F: __dxlog_file8,
1244
- L: 285,
1250
+ L: 284,
1245
1251
  S: this,
1246
1252
  C: (f, a) => f(...a)
1247
1253
  });
@@ -1250,7 +1256,7 @@ var Pipeline = class {
1250
1256
  this._isStarted = true;
1251
1257
  (0, import_log7.log)("started", void 0, {
1252
1258
  F: __dxlog_file8,
1253
- L: 289,
1259
+ L: 288,
1254
1260
  S: this,
1255
1261
  C: (f, a) => f(...a)
1256
1262
  });
@@ -1263,7 +1269,7 @@ var Pipeline = class {
1263
1269
  async stop() {
1264
1270
  (0, import_log7.log)("stopping...", void 0, {
1265
1271
  F: __dxlog_file8,
1266
- L: 300,
1272
+ L: 299,
1267
1273
  S: this,
1268
1274
  C: (f, a) => f(...a)
1269
1275
  });
@@ -1281,7 +1287,7 @@ var Pipeline = class {
1281
1287
  this._isStarted = false;
1282
1288
  (0, import_log7.log)("stopped", void 0, {
1283
1289
  F: __dxlog_file8,
1284
- L: 313,
1290
+ L: 312,
1285
1291
  S: this,
1286
1292
  C: (f, a) => f(...a)
1287
1293
  });
@@ -1293,7 +1299,7 @@ var Pipeline = class {
1293
1299
  async setCursor(timeframe) {
1294
1300
  (0, import_invariant7.invariant)(!this._isStarted || this._isPaused, "Invalid state.", {
1295
1301
  F: __dxlog_file8,
1296
- L: 322,
1302
+ L: 321,
1297
1303
  S: this,
1298
1304
  A: [
1299
1305
  "!this._isStarted || this._isPaused",
@@ -1322,7 +1328,7 @@ var Pipeline = class {
1322
1328
  async unpause() {
1323
1329
  (0, import_invariant7.invariant)(this._isPaused, "Pipeline is not paused.", {
1324
1330
  F: __dxlog_file8,
1325
- L: 351,
1331
+ L: 350,
1326
1332
  S: this,
1327
1333
  A: [
1328
1334
  "this._isPaused",
@@ -1342,7 +1348,7 @@ var Pipeline = class {
1342
1348
  async *consume() {
1343
1349
  (0, import_invariant7.invariant)(!this._isBeingConsumed, "Pipeline is already being consumed.", {
1344
1350
  F: __dxlog_file8,
1345
- L: 366,
1351
+ L: 365,
1346
1352
  S: this,
1347
1353
  A: [
1348
1354
  "!this._isBeingConsumed",
@@ -1352,7 +1358,7 @@ var Pipeline = class {
1352
1358
  this._isBeingConsumed = true;
1353
1359
  (0, import_invariant7.invariant)(this._feedSetIterator, "Iterator not initialized.", {
1354
1360
  F: __dxlog_file8,
1355
- L: 369,
1361
+ L: 368,
1356
1362
  S: this,
1357
1363
  A: [
1358
1364
  "this._feedSetIterator",
@@ -1366,7 +1372,7 @@ var Pipeline = class {
1366
1372
  if (lastFeedSetIterator !== this._feedSetIterator) {
1367
1373
  (0, import_invariant7.invariant)(this._feedSetIterator, "Iterator not initialized.", {
1368
1374
  F: __dxlog_file8,
1369
- L: 378,
1375
+ L: 377,
1370
1376
  S: this,
1371
1377
  A: [
1372
1378
  "this._feedSetIterator",
@@ -1401,7 +1407,7 @@ var Pipeline = class {
1401
1407
  length: feed.length
1402
1408
  }, {
1403
1409
  F: __dxlog_file8,
1404
- L: 407,
1410
+ L: 406,
1405
1411
  S: this,
1406
1412
  C: (f, a) => f(...a)
1407
1413
  });
@@ -1415,7 +1421,7 @@ var Pipeline = class {
1415
1421
  data
1416
1422
  }, {
1417
1423
  F: __dxlog_file8,
1418
- L: 412,
1424
+ L: 411,
1419
1425
  S: this,
1420
1426
  C: (f, a) => f(...a)
1421
1427
  });
@@ -1431,7 +1437,7 @@ var Pipeline = class {
1431
1437
  this._feedSetIterator.stalled.on((iterator) => {
1432
1438
  import_log7.log.warn(`Stalled after ${iterator.options.stallTimeout}ms with ${iterator.size} feeds.`, void 0, {
1433
1439
  F: __dxlog_file8,
1434
- L: 426,
1440
+ L: 425,
1435
1441
  S: this,
1436
1442
  C: (f, a) => f(...a)
1437
1443
  });
@@ -1711,9 +1717,9 @@ var import_async7 = require("@dxos/async");
1711
1717
  var import_context6 = require("@dxos/context");
1712
1718
  var import_credentials3 = require("@dxos/credentials");
1713
1719
  var import_echo_db3 = require("@dxos/echo-db");
1714
- var import_errors2 = require("@dxos/errors");
1715
1720
  var import_invariant8 = require("@dxos/invariant");
1716
1721
  var import_log9 = require("@dxos/log");
1722
+ var import_protocols6 = require("@dxos/protocols");
1717
1723
  var import_timeframe4 = require("@dxos/timeframe");
1718
1724
  var import_tracing2 = require("@dxos/tracing");
1719
1725
  var import_util6 = require("@dxos/util");
@@ -1785,7 +1791,7 @@ var DataPipeline = class DataPipeline2 {
1785
1791
  write: (data, options) => {
1786
1792
  (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1787
1793
  F: __dxlog_file10,
1788
- L: 154,
1794
+ L: 153,
1789
1795
  S: this,
1790
1796
  A: [
1791
1797
  "this._pipeline",
@@ -1794,7 +1800,7 @@ var DataPipeline = class DataPipeline2 {
1794
1800
  });
1795
1801
  (0, import_invariant8.invariant)(this.currentEpoch, "Epoch is not initialized.", {
1796
1802
  F: __dxlog_file10,
1797
- L: 155,
1803
+ L: 154,
1798
1804
  S: this,
1799
1805
  A: [
1800
1806
  "this.currentEpoch",
@@ -1820,7 +1826,7 @@ var DataPipeline = class DataPipeline2 {
1820
1826
  }
1821
1827
  (0, import_log9.log)("close", void 0, {
1822
1828
  F: __dxlog_file10,
1823
- L: 179,
1829
+ L: 178,
1824
1830
  S: this,
1825
1831
  C: (f, a) => f(...a)
1826
1832
  });
@@ -1835,7 +1841,7 @@ var DataPipeline = class DataPipeline2 {
1835
1841
  } catch (err) {
1836
1842
  import_log9.log.catch(err, void 0, {
1837
1843
  F: __dxlog_file10,
1838
- L: 192,
1844
+ L: 191,
1839
1845
  S: this,
1840
1846
  C: (f, a) => f(...a)
1841
1847
  });
@@ -1860,7 +1866,7 @@ var DataPipeline = class DataPipeline2 {
1860
1866
  let messageCounter = 0;
1861
1867
  (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
1862
1868
  F: __dxlog_file10,
1863
- L: 217,
1869
+ L: 216,
1864
1870
  S: this,
1865
1871
  A: [
1866
1872
  "this._pipeline",
@@ -1876,7 +1882,7 @@ var DataPipeline = class DataPipeline2 {
1876
1882
  seq
1877
1883
  }, {
1878
1884
  F: __dxlog_file10,
1879
- L: 223,
1885
+ L: 222,
1880
1886
  S: this,
1881
1887
  C: (f, a) => f(...a)
1882
1888
  });
@@ -1888,7 +1894,7 @@ var DataPipeline = class DataPipeline2 {
1888
1894
  feedKey
1889
1895
  }, {
1890
1896
  F: __dxlog_file10,
1891
- L: 229,
1897
+ L: 228,
1892
1898
  S: this,
1893
1899
  C: (f, a) => f(...a)
1894
1900
  });
@@ -1911,7 +1917,7 @@ var DataPipeline = class DataPipeline2 {
1911
1917
  spaceKey: this._params.spaceKey.toHex()
1912
1918
  }, {
1913
1919
  F: __dxlog_file10,
1914
- L: 246,
1920
+ L: 245,
1915
1921
  S: this,
1916
1922
  C: (f, a) => f(...a)
1917
1923
  });
@@ -1920,7 +1926,7 @@ var DataPipeline = class DataPipeline2 {
1920
1926
  } catch (err) {
1921
1927
  import_log9.log.catch(err, void 0, {
1922
1928
  F: __dxlog_file10,
1923
- L: 256,
1929
+ L: 255,
1924
1930
  S: this,
1925
1931
  C: (f, a) => f(...a)
1926
1932
  });
@@ -1935,7 +1941,7 @@ var DataPipeline = class DataPipeline2 {
1935
1941
  _createSnapshot() {
1936
1942
  (0, import_invariant8.invariant)(this.databaseHost, "Database backend is not initialized.", {
1937
1943
  F: __dxlog_file10,
1938
- L: 270,
1944
+ L: 269,
1939
1945
  S: this,
1940
1946
  A: [
1941
1947
  "this.databaseHost",
@@ -1964,7 +1970,7 @@ var DataPipeline = class DataPipeline2 {
1964
1970
  } catch (err) {
1965
1971
  import_log9.log.warn("Failed to cache properties", err, {
1966
1972
  F: __dxlog_file10,
1967
- L: 299,
1973
+ L: 298,
1968
1974
  S: this,
1969
1975
  C: (f, a) => f(...a)
1970
1976
  });
@@ -1990,17 +1996,17 @@ var DataPipeline = class DataPipeline2 {
1990
1996
  await this._epochCtx?.dispose();
1991
1997
  const ctx = new import_context6.Context({
1992
1998
  onError: (err) => {
1993
- if (err instanceof import_errors2.CancelledError) {
1999
+ if (err instanceof import_protocols6.CancelledError) {
1994
2000
  (0, import_log9.log)("Epoch processing cancelled.", void 0, {
1995
2001
  F: __dxlog_file10,
1996
- L: 335,
2002
+ L: 334,
1997
2003
  S: this,
1998
2004
  C: (f, a) => f(...a)
1999
2005
  });
2000
2006
  } else {
2001
2007
  import_log9.log.catch(err, void 0, {
2002
2008
  F: __dxlog_file10,
2003
- L: 337,
2009
+ L: 336,
2004
2010
  S: this,
2005
2011
  C: (f, a) => f(...a)
2006
2012
  });
@@ -2020,7 +2026,7 @@ var DataPipeline = class DataPipeline2 {
2020
2026
  async _processEpoch(ctx, epoch) {
2021
2027
  (0, import_invariant8.invariant)(this._isOpen, "Space is closed.", {
2022
2028
  F: __dxlog_file10,
2023
- L: 356,
2029
+ L: 355,
2024
2030
  S: this,
2025
2031
  A: [
2026
2032
  "this._isOpen",
@@ -2029,7 +2035,7 @@ var DataPipeline = class DataPipeline2 {
2029
2035
  });
2030
2036
  (0, import_invariant8.invariant)(this._pipeline, void 0, {
2031
2037
  F: __dxlog_file10,
2032
- L: 357,
2038
+ L: 356,
2033
2039
  S: this,
2034
2040
  A: [
2035
2041
  "this._pipeline",
@@ -2041,7 +2047,7 @@ var DataPipeline = class DataPipeline2 {
2041
2047
  epoch: (0, import_log9.omit)(epoch, "proof")
2042
2048
  }, {
2043
2049
  F: __dxlog_file10,
2044
- L: 360,
2050
+ L: 359,
2045
2051
  S: this,
2046
2052
  C: (f, a) => f(...a)
2047
2053
  });
@@ -2051,7 +2057,7 @@ var DataPipeline = class DataPipeline2 {
2051
2057
  }
2052
2058
  (0, import_log9.log)("restarting pipeline from epoch", void 0, {
2053
2059
  F: __dxlog_file10,
2054
- L: 366,
2060
+ L: 365,
2055
2061
  S: this,
2056
2062
  C: (f, a) => f(...a)
2057
2063
  });
@@ -2062,7 +2068,7 @@ var DataPipeline = class DataPipeline2 {
2062
2068
  async waitUntilTimeframe(timeframe) {
2063
2069
  (0, import_invariant8.invariant)(this._pipeline, "Pipeline is not initialized.", {
2064
2070
  F: __dxlog_file10,
2065
- L: 373,
2071
+ L: 372,
2066
2072
  S: this,
2067
2073
  A: [
2068
2074
  "this._pipeline",
@@ -2074,7 +2080,7 @@ var DataPipeline = class DataPipeline2 {
2074
2080
  async createEpoch() {
2075
2081
  (0, import_invariant8.invariant)(this._pipeline, void 0, {
2076
2082
  F: __dxlog_file10,
2077
- L: 379,
2083
+ L: 378,
2078
2084
  S: this,
2079
2085
  A: [
2080
2086
  "this._pipeline",
@@ -2083,7 +2089,7 @@ var DataPipeline = class DataPipeline2 {
2083
2089
  });
2084
2090
  (0, import_invariant8.invariant)(this.currentEpoch, void 0, {
2085
2091
  F: __dxlog_file10,
2086
- L: 380,
2092
+ L: 379,
2087
2093
  S: this,
2088
2094
  A: [
2089
2095
  "this.currentEpoch",
@@ -2114,7 +2120,7 @@ var DataPipeline = class DataPipeline2 {
2114
2120
  } catch (err) {
2115
2121
  import_log9.log.catch(err, void 0, {
2116
2122
  F: __dxlog_file10,
2117
- L: 410,
2123
+ L: 409,
2118
2124
  S: this,
2119
2125
  C: (f, a) => f(...a)
2120
2126
  });
@@ -2399,7 +2405,7 @@ var import_async9 = require("@dxos/async");
2399
2405
  var import_debug4 = require("@dxos/debug");
2400
2406
  var import_keys7 = require("@dxos/keys");
2401
2407
  var import_log12 = require("@dxos/log");
2402
- var import_protocols6 = require("@dxos/protocols");
2408
+ var import_protocols7 = require("@dxos/protocols");
2403
2409
  var import_util9 = require("@dxos/util");
2404
2410
 
2405
2411
  // packages/core/echo/echo-pipeline/src/space/space-protocol.ts
@@ -2643,7 +2649,7 @@ var SpaceManager = class SpaceManager2 {
2643
2649
  ].map((space) => space.close()));
2644
2650
  }
2645
2651
  async constructSpace({ metadata, swarmIdentity, onNetworkConnection, onAuthFailure, memberKey }) {
2646
- import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols6.trace.begin({
2652
+ import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols7.trace.begin({
2647
2653
  id: this._instanceId
2648
2654
  }), {
2649
2655
  F: __dxlog_file13,
@@ -2681,7 +2687,7 @@ var SpaceManager = class SpaceManager2 {
2681
2687
  memberKey
2682
2688
  });
2683
2689
  this._spaces.set(space.key, space);
2684
- import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols6.trace.end({
2690
+ import_log12.log.trace("dxos.echo.space-manager.construct-space", import_protocols7.trace.end({
2685
2691
  id: this._instanceId
2686
2692
  }), {
2687
2693
  F: __dxlog_file13,
@@ -2702,16 +2708,6 @@ SpaceManager = _ts_decorate9([
2702
2708
  (0, import_async9.trackLeaks)("open", "close")
2703
2709
  ], SpaceManager);
2704
2710
 
2705
- // packages/core/echo/echo-pipeline/src/testing/test-feed-builder.ts
2706
- var import_testing = require("@dxos/feed-store/testing");
2707
- var TestFeedBuilder = class extends import_testing.TestBuilder {
2708
- constructor() {
2709
- super({
2710
- valueEncoding
2711
- });
2712
- }
2713
- };
2714
-
2715
2711
  // packages/core/echo/echo-pipeline/src/testing/test-agent-builder.ts
2716
2712
  var MemoryNetworkManagerProvider = (signalContext) => () => new import_network_manager2.NetworkManager({
2717
2713
  signalManager: new import_messaging.MemorySignalManager(signalContext),