@dxos/client-services 0.1.50 → 0.1.51-main.04d9478

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.
@@ -1394,7 +1394,7 @@ var InvitationsHandler = class {
1394
1394
  ...protocol.toJSON()
1395
1395
  }, {
1396
1396
  file: "invitations-handler.ts",
1397
- line: 100,
1397
+ line: 99,
1398
1398
  scope: this,
1399
1399
  callSite: (f, a) => f(...a)
1400
1400
  });
@@ -1435,7 +1435,7 @@ var InvitationsHandler = class {
1435
1435
  id: traceId
1436
1436
  }), {
1437
1437
  file: "invitations-handler.ts",
1438
- line: 139,
1438
+ line: 138,
1439
1439
  scope: this,
1440
1440
  callSite: (f, a) => f(...a)
1441
1441
  });
@@ -1443,7 +1443,7 @@ var InvitationsHandler = class {
1443
1443
  ...protocol.toJSON()
1444
1444
  }, {
1445
1445
  file: "invitations-handler.ts",
1446
- line: 140,
1446
+ line: 139,
1447
1447
  scope: this,
1448
1448
  callSite: (f, a) => f(...a)
1449
1449
  });
@@ -1459,7 +1459,7 @@ var InvitationsHandler = class {
1459
1459
  ...protocol.toJSON()
1460
1460
  }, {
1461
1461
  file: "invitations-handler.ts",
1462
- line: 143,
1462
+ line: 142,
1463
1463
  scope: this,
1464
1464
  callSite: (f, a) => f(...a)
1465
1465
  });
@@ -1471,7 +1471,7 @@ var InvitationsHandler = class {
1471
1471
  id: traceId
1472
1472
  }), {
1473
1473
  file: "invitations-handler.ts",
1474
- line: 145,
1474
+ line: 144,
1475
1475
  scope: this,
1476
1476
  callSite: (f, a) => f(...a)
1477
1477
  });
@@ -1481,7 +1481,7 @@ var InvitationsHandler = class {
1481
1481
  ...protocol.toJSON()
1482
1482
  }, {
1483
1483
  file: "invitations-handler.ts",
1484
- line: 148,
1484
+ line: 147,
1485
1485
  scope: this,
1486
1486
  callSite: (f, a) => f(...a)
1487
1487
  });
@@ -1492,7 +1492,7 @@ var InvitationsHandler = class {
1492
1492
  } else {
1493
1493
  import_log5.log.error("failed", err, {
1494
1494
  file: "invitations-handler.ts",
1495
- line: 151,
1495
+ line: 150,
1496
1496
  scope: this,
1497
1497
  callSite: (f, a) => f(...a)
1498
1498
  });
@@ -1503,13 +1503,13 @@ var InvitationsHandler = class {
1503
1503
  error: err
1504
1504
  }), {
1505
1505
  file: "invitations-handler.ts",
1506
- line: 154,
1506
+ line: 153,
1507
1507
  scope: this,
1508
1508
  callSite: (f, a) => f(...a)
1509
1509
  });
1510
1510
  } finally {
1511
1511
  if (type !== import_services3.Invitation.Type.MULTIUSE) {
1512
- await (0, import_async8.sleep)(import_client_protocol2.ON_CLOSE_DELAY);
1512
+ await swarmConnection.close();
1513
1513
  await ctx.dispose();
1514
1514
  }
1515
1515
  }
@@ -1545,9 +1545,10 @@ var InvitationsHandler = class {
1545
1545
  });
1546
1546
  return extension;
1547
1547
  };
