@dxos/echo-pipeline 0.5.7-main.a079570 → 0.5.7-main.c48bccd

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.
@@ -1150,9 +1150,7 @@ var AuthExtension = class extends RpcExtension {
1150
1150
  // packages/core/echo/echo-pipeline/src/space/space.ts
1151
1151
  import { Event as Event4, Mutex, synchronized as synchronized3, trackLeaks as trackLeaks2 } from "@dxos/async";
1152
1152
  import { LifecycleState, Resource } from "@dxos/context";
1153
- import { subtleCrypto as subtleCrypto2 } from "@dxos/crypto";
1154
1153
  import { invariant as invariant6 } from "@dxos/invariant";
1155
- import { SpaceId } from "@dxos/keys";
1156
1154
  import { log as log7, logInfo } from "@dxos/log";
1157
1155
  import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
1158
1156
  import { trace as trace2 } from "@dxos/tracing";
@@ -1441,14 +1439,13 @@ var Space = class extends Resource {
1441
1439
  this.stateUpdate = new Event4();
1442
1440
  invariant6(params.spaceKey && params.feedProvider, void 0, {
1443
1441
  F: __dxlog_file8,
1444
- L: 78,
1442
+ L: 75,
1445
1443
  S: this,
1446
1444
  A: [
1447
1445
  "params.spaceKey && params.feedProvider",
1448
1446
  ""
1449
1447
  ]
1450
1448
  });
1451
- this._id = params.id;
1452
1449
  this._key = params.spaceKey;
1453
1450
  this._genesisFeedKey = params.genesisFeed.key;
1454
1451
  this._feedProvider = params.feedProvider;
@@ -1475,7 +1472,7 @@ var Space = class extends Resource {
1475
1472
  credential
1476
1473
  }, {
1477
1474
  F: __dxlog_file8,
1478
- L: 106,
1475
+ L: 102,
1479
1476
  S: this,
1480
1477
  C: (f, a) => f(...a)
1481
1478
  });
@@ -1486,7 +1483,7 @@ var Space = class extends Resource {
1486
1483
  invitation
1487
1484
  }, {
1488
1485
  F: __dxlog_file8,
1489
- L: 110,
1486
+ L: 106,
1490
1487
  S: this,
1491
1488
  C: (f, a) => f(...a)
1492
1489
  });
@@ -1497,7 +1494,7 @@ var Space = class extends Resource {
1497
1494
  invitation
1498
1495
  }, {
1499
1496
  F: __dxlog_file8,
1500
- L: 114,
1497
+ L: 110,
1501
1498
  S: this,
1502
1499
  C: (f, a) => f(...a)
1503
1500
  });
@@ -1511,7 +1508,7 @@ var Space = class extends Resource {
1511
1508
  ])
1512
1509
  }), {
1513
1510
  F: __dxlog_file8,
1514
- L: 118,
1511
+ L: 114,
1515
1512
  S: this,
1516
1513
  C: (f, a) => f(...a)
1517
1514
  });
@@ -1520,9 +1517,6 @@ var Space = class extends Resource {
1520
1517
  this.protocol = params.protocol;
1521
1518
  this.protocol.addFeed(params.genesisFeed);
1522
1519
  }
1523
- get id() {
1524
- return this._id;
1525
- }
1526
1520
  get key() {
1527
1521
  return this._key;
1528
1522
  }
