@dxos/client-services 0.1.58-main.e460f33 → 0.1.58-main.e4cedde

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 (28) hide show
  1. package/dist/lib/browser/{chunk-PNAXUNJ7.mjs → chunk-FIKNAQOZ.mjs} +99 -141
  2. package/dist/lib/browser/chunk-FIKNAQOZ.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +2 -2
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/packlets/testing/index.mjs +1 -1
  7. package/dist/lib/node/index.cjs +141 -183
  8. package/dist/lib/node/index.cjs.map +3 -3
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/packlets/testing/index.cjs +143 -185
  11. package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
  12. package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
  13. package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
  14. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  15. package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
  16. package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
  17. package/dist/types/src/version.d.ts +1 -1
  18. package/package.json +35 -34
  19. package/src/packlets/identity/authenticator.ts +1 -1
  20. package/src/packlets/invitations/invitation-extension.ts +2 -1
  21. package/src/packlets/invitations/invitations-handler.ts +2 -1
  22. package/src/packlets/services/service-context.ts +2 -2
  23. package/src/packlets/spaces/data-space.ts +2 -8
  24. package/src/packlets/spaces/spaces-service.ts +8 -29
  25. package/src/packlets/storage/storage.ts +1 -1
  26. package/src/packlets/vault/iframe-proxy-runtime.ts +1 -1
  27. package/src/version.ts +1 -1
  28. package/dist/lib/browser/chunk-PNAXUNJ7.mjs.map +0 -7
@@ -1161,21 +1161,23 @@ import { PushStream, scheduleTask as scheduleTask2, TimeoutError, Trigger as Tri
1161
1161
  import { AuthenticatingInvitationObservable, AUTHENTICATION_CODE_LENGTH, CancellableInvitationObservable, INVITATION_TIMEOUT } from "@dxos/client-protocol";
1162
1162
  import { Context as Context5 } from "@dxos/context";
1163
1163
  import { generatePasscode } from "@dxos/credentials";
1164
+ import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2 } from "@dxos/errors";
1164
1165
  import { invariant as invariant6 } from "@dxos/invariant";
1165
1166
  import { PublicKey as PublicKey5 } from "@dxos/keys";
1166
1167
  import { log as log5 } from "@dxos/log";
1167
1168
  import { createTeleportProtocolFactory, StarTopology } from "@dxos/network-manager";
1168
- import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2, trace as trace4 } from "@dxos/protocols";
1169
+ import { trace as trace4 } from "@dxos/protocols";
1169
1170
  import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
1170
1171
  import { AuthenticationResponse as AuthenticationResponse2 } from "@dxos/protocols/proto/dxos/halo/invitations";
1171
1172
 
1172
1173
  // packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
1173
1174
  import { Trigger as Trigger2 } from "@dxos/async";
1174
1175
  import { cancelWithContext, Context as Context4 } from "@dxos/context";
1176
+ import { InvalidInvitationExtensionRoleError } from "@dxos/errors";
1175
1177
  import { invariant as invariant5 } from "@dxos/invariant";
1176
1178
  import { PublicKey as PublicKey4 } from "@dxos/keys";
1177
1179
  import { log as log4 } from "@dxos/log";
1178
- import { InvalidInvitationExtensionRoleError, schema as schema2, trace as trace3 } from "@dxos/protocols";
1180
+ import { schema as schema2, trace as trace3 } from "@dxos/protocols";
1179
1181
  import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
1180
1182
  import { AuthenticationResponse, Options } from "@dxos/protocols/proto/dxos/halo/invitations";
1181
1183
  import { RpcExtension } from "@dxos/teleport";
@@ -1209,7 +1211,7 @@ var InvitationHostExtension = class extends RpcExtension {
1209
1211
  options: async (options) => {
1210
1212
  invariant5(!this._remoteOptions, "Remote options already set.", {
1211
1213
  F: __dxlog_file6,
1212
- L: 87,
1214
+ L: 88,
1213
1215
  S: this,
1214
1216
  A: [
1215
1217
  "!this._remoteOptions",
@@ -1226,7 +1228,7 @@ var InvitationHostExtension = class extends RpcExtension {
1226
1228
  id: traceId
1227
1229
  }), {
1228
1230
  F: __dxlog_file6,
1229
- L: 96,
1231
+ L: 97,
1230
1232
  S: this,
1231
1233
  C: (f, a) => f(...a)
1232
1234
  });
@@ -1236,7 +1238,7 @@ var InvitationHostExtension = class extends RpcExtension {
1236
1238
  invitationId
1237
1239
  }, {
1238
1240
  F: __dxlog_file6,
1239
- L: 100,
1241
+ L: 101,
1240
1242
  S: this,
1241
1243
  C: (f, a) => f(...a)
1242
1244
  });
@@ -1250,7 +1252,7 @@ var InvitationHostExtension = class extends RpcExtension {
1250
1252
  guestProfile: profile
1251
1253
  }, {
1252
1254
  F: __dxlog_file6,
1253
- L: 109,
1255
+ L: 110,
1254
1256
  S: this,
1255
1257
  C: (f, a) => f(...a)
1256
1258
  });
@@ -1263,7 +1265,7 @@ var InvitationHostExtension = class extends RpcExtension {
1263
1265
  id: traceId
1264
1266
  }), {
1265
1267
  F: __dxlog_file6,
1266
- L: 116,
1268
+ L: 117,
1267
1269
  S: this,
1268
1270
  C: (f, a) => f(...a)
1269
1271
  });
