@dxos/echo-pipeline 0.3.2 → 0.3.3-main.10234ef

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.
@@ -65,7 +65,7 @@ var valueEncoding = (0, import_hypercore.createCodecEncoding)(codec);
65
65
 
66
66
  // packages/core/echo/echo-pipeline/src/common/feeds.ts
67
67
  var import_invariant = require("@dxos/invariant");
68
- var __dxlog_file = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/common/feeds.ts";
68
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/common/feeds.ts";
69
69
  var createMappedFeedWriter = (mapper, writer) => {
70
70
  (0, import_invariant.invariant)(mapper, void 0, {
71
71
  F: __dxlog_file,
@@ -91,6 +91,7 @@ var createMappedFeedWriter = (mapper, writer) => {
91
91
  };
92
92
 
93
93
  // packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts
94
+ var import_async = require("@dxos/async");
94
95
  var import_codec_protobuf = require("@dxos/codec-protobuf");
95
96
  var import_context = require("@dxos/context");
96
97
  var import_echo_db = require("@dxos/echo-db");
@@ -98,13 +99,15 @@ var import_invariant2 = require("@dxos/invariant");
98
99
  var import_log = require("@dxos/log");
99
100
  var import_service = require("@dxos/protocols/proto/dxos/echo/service");
100
101
  var import_util = require("@dxos/util");
101
- var __dxlog_file2 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
102
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
103
+ var MUTATION_LIMIT_PER_OBJECT = 10;
102
104
  var DataServiceHost = class {
103
- constructor(_itemManager, _itemDemuxer, _flush, _writeStream) {
105
+ constructor(_itemManager, _itemDemuxer, _flush, _writeStream, _opts = {}) {
104
106
  this._itemManager = _itemManager;
105
107
  this._itemDemuxer = _itemDemuxer;
106
108
  this._flush = _flush;
107
109
  this._writeStream = _writeStream;
110
+ this._opts = _opts;
108
111
  this._ctx = new import_context.Context();
109
112
  this._clientTagMap = new import_util.ComplexMap(([feedKey, seq]) => `${feedKey.toHex()}:${seq}`);
110
113
  }
@@ -113,6 +116,9 @@ var DataServiceHost = class {
113
116
  async close() {
114
117
  await this._ctx.dispose();
115
118
  }
119
+ get _deferEvents() {
120
+ return this._opts.deferEvents ?? true;
121
+ }
116
122
  /**
117
123
  * Real-time subscription to data objects in a space.
118
124
  */
@@ -125,7 +131,43 @@ var DataServiceHost = class {
125
131
  objects
126
132
  }
127
133
  });
134
+ const updateScheduler = new import_async.UpdateScheduler(ctx, async () => {
135
+ flushPendingUpdate();
136
+ }, {
137
+ maxFrequency: 10
138
+ });
139
+ const pendingUpdates = [];
140
+ const mutationsPerObject = /* @__PURE__ */ new Map();
141
+ const clearPendingUpdates = () => {
142
+ pendingUpdates.length = 0;
143
+ mutationsPerObject.clear();
144
+ };
145
+ const flushPendingUpdate = () => {
146
+ const stagedEvents = [];
147
+ const objectsWithSnapshots = /* @__PURE__ */ new Set();
148
+ for (const [id, count] of mutationsPerObject) {
149
+ if (count >= MUTATION_LIMIT_PER_OBJECT) {
150
+ objectsWithSnapshots.add(id);
151
+ const entity = this._itemManager.entities.get(id);
152
+ if (entity) {
153
+ stagedEvents.push(entity.createSnapshot());
154
+ }
155
+ }
156
+ }
157
+ for (const obj of pendingUpdates) {
158
+ if (!objectsWithSnapshots.has(obj.objectId)) {
159
+ stagedEvents.push(obj);
160
+ }
161
+ }
162
+ next({
163
+ batch: {
164
+ objects: stagedEvents
165
+ }
166
+ });
167
+ clearPendingUpdates();
168
+ };
128
169
  this._itemDemuxer.snapshot.on(ctx, (snapshot) => {
170
+ clearPendingUpdates();
129
171
  next({
130
172
  action: import_service.EchoEvent.DatabaseAction.RESET,
131
173
  batch: {
@@ -137,7 +179,7 @@ var DataServiceHost = class {
137
179
  const { batch, meta } = message;
138
180
  (0, import_invariant2.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
139
181
  F: __dxlog_file2,
140
- L: 69,
182
+ L: 131,
141
183
  S: this,
142
184
  A: [
143
185
  "!(meta as any).clientTag",
@@ -149,7 +191,7 @@ var DataServiceHost = class {
149
191
  meta
150
192
  }, {
151
193
  F: __dxlog_file2,
152
- L: 70,
194
+ L: 132,
153
195
  S: this,
154
196
  C: (f, a) => f(...a)
155
197
  });
@@ -163,21 +205,37 @@ var DataServiceHost = class {
163
205
  });
164
206
  });
165
207
  if (clientTag) {
208
+ flushPendingUpdate();
166
209
  (0, import_echo_db.tagMutationsInBatch)(batch, clientTag, 0);
210
+ next({
211
+ clientTag,
212
+ feedKey: message.meta.feedKey,
213
+ seq: message.meta.seq,
214
+ batch
215
+ });
216
+ } else {
217
+ for (const obj of batch.objects ?? []) {
218
+ const newCount = (mutationsPerObject.get(obj.objectId) ?? 0) + 1;
219
+ mutationsPerObject.set(obj.objectId, newCount);
220
+ }
221
+ for (const obj of batch.objects ?? []) {
222
+ if ((mutationsPerObject.get(obj.objectId) ?? 0) < MUTATION_LIMIT_PER_OBJECT) {
223
+ pendingUpdates.push(obj);
224
+ }
225
+ }
226
+ if (this._deferEvents) {
227
+ updateScheduler.trigger();
228
+ } else {
229
+ flushPendingUpdate();
230
+ }
167
231
  }
168
- next({
169
- clientTag,
170
- feedKey: message.meta.feedKey,
171
- seq: message.meta.seq,
172
- batch
173
- });
174
232
  });
175
233
  });
176
234
  }
177
235
  async write(request) {
178
236
  (0, import_invariant2.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
179
237
  F: __dxlog_file2,
180
- L: 96,
238
+ L: 177,
181
239
  S: this,
182
240
  A: [
183
241
  "!this._ctx.disposed",
@@ -186,7 +244,7 @@ var DataServiceHost = class {
186
244
  });
187
245
  (0, import_invariant2.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
188
246
  F: __dxlog_file2,
189
- L: 97,
247
+ L: 178,
190
248
  S: this,
191
249
  A: [
192
250
  "this._writeStream",
@@ -198,7 +256,7 @@ var DataServiceHost = class {
198
256
  objectCount: request.batch.objects?.length ?? 0
199
257
  }, {
200
258
  F: __dxlog_file2,
201
- L: 99,
259
+ L: 180,
202
260
  S: this,
203
261
  C: (f, a) => f(...a)
204
262
  });
@@ -212,7 +270,7 @@ var DataServiceHost = class {
212
270
  seq: receipt2.seq
213
271
  }, {
214
272
  F: __dxlog_file2,
215
- L: 108,
273
+ L: 189,
216
274
  S: this,
217
275
  C: (f, a) => f(...a)
218
276
  });
@@ -269,8 +327,8 @@ var DatabaseHost = class {
269
327
  createSnapshot() {
270
328
  return this._itemDemuxer.createSnapshot();
271
329
  }
272
- createDataServiceHost() {
273
- return new DataServiceHost(this._itemManager, this._itemDemuxer, this._flush, this._outboundStream ?? void 0);
330
+ createDataServiceHost(opts = {}) {
331
+ return new DataServiceHost(this._itemManager, this._itemDemuxer, this._flush, this._outboundStream ?? void 0, opts);
274
332
  }
275
333
  };
276
334
 
@@ -361,7 +419,7 @@ var import_invariant3 = require("@dxos/invariant");
361
419
  var import_keys2 = require("@dxos/keys");
362
420
  var import_log2 = require("@dxos/log");
363
421
  var import_util2 = require("@dxos/util");
364
- var __dxlog_file3 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
422
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service.ts";
365
423
  var DataServiceSubscriptions = class {
366
424
  constructor() {
367
425
  this._spaces = new import_util2.ComplexMap(import_keys2.PublicKey.hash);
@@ -463,7 +521,7 @@ var DataServiceImpl = class {
463
521
 
464
522
  // packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
465
523
  var import_crc_32 = __toESM(require("crc-32"));
466
- var import_async = require("@dxos/async");
524
+ var import_async2 = require("@dxos/async");
467
525
  var import_invariant4 = require("@dxos/invariant");
468
526
  var import_keys3 = require("@dxos/keys");
469
527
  var import_log3 = require("@dxos/log");
@@ -480,7 +538,7 @@ function _ts_decorate(decorators, target, key, desc) {
480
538
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
481
539
  return c > 3 && r && Object.defineProperty(target, key, r), r;
482
540
  }
483
- var __dxlog_file4 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
541
+ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
484
542
  var emptyEchoMetadata = () => ({
485
543
  version: import_protocols4.STORAGE_VERSION,
486
544
  spaces: [],
@@ -496,7 +554,7 @@ var MetadataStore = class {
496
554
  this._metadata = emptyEchoMetadata();
497
555
  this._spaceLargeMetadata = new import_util3.ComplexMap(import_keys3.PublicKey.hash);
498
556
  this._metadataFile = void 0;
499
- this.update = new import_async.Event();
557
+ this.update = new import_async2.Event();
500
558
  }
501
559
  get metadata() {
502
560
  return this._metadata;
@@ -755,18 +813,18 @@ var MetadataStore = class {
755
813
  }
756
814
  };
757
815
  _ts_decorate([
758
- import_async.synchronized
816
+ import_async2.synchronized
759
817
  ], MetadataStore.prototype, "load", null);
760
818
  _ts_decorate([
761
- import_async.synchronized
819
+ import_async2.synchronized
762
820
  ], MetadataStore.prototype, "_save", null);
763
821
  _ts_decorate([
764
- import_async.synchronized
822
+ import_async2.synchronized
765
823
  ], MetadataStore.prototype, "_saveSpaceLargeMetadata", null);
766
824
  var fromBytesInt32 = (buf) => buf.readInt32LE(0);
767
825
 
768
826
  // packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
769
- var import_async3 = require("@dxos/async");
827
+ var import_async4 = require("@dxos/async");
770
828
  var import_context3 = require("@dxos/context");
771
829
  var import_debug3 = require("@dxos/debug");
772
830
  var import_feed_store = require("@dxos/feed-store");
@@ -779,7 +837,7 @@ var import_util4 = require("@dxos/util");
779
837
  // packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts
780
838
  var import_invariant5 = require("@dxos/invariant");
781
839
  var import_log4 = require("@dxos/log");
782
- var __dxlog_file5 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts";
840
+ var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/message-selector.ts";
783
841
  var createMessageSelector = (timeframeClock) => {
784
842
  return (messages) => {
785
843
  for (let i = 0; i < messages.length; i++) {
@@ -807,7 +865,7 @@ var createMessageSelector = (timeframeClock) => {
807
865
  };
808
866
 
809
867
  // packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts
810
- var import_async2 = require("@dxos/async");
868
+ var import_async3 = require("@dxos/async");
811
869
  var import_debug2 = require("@dxos/debug");
812
870
  var import_log5 = require("@dxos/log");
813
871
  var import_timeframe = require("@dxos/timeframe");
@@ -821,7 +879,7 @@ function _ts_decorate2(decorators, target, key, desc) {
821
879
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
822
880
  return c > 3 && r && Object.defineProperty(target, key, r), r;
823
881
  }
824
- var __dxlog_file6 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts";
882
+ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts";
825
883
  var mapTimeframeToFeedIndexes = (timeframe) => timeframe.frames().map(([feedKey, index]) => ({
826
884
  feedKey,
827
885
  index
@@ -837,7 +895,7 @@ var startAfter = (timeframe) => timeframe.frames().map(([feedKey, index]) => ({
837
895
  var TimeframeClock = class {
838
896
  constructor(_timeframe = new import_timeframe.Timeframe()) {
839
897
  this._timeframe = _timeframe;
840
- this.update = new import_async2.Event();
898
+ this.update = new import_async3.Event();
841
899
  this._pendingTimeframe = _timeframe;
842
900
  }
843
901
  /**
@@ -914,14 +972,14 @@ function _ts_decorate3(decorators, target, key, desc) {
914
972
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
915
973
  return c > 3 && r && Object.defineProperty(target, key, r), r;
916
974
  }
917
- var __dxlog_file7 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
975
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts";
918
976
  var PipelineState = class {
919
977
  constructor(_feeds, _timeframeClock) {
920
978
  this._feeds = _feeds;
921
979
  this._timeframeClock = _timeframeClock;
922
980
  this._ctx = new import_context3.Context();
923
981
  this.timeframeUpdate = this._timeframeClock.update;
924
- this.stalled = new import_async3.Event();
982
+ this.stalled = new import_async4.Event();
925
983
  this._startTimeframe = new import_timeframe2.Timeframe();
926
984
  this._reachedTarget = false;
927
985
  }
@@ -995,7 +1053,7 @@ var PipelineState = class {
995
1053
  done = true;
996
1054
  this._reachedTarget = true;
997
1055
  }),
998
- (0, import_async3.sleepWithContext)(this._ctx, timeout).then(() => {
1056
+ (0, import_async4.sleepWithContext)(this._ctx, timeout).then(() => {
999
1057
  if (done) {
1000
1058
  return;
1001
1059
  }
@@ -1024,8 +1082,8 @@ var Pipeline = class {
1024
1082
  // External state accessor.
1025
1083
  this._state = new PipelineState(this._feeds, this._timeframeClock);
1026
1084
  // Waits for the message consumer to process the message and yield control back to the pipeline.
1027
- this._processingTrigger = new import_async3.Trigger().wake();
1028
- this._pauseTrigger = new import_async3.Trigger().wake();
1085
+ this._processingTrigger = new import_async4.Trigger().wake();
1086
+ this._pauseTrigger = new import_async4.Trigger().wake();
1029
1087
  // Pending downloads.
1030
1088
  this._downloads = new import_util4.ComplexMap((value) => import_keys4.PublicKey.hash(value.key));
1031
1089
  this._isStopping = false;
@@ -1303,30 +1361,30 @@ var Pipeline = class {
1303
1361
  }
1304
1362
  };
1305
1363
  _ts_decorate3([
1306
- import_async3.synchronized
1364
+ import_async4.synchronized
1307
1365
  ], Pipeline.prototype, "start", null);
1308
1366
  _ts_decorate3([
1309
- import_async3.synchronized
1367
+ import_async4.synchronized
1310
1368
  ], Pipeline.prototype, "stop", null);
1311
1369
  _ts_decorate3([
1312
- import_async3.synchronized
1370
+ import_async4.synchronized
1313
1371
  ], Pipeline.prototype, "setCursor", null);
1314
1372
  _ts_decorate3([
1315
- import_async3.synchronized
1373
+ import_async4.synchronized
1316
1374
  ], Pipeline.prototype, "pause", null);
1317
1375
  _ts_decorate3([
1318
- import_async3.synchronized
1376
+ import_async4.synchronized
1319
1377
  ], Pipeline.prototype, "unpause", null);
1320
1378
 
1321
1379
  // packages/core/echo/echo-pipeline/src/space/auth.ts
1322
- var import_async4 = require("@dxos/async");
1380
+ var import_async5 = require("@dxos/async");
1323
1381
  var import_context4 = require("@dxos/context");
1324
1382
  var import_crypto2 = require("@dxos/crypto");
1325
1383
  var import_invariant7 = require("@dxos/invariant");
1326
1384
  var import_log7 = require("@dxos/log");
1327
1385
  var import_protocols5 = require("@dxos/protocols");
1328
1386
  var import_teleport = require("@dxos/teleport");
1329
- var __dxlog_file8 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/auth.ts";
1387
+ var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/auth.ts";
1330
1388
  var AuthExtension = class extends import_teleport.RpcExtension {
1331
1389
  constructor(_authParams) {
1332
1390
  super({
@@ -1377,7 +1435,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1377
1435
  }
1378
1436
  async onOpen(context) {
1379
1437
  await super.onOpen(context);
1380
- (0, import_async4.scheduleTask)(this._ctx, async () => {
1438
+ (0, import_async5.scheduleTask)(this._ctx, async () => {
1381
1439
  try {
1382
1440
  const challenge = (0, import_crypto2.randomBytes)(32);
1383
1441
  const { credential } = await this.rpc.AuthService.authenticate({
@@ -1402,7 +1460,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1402
1460
  "'credential not verified'"
1403
1461
  ]
1404
1462
  });
1405
- (0, import_async4.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
1463
+ (0, import_async5.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
1406
1464
  } catch (err) {
1407
1465
  (0, import_log7.log)("auth failed", err, {
1408
1466
  F: __dxlog_file8,
@@ -1426,7 +1484,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
1426
1484
  };
1427
1485
 
1428
1486
  // packages/core/echo/echo-pipeline/src/space/space.ts
1429
- var import_async7 = require("@dxos/async");
1487
+ var import_async8 = require("@dxos/async");
1430
1488
  var import_invariant9 = require("@dxos/invariant");
1431
1489
  var import_log10 = require("@dxos/log");
1432
1490
  var import_credentials4 = require("@dxos/protocols/proto/dxos/halo/credentials");
@@ -1434,7 +1492,7 @@ var import_tracing3 = require("@dxos/tracing");
1434
1492
  var import_util7 = require("@dxos/util");
1435
1493
 
1436
1494
  // packages/core/echo/echo-pipeline/src/space/control-pipeline.ts
1437
- var import_async5 = require("@dxos/async");
1495
+ var import_async6 = require("@dxos/async");
1438
1496
  var import_context5 = require("@dxos/context");
1439
1497
  var import_credentials = require("@dxos/credentials");
1440
1498
  var import_keys5 = require("@dxos/keys");
@@ -1453,7 +1511,7 @@ function _ts_decorate4(decorators, target, key, desc) {
1453
1511
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1454
1512
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1455
1513
  }
1456
- var __dxlog_file9 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/control-pipeline.ts";
1514
+ var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/control-pipeline.ts";
1457
1515
  var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL = 500;
1458
1516
  var CONTROL_PIPELINE_SNAPSHOT_DELAY = 1e4;
1459
1517
  var USE_SNAPSHOTS = true;
@@ -1464,8 +1522,8 @@ var ControlPipeline = class ControlPipeline2 {
1464
1522
  this.onFeedAdmitted = new import_util5.Callback();
1465
1523
  this._usage = new import_tracing.TimeUsageCounter();
1466
1524
  this._mutations = new import_tracing.TimeSeriesCounter();
1467
- this._snapshotTask = new import_async5.DeferredTask(this._ctx, async () => {
1468
- await (0, import_async5.sleepWithContext)(this._ctx, CONTROL_PIPELINE_SNAPSHOT_DELAY);
1525
+ this._snapshotTask = new import_async6.DeferredTask(this._ctx, async () => {
1526
+ await (0, import_async6.sleepWithContext)(this._ctx, CONTROL_PIPELINE_SNAPSHOT_DELAY);
1469
1527
  await this._saveSnapshot();
1470
1528
  });
1471
1529
  this._spaceKey = spaceKey;
@@ -1688,11 +1746,11 @@ _ts_decorate4([
1688
1746
  ], ControlPipeline.prototype, "_processMessage", null);
1689
1747
  ControlPipeline = _ts_decorate4([
1690
1748
  import_tracing.trace.resource(),
1691
- (0, import_async5.trackLeaks)("start", "stop")
1749
+ (0, import_async6.trackLeaks)("start", "stop")
1692
1750
  ], ControlPipeline);
1693
1751
 
1694
1752
  // packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
1695
- var import_async6 = require("@dxos/async");
1753
+ var import_async7 = require("@dxos/async");
1696
1754
  var import_context6 = require("@dxos/context");
1697
1755
  var import_credentials3 = require("@dxos/credentials");
1698
1756
  var import_echo_db3 = require("@dxos/echo-db");
@@ -1712,7 +1770,7 @@ function _ts_decorate5(decorators, target, key, desc) {
1712
1770
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1713
1771
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1714
1772
  }
1715
- var __dxlog_file10 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/data-pipeline.ts";
1773
+ var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/data-pipeline.ts";
1716
1774
  var MESSAGES_PER_SNAPSHOT = 10;
1717
1775
  var AUTOMATIC_SNAPSHOT_DEBOUNCE_INTERVAL = 5e3;
1718
1776
  var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL2 = 5e3;
@@ -1731,7 +1789,7 @@ var DataPipeline = class DataPipeline2 {
1731
1789
  this._mutations = new import_tracing2.TimeSeriesCounter();
1732
1790
  this.currentEpoch = void 0;
1733
1791
  this.appliedEpoch = void 0;
1734
- this.onNewEpoch = new import_async6.Event();
1792
+ this.onNewEpoch = new import_async7.Event();
1735
1793
  }
1736
1794
  get isOpen() {
1737
1795
  return this._isOpen;
@@ -1794,7 +1852,7 @@ var DataPipeline = class DataPipeline2 {
1794
1852
  this.databaseHost = new DatabaseHost(feedWriter, () => this._flush());
1795
1853
  this.itemManager = new import_echo_db3.ItemManager(this._params.modelFactory);
1796
1854
  await this.databaseHost.open(this.itemManager, this._params.modelFactory);
1797
- (0, import_async6.scheduleTask)(this._ctx, async () => {
1855
+ (0, import_async7.scheduleTask)(this._ctx, async () => {
1798
1856
  await this._consumePipeline();
1799
1857
  });
1800
1858
  this._isOpen = true;
@@ -1913,7 +1971,7 @@ var DataPipeline = class DataPipeline2 {
1913
1971
  span.end();
1914
1972
  if (++messageCounter > 1e3) {
1915
1973
  messageCounter = 0;
1916
- await (0, import_async6.sleep)(1);
1974
+ await (0, import_async7.sleep)(1);
1917
1975
  }
1918
1976
  }
1919
1977
  }
@@ -1993,7 +2051,7 @@ var DataPipeline = class DataPipeline2 {
1993
2051
  }
1994
2052
  });
1995
2053
  this._epochCtx = ctx;
1996
- (0, import_async6.scheduleTask)(ctx, async () => {
2054
+ (0, import_async7.scheduleTask)(ctx, async () => {
1997
2055
  if (!this._isOpen) {
1998
2056
  return;
1999
2057
  }
@@ -2114,19 +2172,19 @@ _ts_decorate5([
2114
2172
  import_tracing2.trace.metricsCounter()
2115
2173
  ], DataPipeline.prototype, "_mutations", void 0);
2116
2174
  _ts_decorate5([
2117
- import_async6.synchronized
2175
+ import_async7.synchronized
2118
2176
  ], DataPipeline.prototype, "open", null);
2119
2177
  _ts_decorate5([
2120
- import_async6.synchronized
2178
+ import_async7.synchronized
2121
2179
  ], DataPipeline.prototype, "close", null);
2122
2180
  _ts_decorate5([
2123
- import_async6.synchronized
2181
+ import_async7.synchronized
2124
2182
  ], DataPipeline.prototype, "_processEpoch", null);
2125
2183
  _ts_decorate5([
2126
- import_async6.synchronized
2184
+ import_async7.synchronized
2127
2185
  ], DataPipeline.prototype, "createEpoch", null);
2128
2186
  DataPipeline = _ts_decorate5([
2129
- (0, import_async6.trackLeaks)("open", "close"),
2187
+ (0, import_async7.trackLeaks)("open", "close"),
2130
2188
  import_tracing2.trace.resource()
2131
2189
  ], DataPipeline);
2132
2190
 
@@ -2141,12 +2199,12 @@ function _ts_decorate6(decorators, target, key, desc) {
2141
2199
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2142
2200
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2143
2201
  }
2144
- var __dxlog_file11 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space.ts";
2202
+ var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
2145
2203
  var Space = class Space2 {
2146
2204
  constructor(params) {
2147
- this._addFeedLock = new import_async7.Lock();
2205
+ this._addFeedLock = new import_async8.Lock();
2148
2206
  this.onCredentialProcessed = new import_util7.Callback();
2149
- this.stateUpdate = new import_async7.Event();
2207
+ this.stateUpdate = new import_async8.Event();
2150
2208
  this._isOpen = false;
2151
2209
  (0, import_invariant9.invariant)(params.spaceKey && params.feedProvider, void 0, {
2152
2210
  F: __dxlog_file11,
@@ -2365,22 +2423,22 @@ _ts_decorate6([
2365
2423
  import_tracing3.trace.info()
2366
2424
  ], Space.prototype, "key", null);
2367
2425
  _ts_decorate6([
2368
- import_async7.synchronized,
2426
+ import_async8.synchronized,
2369
2427
  import_tracing3.trace.span()
2370
2428
  ], Space.prototype, "open", null);
2371
2429
  _ts_decorate6([
2372
- import_async7.synchronized
2430
+ import_async8.synchronized
2373
2431
  ], Space.prototype, "close", null);
2374
2432
  _ts_decorate6([
2375
- import_async7.synchronized
2433
+ import_async8.synchronized
2376
2434
  ], Space.prototype, "initializeDataPipeline", null);
2377
2435
  Space = _ts_decorate6([
2378
- (0, import_async7.trackLeaks)("open", "close"),
2436
+ (0, import_async8.trackLeaks)("open", "close"),
2379
2437
  import_tracing3.trace.resource()
2380
2438
  ], Space);
2381
2439
 
2382
2440
  // packages/core/echo/echo-pipeline/src/space/space-manager.ts
2383
- var import_async8 = require("@dxos/async");
2441
+ var import_async9 = require("@dxos/async");
2384
2442
  var import_debug4 = require("@dxos/debug");
2385
2443
  var import_keys7 = require("@dxos/keys");
2386
2444
  var import_log12 = require("@dxos/log");
@@ -2406,7 +2464,7 @@ function _ts_decorate7(decorators, target, key, desc) {
2406
2464
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2407
2465
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2408
2466
  }
2409
- var __dxlog_file12 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space-protocol.ts";
2467
+ var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space-protocol.ts";
2410
2468
  var MOCK_AUTH_PROVIDER = async (nonce) => Buffer.from("mock");
2411
2469
  var MOCK_AUTH_VERIFIER = async (nonce, credential) => true;
2412
2470
  var SpaceProtocol = class {
@@ -2604,7 +2662,7 @@ function _ts_decorate8(decorators, target, key, desc) {
2604
2662
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2605
2663
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2606
2664
  }
2607
- var __dxlog_file13 = "/mnt/ramdisk/work/packages/core/echo/echo-pipeline/src/space/space-manager.ts";
2665
+ var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space-manager.ts";
2608
2666
  var SpaceManager = class SpaceManager2 {
2609
2667
  constructor({ feedStore, networkManager, modelFactory, metadataStore, snapshotStore, blobStore }) {
2610
2668
  this._spaces = new import_util9.ComplexMap(import_keys7.PublicKey.hash);
@@ -2678,13 +2736,13 @@ var SpaceManager = class SpaceManager2 {
2678
2736
  }
2679
2737
  };
2680
2738
  _ts_decorate8([
2681
- import_async8.synchronized
2739
+ import_async9.synchronized
2682
2740
  ], SpaceManager.prototype, "open", null);
2683
2741
  _ts_decorate8([
2684
- import_async8.synchronized
2742
+ import_async9.synchronized
2685
2743
  ], SpaceManager.prototype, "close", null);
2686
2744
  SpaceManager = _ts_decorate8([
2687
- (0, import_async8.trackLeaks)("open", "close")
2745
+ (0, import_async9.trackLeaks)("open", "close")
2688
2746
  ], SpaceManager);
2689
2747
  // Annotate the CommonJS export names for ESM import in node:
2690
2748
  0 && (module.exports = {