1548
+ let swarmConnection;
1548
1549
  (0, import_async8.scheduleTask)(ctx, async () => {
1549
1550
  const topic = invitation.swarmKey;
1550
- const swarmConnection = await this._networkManager.joinSwarm({
1551
+ swarmConnection = await this._networkManager.joinSwarm({
1551
1552
  topic,
1552
1553
  peerId: topic,
1553
1554
  protocolProvider: (0, import_network_manager.createTeleportProtocolFactory)(async (teleport) => {
@@ -1578,6 +1579,7 @@ var InvitationsHandler = class {
1578
1579
  const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
1579
1580
  (0, import_node_assert6.default)(protocol);
1580
1581
  const authenticated = new import_async8.Trigger();
1582
+ let admitted = false;
1581
1583
  let currentState;
1582
1584
  const stream = new import_async8.PushStream();
1583
1585
  const setState = (newData) => {
@@ -1595,7 +1597,7 @@ var InvitationsHandler = class {
1595
1597
  ...protocol.toJSON()
1596
1598
  }, {
1597
1599
  file: "invitations-handler.ts",
1598
- line: 225,
1600
+ line: 230,
1599
1601
  scope: this,
1600
1602
  callSite: (f, a) => f(...a)
1601
1603
  });
@@ -1605,7 +1607,7 @@ var InvitationsHandler = class {
1605
1607
  } else {
1606
1608
  import_log5.log.warn("auth failed", err, {
1607
1609
  file: "invitations-handler.ts",
1608
- line: 228,
1610
+ line: 233,
1609
1611
  scope: this,
1610
1612
  callSite: (f, a) => f(...a)
1611
1613
  });
@@ -1619,7 +1621,7 @@ var InvitationsHandler = class {
1619
1621
  ...protocol.toJSON()
1620
1622
  }, {
1621
1623
  file: "invitations-handler.ts",
1622
- line: 236,
1624
+ line: 241,
1623
1625
  scope: this,
1624
1626
  callSite: (f, a) => f(...a)
1625
1627
  });
@@ -1634,11 +1636,11 @@ var InvitationsHandler = class {
1634
1636
  currentState
1635
1637
  }, {
1636
1638
  file: "invitations-handler.ts",
1637
- line: 246,
1639
+ line: 251,
1638
1640
  scope: this,
1639
1641
  callSite: (f, a) => f(...a)
1640
1642
  });
1641
- if (currentState !== import_services3.Invitation.State.SUCCESS) {
1643
+ if (!admitted) {
1642
1644
  stream.error(new Error("Remote peer disconnected."));
1643
1645
  }
1644
1646
  });
@@ -1649,7 +1651,7 @@ var InvitationsHandler = class {
1649
1651
  id: traceId
1650
1652
  }), {
1651
1653
  file: "invitations-handler.ts",
1652
- line: 255,
1654
+ line: 260,
1653
1655
  scope: this,
1654
1656
  callSite: (f, a) => f(...a)
1655
1657
  });
@@ -1661,7 +1663,7 @@ var InvitationsHandler = class {
1661
1663
  ...protocol.toJSON()
1662
1664
  }, {
1663
1665
  file: "invitations-handler.ts",
1664
- line: 263,
1666
+ line: 268,
1665
1667
  scope: this,
1666
1668
  callSite: (f, a) => f(...a)
1667
1669
  });
@@ -1672,7 +1674,7 @@ var InvitationsHandler = class {
1672
1674
  ...protocol.toJSON()
1673
1675
  }, {
1674
1676
  file: "invitations-handler.ts",
1675
- line: 267,
1677
+ line: 272,
1676
1678
  scope: this,
1677
1679
  callSite: (f, a) => f(...a)
1678
1680
  });
@@ -1682,7 +1684,7 @@ var InvitationsHandler = class {
1682
1684
  response: introductionResponse
1683
1685
  }, {
1684
1686
  file: "invitations-handler.ts",
1685
- line: 271,
1687
+ line: 276,
1686
1688
  scope: this,
1687
1689
  callSite: (f, a) => f(...a)
1688
1690
  });
@@ -1694,7 +1696,7 @@ var InvitationsHandler = class {
1694
1696
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
1695
1697
  (0, import_log5.log)("guest waiting for authentication code...", {}, {
1696
1698
  file: "invitations-handler.ts",
1697
- line: 280,
1699
+ line: 285,
1698
1700
  scope: this,
1699
1701
  callSite: (f, a) => f(...a)
1700
1702
  });
@@ -1706,7 +1708,7 @@ var InvitationsHandler = class {
1706
1708
  });
1707
1709
  (0, import_log5.log)("sending authentication request", {}, {
1708
1710
  file: "invitations-handler.ts",
1709
- line: 284,
1711
+ line: 289,
1710
1712
  scope: this,
1711
1713
  callSite: (f, a) => f(...a)
1712
1714
  });
@@ -1727,7 +1729,7 @@ var InvitationsHandler = class {
1727
1729
  attempt
1728
1730
  }, {
1729
1731
  file: "invitations-handler.ts",
1730
- line: 295,
1732
+ line: 300,
1731
1733
  scope: this,
1732
1734
  callSite: (f, a) => f(...a)
1733
1735
  });
@@ -1744,18 +1746,19 @@ var InvitationsHandler = class {
1744
1746
  ...protocol.toJSON()
1745
1747
  }, {
1746
1748
  file: "invitations-handler.ts",
1747
- line: 306,
1749
+ line: 311,
1748
1750
  scope: this,
1749
1751
  callSite: (f, a) => f(...a)
1750
1752
  });