@@ -1278,7 +1280,7 @@ var InvitationHostExtension = class extends RpcExtension {
1278
1280
  id: traceId
1279
1281
  }), {
1280
1282
  F: __dxlog_file6,
1281
- L: 125,
1283
+ L: 126,
1282
1284
  S: this,
1283
1285
  C: (f, a) => f(...a)
1284
1286
  });
@@ -1286,14 +1288,14 @@ var InvitationHostExtension = class extends RpcExtension {
1286
1288
  authCode: code
1287
1289
  }, {
1288
1290
  F: __dxlog_file6,
1289
- L: 126,
1291
+ L: 127,
1290
1292
  S: this,
1291
1293
  C: (f, a) => f(...a)
1292
1294
  });
1293
1295
  let status = AuthenticationResponse.Status.OK;
1294
1296
  invariant5(this.invitation, "Invitation is not set.", {
1295
1297
  F: __dxlog_file6,
1296
- L: 129,
1298
+ L: 130,
1297
1299
  S: this,
1298
1300
  A: [
1299
1301
  "this.invitation",
@@ -1304,7 +1306,7 @@ var InvitationHostExtension = class extends RpcExtension {
1304
1306
  case Invitation2.AuthMethod.NONE: {
1305
1307
  log4("authentication not required", void 0, {
1306
1308
  F: __dxlog_file6,
1307
- L: 132,
1309
+ L: 133,
1308
1310
  S: this,
1309
1311
  C: (f, a) => f(...a)
1310
1312
  });
@@ -1329,7 +1331,7 @@ var InvitationHostExtension = class extends RpcExtension {
1329
1331
  authMethod: this.invitation.authMethod
1330
1332
  }, {
1331
1333
  F: __dxlog_file6,
1332
- L: 150,
1334
+ L: 151,
1333
1335
  S: this,
1334
1336
  C: (f, a) => f(...a)
1335
1337
  });
@@ -1344,7 +1346,7 @@ var InvitationHostExtension = class extends RpcExtension {
1344
1346
  }
1345
1347
  }), {
1346
1348
  F: __dxlog_file6,
1347
- L: 156,
1349
+ L: 157,
1348
1350
  S: this,
1349
1351
  C: (f, a) => f(...a)
1350
1352
  });
@@ -1358,14 +1360,14 @@ var InvitationHostExtension = class extends RpcExtension {
1358
1360
  id: traceId
1359
1361
  }), {
1360
1362
  F: __dxlog_file6,
1361
- L: 162,
1363
+ L: 163,
1362
1364
  S: this,
1363
1365
  C: (f, a) => f(...a)
1364
1366
  });
