@dxos/client-services 0.1.58-main.e4cedde → 0.1.58-main.f5feb2a
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.
- package/dist/lib/browser/{chunk-FIKNAQOZ.mjs → chunk-L426VUEE.mjs} +144 -102
- package/dist/lib/browser/chunk-L426VUEE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -6
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +3 -3
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +190 -147
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +189 -147
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +5 -5
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -35
- package/src/packlets/identity/authenticator.ts +1 -1
- package/src/packlets/invitations/invitation-extension.ts +1 -2
- package/src/packlets/invitations/invitations-handler.ts +7 -8
- package/src/packlets/invitations/invitations-service.ts +5 -5
- package/src/packlets/services/service-context.ts +2 -2
- package/src/packlets/spaces/data-space.ts +8 -2
- package/src/packlets/spaces/spaces-service.ts +29 -8
- package/src/packlets/storage/storage.ts +1 -1
- package/src/packlets/testing/invitation-utils.ts +9 -9
- package/src/packlets/vault/iframe-proxy-runtime.ts +1 -1
- package/src/packlets/vault/shell-runtime.ts +4 -4
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-FIKNAQOZ.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -1220,7 +1220,6 @@ var import_async8 = require("@dxos/async");
|
|
|
1220
1220
|
var import_client_protocol2 = require("@dxos/client-protocol");
|
|
1221
1221
|
var import_context5 = require("@dxos/context");
|
|
1222
1222
|
var import_credentials7 = require("@dxos/credentials");
|
|
1223
|
-
var import_errors2 = require("@dxos/errors");
|
|
1224
1223
|
var import_invariant6 = require("@dxos/invariant");
|
|
1225
1224
|
var import_keys6 = require("@dxos/keys");
|
|
1226
1225
|
var import_log5 = require("@dxos/log");
|
|
@@ -1232,7 +1231,6 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
|
|
|
1232
1231
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
1233
1232
|
var import_async7 = require("@dxos/async");
|
|
1234
1233
|
var import_context4 = require("@dxos/context");
|
|
1235
|
-
var import_errors = require("@dxos/errors");
|
|
1236
1234
|
var import_invariant5 = require("@dxos/invariant");
|
|
1237
1235
|
var import_keys5 = require("@dxos/keys");
|
|
1238
1236
|
var import_log4 = require("@dxos/log");
|
|
@@ -1270,7 +1268,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1270
1268
|
options: async (options) => {
|
|
1271
1269
|
(0, import_invariant5.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1272
1270
|
F: __dxlog_file6,
|
|
1273
|
-
L:
|
|
1271
|
+
L: 87,
|
|
1274
1272
|
S: this,
|
|
1275
1273
|
A: [
|
|
1276
1274
|
"!this._remoteOptions",
|
|
@@ -1287,7 +1285,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1287
1285
|
id: traceId
|
|
1288
1286
|
}), {
|
|
1289
1287
|
F: __dxlog_file6,
|
|
1290
|
-
L:
|
|
1288
|
+
L: 96,
|
|
1291
1289
|
S: this,
|
|
1292
1290
|
C: (f, a) => f(...a)
|
|
1293
1291
|
});
|
|
@@ -1297,7 +1295,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1297
1295
|
invitationId
|
|
1298
1296
|
}, {
|
|
1299
1297
|
F: __dxlog_file6,
|
|
1300
|
-
L:
|
|
1298
|
+
L: 100,
|
|
1301
1299
|
S: this,
|
|
1302
1300
|
C: (f, a) => f(...a)
|
|
1303
1301
|
});
|
|
@@ -1311,7 +1309,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1311
1309
|
guestProfile: profile
|
|
1312
1310
|
}, {
|
|
1313
1311
|
F: __dxlog_file6,
|
|
1314
|
-
L:
|
|
1312
|
+
L: 109,
|
|
1315
1313
|
S: this,
|
|
1316
1314
|
C: (f, a) => f(...a)
|
|
1317
1315
|
});
|
|
@@ -1324,7 +1322,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1324
1322
|
id: traceId
|
|
1325
1323
|
}), {
|
|
1326
1324
|
F: __dxlog_file6,
|
|
1327
|
-
L:
|
|
1325
|
+
L: 116,
|
|
1328
1326
|
S: this,
|
|
1329
1327
|
C: (f, a) => f(...a)
|
|
1330
1328
|
});
|
|
@@ -1339,7 +1337,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1339
1337
|
id: traceId
|
|
1340
1338
|
}), {
|
|
1341
1339
|
F: __dxlog_file6,
|
|
1342
|
-
L:
|
|
1340
|
+
L: 125,
|
|
1343
1341
|
S: this,
|
|
1344
1342
|
C: (f, a) => f(...a)
|
|
1345
1343
|
});
|
|
@@ -1347,14 +1345,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1347
1345
|
authCode: code
|
|
1348
1346
|
}, {
|
|
1349
1347
|
F: __dxlog_file6,
|
|
1350
|
-
L:
|
|
1348
|
+
L: 126,
|
|
1351
1349
|
S: this,
|
|
1352
1350
|
C: (f, a) => f(...a)
|
|
1353
1351
|
});
|
|
1354
1352
|
let status = import_invitations.AuthenticationResponse.Status.OK;
|
|
1355
1353
|
(0, import_invariant5.invariant)(this.invitation, "Invitation is not set.", {
|
|
1356
1354
|
F: __dxlog_file6,
|
|
1357
|
-
L:
|
|
1355
|
+
L: 129,
|
|
1358
1356
|
S: this,
|
|
1359
1357
|
A: [
|
|
1360
1358
|
"this.invitation",
|
|
@@ -1365,7 +1363,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1365
1363
|
case import_services2.Invitation.AuthMethod.NONE: {
|
|
1366
1364
|
(0, import_log4.log)("authentication not required", void 0, {
|
|
1367
1365
|
F: __dxlog_file6,
|
|
1368
|
-
L:
|
|
1366
|
+
L: 132,
|
|
1369
1367
|
S: this,
|
|
1370
1368
|
C: (f, a) => f(...a)
|
|
1371
1369
|
});
|
|
@@ -1390,7 +1388,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1390
1388
|
authMethod: this.invitation.authMethod
|
|
1391
1389
|
}, {
|
|
1392
1390
|
F: __dxlog_file6,
|
|
1393
|
-
L:
|
|
1391
|
+
L: 150,
|
|
1394
1392
|
S: this,
|
|
1395
1393
|
C: (f, a) => f(...a)
|
|
1396
1394
|
});
|
|
@@ -1405,7 +1403,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1405
1403
|
}
|
|
1406
1404
|
}), {
|
|
1407
1405
|
F: __dxlog_file6,
|
|
1408
|
-
L:
|
|
1406
|
+
L: 156,
|
|
1409
1407
|
S: this,
|
|
1410
1408
|
C: (f, a) => f(...a)
|
|
1411
1409
|
});
|
|
@@ -1419,14 +1417,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1419
1417
|
id: traceId
|
|
1420
1418
|
}), {
|
|
1421
1419
|
F: __dxlog_file6,
|
|
1422
|
-
L:
|
|
1420
|
+
L: 162,
|
|
1423
1421
|
S: this,
|
|
1424
1422
|
C: (f, a) => f(...a)
|
|
1425
1423
|
});
|
|
1426
1424
|
try {
|
|
1427
1425
|
(0, import_invariant5.invariant)(this.invitation, "Invitation is not set.", {
|
|
1428
1426
|
F: __dxlog_file6,
|
|
1429
|
-
L:
|
|
1427
|
+
L: 165,
|
|
1430
1428
|
S: this,
|
|
1431
1429
|
A: [
|
|
1432
1430
|
"this.invitation",
|
|
@@ -1441,7 +1439,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1441
1439
|
id: traceId
|
|
1442
1440
|
}), {
|
|
1443
1441
|
F: __dxlog_file6,
|
|
1444
|
-
L:
|
|
1442
|
+
L: 173,
|
|
1445
1443
|
S: this,
|
|
1446
1444
|
C: (f, a) => f(...a)
|
|
1447
1445
|
});
|
|
@@ -1464,7 +1462,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1464
1462
|
timeout: OPTIONS_TIMEOUT
|
|
1465
1463
|
}));
|
|
1466
1464
|
if (this._remoteOptions?.role !== import_invitations.Options.Role.GUEST) {
|
|
1467
|
-
throw new
|
|
1465
|
+
throw new import_protocols3.InvalidInvitationExtensionRoleError(void 0, {
|
|
1468
1466
|
expected: import_invitations.Options.Role.GUEST,
|
|
1469
1467
|
remoteOptions: this._remoteOptions
|
|
1470
1468
|
});
|
|
@@ -1498,7 +1496,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1498
1496
|
options: async (options) => {
|
|
1499
1497
|
(0, import_invariant5.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1500
1498
|
F: __dxlog_file6,
|
|
1501
|
-
L:
|
|
1499
|
+
L: 240,
|
|
1502
1500
|
S: this,
|
|
1503
1501
|
A: [
|
|
1504
1502
|
"!this._remoteOptions",
|
|
@@ -1525,7 +1523,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1525
1523
|
try {
|
|
1526
1524
|
(0, import_log4.log)("begin options", void 0, {
|
|
1527
1525
|
F: __dxlog_file6,
|
|
1528
|
-
L:
|
|
1526
|
+
L: 261,
|
|
1529
1527
|
S: this,
|
|
1530
1528
|
C: (f, a) => f(...a)
|
|
1531
1529
|
});
|
|
@@ -1537,12 +1535,12 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1537
1535
|
}));
|
|
1538
1536
|
(0, import_log4.log)("end options", void 0, {
|
|
1539
1537
|
F: __dxlog_file6,
|
|
1540
|
-
L:
|
|
1538
|
+
L: 264,
|
|
1541
1539
|
S: this,
|
|
1542
1540
|
C: (f, a) => f(...a)
|
|
1543
1541
|
});
|
|
1544
1542
|
if (this._remoteOptions?.role !== import_invitations.Options.Role.HOST) {
|
|
1545
|
-
throw new
|
|
1543
|
+
throw new import_protocols3.InvalidInvitationExtensionRoleError(void 0, {
|
|
1546
1544
|
expected: import_invitations.Options.Role.HOST,
|
|
1547
1545
|
remoteOptions: this._remoteOptions
|
|
1548
1546
|
});
|
|
@@ -1551,7 +1549,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1551
1549
|
} catch (err) {
|
|
1552
1550
|
(0, import_log4.log)("openError", err, {
|
|
1553
1551
|
F: __dxlog_file6,
|
|
1554
|
-
L:
|
|
1552
|
+
L: 274,
|
|
1555
1553
|
S: this,
|
|
1556
1554
|
C: (f, a) => f(...a)
|
|
1557
1555
|
});
|
|
@@ -1561,7 +1559,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1561
1559
|
async onClose() {
|
|
1562
1560
|
(0, import_log4.log)("onClose", void 0, {
|
|
1563
1561
|
F: __dxlog_file6,
|
|
1564
|
-
L:
|
|
1562
|
+
L: 280,
|
|
1565
1563
|
S: this,
|
|
1566
1564
|
C: (f, a) => f(...a)
|
|
1567
1565
|
});
|
|
@@ -1584,7 +1582,7 @@ var InvitationsHandler = class {
|
|
|
1584
1582
|
const authCode = options?.authCode ?? (authMethod === import_services3.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials7.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1585
1583
|
(0, import_invariant6.invariant)(protocol, void 0, {
|
|
1586
1584
|
F: __dxlog_file7,
|
|
1587
|
-
L:
|
|
1585
|
+
L: 75,
|
|
1588
1586
|
S: this,
|
|
1589
1587
|
A: [
|
|
1590
1588
|
"protocol",
|
|
@@ -1613,7 +1611,7 @@ var InvitationsHandler = class {
|
|
|
1613
1611
|
...protocol.toJSON()
|
|
1614
1612
|
}, {
|
|
1615
1613
|
F: __dxlog_file7,
|
|
1616
|
-
L:
|
|
1614
|
+
L: 97,
|
|
1617
1615
|
S: this,
|
|
1618
1616
|
C: (f, a) => f(...a)
|
|
1619
1617
|
});
|
|
@@ -1638,7 +1636,7 @@ var InvitationsHandler = class {
|
|
|
1638
1636
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1639
1637
|
(0, import_invariant6.invariant)(deviceKey, void 0, {
|
|
1640
1638
|
F: __dxlog_file7,
|
|
1641
|
-
L:
|
|
1639
|
+
L: 118,
|
|
1642
1640
|
S: this,
|
|
1643
1641
|
A: [
|
|
1644
1642
|
"deviceKey",
|
|
@@ -1661,7 +1659,7 @@ var InvitationsHandler = class {
|
|
|
1661
1659
|
id: traceId
|
|
1662
1660
|
}), {
|
|
1663
1661
|
F: __dxlog_file7,
|
|
1664
|
-
L:
|
|
1662
|
+
L: 136,
|
|
1665
1663
|
S: this,
|
|
1666
1664
|
C: (f, a) => f(...a)
|
|
1667
1665
|
});
|
|
@@ -1669,7 +1667,7 @@ var InvitationsHandler = class {
|
|
|
1669
1667
|
...protocol.toJSON()
|
|
1670
1668
|
}, {
|
|
1671
1669
|
F: __dxlog_file7,
|
|
1672
|
-
L:
|
|
1670
|
+
L: 137,
|
|
1673
1671
|
S: this,
|
|
1674
1672
|
C: (f, a) => f(...a)
|
|
1675
1673
|
});
|
|
@@ -1685,7 +1683,7 @@ var InvitationsHandler = class {
|
|
|
1685
1683
|
...protocol.toJSON()
|
|
1686
1684
|
}, {
|
|
1687
1685
|
F: __dxlog_file7,
|
|
1688
|
-
L:
|
|
1686
|
+
L: 140,
|
|
1689
1687
|
S: this,
|
|
1690
1688
|
C: (f, a) => f(...a)
|
|
1691
1689
|
});
|
|
@@ -1697,7 +1695,7 @@ var InvitationsHandler = class {
|
|
|
1697
1695
|
id: traceId
|
|
1698
1696
|
}), {
|
|
1699
1697
|
F: __dxlog_file7,
|
|
1700
|
-
L:
|
|
1698
|
+
L: 142,
|
|
1701
1699
|
S: this,
|
|
1702
1700
|
C: (f, a) => f(...a)
|
|
1703
1701
|
});
|
|
@@ -1707,7 +1705,7 @@ var InvitationsHandler = class {
|
|
|
1707
1705
|
...protocol.toJSON()
|
|
1708
1706
|
}, {
|
|
1709
1707
|
F: __dxlog_file7,
|
|
1710
|
-
L:
|
|
1708
|
+
L: 145,
|
|
1711
1709
|
S: this,
|
|
1712
1710
|
C: (f, a) => f(...a)
|
|
1713
1711
|
});
|
|
@@ -1718,7 +1716,7 @@ var InvitationsHandler = class {
|
|
|
1718
1716
|
} else {
|
|
1719
1717
|
import_log5.log.error("failed", err, {
|
|
1720
1718
|
F: __dxlog_file7,
|
|
1721
|
-
L:
|
|
1719
|
+
L: 148,
|
|
1722
1720
|
S: this,
|
|
1723
1721
|
C: (f, a) => f(...a)
|
|
1724
1722
|
});
|
|
@@ -1729,7 +1727,7 @@ var InvitationsHandler = class {
|
|
|
1729
1727
|
error: err
|
|
1730
1728
|
}), {
|
|
1731
1729
|
F: __dxlog_file7,
|
|
1732
|
-
L:
|
|
1730
|
+
L: 151,
|
|
1733
1731
|
S: this,
|
|
1734
1732
|
C: (f, a) => f(...a)
|
|
1735
1733
|
});
|
|
@@ -1742,7 +1740,7 @@ var InvitationsHandler = class {
|
|
|
1742
1740
|
});
|
|
1743
1741
|
},
|
|
1744
1742
|
onError: (err) => {
|
|
1745
|
-
if (err instanceof
|
|
1743
|
+
if (err instanceof import_protocols4.InvalidInvitationExtensionRoleError) {
|
|
1746
1744
|
return;
|
|
1747
1745
|
}
|
|
1748
1746
|
if (err instanceof import_async8.TimeoutError) {
|
|
@@ -1750,7 +1748,7 @@ var InvitationsHandler = class {
|
|
|
1750
1748
|
...protocol.toJSON()
|
|
1751
1749
|
}, {
|
|
1752
1750
|
F: __dxlog_file7,
|
|
1753
|
-
L:
|
|
1751
|
+
L: 166,
|
|
1754
1752
|
S: this,
|
|
1755
1753
|
C: (f, a) => f(...a)
|
|
1756
1754
|
});
|
|
@@ -1761,7 +1759,7 @@ var InvitationsHandler = class {
|
|
|
1761
1759
|
} else {
|
|
1762
1760
|
import_log5.log.error("failed", err, {
|
|
1763
1761
|
F: __dxlog_file7,
|
|
1764
|
-
L:
|
|
1762
|
+
L: 169,
|
|
1765
1763
|
S: this,
|
|
1766
1764
|
C: (f, a) => f(...a)
|
|
1767
1765
|
});
|
|
@@ -1789,7 +1787,7 @@ var InvitationsHandler = class {
|
|
|
1789
1787
|
state: import_services3.Invitation.State.CONNECTING
|
|
1790
1788
|
});
|
|
1791
1789
|
});
|
|
1792
|
-
const observable = new import_client_protocol2.
|
|
1790
|
+
const observable = new import_client_protocol2.CancellableInvitation({
|
|
1793
1791
|
initialInvitation: invitation,
|
|
1794
1792
|
subscriber: stream.observable,
|
|
1795
1793
|
onCancel: async () => {
|
|
@@ -1806,7 +1804,7 @@ var InvitationsHandler = class {
|
|
|
1806
1804
|
const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
|
|
1807
1805
|
(0, import_invariant6.invariant)(protocol, void 0, {
|
|
1808
1806
|
F: __dxlog_file7,
|
|
1809
|
-
L:
|
|
1807
|
+
L: 210,
|
|
1810
1808
|
S: this,
|
|
1811
1809
|
A: [
|
|
1812
1810
|
"protocol",
|
|
@@ -1820,7 +1818,7 @@ var InvitationsHandler = class {
|
|
|
1820
1818
|
const setState = (newData) => {
|
|
1821
1819
|
(0, import_invariant6.invariant)(newData.state !== void 0, void 0, {
|
|
1822
1820
|
F: __dxlog_file7,
|
|
1823
|
-
L:
|
|
1821
|
+
L: 221,
|
|
1824
1822
|
S: this,
|
|
1825
1823
|
A: [
|
|
1826
1824
|
"newData.state !== undefined",
|
|
@@ -1840,7 +1838,7 @@ var InvitationsHandler = class {
|
|
|
1840
1838
|
...protocol.toJSON()
|
|
1841
1839
|
}, {
|
|
1842
1840
|
F: __dxlog_file7,
|
|
1843
|
-
L:
|
|
1841
|
+
L: 229,
|
|
1844
1842
|
S: this,
|
|
1845
1843
|
C: (f, a) => f(...a)
|
|
1846
1844
|
});
|
|
@@ -1850,7 +1848,7 @@ var InvitationsHandler = class {
|
|
|
1850
1848
|
} else {
|
|
1851
1849
|
import_log5.log.warn("auth failed", err, {
|
|
1852
1850
|
F: __dxlog_file7,
|
|
1853
|
-
L:
|
|
1851
|
+
L: 232,
|
|
1854
1852
|
S: this,
|
|
1855
1853
|
C: (f, a) => f(...a)
|
|
1856
1854
|
});
|
|
@@ -1864,7 +1862,7 @@ var InvitationsHandler = class {
|
|
|
1864
1862
|
...protocol.toJSON()
|
|
1865
1863
|
}, {
|
|
1866
1864
|
F: __dxlog_file7,
|
|
1867
|
-
L:
|
|
1865
|
+
L: 240,
|
|
1868
1866
|
S: this,
|
|
1869
1867
|
C: (f, a) => f(...a)
|
|
1870
1868
|
});
|
|
@@ -1879,7 +1877,7 @@ var InvitationsHandler = class {
|
|
|
1879
1877
|
currentState
|
|
1880
1878
|
}, {
|
|
1881
1879
|
F: __dxlog_file7,
|
|
1882
|
-
L:
|
|
1880
|
+
L: 250,
|
|
1883
1881
|
S: this,
|
|
1884
1882
|
C: (f, a) => f(...a)
|
|
1885
1883
|
});
|
|
@@ -1894,7 +1892,7 @@ var InvitationsHandler = class {
|
|
|
1894
1892
|
id: traceId
|
|
1895
1893
|
}), {
|
|
1896
1894
|
F: __dxlog_file7,
|
|
1897
|
-
L:
|
|
1895
|
+
L: 259,
|
|
1898
1896
|
S: this,
|
|
1899
1897
|
C: (f, a) => f(...a)
|
|
1900
1898
|
});
|
|
@@ -1906,7 +1904,7 @@ var InvitationsHandler = class {
|
|
|
1906
1904
|
...protocol.toJSON()
|
|
1907
1905
|
}, {
|
|
1908
1906
|
F: __dxlog_file7,
|
|
1909
|
-
L:
|
|
1907
|
+
L: 267,
|
|
1910
1908
|
S: this,
|
|
1911
1909
|
C: (f, a) => f(...a)
|
|
1912
1910
|
});
|
|
@@ -1917,7 +1915,7 @@ var InvitationsHandler = class {
|
|
|
1917
1915
|
...protocol.toJSON()
|
|
1918
1916
|
}, {
|
|
1919
1917
|
F: __dxlog_file7,
|
|
1920
|
-
L:
|
|
1918
|
+
L: 271,
|
|
1921
1919
|
S: this,
|
|
1922
1920
|
C: (f, a) => f(...a)
|
|
1923
1921
|
});
|
|
@@ -1927,7 +1925,7 @@ var InvitationsHandler = class {
|
|
|
1927
1925
|
response: introductionResponse
|
|
1928
1926
|
}, {
|
|
1929
1927
|
F: __dxlog_file7,
|
|
1930
|
-
L:
|
|
1928
|
+
L: 275,
|
|
1931
1929
|
S: this,
|
|
1932
1930
|
C: (f, a) => f(...a)
|
|
1933
1931
|
});
|
|
@@ -1939,7 +1937,7 @@ var InvitationsHandler = class {
|
|
|
1939
1937
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1940
1938
|
(0, import_log5.log)("guest waiting for authentication code...", void 0, {
|
|
1941
1939
|
F: __dxlog_file7,
|
|
1942
|
-
L:
|
|
1940
|
+
L: 284,
|
|
1943
1941
|
S: this,
|
|
1944
1942
|
C: (f, a) => f(...a)
|
|
1945
1943
|
});
|
|
@@ -1951,7 +1949,7 @@ var InvitationsHandler = class {
|
|
|
1951
1949
|
});
|
|
1952
1950
|
(0, import_log5.log)("sending authentication request", void 0, {
|
|
1953
1951
|
F: __dxlog_file7,
|
|
1954
|
-
L:
|
|
1952
|
+
L: 288,
|
|
1955
1953
|
S: this,
|
|
1956
1954
|
C: (f, a) => f(...a)
|
|
1957
1955
|
});
|
|
@@ -1972,7 +1970,7 @@ var InvitationsHandler = class {
|
|
|
1972
1970
|
attempt
|
|
1973
1971
|
}, {
|
|
1974
1972
|
F: __dxlog_file7,
|
|
1975
|
-
L:
|
|
1973
|
+
L: 299,
|
|
1976
1974
|
S: this,
|
|
1977
1975
|
C: (f, a) => f(...a)
|
|
1978
1976
|
});
|
|
@@ -1989,7 +1987,7 @@ var InvitationsHandler = class {
|
|
|
1989
1987
|
...protocol.toJSON()
|
|
1990
1988
|
}, {
|
|
1991
1989
|
F: __dxlog_file7,
|
|
1992
|
-
L:
|
|
1990
|
+
L: 310,
|
|
1993
1991
|
S: this,
|
|
1994
1992
|
C: (f, a) => f(...a)
|
|
1995
1993
|
});
|
|
@@ -2001,7 +1999,7 @@ var InvitationsHandler = class {
|
|
|
2001
1999
|
...protocol.toJSON()
|
|
2002
2000
|
}, {
|
|
2003
2001
|
F: __dxlog_file7,
|
|
2004
|
-
L:
|
|
2002
|
+
L: 321,
|
|
2005
2003
|
S: this,
|
|
2006
2004
|
C: (f, a) => f(...a)
|
|
2007
2005
|
});
|
|
@@ -2013,7 +2011,7 @@ var InvitationsHandler = class {
|
|
|
2013
2011
|
id: traceId
|
|
2014
2012
|
}), {
|
|
2015
2013
|
F: __dxlog_file7,
|
|
2016
|
-
L:
|
|
2014
|
+
L: 323,
|
|
2017
2015
|
S: this,
|
|
2018
2016
|
C: (f, a) => f(...a)
|
|
2019
2017
|
});
|
|
@@ -2023,7 +2021,7 @@ var InvitationsHandler = class {
|
|
|
2023
2021
|
...protocol.toJSON()
|
|
2024
2022
|
}, {
|
|
2025
2023
|
F: __dxlog_file7,
|
|
2026
|
-
L:
|
|
2024
|
+
L: 326,
|
|
2027
2025
|
S: this,
|
|
2028
2026
|
C: (f, a) => f(...a)
|
|
2029
2027
|
});
|
|
@@ -2033,7 +2031,7 @@ var InvitationsHandler = class {
|
|
|
2033
2031
|
} else {
|
|
2034
2032
|
(0, import_log5.log)("auth failed", err, {
|
|
2035
2033
|
F: __dxlog_file7,
|
|
2036
|
-
L:
|
|
2034
|
+
L: 329,
|
|
2037
2035
|
S: this,
|
|
2038
2036
|
C: (f, a) => f(...a)
|
|
2039
2037
|
});
|
|
@@ -2044,7 +2042,7 @@ var InvitationsHandler = class {
|
|
|
2044
2042
|
error: err
|
|
2045
2043
|
}), {
|
|
2046
2044
|
F: __dxlog_file7,
|
|
2047
|
-
L:
|
|
2045
|
+
L: 332,
|
|
2048
2046
|
S: this,
|
|
2049
2047
|
C: (f, a) => f(...a)
|
|
2050
2048
|
});
|
|
@@ -2054,7 +2052,7 @@ var InvitationsHandler = class {
|
|
|
2054
2052
|
});
|
|
2055
2053
|
},
|
|
2056
2054
|
onError: (err) => {
|
|
2057
|
-
if (err instanceof
|
|
2055
|
+
if (err instanceof import_protocols4.InvalidInvitationExtensionRoleError) {
|
|
2058
2056
|
return;
|
|
2059
2057
|
}
|
|
2060
2058
|
if (err instanceof import_async8.TimeoutError) {
|
|
@@ -2062,7 +2060,7 @@ var InvitationsHandler = class {
|
|
|
2062
2060
|
...protocol.toJSON()
|
|
2063
2061
|
}, {
|
|
2064
2062
|
F: __dxlog_file7,
|
|
2065
|
-
L:
|
|
2063
|
+
L: 343,
|
|
2066
2064
|
S: this,
|
|
2067
2065
|
C: (f, a) => f(...a)
|
|
2068
2066
|
});
|
|
@@ -2072,7 +2070,7 @@ var InvitationsHandler = class {
|
|
|
2072
2070
|
} else {
|
|
2073
2071
|
(0, import_log5.log)("auth failed", err, {
|
|
2074
2072
|
F: __dxlog_file7,
|
|
2075
|
-
L:
|
|
2073
|
+
L: 346,
|
|
2076
2074
|
S: this,
|
|
2077
2075
|
C: (f, a) => f(...a)
|
|
2078
2076
|
});
|
|
@@ -2085,7 +2083,7 @@ var InvitationsHandler = class {
|
|
|
2085
2083
|
(0, import_async8.scheduleTask)(ctx, async () => {
|
|
2086
2084
|
(0, import_invariant6.invariant)(invitation.swarmKey, void 0, {
|
|
2087
2085
|
F: __dxlog_file7,
|
|
2088
|
-
L:
|
|
2086
|
+
L: 356,
|
|
2089
2087
|
S: this,
|
|
2090
2088
|
A: [
|
|
2091
2089
|
"invitation.swarmKey",
|
|
@@ -2107,7 +2105,7 @@ var InvitationsHandler = class {
|
|
|
2107
2105
|
state: import_services3.Invitation.State.CONNECTING
|
|
2108
2106
|
});
|
|
2109
2107
|
});
|
|
2110
|
-
const observable = new import_client_protocol2.
|
|
2108
|
+
const observable = new import_client_protocol2.AuthenticatingInvitation({
|
|
2111
2109
|
initialInvitation: invitation,
|
|
2112
2110
|
subscriber: stream.observable,
|
|
2113
2111
|
onCancel: async () => {
|
|
@@ -2532,7 +2530,7 @@ var import_protocols5 = require("@dxos/protocols");
|
|
|
2532
2530
|
var import_services6 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2533
2531
|
|
|
2534
2532
|
// packages/sdk/client-services/src/version.ts
|
|
2535
|
-
var DXOS_VERSION = "0.1.58-main.
|
|
2533
|
+
var DXOS_VERSION = "0.1.58-main.f5feb2a";
|
|
2536
2534
|
|
|
2537
2535
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
2538
2536
|
var getPlatform = () => {
|
|
@@ -2685,13 +2683,13 @@ var import_async14 = require("@dxos/async");
|
|
|
2685
2683
|
var import_context9 = require("@dxos/context");
|
|
2686
2684
|
var import_credentials14 = require("@dxos/credentials");
|
|
2687
2685
|
var import_debug7 = require("@dxos/debug");
|
|
2688
|
-
var
|
|
2686
|
+
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
2689
2687
|
var import_feed_store4 = require("@dxos/feed-store");
|
|
2690
|
-
var
|
|
2688
|
+
var import_invariant13 = require("@dxos/invariant");
|
|
2691
2689
|
var import_keyring = require("@dxos/keyring");
|
|
2692
2690
|
var import_keys10 = require("@dxos/keys");
|
|
2693
2691
|
var import_log13 = require("@dxos/log");
|
|
2694
|
-
var
|
|
2692
|
+
var import_protocols10 = require("@dxos/protocols");
|
|
2695
2693
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2696
2694
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
2697
2695
|
var import_tracing4 = require("@dxos/tracing");
|
|
@@ -2704,7 +2702,7 @@ var import_credentials13 = require("@dxos/credentials");
|
|
|
2704
2702
|
var import_invariant11 = require("@dxos/invariant");
|
|
2705
2703
|
var import_keys9 = require("@dxos/keys");
|
|
2706
2704
|
var import_log11 = require("@dxos/log");
|
|
2707
|
-
var
|
|
2705
|
+
var import_protocols8 = require("@dxos/protocols");
|
|
2708
2706
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2709
2707
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2710
2708
|
var import_util5 = require("@dxos/util");
|
|
@@ -2715,9 +2713,9 @@ var import_client_protocol3 = require("@dxos/client-protocol");
|
|
|
2715
2713
|
var import_context7 = require("@dxos/context");
|
|
2716
2714
|
var import_debug4 = require("@dxos/debug");
|
|
2717
2715
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2718
|
-
var import_errors3 = require("@dxos/errors");
|
|
2719
2716
|
var import_keys8 = require("@dxos/keys");
|
|
2720
2717
|
var import_log10 = require("@dxos/log");
|
|
2718
|
+
var import_protocols7 = require("@dxos/protocols");
|
|
2721
2719
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2722
2720
|
var import_credentials10 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2723
2721
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
@@ -3026,7 +3024,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3026
3024
|
this._signingContext = params.signingContext;
|
|
3027
3025
|
this._callbacks = params.callbacks ?? {};
|
|
3028
3026
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
3029
|
-
trustedKeysProvider: () => new import_util4.ComplexSet(import_keys8.PublicKey.hash, Array.from(this._inner.spaceState.members.
|
|
3027
|
+
trustedKeysProvider: () => new import_util4.ComplexSet(import_keys8.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
3030
3028
|
update: this._inner.stateUpdate,
|
|
3031
3029
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
3032
3030
|
});
|
|
@@ -3036,7 +3034,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3036
3034
|
state: import_services7.SpaceState[this._state]
|
|
3037
3035
|
}, {
|
|
3038
3036
|
F: __dxlog_file12,
|
|
3039
|
-
L:
|
|
3037
|
+
L: 118,
|
|
3040
3038
|
S: this,
|
|
3041
3039
|
C: (f, a) => f(...a)
|
|
3042
3040
|
});
|
|
@@ -3079,7 +3077,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3079
3077
|
state: import_services7.SpaceState[this._state]
|
|
3080
3078
|
}, {
|
|
3081
3079
|
F: __dxlog_file12,
|
|
3082
|
-
L:
|
|
3080
|
+
L: 165,
|
|
3083
3081
|
S: this,
|
|
3084
3082
|
C: (f, a) => f(...a)
|
|
3085
3083
|
});
|
|
@@ -3097,7 +3095,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3097
3095
|
state: import_services7.SpaceState[this._state]
|
|
3098
3096
|
}, {
|
|
3099
3097
|
F: __dxlog_file12,
|
|
3100
|
-
L:
|
|
3098
|
+
L: 179,
|
|
3101
3099
|
S: this,
|
|
3102
3100
|
C: (f, a) => f(...a)
|
|
3103
3101
|
});
|
|
@@ -3125,10 +3123,10 @@ var DataSpace = class DataSpace2 {
|
|
|
3125
3123
|
this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
|
|
3126
3124
|
await this.initializeDataPipeline();
|
|
3127
3125
|
} catch (err) {
|
|
3128
|
-
if (err instanceof
|
|
3126
|
+
if (err instanceof import_protocols7.CancelledError) {
|
|
3129
3127
|
(0, import_log10.log)("data pipeline initialization cancelled", err, {
|
|
3130
3128
|
F: __dxlog_file12,
|
|
3131
|
-
L:
|
|
3129
|
+
L: 211,
|
|
3132
3130
|
S: this,
|
|
3133
3131
|
C: (f, a) => f(...a)
|
|
3134
3132
|
});
|
|
@@ -3136,7 +3134,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3136
3134
|
}
|
|
3137
3135
|
import_log10.log.error("Error initializing data pipeline", err, {
|
|
3138
3136
|
F: __dxlog_file12,
|
|
3139
|
-
L:
|
|
3137
|
+
L: 215,
|
|
3140
3138
|
S: this,
|
|
3141
3139
|
C: (f, a) => f(...a)
|
|
3142
3140
|
});
|
|
@@ -3145,7 +3143,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3145
3143
|
state: import_services7.SpaceState[this._state]
|
|
3146
3144
|
}, {
|
|
3147
3145
|
F: __dxlog_file12,
|
|
3148
|
-
L:
|
|
3146
|
+
L: 217,
|
|
3149
3147
|
S: this,
|
|
3150
3148
|
C: (f, a) => f(...a)
|
|
3151
3149
|
});
|
|
@@ -3158,14 +3156,14 @@ var DataSpace = class DataSpace2 {
|
|
|
3158
3156
|
}
|
|
3159
3157
|
async initializeDataPipeline() {
|
|
3160
3158
|
if (this._state !== import_services7.SpaceState.CONTROL_ONLY) {
|
|
3161
|
-
throw new
|
|
3159
|
+
throw new import_protocols7.SystemError("Invalid operation");
|
|
3162
3160
|
}
|
|
3163
3161
|
this._state = import_services7.SpaceState.INITIALIZING;
|
|
3164
3162
|
(0, import_log10.log)("new state", {
|
|
3165
3163
|
state: import_services7.SpaceState[this._state]
|
|
3166
3164
|
}, {
|
|
3167
3165
|
F: __dxlog_file12,
|
|
3168
|
-
L:
|
|
3166
|
+
L: 233,
|
|
3169
3167
|
S: this,
|
|
3170
3168
|
C: (f, a) => f(...a)
|
|
3171
3169
|
});
|
|
@@ -3176,7 +3174,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3176
3174
|
await (0, import_context7.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
3177
3175
|
(0, import_log10.log)("waiting for data pipeline to reach target timeframe", void 0, {
|
|
3178
3176
|
F: __dxlog_file12,
|
|
3179
|
-
L:
|
|
3177
|
+
L: 247,
|
|
3180
3178
|
S: this,
|
|
3181
3179
|
C: (f, a) => f(...a)
|
|
3182
3180
|
});
|
|
@@ -3187,7 +3185,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3187
3185
|
this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
|
|
3188
3186
|
(0, import_log10.log)("data pipeline ready", void 0, {
|
|
3189
3187
|
F: __dxlog_file12,
|
|
3190
|
-
L:
|
|
3188
|
+
L: 256,
|
|
3191
3189
|
S: this,
|
|
3192
3190
|
C: (f, a) => f(...a)
|
|
3193
3191
|
});
|
|
@@ -3197,7 +3195,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3197
3195
|
state: import_services7.SpaceState[this._state]
|
|
3198
3196
|
}, {
|
|
3199
3197
|
F: __dxlog_file12,
|
|
3200
|
-
L:
|
|
3198
|
+
L: 260,
|
|
3201
3199
|
S: this,
|
|
3202
3200
|
C: (f, a) => f(...a)
|
|
3203
3201
|
});
|
|
@@ -3213,7 +3211,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3213
3211
|
await this._createWritableFeeds();
|
|
3214
3212
|
(0, import_log10.log)("writable feeds created", void 0, {
|
|
3215
3213
|
F: __dxlog_file12,
|
|
3216
|
-
L:
|
|
3214
|
+
L: 276,
|
|
3217
3215
|
S: this,
|
|
3218
3216
|
C: (f, a) => f(...a)
|
|
3219
3217
|
});
|
|
@@ -3318,7 +3316,7 @@ var DataSpace = class DataSpace2 {
|
|
|
3318
3316
|
state: import_services7.SpaceState[this._state]
|
|
3319
3317
|
}, {
|
|
3320
3318
|
F: __dxlog_file12,
|
|
3321
|
-
L:
|
|
3319
|
+
L: 392,
|
|
3322
3320
|
S: this,
|
|
3323
3321
|
C: (f, a) => f(...a)
|
|
3324
3322
|
});
|
|
@@ -3460,7 +3458,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3460
3458
|
S: this,
|
|
3461
3459
|
C: (f, a) => f(...a)
|
|
3462
3460
|
});
|
|
3463
|
-
import_log11.log.trace("dxos.echo.data-space-manager.open",
|
|
3461
|
+
import_log11.log.trace("dxos.echo.data-space-manager.open", import_protocols8.trace.begin({
|
|
3464
3462
|
id: this._instanceId
|
|
3465
3463
|
}), {
|
|
3466
3464
|
F: __dxlog_file13,
|
|
@@ -3506,7 +3504,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3506
3504
|
space.initializeDataPipelineAsync();
|
|
3507
3505
|
}
|
|
3508
3506
|
}
|
|
3509
|
-
import_log11.log.trace("dxos.echo.data-space-manager.open",
|
|
3507
|
+
import_log11.log.trace("dxos.echo.data-space-manager.open", import_protocols8.trace.end({
|
|
3510
3508
|
id: this._instanceId
|
|
3511
3509
|
}), {
|
|
3512
3510
|
F: __dxlog_file13,
|
|
@@ -3760,10 +3758,9 @@ DataSpaceManager = _ts_decorate4([
|
|
|
3760
3758
|
var import_async13 = require("@dxos/async");
|
|
3761
3759
|
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
3762
3760
|
var import_debug6 = require("@dxos/debug");
|
|
3763
|
-
var
|
|
3764
|
-
var import_errors4 = require("@dxos/errors");
|
|
3761
|
+
var import_invariant12 = require("@dxos/invariant");
|
|
3765
3762
|
var import_log12 = require("@dxos/log");
|
|
3766
|
-
var
|
|
3763
|
+
var import_protocols9 = require("@dxos/protocols");
|
|
3767
3764
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3768
3765
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3769
3766
|
var SpacesServiceImpl = class {
|
|
@@ -3783,7 +3780,7 @@ var SpacesServiceImpl = class {
|
|
|
3783
3780
|
}
|
|
3784
3781
|
async updateSpace({ spaceKey, state }) {
|
|
3785
3782
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3786
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3783
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3787
3784
|
if (state) {
|
|
3788
3785
|
switch (state) {
|
|
3789
3786
|
case import_services9.SpaceState.ACTIVE:
|
|
@@ -3793,7 +3790,7 @@ var SpacesServiceImpl = class {
|
|
|
3793
3790
|
await space.deactivate();
|
|
3794
3791
|
break;
|
|
3795
3792
|
default:
|
|
3796
|
-
throw new
|
|
3793
|
+
throw new import_protocols9.ApiError("Invalid space state");
|
|
3797
3794
|
}
|
|
3798
3795
|
}
|
|
3799
3796
|
}
|
|
@@ -3848,14 +3845,14 @@ var SpacesServiceImpl = class {
|
|
|
3848
3845
|
}
|
|
3849
3846
|
async postMessage({ spaceKey, channel, message }) {
|
|
3850
3847
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3851
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3848
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3852
3849
|
await space.postMessage(getChannelId(channel), message);
|
|
3853
3850
|
}
|
|
3854
3851
|
subscribeMessages({ spaceKey, channel }) {
|
|
3855
3852
|
return new import_codec_protobuf11.Stream(({ ctx, next }) => {
|
|
3856
3853
|
(0, import_async13.scheduleTask)(ctx, async () => {
|
|
3857
3854
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3858
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3855
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3859
3856
|
const handle = space.listen(getChannelId(channel), (message) => {
|
|
3860
3857
|
next(message);
|
|
3861
3858
|
});
|
|
@@ -3863,38 +3860,83 @@ var SpacesServiceImpl = class {
|
|
|
3863
3860
|
});
|
|
3864
3861
|
});
|
|
3865
3862
|
}
|
|
3866
|
-
queryCredentials({ spaceKey }) {
|
|
3867
|
-
return new import_codec_protobuf11.Stream(({ ctx, next }) => {
|
|
3868
|
-
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3863
|
+
queryCredentials({ spaceKey, noTail }) {
|
|
3864
|
+
return new import_codec_protobuf11.Stream(({ ctx, next, close }) => {
|
|
3865
|
+
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3869
3866
|
const processor = {
|
|
3870
3867
|
processCredential: async (credential) => {
|
|
3871
3868
|
next(credential);
|
|
3872
3869
|
}
|
|
3873
3870
|
};
|
|
3874
3871
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3875
|
-
(0, import_async13.scheduleTask)(ctx, () =>
|
|
3872
|
+
(0, import_async13.scheduleTask)(ctx, async () => {
|
|
3873
|
+
await space.spaceState.addCredentialProcessor(processor);
|
|
3874
|
+
if (noTail) {
|
|
3875
|
+
close();
|
|
3876
|
+
}
|
|
3877
|
+
});
|
|
3876
3878
|
});
|
|
3877
3879
|
}
|
|
3878
3880
|
async writeCredentials({ spaceKey, credentials }) {
|
|
3879
|
-
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3881
|
+
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3880
3882
|
for (const credential of credentials ?? []) {
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
credential
|
|
3884
|
-
|
|
3885
|
-
|
|
3883
|
+
if (credential.proof) {
|
|
3884
|
+
await space.controlPipeline.writer.write({
|
|
3885
|
+
credential: {
|
|
3886
|
+
credential
|
|
3887
|
+
}
|
|
3888
|
+
});
|
|
3889
|
+
} else {
|
|
3890
|
+
(0, import_invariant12.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
3891
|
+
F: __dxlog_file14,
|
|
3892
|
+
L: 168,
|
|
3893
|
+
S: this,
|
|
3894
|
+
A: [
|
|
3895
|
+
"!credential.id",
|
|
3896
|
+
"'Id on unsigned credentials is not allowed'"
|
|
3897
|
+
]
|
|
3898
|
+
});
|
|
3899
|
+
(0, import_invariant12.invariant)(this._identityManager.identity, "Identity is not available", {
|
|
3900
|
+
F: __dxlog_file14,
|
|
3901
|
+
L: 169,
|
|
3902
|
+
S: this,
|
|
3903
|
+
A: [
|
|
3904
|
+
"this._identityManager.identity",
|
|
3905
|
+
"'Identity is not available'"
|
|
3906
|
+
]
|
|
3907
|
+
});
|
|
3908
|
+
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
3909
|
+
(0, import_invariant12.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
3910
|
+
F: __dxlog_file14,
|
|
3911
|
+
L: 171,
|
|
3912
|
+
S: this,
|
|
3913
|
+
A: [
|
|
3914
|
+
"credential.issuer.equals(signer.getIssuer())",
|
|
3915
|
+
""
|
|
3916
|
+
]
|
|
3917
|
+
});
|
|
3918
|
+
const signedCredential = await signer.createCredential({
|
|
3919
|
+
subject: credential.subject.id,
|
|
3920
|
+
assertion: credential.subject.assertion
|
|
3921
|
+
});
|
|
3922
|
+
await space.controlPipeline.writer.write({
|
|
3923
|
+
credential: {
|
|
3924
|
+
credential: signedCredential
|
|
3925
|
+
}
|
|
3926
|
+
});
|
|
3927
|
+
}
|
|
3886
3928
|
}
|
|
3887
3929
|
}
|
|
3888
3930
|
async createEpoch({ spaceKey }) {
|
|
3889
3931
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3890
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3932
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3891
3933
|
await space.createEpoch();
|
|
3892
3934
|
}
|
|
3893
3935
|
_serializeSpace(space) {
|
|
3894
3936
|
return {
|
|
3895
3937
|
spaceKey: space.key,
|
|
3896
3938
|
state: space.state,
|
|
3897
|
-
error: space.error ? (0,
|
|
3939
|
+
error: space.error ? (0, import_protocols9.encodeError)(space.error) : void 0,
|
|
3898
3940
|
pipeline: {
|
|
3899
3941
|
currentEpoch: space.dataPipeline.currentEpoch,
|
|
3900
3942
|
appliedEpoch: space.dataPipeline.appliedEpoch,
|
|
@@ -3921,7 +3963,7 @@ var SpacesServiceImpl = class {
|
|
|
3921
3963
|
displayName: member.assertion.profile?.displayName
|
|
3922
3964
|
}
|
|
3923
3965
|
},
|
|
3924
|
-
presence: isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
3966
|
+
presence: member.removed ? import_services9.SpaceMember.PresenceState.REMOVED : isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
3925
3967
|
peerStates: peers
|
|
3926
3968
|
};
|
|
3927
3969
|
}),
|
|
@@ -3953,11 +3995,11 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3953
3995
|
this.signalManager = signalManager;
|
|
3954
3996
|
this.modelFactory = modelFactory;
|
|
3955
3997
|
this.initialized = new import_async14.Trigger();
|
|
3956
|
-
this.dataServiceSubscriptions = new
|
|
3998
|
+
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
3957
3999
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3958
4000
|
this._instanceId = import_keys10.PublicKey.random().toHex();
|
|
3959
|
-
this.metadataStore = new
|
|
3960
|
-
this.snapshotStore = new
|
|
4001
|
+
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
4002
|
+
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
3961
4003
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
3962
4004
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
3963
4005
|
this.feedStore = new import_feed_store4.FeedStore({
|
|
@@ -3965,12 +4007,12 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3965
4007
|
root: storage.createDirectory("feeds"),
|
|
3966
4008
|
signer: this.keyring,
|
|
3967
4009
|
hypercore: {
|
|
3968
|
-
valueEncoding:
|
|
4010
|
+
valueEncoding: import_echo_pipeline2.valueEncoding,
|
|
3969
4011
|
stats: true
|
|
3970
4012
|
}
|
|
3971
4013
|
})
|
|
3972
4014
|
});
|
|
3973
|
-
this.spaceManager = new
|
|
4015
|
+
this.spaceManager = new import_echo_pipeline2.SpaceManager({
|
|
3974
4016
|
feedStore: this.feedStore,
|
|
3975
4017
|
networkManager: this.networkManager,
|
|
3976
4018
|
blobStore: this.blobStore,
|
|
@@ -3990,7 +4032,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3990
4032
|
S: this,
|
|
3991
4033
|
C: (f, a) => f(...a)
|
|
3992
4034
|
});
|
|
3993
|
-
import_log13.log.trace("dxos.sdk.service-context.open",
|
|
4035
|
+
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols10.trace.begin({
|
|
3994
4036
|
id: this._instanceId
|
|
3995
4037
|
}), {
|
|
3996
4038
|
F: __dxlog_file15,
|
|
@@ -4006,7 +4048,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4006
4048
|
if (this.identityManager.identity) {
|
|
4007
4049
|
await this._initialize(ctx);
|
|
4008
4050
|
}
|
|
4009
|
-
import_log13.log.trace("dxos.sdk.service-context.open",
|
|
4051
|
+
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols10.trace.end({
|
|
4010
4052
|
id: this._instanceId
|
|
4011
4053
|
}), {
|
|
4012
4054
|
F: __dxlog_file15,
|
|
@@ -4053,7 +4095,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4053
4095
|
}
|
|
4054
4096
|
getInvitationHandler(invitation) {
|
|
4055
4097
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
4056
|
-
(0,
|
|
4098
|
+
(0, import_invariant13.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
4057
4099
|
F: __dxlog_file15,
|
|
4058
4100
|
L: 174,
|
|
4059
4101
|
S: this,
|
|
@@ -4071,8 +4113,8 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4071
4113
|
}
|
|
4072
4114
|
async _checkStorageVersion() {
|
|
4073
4115
|
await this.metadataStore.load();
|
|
4074
|
-
if (this.metadataStore.version !==
|
|
4075
|
-
throw new
|
|
4116
|
+
if (this.metadataStore.version !== import_protocols10.STORAGE_VERSION) {
|
|
4117
|
+
throw new import_protocols10.InvalidStorageVersionError(import_protocols10.STORAGE_VERSION, this.metadataStore.version);
|
|
4076
4118
|
}
|
|
4077
4119
|
}
|
|
4078
4120
|
// Called when identity is created.
|
|
@@ -4100,7 +4142,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
4100
4142
|
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
|
|
4101
4143
|
await this.dataSpaceManager.open();
|
|
4102
4144
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
4103
|
-
(0,
|
|
4145
|
+
(0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
4104
4146
|
F: __dxlog_file15,
|
|
4105
4147
|
L: 218,
|
|
4106
4148
|
S: this,
|
|
@@ -4185,14 +4227,14 @@ var import_async17 = require("@dxos/async");
|
|
|
4185
4227
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
4186
4228
|
var import_context10 = require("@dxos/context");
|
|
4187
4229
|
var import_document_model2 = require("@dxos/document-model");
|
|
4188
|
-
var
|
|
4189
|
-
var
|
|
4230
|
+
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
4231
|
+
var import_invariant15 = require("@dxos/invariant");
|
|
4190
4232
|
var import_keys11 = require("@dxos/keys");
|
|
4191
4233
|
var import_log16 = require("@dxos/log");
|
|
4192
4234
|
var import_messaging = require("@dxos/messaging");
|
|
4193
4235
|
var import_model_factory = require("@dxos/model-factory");
|
|
4194
4236
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
4195
|
-
var
|
|
4237
|
+
var import_protocols12 = require("@dxos/protocols");
|
|
4196
4238
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
4197
4239
|
var import_text_model = require("@dxos/text-model");
|
|
4198
4240
|
var import_tracing5 = require("@dxos/tracing");
|
|
@@ -4242,7 +4284,7 @@ var DevicesServiceImpl = class {
|
|
|
4242
4284
|
};
|
|
4243
4285
|
|
|
4244
4286
|
// packages/sdk/client-services/src/packlets/locks/node.ts
|
|
4245
|
-
var
|
|
4287
|
+
var import_invariant14 = require("@dxos/invariant");
|
|
4246
4288
|
var import_lock_file = require("@dxos/lock-file");
|
|
4247
4289
|
var import_log14 = require("@dxos/log");
|
|
4248
4290
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -4283,7 +4325,7 @@ var Lock = class {
|
|
|
4283
4325
|
}
|
|
4284
4326
|
async release() {
|
|
4285
4327
|
await this._onRelease?.();
|
|
4286
|
-
(0,
|
|
4328
|
+
(0, import_invariant14.invariant)(this._fileHandle, "Lock is not acquired", {
|
|
4287
4329
|
F: __dxlog_file16,
|
|
4288
4330
|
L: 42,
|
|
4289
4331
|
S: this,
|
|
@@ -4451,7 +4493,7 @@ var NetworkServiceImpl = class {
|
|
|
4451
4493
|
|
|
4452
4494
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4453
4495
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
4454
|
-
var
|
|
4496
|
+
var import_protocols11 = require("@dxos/protocols");
|
|
4455
4497
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
4456
4498
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
4457
4499
|
var import_util8 = require("@dxos/util");
|
|
@@ -4459,16 +4501,16 @@ var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
|
4459
4501
|
var createStorageObjects = (config) => {
|
|
4460
4502
|
const { path = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage", storageType, keyStorage, persistent = false } = config ?? {};
|
|
4461
4503
|
if (persistent && storageType === StorageDriver.RAM) {
|
|
4462
|
-
throw new
|
|
4504
|
+
throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4463
4505
|
}
|
|
4464
4506
|
if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
|
|
4465
|
-
throw new
|
|
4507
|
+
throw new import_protocols11.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
4466
4508
|
}
|
|
4467
4509
|
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
4468
|
-
throw new
|
|
4510
|
+
throw new import_protocols11.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
4469
4511
|
}
|
|
4470
4512
|
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
|
|
4471
|
-
throw new
|
|
4513
|
+
throw new import_protocols11.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
4472
4514
|
}
|
|
4473
4515
|
return {
|
|
4474
4516
|
storage: (0, import_random_access_storage.createStorage)({
|
|
@@ -4675,7 +4717,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4675
4717
|
* Can only be called once.
|
|
4676
4718
|
*/
|
|
4677
4719
|
initialize({ config, ...options }) {
|
|
4678
|
-
(0,
|
|
4720
|
+
(0, import_invariant15.invariant)(!this._open, "service host is open", {
|
|
4679
4721
|
F: __dxlog_file17,
|
|
4680
4722
|
L: 184,
|
|
4681
4723
|
S: this,
|
|
@@ -4691,7 +4733,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4691
4733
|
C: (f, a) => f(...a)
|
|
4692
4734
|
});
|
|
4693
4735
|
if (config) {
|
|
4694
|
-
(0,
|
|
4736
|
+
(0, import_invariant15.invariant)(!this._config, "config already set", {
|
|
4695
4737
|
F: __dxlog_file17,
|
|
4696
4738
|
L: 188,
|
|
4697
4739
|
S: this,
|
|
@@ -4709,7 +4751,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4709
4751
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4710
4752
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4711
4753
|
this._signalManager = signalManager;
|
|
4712
|
-
(0,
|
|
4754
|
+
(0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
|
|
4713
4755
|
F: __dxlog_file17,
|
|
4714
4756
|
L: 204,
|
|
4715
4757
|
S: this,
|
|
@@ -4735,7 +4777,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4735
4777
|
return;
|
|
4736
4778
|
}
|
|
4737
4779
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
4738
|
-
import_log16.log.trace("dxos.client-services.host.open",
|
|
4780
|
+
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4739
4781
|
id: traceId
|
|
4740
4782
|
}), {
|
|
4741
4783
|
F: __dxlog_file17,
|
|
@@ -4743,7 +4785,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4743
4785
|
S: this,
|
|
4744
4786
|
C: (f, a) => f(...a)
|
|
4745
4787
|
});
|
|
4746
|
-
(0,
|
|
4788
|
+
(0, import_invariant15.invariant)(this._config, "config not set", {
|
|
4747
4789
|
F: __dxlog_file17,
|
|
4748
4790
|
L: 224,
|
|
4749
4791
|
S: this,
|
|
@@ -4752,7 +4794,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4752
4794
|
"'config not set'"
|
|
4753
4795
|
]
|
|
4754
4796
|
});
|
|
4755
|
-
(0,
|
|
4797
|
+
(0, import_invariant15.invariant)(this._storage, "storage not set", {
|
|
4756
4798
|
F: __dxlog_file17,
|
|
4757
4799
|
L: 225,
|
|
4758
4800
|
S: this,
|
|
@@ -4761,7 +4803,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4761
4803
|
"'storage not set'"
|
|
4762
4804
|
]
|
|
4763
4805
|
});
|
|
4764
|
-
(0,
|
|
4806
|
+
(0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
|
|
4765
4807
|
F: __dxlog_file17,
|
|
4766
4808
|
L: 226,
|
|
4767
4809
|
S: this,
|
|
@@ -4770,7 +4812,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4770
4812
|
"'signal manager not set'"
|
|
4771
4813
|
]
|
|
4772
4814
|
});
|
|
4773
|
-
(0,
|
|
4815
|
+
(0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
|
|
4774
4816
|
F: __dxlog_file17,
|
|
4775
4817
|
L: 227,
|
|
4776
4818
|
S: this,
|
|
@@ -4800,7 +4842,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4800
4842
|
await this._serviceContext.initialized.wait();
|
|
4801
4843
|
return this._serviceContext.dataSpaceManager;
|
|
4802
4844
|
}),
|
|
4803
|
-
DataService: new
|
|
4845
|
+
DataService: new import_echo_pipeline3.DataServiceImpl(this._serviceContext.dataServiceSubscriptions),
|
|
4804
4846
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
4805
4847
|
LoggingService: this._loggingService,
|
|
4806
4848
|
TracingService: this._tracingService,
|
|
@@ -4834,7 +4876,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4834
4876
|
S: this,
|
|
4835
4877
|
C: (f, a) => f(...a)
|
|
4836
4878
|
});
|
|
4837
|
-
import_log16.log.trace("dxos.client-services.host.open",
|
|
4879
|
+
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.end({
|
|
4838
4880
|
id: traceId
|
|
4839
4881
|
}), {
|
|
4840
4882
|
F: __dxlog_file17,
|
|
@@ -4875,7 +4917,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4875
4917
|
}
|
|
4876
4918
|
async reset() {
|
|
4877
4919
|
const traceId = import_keys11.PublicKey.random().toHex();
|
|
4878
|
-
import_log16.log.trace("dxos.sdk.client-services-host.reset",
|
|
4920
|
+
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4879
4921
|
id: traceId
|
|
4880
4922
|
}), {
|
|
4881
4923
|
F: __dxlog_file17,
|
|
@@ -4897,7 +4939,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4897
4939
|
S: this,
|
|
4898
4940
|
C: (f, a) => f(...a)
|
|
4899
4941
|
});
|
|
4900
|
-
import_log16.log.trace("dxos.sdk.client-services-host.reset",
|
|
4942
|
+
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.end({
|
|
4901
4943
|
id: traceId
|
|
4902
4944
|
}), {
|
|
4903
4945
|
F: __dxlog_file17,
|
|
@@ -4938,7 +4980,7 @@ var import_util10 = require("@dxos/util");
|
|
|
4938
4980
|
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
4939
4981
|
var import_async18 = require("@dxos/async");
|
|
4940
4982
|
var import_client_protocol6 = require("@dxos/client-protocol");
|
|
4941
|
-
var
|
|
4983
|
+
var import_invariant16 = require("@dxos/invariant");
|
|
4942
4984
|
var import_iframe = require("@dxos/protocols/proto/dxos/iframe");
|
|
4943
4985
|
var import_rpc2 = require("@dxos/rpc");
|
|
4944
4986
|
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/shell-runtime.ts";
|
|
@@ -4957,17 +4999,18 @@ var ShellRuntimeImpl = class {
|
|
|
4957
4999
|
get spaceKey() {
|
|
4958
5000
|
return this._spaceKey;
|
|
4959
5001
|
}
|
|
4960
|
-
setLayout(layout,
|
|
5002
|
+
setLayout({ layout, invitationCode, spaceKey }) {
|
|
4961
5003
|
this._layout = layout;
|
|
4962
|
-
this._invitationCode =
|
|
4963
|
-
this._spaceKey =
|
|
5004
|
+
this._invitationCode = invitationCode;
|
|
5005
|
+
this._spaceKey = spaceKey;
|
|
4964
5006
|
this.layoutUpdate.emit({
|
|
4965
5007
|
layout,
|
|
4966
|
-
|
|
5008
|
+
invitationCode,
|
|
5009
|
+
spaceKey
|
|
4967
5010
|
});
|
|
4968
5011
|
}
|
|
4969
5012
|
async setAppContext(context) {
|
|
4970
|
-
(0,
|
|
5013
|
+
(0, import_invariant16.invariant)(this._appRpc, "runtime not open", {
|
|
4971
5014
|
F: __dxlog_file18,
|
|
4972
5015
|
L: 44,
|
|
4973
5016
|
S: this,
|
|
@@ -5123,9 +5166,9 @@ _ts_decorate8([
|
|
|
5123
5166
|
// packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
|
|
5124
5167
|
var import_async20 = require("@dxos/async");
|
|
5125
5168
|
var import_client_protocol8 = require("@dxos/client-protocol");
|
|
5126
|
-
var import_errors6 = require("@dxos/errors");
|
|
5127
5169
|
var import_log18 = require("@dxos/log");
|
|
5128
5170
|
var import_network_manager4 = require("@dxos/network-manager");
|
|
5171
|
+
var import_protocols13 = require("@dxos/protocols");
|
|
5129
5172
|
var import_rpc3 = require("@dxos/rpc");
|
|
5130
5173
|
var import_util11 = require("@dxos/util");
|
|
5131
5174
|
var __dxlog_file20 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts";
|
|
@@ -5181,7 +5224,7 @@ var IFrameProxyRuntime = class {
|
|
|
5181
5224
|
S: this,
|
|
5182
5225
|
C: (f, a) => f(...a)
|
|
5183
5226
|
});
|
|
5184
|
-
throw new
|
|
5227
|
+
throw new import_protocols13.RemoteServiceConnectionError("Failed to connect to worker");
|
|
5185
5228
|
}
|
|
5186
5229
|
await this._shellRuntime?.open();
|
|
5187
5230
|
}
|
|
@@ -5206,7 +5249,7 @@ var import_network_manager5 = require("@dxos/network-manager");
|
|
|
5206
5249
|
// packages/sdk/client-services/src/packlets/vault/worker-session.ts
|
|
5207
5250
|
var import_async21 = require("@dxos/async");
|
|
5208
5251
|
var import_client_protocol9 = require("@dxos/client-protocol");
|
|
5209
|
-
var
|
|
5252
|
+
var import_invariant17 = require("@dxos/invariant");
|
|
5210
5253
|
var import_log19 = require("@dxos/log");
|
|
5211
5254
|
var import_rpc4 = require("@dxos/rpc");
|
|
5212
5255
|
var import_util12 = require("@dxos/util");
|
|
@@ -5225,7 +5268,7 @@ var WorkerSession = class {
|
|
|
5225
5268
|
constructor({ serviceHost, systemPort, appPort, shellPort, readySignal }) {
|
|
5226
5269
|
this._startTrigger = new import_async21.Trigger();
|
|
5227
5270
|
this.onClose = new import_util12.Callback();
|
|
5228
|
-
(0,
|
|
5271
|
+
(0, import_invariant17.invariant)(serviceHost, void 0, {
|
|
5229
5272
|
F: __dxlog_file21,
|
|
5230
5273
|
L: 49,
|
|
5231
5274
|
S: this,
|