@@ -1553,7 +1547,7 @@ var Space = class extends Resource {
1553
1547
  async setControlFeed(feed) {
1554
1548
  invariant6(!this._controlFeed, "Control feed already set.", {
1555
1549
  F: __dxlog_file8,
1556
- L: 171,
1550
+ L: 161,
1557
1551
  S: this,
1558
1552
  A: [
1559
1553
  "!this._controlFeed",
@@ -1567,7 +1561,7 @@ var Space = class extends Resource {
1567
1561
  async setDataFeed(feed) {
1568
1562
  invariant6(!this._dataFeed, "Data feed already set.", {
1569
1563
  F: __dxlog_file8,
1570
- L: 178,
1564
+ L: 168,
1571
1565
  S: this,
1572
1566
  A: [
1573
1567
  "!this._dataFeed",
@@ -1586,7 +1580,7 @@ var Space = class extends Resource {
1586
1580
  async _open(ctx) {
1587
1581
  log7("opening...", void 0, {
1588
1582
  F: __dxlog_file8,
1589
- L: 192,
1583
+ L: 182,
1590
1584
  S: this,
1591
1585
  C: (f, a) => f(...a)
1592
1586
  });
@@ -1594,7 +1588,7 @@ var Space = class extends Resource {
1594
1588
  await this.protocol.start();
1595
1589
  log7("opened", void 0, {
1596
1590
  F: __dxlog_file8,
1597
- L: 198,
1591
+ L: 188,
1598
1592
  S: this,
1599
1593
  C: (f, a) => f(...a)
1600
1594
  });
@@ -1604,7 +1598,7 @@ var Space = class extends Resource {
1604
1598
  key: this._key
1605
1599
  }, {
1606
1600
  F: __dxlog_file8,
1607
- L: 203,
1601
+ L: 193,
1608
1602
  S: this,
1609
1603
  C: (f, a) => f(...a)
1610
1604
  });
@@ -1612,7 +1606,7 @@ var Space = class extends Resource {
1612
1606
  await this._controlPipeline.stop();
1613
1607
  log7("closed", void 0, {
1614
1608
  F: __dxlog_file8,
1615
- L: 209,
1609
+ L: 199,
1616
1610
  S: this,
1617
1611
  C: (f, a) => f(...a)
1618
1612
  });
@@ -1624,10 +1618,6 @@ _ts_decorate5([
1624
1618
  _ts_decorate5([
1625
1619
  trace2.info()
1626
1620
  ], Space.prototype, "_controlPipeline", void 0);
1627
- _ts_decorate5([
1628
- logInfo,
1629
- trace2.info()
1630
- ], Space.prototype, "id", null);
1631
1621
  _ts_decorate5([
1632
1622
  logInfo,
1633
1623
  trace2.info()
@@ -1642,24 +1632,9 @@ Space = _ts_decorate5([
1642
1632
  trackLeaks2("open", "close"),
1643
1633
  trace2.resource()
1644
1634
  ], Space);
1645
- var createIdFromSpaceKey = async (spaceKey) => {
1646
- invariant6(spaceKey.length === EXPECTED_SPACE_KEY_LENGTH, void 0, {
1647
- F: __dxlog_file8,
1648
- L: 219,
1649
- S: void 0,
1650
- A: [
1651
- "spaceKey.length === EXPECTED_SPACE_KEY_LENGTH",
1652
- ""
1653
- ]
1654
- });
1655
- const digest = await subtleCrypto2.digest("SHA-256", spaceKey.asUint8Array());
1656
- const bytes = new Uint8Array(digest).slice(0, SpaceId.byteLength);
1657
- return SpaceId.encode(bytes);
1658
- };
1659
- var EXPECTED_SPACE_KEY_LENGTH = 65;
1660
1635
 
1661
1636
  // packages/core/echo/echo-pipeline/src/space/space-protocol.ts
1662
- import { discoveryKey, subtleCrypto as subtleCrypto3 } from "@dxos/crypto";
1637
+ import { discoveryKey, subtleCrypto as subtleCrypto2 } from "@dxos/crypto";
1663
1638
  import { PublicKey as PublicKey5 } from "@dxos/keys";
1664
1639
  import { log as log8, logInfo as logInfo2 } from "@dxos/log";
1665
1640
  import { MMSTTopology } from "@dxos/network-manager";
@@ -1699,7 +1674,7 @@ var SpaceProtocol = class {
1699
1674
  this.blobSync = new BlobSync({
1700
1675
  blobStore
1701
1676
  });
1702
- this._topic = subtleCrypto3.digest("SHA-256", topic.asBuffer()).then(discoveryKey).then(PublicKey5.from);
1677
+ this._topic = subtleCrypto2.digest("SHA-256", topic.asBuffer()).then(discoveryKey).then(PublicKey5.from);
1703
1678
  }
1704
1679
  get sessions() {
1705
1680
  return this._sessions;
@@ -1935,7 +1910,6 @@ var SpaceManager = class {
1935
1910
  });
1936
1911
  const genesisFeed = await this._feedStore.openFeed(metadata.genesisFeedKey ?? failUndefined2());
1937
1912
  const spaceKey = metadata.key;
1938
- const spaceId = await createIdFromSpaceKey(spaceKey);
1939
1913
  const protocol = new SpaceProtocol({
1940
1914
  topic: spaceKey,
1941
1915
  swarmIdentity,
@@ -1946,7 +1920,6 @@ var SpaceManager = class {
1946
1920
  });
1947
1921
  const snapshotManager = new SnapshotManager(this._snapshotStore, this._blobStore, protocol.blobSync);
1948
1922
  const space = new Space({
1949
- id: spaceId,
1950
1923
  spaceKey,
1951
1924
  protocol,
1952
1925
  genesisFeed,
@@ -1962,7 +1935,7 @@ var SpaceManager = class {
1962
1935
  id: this._instanceId
1963
1936
  }), {
1964
1937
  F: __dxlog_file10,
1965
- L: 126,
1938
+ L: 124,
1966
1939
  S: this,
1967
1940
  C: (f, a) => f(...a)
1968
1941
  });
@@ -1996,7 +1969,6 @@ export {
1996
1969
  Pipeline,
1997
1970
  AuthExtension,
1998
1971
  Space,
1999
- createIdFromSpaceKey,
2000
1972
  MOCK_AUTH_PROVIDER,
2001
1973
  MOCK_AUTH_VERIFIER,
2002
1974
  SpaceProtocol,
@@ -2004,4 +1976,4 @@ export {
2004
1976
  SpaceProtocolSession,
2005
1977
  SpaceManager
2006
1978
  };
2007
- //# sourceMappingURL=chunk-BE5QQHWH.mjs.map
1979
+ //# sourceMappingURL=chunk-LPYLRJZ4.mjs.map