1365
1367
  try {
1366
1368
  invariant5(this.invitation, "Invitation is not set.", {
1367
1369
  F: __dxlog_file6,
1368
- L: 165,
1370
+ L: 166,
1369
1371
  S: this,
1370
1372
  A: [
1371
1373
  "this.invitation",
@@ -1380,7 +1382,7 @@ var InvitationHostExtension = class extends RpcExtension {
1380
1382
  id: traceId
1381
1383
  }), {
1382
1384
  F: __dxlog_file6,
1383
- L: 173,
1385
+ L: 174,
1384
1386
  S: this,
1385
1387
  C: (f, a) => f(...a)
1386
1388
  });
@@ -1437,7 +1439,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1437
1439
  options: async (options) => {
1438
1440
  invariant5(!this._remoteOptions, "Remote options already set.", {
1439
1441
  F: __dxlog_file6,
1440
- L: 240,
1442
+ L: 241,
1441
1443
  S: this,
1442
1444
  A: [
1443
1445
  "!this._remoteOptions",
@@ -1464,7 +1466,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1464
1466
  try {
1465
1467
  log4("begin options", void 0, {
1466
1468
  F: __dxlog_file6,
1467
- L: 261,
1469
+ L: 262,
1468
1470
  S: this,
1469
1471
  C: (f, a) => f(...a)
1470
1472
  });
@@ -1476,7 +1478,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1476
1478
  }));
1477
1479
  log4("end options", void 0, {
1478
1480
  F: __dxlog_file6,
1479
- L: 264,
1481
+ L: 265,
1480
1482
  S: this,
1481
1483
  C: (f, a) => f(...a)
1482
1484
  });
@@ -1490,7 +1492,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1490
1492
  } catch (err) {
1491
1493
  log4("openError", err, {
1492
1494
  F: __dxlog_file6,
1493
- L: 274,
1495
+ L: 275,
1494
1496
  S: this,
1495
1497
  C: (f, a) => f(...a)
1496
1498
  });
@@ -1500,7 +1502,7 @@ var InvitationGuestExtension = class extends RpcExtension {
1500
1502
  async onClose() {
1501
1503
  log4("onClose", void 0, {
1502
1504
  F: __dxlog_file6,
1503
- L: 280,
1505
+ L: 281,
1504
1506
  S: this,
1505
1507
  C: (f, a) => f(...a)
1506
1508
  });
@@ -1523,7 +1525,7 @@ var InvitationsHandler = class {
1523
1525
  const authCode = options?.authCode ?? (authMethod === Invitation3.AuthMethod.SHARED_SECRET ? generatePasscode(AUTHENTICATION_CODE_LENGTH) : void 0);
1524
1526
  invariant6(protocol, void 0, {
1525
1527
  F: __dxlog_file7,
1526
- L: 75,
1528
+ L: 76,
1527
1529
  S: this,
1528
1530
  A: [
1529
1531
  "protocol",
@@ -1552,7 +1554,7 @@ var InvitationsHandler = class {
1552
1554
  ...protocol.toJSON()
1553
1555
  }, {
1554
1556
  F: __dxlog_file7,
1555
- L: 97,
1557
+ L: 98,
1556
1558
  S: this,
1557
1559
  C: (f, a) => f(...a)
1558
1560
  });
@@ -1577,7 +1579,7 @@ var InvitationsHandler = class {
1577
1579
  const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
1578
1580
  invariant6(deviceKey, void 0, {
1579
1581
  F: __dxlog_file7,
1580
- L: 118,
1582
+ L: 119,
1581
1583
  S: this,
1582
1584
  A: [
1583
1585
  "deviceKey",
@@ -1600,7 +1602,7 @@ var InvitationsHandler = class {
1600
1602
  id: traceId
1601
1603
  }), {
1602
1604
  F: __dxlog_file7,
1603
- L: 136,
1605
+ L: 137,
1604
1606
  S: this,
1605
1607
  C: (f, a) => f(...a)
1606
1608
  });
@@ -1608,7 +1610,7 @@ var InvitationsHandler = class {
1608
1610
  ...protocol.toJSON()
1609
1611
  }, {
1610
1612
  F: __dxlog_file7,
1611
- L: 137,
1613
+ L: 138,
1612
1614
  S: this,
1613
1615
  C: (f, a) => f(...a)
1614
1616
  });
@@ -1624,7 +1626,7 @@ var InvitationsHandler = class {
1624
1626
  ...protocol.toJSON()
1625
1627
  }, {
1626
1628
  F: __dxlog_file7,
1627
- L: 140,
1629
+ L: 141,
1628
1630
  S: this,
1629
1631
  C: (f, a) => f(...a)
1630
1632
  });
@@ -1636,7 +1638,7 @@ var InvitationsHandler = class {
1636
1638
  id: traceId
1637
1639
  }), {
1638
1640
  F: __dxlog_file7,
1639
- L: 142,
1641
+ L: 143,
1640
1642
  S: this,
1641
1643
  C: (f, a) => f(...a)
1642
1644
  });
@@ -1646,7 +1648,7 @@ var InvitationsHandler = class {
1646
1648
  ...protocol.toJSON()
1647
1649
  }, {
1648
1650
  F: __dxlog_file7,
1649
- L: 145,
1651
+ L: 146,
1650
1652
  S: this,
1651
1653
  C: (f, a) => f(...a)
1652
1654
  });
@@ -1657,7 +1659,7 @@ var InvitationsHandler = class {
1657
1659
  } else {
1658
1660
  log5.error("failed", err, {
1659
1661
  F: __dxlog_file7,
1660
- L: 148,
1662
+ L: 149,
1661
1663
  S: this,
1662
1664
  C: (f, a) => f(...a)
1663
1665
  });
@@ -1668,7 +1670,7 @@ var InvitationsHandler = class {
1668
1670
  error: err
1669
1671
  }), {
1670
1672
  F: __dxlog_file7,
1671
- L: 151,
1673
+ L: 152,
1672
1674
  S: this,
1673
1675
  C: (f, a) => f(...a)
1674
1676
  });
@@ -1689,7 +1691,7 @@ var InvitationsHandler = class {
1689
1691
  ...protocol.toJSON()
1690
1692
  }, {
1691
1693
  F: __dxlog_file7,
1692
- L: 166,
1694
+ L: 167,
1693
1695
  S: this,
1694
1696
  C: (f, a) => f(...a)
1695
1697
  });
@@ -1700,7 +1702,7 @@ var InvitationsHandler = class {
1700
1702
  } else {
1701
1703
  log5.error("failed", err, {
1702
1704
  F: __dxlog_file7,
1703
- L: 169,
1705
+ L: 170,
1704
1706
  S: this,
1705
1707
  C: (f, a) => f(...a)
1706
1708
  });
@@ -1745,7 +1747,7 @@ var InvitationsHandler = class {
1745
1747
  const { timeout = INVITATION_TIMEOUT } = invitation;
1746
1748
  invariant6(protocol, void 0, {
1747
1749
  F: __dxlog_file7,
1748
- L: 210,
1750
+ L: 211,
1749
1751
  S: this,
1750
1752
  A: [
1751
1753
  "protocol",
@@ -1759,7 +1761,7 @@ var InvitationsHandler = class {
1759
1761
  const setState = (newData) => {
1760
1762
  invariant6(newData.state !== void 0, void 0, {
1761
1763
  F: __dxlog_file7,
1762
- L: 221,
1764
+ L: 222,
1763
1765
  S: this,
1764
1766
  A: [
1765
1767
  "newData.state !== undefined",
@@ -1779,7 +1781,7 @@ var InvitationsHandler = class {
1779
1781
  ...protocol.toJSON()
1780
1782
  }, {
1781
1783
  F: __dxlog_file7,
1782
- L: 229,
1784
+ L: 230,
1783
1785
  S: this,
1784
1786
  C: (f, a) => f(...a)
1785
1787
  });
@@ -1789,7 +1791,7 @@ var InvitationsHandler = class {
1789
1791
  } else {
1790
1792
  log5.warn("auth failed", err, {
1791
1793
  F: __dxlog_file7,
1792
- L: 232,
1794
+ L: 233,
1793
1795
  S: this,
1794
1796
  C: (f, a) => f(...a)
1795
1797
  });
@@ -1803,7 +1805,7 @@ var InvitationsHandler = class {
1803
1805
  ...protocol.toJSON()
1804
1806
  }, {
1805
1807
  F: __dxlog_file7,
1806
- L: 240,
1808
+ L: 241,
1807
1809
  S: this,
1808
1810
  C: (f, a) => f(...a)
1809
1811
  });
@@ -1818,7 +1820,7 @@ var InvitationsHandler = class {
1818
1820
  currentState
1819
1821
  }, {
1820
1822
  F: __dxlog_file7,
1821
- L: 250,
1823
+ L: 251,
1822
1824
  S: this,
1823
1825
  C: (f, a) => f(...a)
1824
1826
  });
@@ -1833,7 +1835,7 @@ var InvitationsHandler = class {
1833
1835
  id: traceId
1834
1836
  }), {
1835
1837
  F: __dxlog_file7,
1836
- L: 259,
1838
+ L: 260,
1837
1839
  S: this,
1838
1840
  C: (f, a) => f(...a)
1839
1841
  });
@@ -1845,7 +1847,7 @@ var InvitationsHandler = class {
1845
1847
  ...protocol.toJSON()
1846
1848
  }, {
1847
1849
  F: __dxlog_file7,
1848
- L: 267,
1850
+ L: 268,
1849
1851
  S: this,
1850
1852
  C: (f, a) => f(...a)
1851
1853
  });
@@ -1856,7 +1858,7 @@ var InvitationsHandler = class {
1856
1858
  ...protocol.toJSON()
1857
1859
  }, {
1858
1860
  F: __dxlog_file7,
1859
- L: 271,
1861
+ L: 272,
1860
1862
  S: this,
1861
1863
  C: (f, a) => f(...a)
1862
1864
  });
@@ -1866,7 +1868,7 @@ var InvitationsHandler = class {
1866
1868
  response: introductionResponse
1867
1869
  }, {
1868
1870
  F: __dxlog_file7,
1869
- L: 275,
1871
+ L: 276,
1870
1872
  S: this,
1871
1873
  C: (f, a) => f(...a)
1872
1874
  });
@@ -1878,7 +1880,7 @@ var InvitationsHandler = class {
1878
1880
  for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
1879
1881
  log5("guest waiting for authentication code...", void 0, {
1880
1882
  F: __dxlog_file7,
1881
- L: 284,
1883
+ L: 285,
1882
1884
  S: this,
1883
1885
  C: (f, a) => f(...a)
1884
1886
  });
@@ -1890,7 +1892,7 @@ var InvitationsHandler = class {
1890
1892
  });
1891
1893
  log5("sending authentication request", void 0, {
1892
1894
  F: __dxlog_file7,
1893
- L: 288,
1895
+ L: 289,
1894
1896
  S: this,
1895
1897
  C: (f, a) => f(...a)
1896
1898
  });
@@ -1911,7 +1913,7 @@ var InvitationsHandler = class {
1911
1913
  attempt
1912
1914
  }, {
1913
1915
  F: __dxlog_file7,
1914
- L: 299,
1916
+ L: 300,
1915
1917
  S: this,
1916
1918
  C: (f, a) => f(...a)
1917
1919
  });
@@ -1928,7 +1930,7 @@ var InvitationsHandler = class {
1928
1930
  ...protocol.toJSON()
1929
1931
  }, {
1930
1932
  F: __dxlog_file7,
1931
- L: 310,
1933
+ L: 311,
1932
1934
  S: this,
1933
1935
  C: (f, a) => f(...a)
1934
1936
  });
@@ -1940,7 +1942,7 @@ var InvitationsHandler = class {
1940
1942
  ...protocol.toJSON()
1941
1943
  }, {
1942
1944
  F: __dxlog_file7,
1943
- L: 321,
1945
+ L: 322,
1944
1946
  S: this,
1945
1947
  C: (f, a) => f(...a)
1946
1948
  });
@@ -1952,7 +1954,7 @@ var InvitationsHandler = class {
1952
1954
  id: traceId
1953
1955
  }), {
1954
1956
  F: __dxlog_file7,
1955
- L: 323,
1957
+ L: 324,
1956
1958
  S: this,
1957
1959
  C: (f, a) => f(...a)
1958
1960
  });
@@ -1962,7 +1964,7 @@ var InvitationsHandler = class {
1962
1964
  ...protocol.toJSON()
1963
1965
  }, {
1964
1966
  F: __dxlog_file7,
1965
- L: 326,
1967
+ L: 327,
1966
1968
  S: this,
1967
1969
  C: (f, a) => f(...a)
1968
1970
  });
@@ -1972,7 +1974,7 @@ var InvitationsHandler = class {
1972
1974
  } else {
1973
1975
  log5("auth failed", err, {
1974
1976
  F: __dxlog_file7,
1975
- L: 329,
1977
+ L: 330,
1976
1978
  S: this,
1977
1979
  C: (f, a) => f(...a)
1978
1980
  });
@@ -1983,7 +1985,7 @@ var InvitationsHandler = class {
1983
1985
  error: err
1984
1986
  }), {
1985
1987
  F: __dxlog_file7,
1986
- L: 332,
1988
+ L: 333,
1987
1989
  S: this,
1988
1990
  C: (f, a) => f(...a)
1989
1991
  });