1751
1753
  const admissionRequest = await protocol.createAdmissionRequest();
1752
1754
  const admissionResponse = await extension.rpc.InvitationHostService.admit(admissionRequest);
1755
+ admitted = true;
1753
1756
  const result = await protocol.accept(admissionResponse, admissionRequest);
1754
1757
  (0, import_log5.log)("admitted by host", {
1755
1758
  ...protocol.toJSON()
1756
1759
  }, {
1757
1760
  file: "invitations-handler.ts",
1758
- line: 314,
1761
+ line: 322,
1759
1762
  scope: this,
1760
1763
  callSite: (f, a) => f(...a)
1761
1764
  });
@@ -1767,7 +1770,7 @@ var InvitationsHandler = class {
1767
1770
  id: traceId
1768
1771
  }), {
1769
1772
  file: "invitations-handler.ts",
1770
- line: 316,
1773
+ line: 324,
1771
1774
  scope: this,
1772
1775
  callSite: (f, a) => f(...a)
1773
1776
  });
@@ -1777,7 +1780,7 @@ var InvitationsHandler = class {
1777
1780
  ...protocol.toJSON()
1778
1781
  }, {
1779
1782
  file: "invitations-handler.ts",
1780
- line: 319,
1783
+ line: 327,
1781
1784
  scope: this,
1782
1785
  callSite: (f, a) => f(...a)
1783
1786
  });
@@ -1787,7 +1790,7 @@ var InvitationsHandler = class {
1787
1790
  } else {
1788
1791
  (0, import_log5.log)("auth failed", err, {
1789
1792
  file: "invitations-handler.ts",
1790
- line: 322,
1793
+ line: 330,
1791
1794
  scope: this,
1792
1795
  callSite: (f, a) => f(...a)
1793
1796
  });
@@ -1798,7 +1801,7 @@ var InvitationsHandler = class {
1798
1801
  error: err
1799
1802
  }), {
1800
1803
  file: "invitations-handler.ts",
1801
- line: 325,
1804
+ line: 333,
1802
1805
  scope: this,
1803
1806
  callSite: (f, a) => f(...a)
1804
1807
  });
@@ -1816,7 +1819,7 @@ var InvitationsHandler = class {
1816
1819
  ...protocol.toJSON()
1817
1820
  }, {
1818
1821
  file: "invitations-handler.ts",
1819
- line: 336,
1822
+ line: 344,
1820
1823
  scope: this,
1821
1824
  callSite: (f, a) => f(...a)
1822
1825
  });
@@ -1826,7 +1829,7 @@ var InvitationsHandler = class {
1826
1829
  } else {
1827
1830
  (0, import_log5.log)("auth failed", err, {
1828
1831
  file: "invitations-handler.ts",
1829
- line: 339,
1832
+ line: 347,
1830
1833
  scope: this,
1831
1834
  callSite: (f, a) => f(...a)
1832
1835
  });
@@ -2137,7 +2140,7 @@ var import_log15 = require("@dxos/log");
2137
2140
  var import_messaging = require("@dxos/messaging");
2138
2141
  var import_network_manager2 = require("@dxos/network-manager");
2139
2142
  var import_protocols9 = require("@dxos/protocols");
2140
- var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
2143
+ var import_services12 = require("@dxos/protocols/proto/dxos/client/services");
2141
2144
 
2142
2145
  // packages/sdk/client-services/src/packlets/devices/devices-service.ts
2143
2146
  var import_async10 = require("@dxos/async");
@@ -2248,6 +2251,7 @@ var isLocked = (lockPath) => import_lockfile.default.checkSync(lockPath);
2248
2251
  var import_async12 = require("@dxos/async");
2249
2252
  var import_codec_protobuf10 = require("@dxos/codec-protobuf");
2250
2253
  var import_log9 = require("@dxos/log");
2254
+ var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2251
2255
  var import_util3 = require("@dxos/util");
2252
2256
  var LoggingServiceImpl = class {
2253
2257
  constructor() {
@@ -2264,31 +2268,60 @@ var LoggingServiceImpl = class {
2264
2268
  import_log9.log.runtimeConfig.processors.splice(index, 1);
2265
2269
  }
2266
2270
  queryLogs(request) {
2267
- var _a;
2268
- const filters = ((_a = request.filters) == null ? void 0 : _a.length) ? request.filters : void 0;
2269
2271
  return new import_codec_protobuf10.Stream(({ ctx, next }) => {
2270
2272
  const handler = (entry2) => {
2271
- var _a2, _b, _c;
2272
- if (((_a2 = entry2.meta) == null ? void 0 : _a2.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
2273
+ var _a, _b, _c, _d, _e;
2274
+ if (LOG_PROCESSING > 0) {
2273
2275
  return;
2274
2276
  }
2275
- if ((0, import_log9.shouldLog)(entry2, filters)) {
2276
- const record = {
2277
- ...entry2,
2278
- context: (0, import_util3.jsonify)((0, import_log9.getContextFromEntry)(entry2))
2279
- };
2280
- (_b = record.meta) == null ? true : delete _b.bugcheck;
2281
- (_c = record.meta) == null ? true : delete _c.scope;
2277
+ if (((_a = entry2.meta) == null ? void 0 : _a.file.includes("logging-service")) || entry2.context && Object.values(entry2.context).some((value) => typeof value === "string" && value.includes("LoggingService"))) {
2278
+ return;
2279
+ }
2280
+ if (!shouldLog(entry2, request)) {
2281
+ return;
2282
+ }
2283
+ const record = {
2284
+ ...entry2,
2285
+ context: (0, import_util3.jsonify)((0, import_log9.getContextFromEntry)(entry2)),
2286
+ timestamp: new Date(),
2287
+ meta: {
2288
+ // TODO(dmaretskyi): Fix proto.
2289
+ file: (_c = (_b = entry2.meta) == null ? void 0 : _b.file) != null ? _c : "",
2290
+ line: (_e = (_d = entry2.meta) == null ? void 0 : _d.line) != null ? _e : 0
2291
+ }
2292
+ };
2293
+ try {
2294
+ LOG_PROCESSING++;
2282
2295
  next(record);
2296
+ } finally {
2297
+ LOG_PROCESSING--;
2283
2298
  }
2284
2299
  };
2285
- ctx.onDispose(() => {
2286
- this._logs.off(handler);
2287
- });
2288
- this._logs.on(handler);
2300
+ this._logs.on(ctx, handler);
2301
+ });
2302
+ }
2303
+ };
2304
+ var matchFilter = (filter, level, path, options) => {
2305
+ switch (options) {
2306
+ case import_services7.QueryLogsRequest.MatchingOptions.INCLUSIVE:
2307
+ return level >= filter.level && (!filter.pattern || path.includes(filter.pattern));
2308
+ case import_services7.QueryLogsRequest.MatchingOptions.EXPLICIT:
2309
+ return level === filter.level && (!filter.pattern || path.includes(filter.pattern));
2310
+ }
2311
+ };
2312
+ var shouldLog = (entry2, request) => {
2313
+ var _a;
2314
+ const options = (_a = request.options) != null ? _a : import_services7.QueryLogsRequest.MatchingOptions.INCLUSIVE;
2315
+ if (request.filters === void 0) {
2316
+ return options === import_services7.QueryLogsRequest.MatchingOptions.INCLUSIVE;
2317
+ } else {
2318
+ return request.filters.some((filter) => {
2319
+ var _a2, _b;
2320
+ return matchFilter(filter, entry2.level, (_b = (_a2 = entry2.meta) == null ? void 0 : _a2.file) != null ? _b : "", options);
2289
2321
  });
2290
2322
  }
2291
2323
  };
2324
+ var LOG_PROCESSING = 0;
2292
2325
 
2293
2326
  // packages/sdk/client-services/src/packlets/network/network-service.ts
2294
2327
  var import_codec_protobuf11 = require("@dxos/codec-protobuf");
@@ -2330,7 +2363,7 @@ var import_credentials12 = require("@dxos/credentials");
2330
2363
  var import_keys9 = require("@dxos/keys");
2331
2364
  var import_log12 = require("@dxos/log");
2332
2365
  var import_protocols6 = require("@dxos/protocols");
2333
- var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
2366
+ var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
2334
2367
  var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
2335
2368
  var import_util6 = require("@dxos/util");
2336
2369
 
@@ -2343,8 +2376,9 @@ var import_echo_pipeline = require("@dxos/echo-pipeline");
2343
2376
  var import_errors3 = require("@dxos/errors");
2344
2377
  var import_keys8 = require("@dxos/keys");
2345
2378
  var import_log11 = require("@dxos/log");
2346
- var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
2379
+ var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
2347
2380
  var import_credentials9 = require("@dxos/protocols/proto/dxos/halo/credentials");
2381
+ var import_timeframe = require("@dxos/timeframe");
2348
2382
  var import_util5 = require("@dxos/util");
2349
2383
 
2350
2384
  // packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
@@ -2603,7 +2637,7 @@ var __decorate2 = function(decorators, target, key, desc) {
2603
2637
  var DataSpace = class DataSpace2 {
2604
2638
  constructor(params) {
2605
2639
  this._ctx = new import_context6.Context();
2606
- this._state = import_services7.SpaceState.CLOSED;
2640
+ this._state = import_services8.SpaceState.CLOSED;
2607
2641
  /**
2608
2642
  * Error for _state === SpaceState.ERROR.
2609
2643
  */
@@ -2657,11 +2691,11 @@ var DataSpace = class DataSpace2 {
2657
2691
  await this.notarizationPlugin.open();
2658
2692
  await this._notarizationPluginConsumer.open();
2659
2693
  await this._inner.open();
2660
- this._state = import_services7.SpaceState.INACTIVE;
2694
+ this._state = import_services8.SpaceState.INACTIVE;
2661
2695
  this.metrics.open = new Date();
2662
2696
  }
2663
2697
  async close() {
2664
- this._state = import_services7.SpaceState.CLOSED;
2698
+ this._state = import_services8.SpaceState.CLOSED;
2665
2699
  await this._ctx.dispose();
2666
2700
  await this.authVerifier.close();
2667
2701
  await this._inner.close();
@@ -2687,7 +2721,7 @@ var DataSpace = class DataSpace2 {
2687
2721
  if (err instanceof import_errors3.CancelledError) {
2688
2722
  (0, import_log11.log)("Data pipeline initialization cancelled", err, {
2689
2723
  file: "data-space.ts",
2690
- line: 172,
2724
+ line: 173,
2691
2725
  scope: this,
2692
2726
  callSite: (f, a) => f(...a)
2693
2727
  });
@@ -2695,11 +2729,11 @@ var DataSpace = class DataSpace2 {
2695
2729
  }
2696
2730
  import_log11.log.error("Error initializing data pipeline", err, {
2697
2731
  file: "data-space.ts",
2698
- line: 176,
2732
+ line: 177,
2699
2733
  scope: this,
2700
2734
  callSite: (f, a) => f(...a)
2701
2735
  });
2702
- this._state = import_services7.SpaceState.ERROR;
2736
+ this._state = import_services8.SpaceState.ERROR;
2703
2737
  this.error = err;
2704
2738
  this.stateUpdate.emit();
2705
2739
  } finally {
@@ -2709,10 +2743,10 @@ var DataSpace = class DataSpace2 {
2709
2743
  }
2710
2744
  async initializeDataPipeline() {
2711
2745
  var _a, _b, _c, _d;
2712
- if (this._state !== import_services7.SpaceState.INACTIVE) {
2746
+ if (this._state !== import_services8.SpaceState.INACTIVE) {
2713
2747
  throw new import_errors3.SystemError("Invalid operation");
2714
2748
  }
2715
- this._state = import_services7.SpaceState.INITIALIZING;
2749
+ this._state = import_services8.SpaceState.INITIALIZING;
2716
2750
  await this._inner.controlPipeline.state.waitUntilReachedTargetTimeframe({
2717
2751
  ctx: this._ctx,
2718
2752
  breakOnStall: false
@@ -2752,7 +2786,7 @@ var DataSpace = class DataSpace2 {
2752
2786
  callSite: (f, a) => f(...a)
2753
2787
  });
2754
2788
  await ((_b = (_a = this._callbacks).beforeReady) == null ? void 0 : _b.call(_a));
2755
- this._state = import_services7.SpaceState.READY;
2789
+ this._state = import_services8.SpaceState.READY;
2756
2790
  this.stateUpdate.emit();
2757
2791
  await ((_d = (_c = this._callbacks).afterReady) == null ? void 0 : _d.call(_c));
2758
2792
  }
@@ -2802,7 +2836,7 @@ var DataSpace = class DataSpace2 {
2802
2836
  async createEpoch() {
2803
2837
  var _a, _b;
2804
2838
  const epoch = await this.dataPipeline.createEpoch();
2805
- await this.inner.controlPipeline.writer.write({
2839
+ const receipt = await this.inner.controlPipeline.writer.write({
2806
2840
  credential: {
2807
2841
  credential: await this._signingContext.credentialSigner.createCredential({
2808
2842
  subject: this.key,
@@ -2813,6 +2847,12 @@ var DataSpace = class DataSpace2 {
2813
2847
  })
2814
2848
  }
2815
2849
  });
2850
+ await this.inner.controlPipeline.state.waitUntilTimeframe(new import_timeframe.Timeframe([
2851
+ [
2852
+ receipt.feedKey,
2853
+ receipt.seq
2854
+ ]
2855
+ ]));
2816
2856
  for (const feed of (_b = (_a = this.inner.dataPipeline.pipelineState) == null ? void 0 : _a.feeds) != null ? _b : []) {
2817
2857
  const indexBeforeEpoch = epoch.timeframe.get(feed.key);
2818
2858
  if (indexBeforeEpoch) {
@@ -2832,7 +2872,7 @@ DataSpace = __decorate2([
2832
2872
  var import_credentials10 = require("@dxos/credentials");
2833
2873
  var import_debug4 = require("@dxos/debug");
2834
2874
  var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
2835
- var import_timeframe = require("@dxos/timeframe");
2875
+ var import_timeframe2 = require("@dxos/timeframe");
2836
2876
  var spaceGenesis = async (keyring, signingContext, space) => {
2837
2877
  var _a, _b, _c, _d;
2838
2878
  const credentials = [
@@ -2883,7 +2923,7 @@ var spaceGenesis = async (keyring, signingContext, space) => {
2883
2923
  "@type": "dxos.halo.credentials.Epoch",
2884
2924
  number: 0,
2885
2925
  previousId: void 0,
2886
- timeframe: new import_timeframe.Timeframe(),
2926
+ timeframe: new import_timeframe2.Timeframe(),
2887
2927
  snapshotCid: void 0
2888
2928
  }
2889
2929
  })
@@ -3063,7 +3103,7 @@ var DataSpaceManager = class DataSpaceManager2 {
3063
3103
  async waitUntilSpaceReady(spaceKey) {
3064
3104
  await (0, import_context7.cancelWithContext)(this._ctx, this.updated.waitForCondition(() => {
3065
3105
  const space = this._spaces.get(spaceKey);
3066
- return !!space && space.state === import_services8.SpaceState.READY;
3106
+ return !!space && space.state === import_services9.SpaceState.READY;
3067
3107
  }));
3068
3108
  }
3069
3109
  async _constructSpace(metadata) {
@@ -3187,7 +3227,7 @@ var import_debug5 = require("@dxos/debug");
3187
3227
  var import_echo_pipeline2 = require("@dxos/echo-pipeline");
3188
3228
  var import_log13 = require("@dxos/log");
3189
3229
  var import_protocols7 = require("@dxos/protocols");
3190
- var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
3230
+ var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
3191
3231
  var import_util7 = require("@dxos/util");
3192
3232
  var TIMEFRAME_UPDATE_DEBOUNCE_TIME = 500;
3193
3233
  var SpacesServiceImpl = class {
@@ -3217,7 +3257,7 @@ var SpacesServiceImpl = class {
3217
3257
  spaces
3218
3258
  }, {
3219
3259
  file: "spaces-service.ts",
3220
- line: 59,
3260
+ line: 60,
3221
3261
  scope: this,
3222
3262
  callSite: (f, a) => f(...a)
3223
3263
  });
@@ -3304,12 +3344,13 @@ var SpacesServiceImpl = class {
3304
3344
  await space.createEpoch();
3305
3345
  }
3306
3346
  _transformSpace(space) {
3307
- var _a, _b, _c, _d, _e;
3347
+ var _a, _b, _c, _d, _e, _f;
3308
3348
  return {
3309
3349
  spaceKey: space.key,
3310
3350
  state: space.state,
3311
3351
  error: space.error ? (0, import_protocols7.encodeError)(space.error) : void 0,
3312
3352
  pipeline: {
3353
+ currentEpoch: space.dataPipeline.currentEpoch,
3313
3354
  controlFeeds: space.inner.controlPipeline.state.feeds.map((feed) => feed.key),
3314
3355
  currentControlTimeframe: space.inner.controlPipeline.state.timeframe,
3315
3356
  targetControlTimeframe: space.inner.controlPipeline.state.targetTimeframe,
@@ -3328,9 +3369,10 @@ var SpacesServiceImpl = class {
3328
3369
  displayName: (_b2 = (_a2 = member.assertion.profile) == null ? void 0 : _a2.displayName) != null ? _b2 : (0, import_util7.humanize)(member.key)
3329
3370
  }
3330
3371
  },
3331
- presence: ((_c2 = this._identityManager.identity) == null ? void 0 : _c2.identityKey.equals(member.key)) || space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE
3372
+ presence: ((_c2 = this._identityManager.identity) == null ? void 0 : _c2.identityKey.equals(member.key)) || space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key)).length > 0 ? import_services10.SpaceMember.PresenceState.ONLINE : import_services10.SpaceMember.PresenceState.OFFLINE
3332
3373
  };
3333
3374
  }),
3375
+ creator: (_f = space.inner.spaceState.creator) == null ? void 0 : _f.key,
3334
3376
  cache: space.cache,
3335
3377
  metrics: space.metrics
3336
3378
  };
@@ -3436,7 +3478,7 @@ var import_keyring = require("@dxos/keyring");
3436
3478
  var import_keys10 = require("@dxos/keys");
3437
3479
  var import_log14 = require("@dxos/log");
3438
3480
  var import_protocols8 = require("@dxos/protocols");
3439
- var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
3481
+ var import_services11 = require("@dxos/protocols/proto/dxos/client/services");
3440
3482
  var ServiceContext = class {
3441
3483
  // prettier-ignore
3442
3484
  constructor(storage, networkManager, signalManager, modelFactory) {
@@ -3469,7 +3511,7 @@ var ServiceContext = class {
3469
3511
  });
3470
3512
  this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
3471
3513
  this.invitations = new InvitationsHandler(this.networkManager);
3472
- this._handlerFactories.set(import_services10.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => {
3514
+ this._handlerFactories.set(import_services11.Invitation.Kind.DEVICE, () => new DeviceInvitationProtocol(this.keyring, () => {
3473
3515
  var _a;
3474
3516
  return (_a = this.identityManager.identity) != null ? _a : (0, import_debug6.failUndefined)();
3475
3517
  }, this._acceptIdentity.bind(this)));
@@ -3581,7 +3623,7 @@ var ServiceContext = class {
3581
3623
  };
3582
3624
  this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
3583
3625
  await this.dataSpaceManager.open();
3584
- this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
3626
+ this._handlerFactories.set(import_services11.Invitation.Kind.SPACE, (invitation) => {
3585
3627
  (0, import_node_assert11.default)(this.dataSpaceManager, "dataSpaceManager not initialized yet");
3586
3628
  return new SpaceInvitationProtocol(this.dataSpaceManager, signingContext, this.keyring, invitation.spaceKey);
3587
3629
  });
@@ -3707,12 +3749,12 @@ var ClientServicesHost = class {
3707
3749
  this._systemService = new SystemServiceImpl({
3708
3750
  config: this._config,
3709
3751
  statusUpdate: this._statusUpdate,
3710
- getCurrentStatus: () => this.isOpen ? import_services11.SystemStatus.ACTIVE : import_services11.SystemStatus.INACTIVE,
3752
+ getCurrentStatus: () => this.isOpen ? import_services12.SystemStatus.ACTIVE : import_services12.SystemStatus.INACTIVE,
3711
3753
  onUpdateStatus: async (status) => {
3712
3754
  var _a, _b;
3713
- if (!this.isOpen && status === import_services11.SystemStatus.ACTIVE) {
3755
+ if (!this.isOpen && status === import_services12.SystemStatus.ACTIVE) {
3714
3756
  await ((_a = this._resourceLock) == null ? void 0 : _a.acquire());
3715
- } else if (this.isOpen && status === import_services11.SystemStatus.INACTIVE) {
3757
+ } else if (this.isOpen && status === import_services12.SystemStatus.INACTIVE) {
3716
3758
  await ((_b = this._resourceLock) == null ? void 0 : _b.release());
3717
3759
  }
3718
3760
  },