@@ -2001,7 +2003,7 @@ var InvitationsHandler = class {
2001
2003
  ...protocol.toJSON()
2002
2004
  }, {
2003
2005
  F: __dxlog_file7,
2004
- L: 343,
2006
+ L: 344,
2005
2007
  S: this,
2006
2008
  C: (f, a) => f(...a)
2007
2009
  });
@@ -2011,7 +2013,7 @@ var InvitationsHandler = class {
2011
2013
  } else {
2012
2014
  log5("auth failed", err, {
2013
2015
  F: __dxlog_file7,
2014
- L: 346,
2016
+ L: 347,
2015
2017
  S: this,
2016
2018
  C: (f, a) => f(...a)
2017
2019
  });
@@ -2024,7 +2026,7 @@ var InvitationsHandler = class {
2024
2026
  scheduleTask2(ctx, async () => {
2025
2027
  invariant6(invitation.swarmKey, void 0, {
2026
2028
  F: __dxlog_file7,
2027
- L: 356,
2029
+ L: 357,
2028
2030
  S: this,
2029
2031
  A: [
2030
2032
  "invitation.swarmKey",
@@ -2471,7 +2473,7 @@ import { STORAGE_VERSION } from "@dxos/protocols";
2471
2473
  import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
2472
2474
 
2473
2475
  // packages/sdk/client-services/src/version.ts
2474
- var DXOS_VERSION = "0.1.58-main.e460f33";
2476
+ var DXOS_VERSION = "0.1.58-main.e4cedde";
2475
2477
 
2476
2478
  // packages/sdk/client-services/src/packlets/services/platform.ts
2477
2479
  var getPlatform = () => {
@@ -2625,9 +2627,9 @@ import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
2625
2627
  import { cancelWithContext as cancelWithContext2, Context as Context7 } from "@dxos/context";
2626
2628
  import { timed } from "@dxos/debug";
2627
2629
  import { createMappedFeedWriter } from "@dxos/echo-pipeline";
2630
+ import { CancelledError, SystemError } from "@dxos/errors";
2628
2631
  import { PublicKey as PublicKey7 } from "@dxos/keys";
2629
2632
  import { log as log10 } from "@dxos/log";
2630
- import { CancelledError, SystemError } from "@dxos/protocols";
2631
2633
  import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
2632
2634
  import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
2633
2635
  import { Timeframe as Timeframe2 } from "@dxos/timeframe";
@@ -2936,7 +2938,7 @@ var DataSpace = class DataSpace2 {
2936
2938
  this._signingContext = params.signingContext;
2937
2939
  this._callbacks = params.callbacks ?? {};
2938
2940
  this.authVerifier = new TrustedKeySetAuthVerifier({
2939
- trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
2941
+ trustedKeysProvider: () => new ComplexSet2(PublicKey7.hash, Array.from(this._inner.spaceState.members.keys())),
2940
2942
  update: this._inner.stateUpdate,
2941
2943
  authTimeout: AUTH_TIMEOUT2
2942
2944
  });
@@ -2946,7 +2948,7 @@ var DataSpace = class DataSpace2 {
2946
2948
  state: SpaceState[this._state]
2947
2949
  }, {
2948
2950
  F: __dxlog_file12,
2949
- L: 118,
2951
+ L: 112,
2950
2952
  S: this,
2951
2953
  C: (f, a) => f(...a)
2952
2954
  });
@@ -2989,7 +2991,7 @@ var DataSpace = class DataSpace2 {
2989
2991
  state: SpaceState[this._state]
2990
2992
  }, {
2991
2993
  F: __dxlog_file12,
2992
- L: 165,
2994
+ L: 159,
2993
2995
  S: this,
2994
2996
  C: (f, a) => f(...a)
2995
2997
  });
@@ -3007,7 +3009,7 @@ var DataSpace = class DataSpace2 {
3007
3009
  state: SpaceState[this._state]
3008
3010
  }, {
3009
3011
  F: __dxlog_file12,
3010
- L: 179,
3012
+ L: 173,
3011
3013
  S: this,
3012
3014
  C: (f, a) => f(...a)
3013
3015
  });
@@ -3038,7 +3040,7 @@ var DataSpace = class DataSpace2 {
3038
3040
  if (err instanceof CancelledError) {
3039
3041
  log10("data pipeline initialization cancelled", err, {
3040
3042
  F: __dxlog_file12,
3041
- L: 211,
3043
+ L: 205,
3042
3044
  S: this,
3043
3045
  C: (f, a) => f(...a)
3044
3046
  });
@@ -3046,7 +3048,7 @@ var DataSpace = class DataSpace2 {
3046
3048
  }
3047
3049
  log10.error("Error initializing data pipeline", err, {
3048
3050
  F: __dxlog_file12,
3049
- L: 215,
3051
+ L: 209,
3050
3052
  S: this,
3051
3053
  C: (f, a) => f(...a)
3052
3054
  });
@@ -3055,7 +3057,7 @@ var DataSpace = class DataSpace2 {
3055
3057
  state: SpaceState[this._state]
3056
3058
  }, {
3057
3059
  F: __dxlog_file12,
3058
- L: 217,
3060
+ L: 211,
3059
3061
  S: this,
3060
3062
  C: (f, a) => f(...a)
3061
3063
  });
@@ -3075,7 +3077,7 @@ var DataSpace = class DataSpace2 {
3075
3077
  state: SpaceState[this._state]
3076
3078
  }, {
3077
3079
  F: __dxlog_file12,
3078
- L: 233,
3080
+ L: 227,
3079
3081
  S: this,
3080
3082
  C: (f, a) => f(...a)
3081
3083
  });
@@ -3086,7 +3088,7 @@ var DataSpace = class DataSpace2 {
3086
3088
  await cancelWithContext2(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
3087
3089
  log10("waiting for data pipeline to reach target timeframe", void 0, {
3088
3090
  F: __dxlog_file12,
3089
- L: 247,
3091
+ L: 241,
3090
3092
  S: this,
3091
3093
  C: (f, a) => f(...a)
3092
3094
  });
@@ -3097,7 +3099,7 @@ var DataSpace = class DataSpace2 {
3097
3099
  this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
3098
3100
  log10("data pipeline ready", void 0, {
3099
3101
  F: __dxlog_file12,
3100
- L: 256,
3102
+ L: 250,
3101
3103
  S: this,
3102
3104
  C: (f, a) => f(...a)
3103
3105
  });
@@ -3107,7 +3109,7 @@ var DataSpace = class DataSpace2 {
3107
3109
  state: SpaceState[this._state]
3108
3110
  }, {
3109
3111
  F: __dxlog_file12,
3110
- L: 260,
3112
+ L: 254,
3111
3113
  S: this,
3112
3114
  C: (f, a) => f(...a)
3113
3115
  });
@@ -3123,7 +3125,7 @@ var DataSpace = class DataSpace2 {
3123
3125
  await this._createWritableFeeds();
3124
3126
  log10("writable feeds created", void 0, {
3125
3127
  F: __dxlog_file12,
3126
- L: 276,
3128
+ L: 270,
3127
3129
  S: this,
3128
3130
  C: (f, a) => f(...a)
3129
3131
  });
@@ -3228,7 +3230,7 @@ var DataSpace = class DataSpace2 {
3228
3230
  state: SpaceState[this._state]
3229
3231
  }, {
3230
3232
  F: __dxlog_file12,
3231
- L: 392,
3233
+ L: 386,
3232
3234
  S: this,
3233
3235
  C: (f, a) => f(...a)
3234
3236
  });
@@ -3682,9 +3684,10 @@ DataSpaceManager = _ts_decorate4([
3682
3684
  import { EventSubscriptions as EventSubscriptions2, UpdateScheduler, scheduleTask as scheduleTask5 } from "@dxos/async";
3683
3685
  import { Stream as Stream10 } from "@dxos/codec-protobuf";
3684
3686
  import { raise as raise2 } from "@dxos/debug";
3685
- import { invariant as invariant12 } from "@dxos/invariant";
3687
+ import { SpaceNotFoundError } from "@dxos/echo-pipeline";
3688
+ import { ApiError } from "@dxos/errors";
3686
3689
  import { log as log12 } from "@dxos/log";
3687
- import { ApiError, SpaceNotFoundError, encodeError } from "@dxos/protocols";
3690
+ import { encodeError } from "@dxos/protocols";
3688
3691
  import { SpaceMember as SpaceMember3, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
3689
3692
  var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
3690
3693
  var SpacesServiceImpl = class {
@@ -3784,8 +3787,8 @@ var SpacesServiceImpl = class {
3784
3787
  });
3785
3788
  });
3786
3789
  }
3787
- queryCredentials({ spaceKey, noTail }) {
3788
- return new Stream10(({ ctx, next, close }) => {
3790
+ queryCredentials({ spaceKey }) {
3791
+ return new Stream10(({ ctx, next }) => {
3789
3792
  const space = this._spaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError(spaceKey));
3790
3793
  const processor = {
3791
3794
  processCredential: async (credential) => {
@@ -3793,62 +3796,17 @@ var SpacesServiceImpl = class {
3793
3796
  }
3794
3797
  };
3795
3798
  ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
3796
- scheduleTask5(ctx, async () => {
3797
- await space.spaceState.addCredentialProcessor(processor);
3798
- if (noTail) {
3799
- close();
3800
- }
3801
- });
3799
+ scheduleTask5(ctx, () => space.spaceState.addCredentialProcessor(processor));
3802
3800
  });
3803
3801
  }
3804
3802
  async writeCredentials({ spaceKey, credentials }) {
3805
3803
  const space = this._spaceManager.spaces.get(spaceKey) ?? raise2(new SpaceNotFoundError(spaceKey));
3806
3804
  for (const credential of credentials ?? []) {
3807
- if (credential.proof) {
3808
- await space.controlPipeline.writer.write({
3809
- credential: {
3810
- credential
3811
- }
3812
- });
3813
- } else {
3814
- invariant12(!credential.id, "Id on unsigned credentials is not allowed", {
3815
- F: __dxlog_file14,
3816
- L: 168,
3817
- S: this,
3818
- A: [
3819
- "!credential.id",
3820
- "'Id on unsigned credentials is not allowed'"
3821
- ]
3822
- });
3823
- invariant12(this._identityManager.identity, "Identity is not available", {
3824
- F: __dxlog_file14,
3825
- L: 169,
3826
- S: this,
3827
- A: [
3828
- "this._identityManager.identity",
3829
- "'Identity is not available'"
3830
- ]
3831
- });
3832
- const signer = this._identityManager.identity.getIdentityCredentialSigner();
3833
- invariant12(credential.issuer.equals(signer.getIssuer()), void 0, {
3834
- F: __dxlog_file14,
3835
- L: 171,
3836
- S: this,
3837
- A: [
3838
- "credential.issuer.equals(signer.getIssuer())",
3839
- ""
3840
- ]
3841
- });
3842
- const signedCredential = await signer.createCredential({
3843
- subject: credential.subject.id,
3844
- assertion: credential.subject.assertion
3845
- });
3846
- await space.controlPipeline.writer.write({
3847
- credential: {
3848
- credential: signedCredential
3849
- }
3850
- });
3851
- }
3805
+ await space.controlPipeline.writer.write({
3806
+ credential: {
3807
+ credential
3808
+ }
3809
+ });
3852
3810
  }
3853
3811
  }
3854
3812
  async createEpoch({ spaceKey }) {
@@ -3887,7 +3845,7 @@ var SpacesServiceImpl = class {
3887
3845
  displayName: member.assertion.profile?.displayName
3888
3846
  }
3889
3847
  },
3890
- presence: member.removed ? SpaceMember3.PresenceState.REMOVED : isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
3848
+ presence: isMe || peers.length > 0 ? SpaceMember3.PresenceState.ONLINE : SpaceMember3.PresenceState.OFFLINE,
3891
3849
  peerStates: peers
3892
3850
  };
3893
3851
  }),
@@ -3906,11 +3864,11 @@ import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credent
3906
3864
  import { failUndefined as failUndefined3 } from "@dxos/debug";
3907
3865
  import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore } from "@dxos/echo-pipeline";
3908
3866
  import { FeedFactory, FeedStore } from "@dxos/feed-store";
3909
- import { invariant as invariant13 } from "@dxos/invariant";
3867
+ import { invariant as invariant12 } from "@dxos/invariant";
3910
3868
  import { Keyring } from "@dxos/keyring";
3911
3869
  import { PublicKey as PublicKey9 } from "@dxos/keys";
3912
3870
  import { log as log13 } from "@dxos/log";
3913
- import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
3871
+ import { STORAGE_VERSION as STORAGE_VERSION2, trace as trace7 } from "@dxos/protocols";
3914
3872
  import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
3915
3873
  import { BlobStore } from "@dxos/teleport-extension-object-sync";
3916
3874
  import { trace as Trace2 } from "@dxos/tracing";
@@ -4034,7 +3992,7 @@ var ServiceContext = class ServiceContext2 {
4034
3992
  }
4035
3993
  getInvitationHandler(invitation) {
4036
3994
  const factory = this._handlerFactories.get(invitation.kind);
4037
- invariant13(factory, `Unknown invitation kind: ${invitation.kind}`, {
3995
+ invariant12(factory, `Unknown invitation kind: ${invitation.kind}`, {
4038
3996
  F: __dxlog_file15,
4039
3997
  L: 174,
4040
3998
  S: this,
@@ -4053,7 +4011,7 @@ var ServiceContext = class ServiceContext2 {
4053
4011
  async _checkStorageVersion() {
4054
4012
  await this.metadataStore.load();
4055
4013
  if (this.metadataStore.version !== STORAGE_VERSION2) {
4056
- throw new InvalidStorageVersionError(STORAGE_VERSION2, this.metadataStore.version);
4014
+ throw new Error(`Invalid storage version: current=${this.metadataStore.version}, expected=${STORAGE_VERSION2}`);
4057
4015
  }
4058
4016
  }
4059
4017
  // Called when identity is created.
@@ -4081,7 +4039,7 @@ var ServiceContext = class ServiceContext2 {
4081
4039
  this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
4082
4040
  await this.dataSpaceManager.open();
4083
4041
  this._handlerFactories.set(Invitation6.Kind.SPACE, (invitation) => {
4084
- invariant13(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
4042
+ invariant12(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
4085
4043
  F: __dxlog_file15,
4086
4044
  L: 218,
4087
4045
  S: this,
@@ -4287,7 +4245,7 @@ var isLocked = (lockPath) => {
4287
4245
 
4288
4246
  // packages/sdk/client-services/src/packlets/storage/storage.ts
4289
4247
  import { DX_DATA } from "@dxos/client-protocol";
4290
- import { InvalidConfigError } from "@dxos/protocols";
4248
+ import { InvalidConfigError } from "@dxos/errors";
4291
4249
  import { Runtime } from "@dxos/protocols/proto/dxos/config";
4292
4250
  import { createStorage, StorageType } from "@dxos/random-access-storage";
4293
4251
  import { isNode } from "@dxos/util";
@@ -4364,7 +4322,7 @@ import { clientServiceBundle } from "@dxos/client-protocol";
4364
4322
  import { Context as Context10 } from "@dxos/context";
4365
4323
  import { DocumentModel as DocumentModel2 } from "@dxos/document-model";
4366
4324
  import { DataServiceImpl } from "@dxos/echo-pipeline";
4367
- import { invariant as invariant14 } from "@dxos/invariant";
4325
+ import { invariant as invariant13 } from "@dxos/invariant";
4368
4326
  import { PublicKey as PublicKey10 } from "@dxos/keys";
4369
4327
  import { log as log16 } from "@dxos/log";
4370
4328
  import { WebsocketSignalManager } from "@dxos/messaging";
@@ -4721,7 +4679,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4721
4679
  * Can only be called once.
4722
4680
  */
4723
4681
  initialize({ config, ...options }) {
4724
- invariant14(!this._open, "service host is open", {
4682
+ invariant13(!this._open, "service host is open", {
4725
4683
  F: __dxlog_file17,
4726
4684
  L: 184,
4727
4685
  S: this,
@@ -4737,7 +4695,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4737
4695
  C: (f, a) => f(...a)
4738
4696
  });
4739
4697
  if (config) {
4740
- invariant14(!this._config, "config already set", {
4698
+ invariant13(!this._config, "config already set", {
4741
4699
  F: __dxlog_file17,
4742
4700
  L: 188,
4743
4701
  S: this,
@@ -4755,7 +4713,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4755
4713
  iceServers: this._config?.get("runtime.services.ice")
4756
4714
  }), signalManager = new WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
4757
4715
  this._signalManager = signalManager;
4758
- invariant14(!this._networkManager, "network manager already set", {
4716
+ invariant13(!this._networkManager, "network manager already set", {
4759
4717
  F: __dxlog_file17,
4760
4718
  L: 204,
4761
4719
  S: this,
@@ -4789,7 +4747,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4789
4747
  S: this,
4790
4748
  C: (f, a) => f(...a)
4791
4749
  });
4792
- invariant14(this._config, "config not set", {
4750
+ invariant13(this._config, "config not set", {
4793
4751
  F: __dxlog_file17,
4794
4752
  L: 224,
4795
4753
  S: this,
@@ -4798,7 +4756,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4798
4756
  "'config not set'"
4799
4757
  ]
4800
4758
  });
4801
- invariant14(this._storage, "storage not set", {
4759
+ invariant13(this._storage, "storage not set", {
4802
4760
  F: __dxlog_file17,
4803
4761
  L: 225,
4804
4762
  S: this,
@@ -4807,7 +4765,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4807
4765
  "'storage not set'"
4808
4766
  ]
4809
4767
  });
4810
- invariant14(this._signalManager, "signal manager not set", {
4768
+ invariant13(this._signalManager, "signal manager not set", {
4811
4769
  F: __dxlog_file17,
4812
4770
  L: 226,
4813
4771
  S: this,
@@ -4816,7 +4774,7 @@ var ClientServicesHost = class ClientServicesHost2 {
4816
4774
  "'signal manager not set'"
4817
4775
  ]
4818
4776
  });
4819
- invariant14(this._networkManager, "network manager not set", {
4777
+ invariant13(this._networkManager, "network manager not set", {
4820
4778
  F: __dxlog_file17,
4821
4779
  L: 227,
4822
4780
  S: this,
@@ -5005,4 +4963,4 @@ export {
5005
4963
  createDefaultModelFactory,
5006
4964
  ClientServicesHost
5007
4965
  };
5008
- //# sourceMappingURL=chunk-PNAXUNJ7.mjs.map
4966
+ //# sourceMappingURL=chunk-FIKNAQOZ.mjs.map