@dxos/client-services 0.8.2-main.fbd8ed0 → 0.8.2-staging.4d6ad0f
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-I3QLQXQD.mjs → chunk-AA2G5WEV.mjs} +375 -394
- package/dist/lib/browser/chunk-AA2G5WEV.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-Y747YVDI.cjs → chunk-JC3EZ3VA.cjs} +378 -386
- package/dist/lib/node/chunk-JC3EZ3VA.cjs.map +7 -0
- package/dist/lib/node/index.cjs +47 -47
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-XNCWQTDB.mjs → chunk-ZCHUTUNU.mjs} +375 -383
- package/dist/lib/node-esm/chunk-ZCHUTUNU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/packlets/agents/edge-agent-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/default-space-state-machine.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity-recovery-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/edge-invitation-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-guest-extenstion.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-topology.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/browser.d.ts.map +1 -1
- package/dist/types/src/packlets/locks/node.d.ts.map +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/client-rpc-server.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-registry.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/space-archive-writer.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/automerge-space-state.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/notarization-plugin.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-session.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +39 -39
- package/src/packlets/agents/edge-agent-manager.ts +6 -6
- package/src/packlets/identity/authenticator.ts +2 -2
- package/src/packlets/identity/default-space-state-machine.ts +1 -1
- package/src/packlets/identity/identity-manager.ts +13 -9
- package/src/packlets/identity/identity-recovery-manager.ts +6 -4
- package/src/packlets/identity/identity-service.ts +4 -4
- package/src/packlets/identity/identity.ts +5 -5
- package/src/packlets/invitations/device-invitation-protocol.ts +1 -1
- package/src/packlets/invitations/edge-invitation-handler.ts +3 -3
- package/src/packlets/invitations/invitation-guest-extenstion.ts +3 -3
- package/src/packlets/invitations/invitation-host-extension.ts +5 -5
- package/src/packlets/invitations/invitation-topology.ts +1 -1
- package/src/packlets/invitations/invitations-handler.ts +2 -2
- package/src/packlets/invitations/invitations-manager.ts +15 -4
- package/src/packlets/invitations/space-invitation-protocol.ts +1 -1
- package/src/packlets/locks/browser.ts +4 -4
- package/src/packlets/locks/node.ts +2 -2
- package/src/packlets/logging/logging-service.ts +2 -2
- package/src/packlets/network/network-service.ts +2 -2
- package/src/packlets/services/client-rpc-server.ts +2 -2
- package/src/packlets/services/service-context.ts +10 -6
- package/src/packlets/services/service-host.ts +8 -4
- package/src/packlets/services/service-registry.ts +3 -3
- package/src/packlets/space-export/space-archive-writer.ts +3 -3
- package/src/packlets/spaces/automerge-space-state.ts +3 -3
- package/src/packlets/spaces/data-space-manager.ts +14 -14
- package/src/packlets/spaces/data-space.ts +18 -18
- package/src/packlets/spaces/edge-feed-replicator.ts +12 -12
- package/src/packlets/spaces/notarization-plugin.test.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.ts +18 -18
- package/src/packlets/spaces/spaces-service.ts +5 -5
- package/src/packlets/system/system-service.ts +2 -2
- package/src/packlets/testing/test-builder.ts +3 -3
- package/src/packlets/worker/worker-runtime.ts +4 -4
- package/src/packlets/worker/worker-session.ts +3 -3
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-I3QLQXQD.mjs.map +0 -7
- package/dist/lib/node/chunk-Y747YVDI.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-XNCWQTDB.mjs.map +0 -7
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_JC3EZ3VA_exports = {};
|
|
30
|
+
__export(chunk_JC3EZ3VA_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -72,7 +72,7 @@ __export(chunk_Y747YVDI_exports, {
|
|
|
72
72
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
73
73
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
74
74
|
});
|
|
75
|
-
module.exports = __toCommonJS(
|
|
75
|
+
module.exports = __toCommonJS(chunk_JC3EZ3VA_exports);
|
|
76
76
|
var import_async = require("@dxos/async");
|
|
77
77
|
var import_stream = require("@dxos/codec-protobuf/stream");
|
|
78
78
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -745,7 +745,7 @@ var DevtoolsServiceImpl = class {
|
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
|
-
var DXOS_VERSION = "0.8.2-
|
|
748
|
+
var DXOS_VERSION = "0.8.2-staging.4d6ad0f";
|
|
749
749
|
var getPlatform = () => {
|
|
750
750
|
if (process.browser) {
|
|
751
751
|
if (typeof window !== "undefined") {
|
|
@@ -1060,67 +1060,70 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
1060
1060
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1061
1061
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
a: isAwait
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
return value;
|
|
1063
|
+
function _ts_add_disposable_resource(env, value, async) {
|
|
1064
|
+
if (value !== null && value !== void 0) {
|
|
1065
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1066
|
+
var dispose, inner;
|
|
1067
|
+
if (async) {
|
|
1068
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
1069
|
+
dispose = value[Symbol.asyncDispose];
|
|
1070
|
+
}
|
|
1071
|
+
if (dispose === void 0) {
|
|
1072
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
1073
|
+
dispose = value[Symbol.dispose];
|
|
1074
|
+
if (async) inner = dispose;
|
|
1075
|
+
}
|
|
1076
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
1077
|
+
if (inner) dispose = function() {
|
|
1078
|
+
try {
|
|
1079
|
+
inner.call(this);
|
|
1080
|
+
} catch (e) {
|
|
1081
|
+
return Promise.reject(e);
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
env.stack.push({
|
|
1085
|
+
value,
|
|
1086
|
+
dispose,
|
|
1087
|
+
async
|
|
1088
|
+
});
|
|
1089
|
+
} else if (async) {
|
|
1090
|
+
env.stack.push({
|
|
1091
|
+
async: true
|
|
1092
|
+
});
|
|
1097
1093
|
}
|
|
1098
|
-
return
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1094
|
+
return value;
|
|
1095
|
+
}
|
|
1096
|
+
function _ts_dispose_resources(env) {
|
|
1097
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1098
|
+
var e = new Error(message);
|
|
1099
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1100
|
+
};
|
|
1101
|
+
return (_ts_dispose_resources = function _ts_dispose_resources5(env2) {
|
|
1102
|
+
function fail(e) {
|
|
1103
|
+
env2.error = env2.hasError ? new _SuppressedError(e, env2.error, "An error was suppressed during disposal.") : e;
|
|
1104
|
+
env2.hasError = true;
|
|
1105
|
+
}
|
|
1106
|
+
var r, s = 0;
|
|
1107
|
+
function next() {
|
|
1108
|
+
while (r = env2.stack.pop()) {
|
|
1109
|
+
try {
|
|
1110
|
+
if (!r.async && s === 1) return s = 0, env2.stack.push(r), Promise.resolve().then(next);
|
|
1111
|
+
if (r.dispose) {
|
|
1112
|
+
var result = r.dispose.call(r.value);
|
|
1113
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
1114
|
+
fail(e);
|
|
1115
|
+
return next();
|
|
1116
|
+
});
|
|
1117
|
+
} else s |= 1;
|
|
1118
|
+
} catch (e) {
|
|
1119
|
+
fail(e);
|
|
1114
1120
|
}
|
|
1115
|
-
if (error !== empty) throw error;
|
|
1116
|
-
}
|
|
1117
|
-
function err(e) {
|
|
1118
|
-
error = error !== empty ? new _disposeSuppressedError(error, e) : e;
|
|
1119
|
-
return next();
|
|
1120
1121
|
}
|
|
1121
|
-
return
|
|
1122
|
+
if (s === 1) return env2.hasError ? Promise.reject(env2.error) : Promise.resolve();
|
|
1123
|
+
if (env2.hasError) throw env2.error;
|
|
1122
1124
|
}
|
|
1123
|
-
|
|
1125
|
+
return next();
|
|
1126
|
+
})(env);
|
|
1124
1127
|
}
|
|
1125
1128
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/edge-feed-replicator.ts";
|
|
1126
1129
|
var EdgeFeedReplicator = class extends import_context3.Resource {
|
|
@@ -1321,8 +1324,12 @@ var EdgeFeedReplicator = class extends import_context3.Resource {
|
|
|
1321
1324
|
(0, import_async6.scheduleMicroTask)(this._connectionCtx, async () => {
|
|
1322
1325
|
switch (message.type) {
|
|
1323
1326
|
case "metadata": {
|
|
1327
|
+
const env = {
|
|
1328
|
+
stack: [],
|
|
1329
|
+
error: void 0,
|
|
1330
|
+
hasError: false
|
|
1331
|
+
};
|
|
1324
1332
|
try {
|
|
1325
|
-
var _usingCtx = _using_ctx();
|
|
1326
1333
|
const feedKey = import_keys3.PublicKey.fromHex(message.feedKey);
|
|
1327
1334
|
const feed = this._feeds.get(feedKey);
|
|
1328
1335
|
if (!feed) {
|
|
@@ -1336,7 +1343,7 @@ var EdgeFeedReplicator = class extends import_context3.Resource {
|
|
|
1336
1343
|
});
|
|
1337
1344
|
return;
|
|
1338
1345
|
}
|
|
1339
|
-
const _guard =
|
|
1346
|
+
const _guard = _ts_add_disposable_resource(env, await this._getPushMutex(feed.key).acquire(), false);
|
|
1340
1347
|
this._remoteLength.set(feedKey, message.length);
|
|
1341
1348
|
const logMeta = {
|
|
1342
1349
|
localLength: feed.length,
|
|
@@ -1368,10 +1375,11 @@ var EdgeFeedReplicator = class extends import_context3.Resource {
|
|
|
1368
1375
|
await this._pushBlocks(feed, message.length, feed.length);
|
|
1369
1376
|
}
|
|
1370
1377
|
break;
|
|
1371
|
-
} catch (
|
|
1372
|
-
|
|
1378
|
+
} catch (e) {
|
|
1379
|
+
env.error = e;
|
|
1380
|
+
env.hasError = true;
|
|
1373
1381
|
} finally {
|
|
1374
|
-
|
|
1382
|
+
_ts_dispose_resources(env);
|
|
1375
1383
|
}
|
|
1376
1384
|
}
|
|
1377
1385
|
case "data": {
|
|
@@ -1474,9 +1482,13 @@ var EdgeFeedReplicator = class extends import_context3.Resource {
|
|
|
1474
1482
|
}
|
|
1475
1483
|
}
|
|
1476
1484
|
async _pushBlocksIfNeeded(feed) {
|
|
1485
|
+
const env = {
|
|
1486
|
+
stack: [],
|
|
1487
|
+
error: void 0,
|
|
1488
|
+
hasError: false
|
|
1489
|
+
};
|
|
1477
1490
|
try {
|
|
1478
|
-
|
|
1479
|
-
const _ = _usingCtx.u(await this._getPushMutex(feed.key).acquire());
|
|
1491
|
+
const _ = _ts_add_disposable_resource(env, await this._getPushMutex(feed.key).acquire(), false);
|
|
1480
1492
|
if (!this._remoteLength.has(feed.key)) {
|
|
1481
1493
|
(0, import_log3.log)("blocks not pushed because remote length is unknown", void 0, {
|
|
1482
1494
|
F: __dxlog_file5,
|
|
@@ -1490,10 +1502,11 @@ var EdgeFeedReplicator = class extends import_context3.Resource {
|
|
|
1490
1502
|
if (remoteLength < feed.length) {
|
|
1491
1503
|
await this._pushBlocks(feed, remoteLength, feed.length);
|
|
1492
1504
|
}
|
|
1493
|
-
} catch (
|
|
1494
|
-
|
|
1505
|
+
} catch (e) {
|
|
1506
|
+
env.error = e;
|
|
1507
|
+
env.hasError = true;
|
|
1495
1508
|
} finally {
|
|
1496
|
-
|
|
1509
|
+
_ts_dispose_resources(env);
|
|
1497
1510
|
}
|
|
1498
1511
|
}
|
|
1499
1512
|
_createConnectionContext() {
|
|
@@ -1536,12 +1549,7 @@ var bufferizeBlock = (block) => ({
|
|
|
1536
1549
|
});
|
|
1537
1550
|
var AutomergeSpaceState = class extends import_context5.Resource {
|
|
1538
1551
|
constructor(_onNewRoot) {
|
|
1539
|
-
super();
|
|
1540
|
-
this._onNewRoot = _onNewRoot;
|
|
1541
|
-
this.rootUrl = void 0;
|
|
1542
|
-
this.lastEpoch = void 0;
|
|
1543
|
-
this.onNewEpoch = new import_async8.Event();
|
|
1544
|
-
this._isProcessingRootDocs = false;
|
|
1552
|
+
super(), this._onNewRoot = _onNewRoot, this.rootUrl = void 0, this.lastEpoch = void 0, this.onNewEpoch = new import_async8.Event(), this._isProcessingRootDocs = false;
|
|
1545
1553
|
}
|
|
1546
1554
|
async _open(ctx) {
|
|
1547
1555
|
}
|
|
@@ -2043,8 +2051,7 @@ var NotarizationTeleportExtension = class extends import_teleport.RpcExtension {
|
|
|
2043
2051
|
exposed: {
|
|
2044
2052
|
NotarizationService: import_proto2.schema.getService("dxos.mesh.teleport.notarization.NotarizationService")
|
|
2045
2053
|
}
|
|
2046
|
-
});
|
|
2047
|
-
this._params = _params;
|
|
2054
|
+
}), this._params = _params;
|
|
2048
2055
|
}
|
|
2049
2056
|
async getHandlers() {
|
|
2050
2057
|
return {
|
|
@@ -2988,67 +2995,70 @@ var extractSpaceArchive = async (archive) => {
|
|
|
2988
2995
|
documents
|
|
2989
2996
|
};
|
|
2990
2997
|
};
|
|
2991
|
-
function
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
a: isAwait
|
|
3022
|
-
});
|
|
3023
|
-
}
|
|
3024
|
-
return value;
|
|
2998
|
+
function _ts_add_disposable_resource2(env, value, async) {
|
|
2999
|
+
if (value !== null && value !== void 0) {
|
|
3000
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
3001
|
+
var dispose, inner;
|
|
3002
|
+
if (async) {
|
|
3003
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
3004
|
+
dispose = value[Symbol.asyncDispose];
|
|
3005
|
+
}
|
|
3006
|
+
if (dispose === void 0) {
|
|
3007
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
3008
|
+
dispose = value[Symbol.dispose];
|
|
3009
|
+
if (async) inner = dispose;
|
|
3010
|
+
}
|
|
3011
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
3012
|
+
if (inner) dispose = function() {
|
|
3013
|
+
try {
|
|
3014
|
+
inner.call(this);
|
|
3015
|
+
} catch (e) {
|
|
3016
|
+
return Promise.reject(e);
|
|
3017
|
+
}
|
|
3018
|
+
};
|
|
3019
|
+
env.stack.push({
|
|
3020
|
+
value,
|
|
3021
|
+
dispose,
|
|
3022
|
+
async
|
|
3023
|
+
});
|
|
3024
|
+
} else if (async) {
|
|
3025
|
+
env.stack.push({
|
|
3026
|
+
async: true
|
|
3027
|
+
});
|
|
3025
3028
|
}
|
|
3026
|
-
return
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3029
|
+
return value;
|
|
3030
|
+
}
|
|
3031
|
+
function _ts_dispose_resources2(env) {
|
|
3032
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
3033
|
+
var e = new Error(message);
|
|
3034
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3035
|
+
};
|
|
3036
|
+
return (_ts_dispose_resources2 = function _ts_dispose_resources5(env2) {
|
|
3037
|
+
function fail(e) {
|
|
3038
|
+
env2.error = env2.hasError ? new _SuppressedError(e, env2.error, "An error was suppressed during disposal.") : e;
|
|
3039
|
+
env2.hasError = true;
|
|
3040
|
+
}
|
|
3041
|
+
var r, s = 0;
|
|
3042
|
+
function next() {
|
|
3043
|
+
while (r = env2.stack.pop()) {
|
|
3044
|
+
try {
|
|
3045
|
+
if (!r.async && s === 1) return s = 0, env2.stack.push(r), Promise.resolve().then(next);
|
|
3046
|
+
if (r.dispose) {
|
|
3047
|
+
var result = r.dispose.call(r.value);
|
|
3048
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
3049
|
+
fail(e);
|
|
3050
|
+
return next();
|
|
3051
|
+
});
|
|
3052
|
+
} else s |= 1;
|
|
3053
|
+
} catch (e) {
|
|
3054
|
+
fail(e);
|
|
3042
3055
|
}
|
|
3043
|
-
if (error !== empty) throw error;
|
|
3044
|
-
}
|
|
3045
|
-
function err(e) {
|
|
3046
|
-
error = error !== empty ? new _disposeSuppressedError(error, e) : e;
|
|
3047
|
-
return next();
|
|
3048
3056
|
}
|
|
3049
|
-
return
|
|
3057
|
+
if (s === 1) return env2.hasError ? Promise.reject(env2.error) : Promise.resolve();
|
|
3058
|
+
if (env2.hasError) throw env2.error;
|
|
3050
3059
|
}
|
|
3051
|
-
|
|
3060
|
+
return next();
|
|
3061
|
+
})(env);
|
|
3052
3062
|
}
|
|
3053
3063
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3054
3064
|
var SpacesServiceImpl = class {
|
|
@@ -3284,9 +3294,13 @@ var SpacesServiceImpl = class {
|
|
|
3284
3294
|
});
|
|
3285
3295
|
}
|
|
3286
3296
|
async exportSpace(request) {
|
|
3297
|
+
const env = {
|
|
3298
|
+
stack: [],
|
|
3299
|
+
error: void 0,
|
|
3300
|
+
hasError: false
|
|
3301
|
+
};
|
|
3287
3302
|
try {
|
|
3288
|
-
|
|
3289
|
-
const writer = _usingCtx.a(await new SpaceArchiveWriter().open());
|
|
3303
|
+
const writer = _ts_add_disposable_resource2(env, await new SpaceArchiveWriter().open(), true);
|
|
3290
3304
|
(0, import_invariant8.assertArgument)(import_keys9.SpaceId.isValid(request.spaceId), "Invalid space ID");
|
|
3291
3305
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3292
3306
|
const space = dataSpaceManager.getSpaceById(request.spaceId) ?? (0, import_debug3.raise)(new Error("Space not found"));
|
|
@@ -3303,10 +3317,12 @@ var SpacesServiceImpl = class {
|
|
|
3303
3317
|
return {
|
|
3304
3318
|
archive
|
|
3305
3319
|
};
|
|
3306
|
-
} catch (
|
|
3307
|
-
|
|
3320
|
+
} catch (e) {
|
|
3321
|
+
env.error = e;
|
|
3322
|
+
env.hasError = true;
|
|
3308
3323
|
} finally {
|
|
3309
|
-
|
|
3324
|
+
const result = _ts_dispose_resources2(env);
|
|
3325
|
+
if (result) await result;
|
|
3310
3326
|
}
|
|
3311
3327
|
}
|
|
3312
3328
|
async importSpace(request) {
|
|
@@ -3726,7 +3742,7 @@ var IdentityManager = class {
|
|
|
3726
3742
|
L: 135
|
|
3727
3743
|
}));
|
|
3728
3744
|
}
|
|
3729
|
-
async createIdentity({
|
|
3745
|
+
async createIdentity({ profile, deviceProfile } = {}) {
|
|
3730
3746
|
(0, import_invariant11.invariant)(!this._identity, "Identity already exists.", {
|
|
3731
3747
|
F: __dxlog_file13,
|
|
3732
3748
|
L: 140,
|
|
@@ -3784,10 +3800,8 @@ var IdentityManager = class {
|
|
|
3784
3800
|
// Feed admission.
|
|
3785
3801
|
await generator.createFeedAdmission(identityRecord.haloSpace.key, identityRecord.haloSpace.dataFeedKey, import_credentials15.AdmittedFeed.Designation.DATA)
|
|
3786
3802
|
];
|
|
3787
|
-
if (
|
|
3788
|
-
credentials.push(await generator.createProfileCredential(
|
|
3789
|
-
displayName
|
|
3790
|
-
}));
|
|
3803
|
+
if (profile) {
|
|
3804
|
+
credentials.push(await generator.createProfileCredential(profile));
|
|
3791
3805
|
}
|
|
3792
3806
|
credentials.push(await generator.createDeviceAuthorization(identityRecord.deviceKey));
|
|
3793
3807
|
credentials.push(await generator.createDeviceProfile({
|
|
@@ -3904,7 +3918,7 @@ var IdentityManager = class {
|
|
|
3904
3918
|
displayName: this._identity.profileDocument?.displayName
|
|
3905
3919
|
}, {
|
|
3906
3920
|
F: __dxlog_file13,
|
|
3907
|
-
L:
|
|
3921
|
+
L: 277,
|
|
3908
3922
|
S: this,
|
|
3909
3923
|
C: (f, a) => f(...a)
|
|
3910
3924
|
});
|
|
@@ -3918,7 +3932,7 @@ var IdentityManager = class {
|
|
|
3918
3932
|
deviceKey: identity.deviceKey
|
|
3919
3933
|
}, {
|
|
3920
3934
|
F: __dxlog_file13,
|
|
3921
|
-
L:
|
|
3935
|
+
L: 288,
|
|
3922
3936
|
S: this,
|
|
3923
3937
|
C: (f, a) => f(...a)
|
|
3924
3938
|
});
|
|
@@ -3929,7 +3943,7 @@ var IdentityManager = class {
|
|
|
3929
3943
|
async updateProfile(profile) {
|
|
3930
3944
|
(0, import_invariant11.invariant)(this._identity, "Identity not initialized.", {
|
|
3931
3945
|
F: __dxlog_file13,
|
|
3932
|
-
L:
|
|
3946
|
+
L: 295,
|
|
3933
3947
|
S: this,
|
|
3934
3948
|
A: [
|
|
3935
3949
|
"this._identity",
|
|
@@ -3960,7 +3974,7 @@ var IdentityManager = class {
|
|
|
3960
3974
|
async updateDeviceProfile(profile) {
|
|
3961
3975
|
(0, import_invariant11.invariant)(this._identity, "Identity not initialized.", {
|
|
3962
3976
|
F: __dxlog_file13,
|
|
3963
|
-
L:
|
|
3977
|
+
L: 312,
|
|
3964
3978
|
S: this,
|
|
3965
3979
|
A: [
|
|
3966
3980
|
"this._identity",
|
|
@@ -3996,7 +4010,7 @@ var IdentityManager = class {
|
|
|
3996
4010
|
async _constructIdentity(identityRecord) {
|
|
3997
4011
|
(0, import_invariant11.invariant)(!this._identity, void 0, {
|
|
3998
4012
|
F: __dxlog_file13,
|
|
3999
|
-
L:
|
|
4013
|
+
L: 338,
|
|
4000
4014
|
S: this,
|
|
4001
4015
|
A: [
|
|
4002
4016
|
"!this._identity",
|
|
@@ -4007,7 +4021,7 @@ var IdentityManager = class {
|
|
|
4007
4021
|
identityRecord
|
|
4008
4022
|
}, {
|
|
4009
4023
|
F: __dxlog_file13,
|
|
4010
|
-
L:
|
|
4024
|
+
L: 339,
|
|
4011
4025
|
S: this,
|
|
4012
4026
|
C: (f, a) => f(...a)
|
|
4013
4027
|
});
|
|
@@ -4022,7 +4036,7 @@ var IdentityManager = class {
|
|
|
4022
4036
|
});
|
|
4023
4037
|
(0, import_invariant11.invariant)(identityRecord.haloSpace.controlFeedKey, void 0, {
|
|
4024
4038
|
F: __dxlog_file13,
|
|
4025
|
-
L:
|
|
4039
|
+
L: 352,
|
|
4026
4040
|
S: this,
|
|
4027
4041
|
A: [
|
|
4028
4042
|
"identityRecord.haloSpace.controlFeedKey",
|
|
@@ -4034,7 +4048,7 @@ var IdentityManager = class {
|
|
|
4034
4048
|
});
|
|
4035
4049
|
(0, import_invariant11.invariant)(identityRecord.haloSpace.dataFeedKey, void 0, {
|
|
4036
4050
|
F: __dxlog_file13,
|
|
4037
|
-
L:
|
|
4051
|
+
L: 356,
|
|
4038
4052
|
S: this,
|
|
4039
4053
|
A: [
|
|
4040
4054
|
"identityRecord.haloSpace.dataFeedKey",
|
|
@@ -4073,7 +4087,7 @@ var IdentityManager = class {
|
|
|
4073
4087
|
identityKey: identityRecord.identityKey
|
|
4074
4088
|
}, {
|
|
4075
4089
|
F: __dxlog_file13,
|
|
4076
|
-
L:
|
|
4090
|
+
L: 387,
|
|
4077
4091
|
S: this,
|
|
4078
4092
|
C: (f, a) => f(...a)
|
|
4079
4093
|
});
|
|
@@ -4098,7 +4112,7 @@ var IdentityManager = class {
|
|
|
4098
4112
|
onAuthFailure: () => {
|
|
4099
4113
|
import_log11.log.warn("auth failure", void 0, {
|
|
4100
4114
|
F: __dxlog_file13,
|
|
4101
|
-
L:
|
|
4115
|
+
L: 412,
|
|
4102
4116
|
S: this,
|
|
4103
4117
|
C: (f, a) => f(...a)
|
|
4104
4118
|
});
|
|
@@ -4123,13 +4137,7 @@ var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/s
|
|
|
4123
4137
|
var DEFAULT_SPACE_SEARCH_TIMEOUT = 1e4;
|
|
4124
4138
|
var IdentityServiceImpl = class extends import_context10.Resource {
|
|
4125
4139
|
constructor(_identityManager, _recoveryManager, _keyring, _dataSpaceManagerProvider, _createIdentity, _onProfileUpdate) {
|
|
4126
|
-
super();
|
|
4127
|
-
this._identityManager = _identityManager;
|
|
4128
|
-
this._recoveryManager = _recoveryManager;
|
|
4129
|
-
this._keyring = _keyring;
|
|
4130
|
-
this._dataSpaceManagerProvider = _dataSpaceManagerProvider;
|
|
4131
|
-
this._createIdentity = _createIdentity;
|
|
4132
|
-
this._onProfileUpdate = _onProfileUpdate;
|
|
4140
|
+
super(), this._identityManager = _identityManager, this._recoveryManager = _recoveryManager, this._keyring = _keyring, this._dataSpaceManagerProvider = _dataSpaceManagerProvider, this._createIdentity = _createIdentity, this._onProfileUpdate = _onProfileUpdate;
|
|
4133
4141
|
}
|
|
4134
4142
|
async _open() {
|
|
4135
4143
|
const identity = this._identityManager.identity;
|
|
@@ -4139,7 +4147,7 @@ var IdentityServiceImpl = class extends import_context10.Resource {
|
|
|
4139
4147
|
}
|
|
4140
4148
|
async createIdentity(request) {
|
|
4141
4149
|
await this._createIdentity({
|
|
4142
|
-
|
|
4150
|
+
profile: request.profile,
|
|
4143
4151
|
deviceProfile: request.deviceProfile
|
|
4144
4152
|
});
|
|
4145
4153
|
const dataSpaceManager = this._dataSpaceManagerProvider();
|
|
@@ -4312,67 +4320,70 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4312
4320
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4313
4321
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4314
4322
|
}
|
|
4315
|
-
function
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
a: isAwait
|
|
4346
|
-
});
|
|
4347
|
-
}
|
|
4348
|
-
return value;
|
|
4323
|
+
function _ts_add_disposable_resource3(env, value, async) {
|
|
4324
|
+
if (value !== null && value !== void 0) {
|
|
4325
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4326
|
+
var dispose, inner;
|
|
4327
|
+
if (async) {
|
|
4328
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
4329
|
+
dispose = value[Symbol.asyncDispose];
|
|
4330
|
+
}
|
|
4331
|
+
if (dispose === void 0) {
|
|
4332
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
4333
|
+
dispose = value[Symbol.dispose];
|
|
4334
|
+
if (async) inner = dispose;
|
|
4335
|
+
}
|
|
4336
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
4337
|
+
if (inner) dispose = function() {
|
|
4338
|
+
try {
|
|
4339
|
+
inner.call(this);
|
|
4340
|
+
} catch (e) {
|
|
4341
|
+
return Promise.reject(e);
|
|
4342
|
+
}
|
|
4343
|
+
};
|
|
4344
|
+
env.stack.push({
|
|
4345
|
+
value,
|
|
4346
|
+
dispose,
|
|
4347
|
+
async
|
|
4348
|
+
});
|
|
4349
|
+
} else if (async) {
|
|
4350
|
+
env.stack.push({
|
|
4351
|
+
async: true
|
|
4352
|
+
});
|
|
4349
4353
|
}
|
|
4350
|
-
return
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4354
|
+
return value;
|
|
4355
|
+
}
|
|
4356
|
+
function _ts_dispose_resources3(env) {
|
|
4357
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
4358
|
+
var e = new Error(message);
|
|
4359
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4360
|
+
};
|
|
4361
|
+
return (_ts_dispose_resources3 = function _ts_dispose_resources5(env2) {
|
|
4362
|
+
function fail(e) {
|
|
4363
|
+
env2.error = env2.hasError ? new _SuppressedError(e, env2.error, "An error was suppressed during disposal.") : e;
|
|
4364
|
+
env2.hasError = true;
|
|
4365
|
+
}
|
|
4366
|
+
var r, s = 0;
|
|
4367
|
+
function next() {
|
|
4368
|
+
while (r = env2.stack.pop()) {
|
|
4369
|
+
try {
|
|
4370
|
+
if (!r.async && s === 1) return s = 0, env2.stack.push(r), Promise.resolve().then(next);
|
|
4371
|
+
if (r.dispose) {
|
|
4372
|
+
var result = r.dispose.call(r.value);
|
|
4373
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
4374
|
+
fail(e);
|
|
4375
|
+
return next();
|
|
4376
|
+
});
|
|
4377
|
+
} else s |= 1;
|
|
4378
|
+
} catch (e) {
|
|
4379
|
+
fail(e);
|
|
4366
4380
|
}
|
|
4367
|
-
if (error !== empty) throw error;
|
|
4368
4381
|
}
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
return next();
|
|
4372
|
-
}
|
|
4373
|
-
return next();
|
|
4382
|
+
if (s === 1) return env2.hasError ? Promise.reject(env2.error) : Promise.resolve();
|
|
4383
|
+
if (env2.hasError) throw env2.error;
|
|
4374
4384
|
}
|
|
4375
|
-
|
|
4385
|
+
return next();
|
|
4386
|
+
})(env);
|
|
4376
4387
|
}
|
|
4377
4388
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
4378
4389
|
var DataSpace = class {
|
|
@@ -4772,8 +4783,12 @@ var DataSpace = class {
|
|
|
4772
4783
|
let handle;
|
|
4773
4784
|
queueMicrotask(async () => {
|
|
4774
4785
|
try {
|
|
4786
|
+
const env = {
|
|
4787
|
+
stack: [],
|
|
4788
|
+
error: void 0,
|
|
4789
|
+
hasError: false
|
|
4790
|
+
};
|
|
4775
4791
|
try {
|
|
4776
|
-
var _usingCtx = _using_ctx3();
|
|
4777
4792
|
await (0, import_debug.warnAfterTimeout)(5e3, "Automerge root doc load timeout (DataSpace)", async () => {
|
|
4778
4793
|
handle = await (0, import_context4.cancelWithContext)(this._ctx, this._echoHost.automergeRepo.find(rootUrl, import_echo_pipeline.FIND_PARAMS));
|
|
4779
4794
|
await (0, import_context4.cancelWithContext)(this._ctx, handle.whenReady());
|
|
@@ -4781,10 +4796,7 @@ var DataSpace = class {
|
|
|
4781
4796
|
if (this._ctx.disposed) {
|
|
4782
4797
|
return;
|
|
4783
4798
|
}
|
|
4784
|
-
const _guard = (
|
|
4785
|
-
// Ensure only one root is processed at a time.
|
|
4786
|
-
_usingCtx.u(await this._epochProcessingMutex.acquire())
|
|
4787
|
-
);
|
|
4799
|
+
const _guard = _ts_add_disposable_resource3(env, await this._epochProcessingMutex.acquire(), false);
|
|
4788
4800
|
const doc = handle.doc() ?? (0, import_invariant3.failedInvariant)();
|
|
4789
4801
|
if (!doc.access?.spaceKey) {
|
|
4790
4802
|
handle.change((doc2) => {
|
|
@@ -4803,10 +4815,11 @@ var DataSpace = class {
|
|
|
4803
4815
|
} else {
|
|
4804
4816
|
this.stateUpdate.emit();
|
|
4805
4817
|
}
|
|
4806
|
-
} catch (
|
|
4807
|
-
|
|
4818
|
+
} catch (e) {
|
|
4819
|
+
env.error = e;
|
|
4820
|
+
env.hasError = true;
|
|
4808
4821
|
} finally {
|
|
4809
|
-
|
|
4822
|
+
_ts_dispose_resources3(env);
|
|
4810
4823
|
}
|
|
4811
4824
|
} catch (err) {
|
|
4812
4825
|
if (err instanceof import_context4.ContextDisposedError) {
|
|
@@ -5271,15 +5284,10 @@ var InvitationGuestExtension = class extends import_teleport2.RpcExtension {
|
|
|
5271
5284
|
exposed: {
|
|
5272
5285
|
InvitationHostService: import_proto4.schema.getService("dxos.halo.invitations.InvitationHostService")
|
|
5273
5286
|
}
|
|
5274
|
-
})
|
|
5275
|
-
this._invitationFlowMutex = _invitationFlowMutex;
|
|
5276
|
-
this._callbacks = _callbacks;
|
|
5277
|
-
this._ctx = new import_context13.Context(void 0, {
|
|
5287
|
+
}), this._invitationFlowMutex = _invitationFlowMutex, this._callbacks = _callbacks, this._ctx = new import_context13.Context(void 0, {
|
|
5278
5288
|
F: __dxlog_file18,
|
|
5279
5289
|
L: 38
|
|
5280
|
-
});
|
|
5281
|
-
this._remoteOptionsTrigger = new import_async17.Trigger();
|
|
5282
|
-
this._invitationFlowLock = null;
|
|
5290
|
+
}), this._remoteOptionsTrigger = new import_async17.Trigger(), this._invitationFlowLock = null;
|
|
5283
5291
|
}
|
|
5284
5292
|
hasFlowLock() {
|
|
5285
5293
|
return this._invitationFlowLock != null;
|
|
@@ -5395,20 +5403,10 @@ var InvitationHostExtension = class extends import_teleport3.RpcExtension {
|
|
|
5395
5403
|
exposed: {
|
|
5396
5404
|
InvitationHostService: import_proto5.schema.getService("dxos.halo.invitations.InvitationHostService")
|
|
5397
5405
|
}
|
|
5398
|
-
})
|
|
5399
|
-
this._invitationFlowMutex = _invitationFlowMutex;
|
|
5400
|
-
this._callbacks = _callbacks;
|
|
5401
|
-
this._ctx = new import_context14.Context(void 0, {
|
|
5406
|
+
}), this._invitationFlowMutex = _invitationFlowMutex, this._callbacks = _callbacks, this._ctx = new import_context14.Context(void 0, {
|
|
5402
5407
|
F: __dxlog_file19,
|
|
5403
5408
|
L: 57
|
|
5404
|
-
});
|
|
5405
|
-
this._remoteOptionsTrigger = new import_async18.Trigger();
|
|
5406
|
-
this._challenge = void 0;
|
|
5407
|
-
this.guestProfile = void 0;
|
|
5408
|
-
this.authenticationPassed = false;
|
|
5409
|
-
this.authenticationRetry = 0;
|
|
5410
|
-
this.completedTrigger = new import_async18.Trigger();
|
|
5411
|
-
this._invitationFlowLock = null;
|
|
5409
|
+
}), this._remoteOptionsTrigger = new import_async18.Trigger(), this._challenge = void 0, this.guestProfile = void 0, this.authenticationPassed = false, this.authenticationRetry = 0, this.completedTrigger = new import_async18.Trigger(), this._invitationFlowLock = null;
|
|
5412
5410
|
}
|
|
5413
5411
|
hasFlowLock() {
|
|
5414
5412
|
return this._invitationFlowLock != null;
|
|
@@ -7072,14 +7070,14 @@ var InvitationsManager = class {
|
|
|
7072
7070
|
}
|
|
7073
7071
|
}, {
|
|
7074
7072
|
F: __dxlog_file24,
|
|
7075
|
-
L:
|
|
7073
|
+
L: 239
|
|
7076
7074
|
});
|
|
7077
7075
|
ctx.onDispose(() => {
|
|
7078
7076
|
(0, import_log20.log)("complete", {
|
|
7079
7077
|
...handler.toJSON()
|
|
7080
7078
|
}, {
|
|
7081
7079
|
F: __dxlog_file24,
|
|
7082
|
-
L:
|
|
7080
|
+
L: 246,
|
|
7083
7081
|
S: this,
|
|
7084
7082
|
C: (f, a) => f(...a)
|
|
7085
7083
|
});
|
|
@@ -7112,7 +7110,7 @@ var InvitationsManager = class {
|
|
|
7112
7110
|
...handler.toJSON()
|
|
7113
7111
|
}, {
|
|
7114
7112
|
F: __dxlog_file24,
|
|
7115
|
-
L:
|
|
7113
|
+
L: 274,
|
|
7116
7114
|
S: this,
|
|
7117
7115
|
C: (f, a) => f(...a)
|
|
7118
7116
|
});
|
|
@@ -7123,7 +7121,7 @@ var InvitationsManager = class {
|
|
|
7123
7121
|
} else {
|
|
7124
7122
|
import_log20.log.warn("auth failed", err, {
|
|
7125
7123
|
F: __dxlog_file24,
|
|
7126
|
-
L:
|
|
7124
|
+
L: 277,
|
|
7127
7125
|
S: this,
|
|
7128
7126
|
C: (f, a) => f(...a)
|
|
7129
7127
|
});
|
|
@@ -7136,14 +7134,14 @@ var InvitationsManager = class {
|
|
|
7136
7134
|
}
|
|
7137
7135
|
}, {
|
|
7138
7136
|
F: __dxlog_file24,
|
|
7139
|
-
L:
|
|
7137
|
+
L: 271
|
|
7140
7138
|
});
|
|
7141
7139
|
ctx.onDispose(() => {
|
|
7142
7140
|
(0, import_log20.log)("complete", {
|
|
7143
7141
|
...handler.toJSON()
|
|
7144
7142
|
}, {
|
|
7145
7143
|
F: __dxlog_file24,
|
|
7146
|
-
L:
|
|
7144
|
+
L: 284,
|
|
7147
7145
|
S: this,
|
|
7148
7146
|
C: (f, a) => f(...a)
|
|
7149
7147
|
});
|
|
@@ -7188,7 +7186,7 @@ var InvitationsManager = class {
|
|
|
7188
7186
|
} catch (err) {
|
|
7189
7187
|
import_log20.log.catch(err, void 0, {
|
|
7190
7188
|
F: __dxlog_file24,
|
|
7191
|
-
L:
|
|
7189
|
+
L: 320,
|
|
7192
7190
|
S: this,
|
|
7193
7191
|
C: (f, a) => f(...a)
|
|
7194
7192
|
});
|
|
@@ -7333,13 +7331,7 @@ var AGENT_STATUS_QUERY_RETRY_JITTER = 1e3;
|
|
|
7333
7331
|
var AGENT_FEED_ADDED_CHECK_INTERVAL_MS = 3e3;
|
|
7334
7332
|
var EdgeAgentManager = class extends import_context16.Resource {
|
|
7335
7333
|
constructor(_edgeFeatures, _edgeHttpClient, _dataSpaceManager, _identity) {
|
|
7336
|
-
super();
|
|
7337
|
-
this._edgeFeatures = _edgeFeatures;
|
|
7338
|
-
this._edgeHttpClient = _edgeHttpClient;
|
|
7339
|
-
this._dataSpaceManager = _dataSpaceManager;
|
|
7340
|
-
this._identity = _identity;
|
|
7341
|
-
this.agentStatusChanged = new import_async21.Event();
|
|
7342
|
-
this._lastKnownDeviceCount = 0;
|
|
7334
|
+
super(), this._edgeFeatures = _edgeFeatures, this._edgeHttpClient = _edgeHttpClient, this._dataSpaceManager = _dataSpaceManager, this._identity = _identity, this.agentStatusChanged = new import_async21.Event(), this._lastKnownDeviceCount = 0;
|
|
7343
7335
|
}
|
|
7344
7336
|
get agentStatus() {
|
|
7345
7337
|
return this._agentStatus;
|
|
@@ -7615,7 +7607,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7615
7607
|
const identity = this._identityProvider();
|
|
7616
7608
|
(0, import_invariant24.invariant)(identity, void 0, {
|
|
7617
7609
|
F: __dxlog_file27,
|
|
7618
|
-
L:
|
|
7610
|
+
L: 39,
|
|
7619
7611
|
S: this,
|
|
7620
7612
|
A: [
|
|
7621
7613
|
"identity",
|
|
@@ -7666,7 +7658,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7666
7658
|
async requestRecoveryChallenge() {
|
|
7667
7659
|
(0, import_invariant24.invariant)(this._edgeClient, "Not connected to EDGE.", {
|
|
7668
7660
|
F: __dxlog_file27,
|
|
7669
|
-
L:
|
|
7661
|
+
L: 76,
|
|
7670
7662
|
S: this,
|
|
7671
7663
|
A: [
|
|
7672
7664
|
"this._edgeClient",
|
|
@@ -7696,7 +7688,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7696
7688
|
async recoverIdentityWithExternalSignature({ lookupKey, deviceKey, controlFeedKey, signature, clientDataJson, authenticatorData }) {
|
|
7697
7689
|
(0, import_invariant24.invariant)(this._edgeClient, "Not connected to EDGE.", {
|
|
7698
7690
|
F: __dxlog_file27,
|
|
7699
|
-
L:
|
|
7691
|
+
L: 108,
|
|
7700
7692
|
S: this,
|
|
7701
7693
|
A: [
|
|
7702
7694
|
"this._edgeClient",
|
|
@@ -7730,7 +7722,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7730
7722
|
async recoverIdentityWithToken({ token }) {
|
|
7731
7723
|
(0, import_invariant24.invariant)(this._edgeClient, "Not connected to EDGE.", {
|
|
7732
7724
|
F: __dxlog_file27,
|
|
7733
|
-
L:
|
|
7725
|
+
L: 141,
|
|
7734
7726
|
S: this,
|
|
7735
7727
|
A: [
|
|
7736
7728
|
"this._edgeClient",
|
|
@@ -7758,7 +7750,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7758
7750
|
async recoverIdentity({ recoveryCode }) {
|
|
7759
7751
|
(0, import_invariant24.invariant)(this._edgeClient, "Not connected to EDGE.", {
|
|
7760
7752
|
F: __dxlog_file27,
|
|
7761
|
-
L:
|
|
7753
|
+
L: 165,
|
|
7762
7754
|
S: this,
|
|
7763
7755
|
A: [
|
|
7764
7756
|
"this._edgeClient",
|
|
@@ -7789,7 +7781,7 @@ var EdgeIdentityRecoveryManager = class {
|
|
|
7789
7781
|
}
|
|
7790
7782
|
import_log24.log.info("recovering identity", response, {
|
|
7791
7783
|
F: __dxlog_file27,
|
|
7792
|
-
L:
|
|
7784
|
+
L: 191,
|
|
7793
7785
|
S: this,
|
|
7794
7786
|
C: (f, a) => f(...a)
|
|
7795
7787
|
});
|
|
@@ -7815,86 +7807,75 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
7815
7807
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7816
7808
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7817
7809
|
}
|
|
7818
|
-
function
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
a: isAwait
|
|
7849
|
-
});
|
|
7850
|
-
}
|
|
7851
|
-
return value;
|
|
7810
|
+
function _ts_add_disposable_resource4(env, value, async) {
|
|
7811
|
+
if (value !== null && value !== void 0) {
|
|
7812
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
7813
|
+
var dispose, inner;
|
|
7814
|
+
if (async) {
|
|
7815
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7816
|
+
dispose = value[Symbol.asyncDispose];
|
|
7817
|
+
}
|
|
7818
|
+
if (dispose === void 0) {
|
|
7819
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
7820
|
+
dispose = value[Symbol.dispose];
|
|
7821
|
+
if (async) inner = dispose;
|
|
7822
|
+
}
|
|
7823
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
7824
|
+
if (inner) dispose = function() {
|
|
7825
|
+
try {
|
|
7826
|
+
inner.call(this);
|
|
7827
|
+
} catch (e) {
|
|
7828
|
+
return Promise.reject(e);
|
|
7829
|
+
}
|
|
7830
|
+
};
|
|
7831
|
+
env.stack.push({
|
|
7832
|
+
value,
|
|
7833
|
+
dispose,
|
|
7834
|
+
async
|
|
7835
|
+
});
|
|
7836
|
+
} else if (async) {
|
|
7837
|
+
env.stack.push({
|
|
7838
|
+
async: true
|
|
7839
|
+
});
|
|
7852
7840
|
}
|
|
7853
|
-
return
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7841
|
+
return value;
|
|
7842
|
+
}
|
|
7843
|
+
function _ts_dispose_resources4(env) {
|
|
7844
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
7845
|
+
var e = new Error(message);
|
|
7846
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7847
|
+
};
|
|
7848
|
+
return (_ts_dispose_resources4 = function _ts_dispose_resources5(env2) {
|
|
7849
|
+
function fail(e) {
|
|
7850
|
+
env2.error = env2.hasError ? new _SuppressedError(e, env2.error, "An error was suppressed during disposal.") : e;
|
|
7851
|
+
env2.hasError = true;
|
|
7852
|
+
}
|
|
7853
|
+
var r, s = 0;
|
|
7854
|
+
function next() {
|
|
7855
|
+
while (r = env2.stack.pop()) {
|
|
7856
|
+
try {
|
|
7857
|
+
if (!r.async && s === 1) return s = 0, env2.stack.push(r), Promise.resolve().then(next);
|
|
7858
|
+
if (r.dispose) {
|
|
7859
|
+
var result = r.dispose.call(r.value);
|
|
7860
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
7861
|
+
fail(e);
|
|
7862
|
+
return next();
|
|
7863
|
+
});
|
|
7864
|
+
} else s |= 1;
|
|
7865
|
+
} catch (e) {
|
|
7866
|
+
fail(e);
|
|
7869
7867
|
}
|
|
7870
|
-
if (error !== empty) throw error;
|
|
7871
|
-
}
|
|
7872
|
-
function err(e) {
|
|
7873
|
-
error = error !== empty ? new _disposeSuppressedError(error, e) : e;
|
|
7874
|
-
return next();
|
|
7875
7868
|
}
|
|
7876
|
-
return
|
|
7869
|
+
if (s === 1) return env2.hasError ? Promise.reject(env2.error) : Promise.resolve();
|
|
7870
|
+
if (env2.hasError) throw env2.error;
|
|
7877
7871
|
}
|
|
7878
|
-
|
|
7872
|
+
return next();
|
|
7873
|
+
})(env);
|
|
7879
7874
|
}
|
|
7880
7875
|
var __dxlog_file28 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
7881
7876
|
var ServiceContext = class extends import_context17.Resource {
|
|
7882
7877
|
constructor(storage, level, networkManager, signalManager, _edgeConnection, _edgeHttpClient, _runtimeParams, _edgeFeatures) {
|
|
7883
|
-
super();
|
|
7884
|
-
this.storage = storage;
|
|
7885
|
-
this.level = level;
|
|
7886
|
-
this.networkManager = networkManager;
|
|
7887
|
-
this.signalManager = signalManager;
|
|
7888
|
-
this._edgeConnection = _edgeConnection;
|
|
7889
|
-
this._edgeHttpClient = _edgeHttpClient;
|
|
7890
|
-
this._runtimeParams = _runtimeParams;
|
|
7891
|
-
this._edgeFeatures = _edgeFeatures;
|
|
7892
|
-
this._edgeIdentityUpdateMutex = new import_async22.Mutex();
|
|
7893
|
-
this.initialized = new import_async22.Trigger();
|
|
7894
|
-
this._meshReplicator = void 0;
|
|
7895
|
-
this._echoEdgeReplicator = void 0;
|
|
7896
|
-
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
7897
|
-
this._instanceId = import_keys17.PublicKey.random().toHex();
|
|
7878
|
+
super(), this.storage = storage, this.level = level, this.networkManager = networkManager, this.signalManager = signalManager, this._edgeConnection = _edgeConnection, this._edgeHttpClient = _edgeHttpClient, this._runtimeParams = _runtimeParams, this._edgeFeatures = _edgeFeatures, this._edgeIdentityUpdateMutex = new import_async22.Mutex(), this.initialized = new import_async22.Trigger(), this._meshReplicator = void 0, this._echoEdgeReplicator = void 0, this._handlerFactories = /* @__PURE__ */ new Map(), this._instanceId = import_keys17.PublicKey.random().toHex();
|
|
7898
7879
|
this.metadataStore = new import_echo_pipeline4.MetadataStore(storage.createDirectory("metadata"));
|
|
7899
7880
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
7900
7881
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
@@ -7929,7 +7910,10 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
7929
7910
|
this.echoHost = new import_echo_pipeline4.EchoHost({
|
|
7930
7911
|
kv: this.level,
|
|
7931
7912
|
peerIdProvider: () => this.identityManager.identity?.deviceKey?.toHex(),
|
|
7932
|
-
getSpaceKeyByRootDocumentId: (documentId) => this.spaceManager.findSpaceByRootDocumentId(documentId)?.key
|
|
7913
|
+
getSpaceKeyByRootDocumentId: (documentId) => this.spaceManager.findSpaceByRootDocumentId(documentId)?.key,
|
|
7914
|
+
indexing: {
|
|
7915
|
+
vector: this._runtimeParams?.enableVectorIndexing
|
|
7916
|
+
}
|
|
7933
7917
|
});
|
|
7934
7918
|
this._meshReplicator = new import_echo_pipeline4.MeshEchoReplicator();
|
|
7935
7919
|
this.invitations = new InvitationsHandler(this.networkManager, this._edgeHttpClient, _runtimeParams?.invitationConnectionDefaultParams);
|
|
@@ -7948,7 +7932,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
7948
7932
|
await this._checkStorageVersion();
|
|
7949
7933
|
(0, import_log23.log)("opening...", void 0, {
|
|
7950
7934
|
F: __dxlog_file28,
|
|
7951
|
-
L:
|
|
7935
|
+
L: 203,
|
|
7952
7936
|
S: this,
|
|
7953
7937
|
C: (f, a) => f(...a)
|
|
7954
7938
|
});
|
|
@@ -7956,7 +7940,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
7956
7940
|
id: this._instanceId
|
|
7957
7941
|
}), {
|
|
7958
7942
|
F: __dxlog_file28,
|
|
7959
|
-
L:
|
|
7943
|
+
L: 204,
|
|
7960
7944
|
S: this,
|
|
7961
7945
|
C: (f, a) => f(...a)
|
|
7962
7946
|
});
|
|
@@ -7983,7 +7967,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
7983
7967
|
count: loadedInvitations.invitations?.length
|
|
7984
7968
|
}, {
|
|
7985
7969
|
F: __dxlog_file28,
|
|
7986
|
-
L:
|
|
7970
|
+
L: 232,
|
|
7987
7971
|
S: this,
|
|
7988
7972
|
C: (f, a) => f(...a)
|
|
7989
7973
|
});
|
|
@@ -7991,13 +7975,13 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
7991
7975
|
id: this._instanceId
|
|
7992
7976
|
}), {
|
|
7993
7977
|
F: __dxlog_file28,
|
|
7994
|
-
L:
|
|
7978
|
+
L: 234,
|
|
7995
7979
|
S: this,
|
|
7996
7980
|
C: (f, a) => f(...a)
|
|
7997
7981
|
});
|
|
7998
7982
|
(0, import_log23.log)("opened", void 0, {
|
|
7999
7983
|
F: __dxlog_file28,
|
|
8000
|
-
L:
|
|
7984
|
+
L: 235,
|
|
8001
7985
|
S: this,
|
|
8002
7986
|
C: (f, a) => f(...a)
|
|
8003
7987
|
});
|
|
@@ -8005,7 +7989,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8005
7989
|
async _close(ctx) {
|
|
8006
7990
|
(0, import_log23.log)("closing...", void 0, {
|
|
8007
7991
|
F: __dxlog_file28,
|
|
8008
|
-
L:
|
|
7992
|
+
L: 239,
|
|
8009
7993
|
S: this,
|
|
8010
7994
|
C: (f, a) => f(...a)
|
|
8011
7995
|
});
|
|
@@ -8024,7 +8008,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8024
8008
|
await this._edgeConnection?.close();
|
|
8025
8009
|
(0, import_log23.log)("closed", void 0, {
|
|
8026
8010
|
F: __dxlog_file28,
|
|
8027
|
-
L:
|
|
8011
|
+
L: 255,
|
|
8028
8012
|
S: this,
|
|
8029
8013
|
C: (f, a) => f(...a)
|
|
8030
8014
|
});
|
|
@@ -8035,7 +8019,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8035
8019
|
await identity.joinNetwork();
|
|
8036
8020
|
await this._initialize(new import_context17.Context(void 0, {
|
|
8037
8021
|
F: __dxlog_file28,
|
|
8038
|
-
L:
|
|
8022
|
+
L: 262
|
|
8039
8023
|
}));
|
|
8040
8024
|
return identity;
|
|
8041
8025
|
}
|
|
@@ -8046,7 +8030,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8046
8030
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
8047
8031
|
(0, import_invariant23.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
8048
8032
|
F: __dxlog_file28,
|
|
8049
|
-
L:
|
|
8033
|
+
L: 271,
|
|
8050
8034
|
S: this,
|
|
8051
8035
|
A: [
|
|
8052
8036
|
"factory",
|
|
@@ -8072,7 +8056,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8072
8056
|
await this.identityManager.acceptIdentity(identity, identityRecord, params.deviceProfile);
|
|
8073
8057
|
await this._initialize(new import_context17.Context(void 0, {
|
|
8074
8058
|
F: __dxlog_file28,
|
|
8075
|
-
L:
|
|
8059
|
+
L: 290
|
|
8076
8060
|
}));
|
|
8077
8061
|
return identity;
|
|
8078
8062
|
}
|
|
@@ -8086,7 +8070,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8086
8070
|
async _initialize(ctx) {
|
|
8087
8071
|
(0, import_log23.log)("initializing spaces...", void 0, {
|
|
8088
8072
|
F: __dxlog_file28,
|
|
8089
|
-
L:
|
|
8073
|
+
L: 305,
|
|
8090
8074
|
S: this,
|
|
8091
8075
|
C: (f, a) => f(...a)
|
|
8092
8076
|
});
|
|
@@ -8125,7 +8109,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8125
8109
|
this._handlerFactories.set(import_services22.Invitation.Kind.SPACE, (invitation) => {
|
|
8126
8110
|
(0, import_invariant23.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
8127
8111
|
F: __dxlog_file28,
|
|
8128
|
-
L:
|
|
8112
|
+
L: 343,
|
|
8129
8113
|
S: this,
|
|
8130
8114
|
A: [
|
|
8131
8115
|
"this.dataSpaceManager",
|
|
@@ -8149,7 +8133,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8149
8133
|
details: assertion
|
|
8150
8134
|
}, {
|
|
8151
8135
|
F: __dxlog_file28,
|
|
8152
|
-
L:
|
|
8136
|
+
L: 359,
|
|
8153
8137
|
S: this,
|
|
8154
8138
|
C: (f, a) => f(...a)
|
|
8155
8139
|
});
|
|
@@ -8160,7 +8144,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8160
8144
|
details: assertion
|
|
8161
8145
|
}, {
|
|
8162
8146
|
F: __dxlog_file28,
|
|
8163
|
-
L:
|
|
8147
|
+
L: 363,
|
|
8164
8148
|
S: this,
|
|
8165
8149
|
C: (f, a) => f(...a)
|
|
8166
8150
|
});
|
|
@@ -8171,7 +8155,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8171
8155
|
details: assertion
|
|
8172
8156
|
}, {
|
|
8173
8157
|
F: __dxlog_file28,
|
|
8174
|
-
L:
|
|
8158
|
+
L: 368,
|
|
8175
8159
|
S: this,
|
|
8176
8160
|
C: (f, a) => f(...a)
|
|
8177
8161
|
});
|
|
@@ -8182,7 +8166,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8182
8166
|
} catch (err) {
|
|
8183
8167
|
import_log23.log.catch(err, void 0, {
|
|
8184
8168
|
F: __dxlog_file28,
|
|
8185
|
-
L:
|
|
8169
|
+
L: 374,
|
|
8186
8170
|
S: this,
|
|
8187
8171
|
C: (f, a) => f(...a)
|
|
8188
8172
|
});
|
|
@@ -8192,9 +8176,13 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8192
8176
|
await identity.space.spaceState.addCredentialProcessor(this._deviceSpaceSync);
|
|
8193
8177
|
}
|
|
8194
8178
|
async _setNetworkIdentity(params) {
|
|
8179
|
+
const env = {
|
|
8180
|
+
stack: [],
|
|
8181
|
+
error: void 0,
|
|
8182
|
+
hasError: false
|
|
8183
|
+
};
|
|
8195
8184
|
try {
|
|
8196
|
-
|
|
8197
|
-
const _ = _usingCtx.u(await this._edgeIdentityUpdateMutex.acquire());
|
|
8185
|
+
const _ = _ts_add_disposable_resource4(env, await this._edgeIdentityUpdateMutex.acquire(), false);
|
|
8198
8186
|
let edgeIdentity;
|
|
8199
8187
|
const identity = this.identityManager.identity;
|
|
8200
8188
|
if (identity) {
|
|
@@ -8203,7 +8191,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8203
8191
|
swarms: this.networkManager.topics
|
|
8204
8192
|
}, {
|
|
8205
8193
|
F: __dxlog_file28,
|
|
8206
|
-
L:
|
|
8194
|
+
L: 388,
|
|
8207
8195
|
S: this,
|
|
8208
8196
|
C: (f, a) => f(...a)
|
|
8209
8197
|
});
|
|
@@ -8217,7 +8205,7 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8217
8205
|
});
|
|
8218
8206
|
(0, import_invariant23.invariant)(identity.deviceCredentialChain, void 0, {
|
|
8219
8207
|
F: __dxlog_file28,
|
|
8220
|
-
L:
|
|
8208
|
+
L: 407,
|
|
8221
8209
|
S: this,
|
|
8222
8210
|
A: [
|
|
8223
8211
|
"identity.deviceCredentialChain",
|
|
@@ -8235,10 +8223,11 @@ var ServiceContext = class extends import_context17.Resource {
|
|
|
8235
8223
|
identityKey: edgeIdentity.identityKey,
|
|
8236
8224
|
peerKey: edgeIdentity.peerKey
|
|
8237
8225
|
});
|
|
8238
|
-
} catch (
|
|
8239
|
-
|
|
8226
|
+
} catch (e) {
|
|
8227
|
+
env.error = e;
|
|
8228
|
+
env.hasError = true;
|
|
8240
8229
|
} finally {
|
|
8241
|
-
|
|
8230
|
+
_ts_dispose_resources4(env);
|
|
8242
8231
|
}
|
|
8243
8232
|
}
|
|
8244
8233
|
};
|
|
@@ -8902,6 +8891,9 @@ var ClientServicesHost = class {
|
|
|
8902
8891
|
if (this._runtimeParams.disableP2pReplication === void 0) {
|
|
8903
8892
|
this._runtimeParams.disableP2pReplication = config?.get("runtime.client.disableP2pReplication", false);
|
|
8904
8893
|
}
|
|
8894
|
+
if (this._runtimeParams.enableVectorIndexing === void 0) {
|
|
8895
|
+
this._runtimeParams.enableVectorIndexing = config?.get("runtime.client.enableVectorIndexing", false);
|
|
8896
|
+
}
|
|
8905
8897
|
if (config) {
|
|
8906
8898
|
this.initialize({
|
|
8907
8899
|
config,
|
|
@@ -8916,7 +8908,7 @@ var ClientServicesHost = class {
|
|
|
8916
8908
|
if (!this._opening) {
|
|
8917
8909
|
void this.open(new import_context18.Context(void 0, {
|
|
8918
8910
|
F: __dxlog_file31,
|
|
8919
|
-
L:
|
|
8911
|
+
L: 141
|
|
8920
8912
|
}));
|
|
8921
8913
|
}
|
|
8922
8914
|
},
|
|
@@ -8974,7 +8966,7 @@ var ClientServicesHost = class {
|
|
|
8974
8966
|
initialize({ config, ...options }) {
|
|
8975
8967
|
(0, import_invariant26.invariant)(!this._open, "service host is open", {
|
|
8976
8968
|
F: __dxlog_file31,
|
|
8977
|
-
L:
|
|
8969
|
+
L: 207,
|
|
8978
8970
|
S: this,
|
|
8979
8971
|
A: [
|
|
8980
8972
|
"!this._open",
|
|
@@ -8983,14 +8975,14 @@ var ClientServicesHost = class {
|
|
|
8983
8975
|
});
|
|
8984
8976
|
(0, import_log26.log)("initializing...", void 0, {
|
|
8985
8977
|
F: __dxlog_file31,
|
|
8986
|
-
L:
|
|
8978
|
+
L: 208,
|
|
8987
8979
|
S: this,
|
|
8988
8980
|
C: (f, a) => f(...a)
|
|
8989
8981
|
});
|
|
8990
8982
|
if (config) {
|
|
8991
8983
|
(0, import_invariant26.invariant)(!this._config, "config already set", {
|
|
8992
8984
|
F: __dxlog_file31,
|
|
8993
|
-
L:
|
|
8985
|
+
L: 211,
|
|
8994
8986
|
S: this,
|
|
8995
8987
|
A: [
|
|
8996
8988
|
"!this._config",
|
|
@@ -9005,7 +8997,7 @@ var ClientServicesHost = class {
|
|
|
9005
8997
|
if (!options.signalManager) {
|
|
9006
8998
|
import_log26.log.warn("running signaling without telemetry metadata.", void 0, {
|
|
9007
8999
|
F: __dxlog_file31,
|
|
9008
|
-
L:
|
|
9000
|
+
L: 219,
|
|
9009
9001
|
S: this,
|
|
9010
9002
|
C: (f, a) => f(...a)
|
|
9011
9003
|
});
|
|
@@ -9025,7 +9017,7 @@ var ClientServicesHost = class {
|
|
|
9025
9017
|
this._signalManager = signalManager;
|
|
9026
9018
|
(0, import_invariant26.invariant)(!this._networkManager, "network manager already set", {
|
|
9027
9019
|
F: __dxlog_file31,
|
|
9028
|
-
L:
|
|
9020
|
+
L: 241,
|
|
9029
9021
|
S: this,
|
|
9030
9022
|
A: [
|
|
9031
9023
|
"!this._networkManager",
|
|
@@ -9043,7 +9035,7 @@ var ClientServicesHost = class {
|
|
|
9043
9035
|
});
|
|
9044
9036
|
(0, import_log26.log)("initialized", void 0, {
|
|
9045
9037
|
F: __dxlog_file31,
|
|
9046
|
-
L:
|
|
9038
|
+
L: 254,
|
|
9047
9039
|
S: this,
|
|
9048
9040
|
C: (f, a) => f(...a)
|
|
9049
9041
|
});
|
|
@@ -9057,13 +9049,13 @@ var ClientServicesHost = class {
|
|
|
9057
9049
|
id: traceId
|
|
9058
9050
|
}), {
|
|
9059
9051
|
F: __dxlog_file31,
|
|
9060
|
-
L:
|
|
9052
|
+
L: 265,
|
|
9061
9053
|
S: this,
|
|
9062
9054
|
C: (f, a) => f(...a)
|
|
9063
9055
|
});
|
|
9064
9056
|
(0, import_invariant26.invariant)(this._config, "config not set", {
|
|
9065
9057
|
F: __dxlog_file31,
|
|
9066
|
-
L:
|
|
9058
|
+
L: 267,
|
|
9067
9059
|
S: this,
|
|
9068
9060
|
A: [
|
|
9069
9061
|
"this._config",
|
|
@@ -9072,7 +9064,7 @@ var ClientServicesHost = class {
|
|
|
9072
9064
|
});
|
|
9073
9065
|
(0, import_invariant26.invariant)(this._storage, "storage not set", {
|
|
9074
9066
|
F: __dxlog_file31,
|
|
9075
|
-
L:
|
|
9067
|
+
L: 268,
|
|
9076
9068
|
S: this,
|
|
9077
9069
|
A: [
|
|
9078
9070
|
"this._storage",
|
|
@@ -9081,7 +9073,7 @@ var ClientServicesHost = class {
|
|
|
9081
9073
|
});
|
|
9082
9074
|
(0, import_invariant26.invariant)(this._signalManager, "signal manager not set", {
|
|
9083
9075
|
F: __dxlog_file31,
|
|
9084
|
-
L:
|
|
9076
|
+
L: 269,
|
|
9085
9077
|
S: this,
|
|
9086
9078
|
A: [
|
|
9087
9079
|
"this._signalManager",
|
|
@@ -9090,7 +9082,7 @@ var ClientServicesHost = class {
|
|
|
9090
9082
|
});
|
|
9091
9083
|
(0, import_invariant26.invariant)(this._networkManager, "network manager not set", {
|
|
9092
9084
|
F: __dxlog_file31,
|
|
9093
|
-
L:
|
|
9085
|
+
L: 270,
|
|
9094
9086
|
S: this,
|
|
9095
9087
|
A: [
|
|
9096
9088
|
"this._networkManager",
|
|
@@ -9102,7 +9094,7 @@ var ClientServicesHost = class {
|
|
|
9102
9094
|
lockKey: this._resourceLock?.lockKey
|
|
9103
9095
|
}, {
|
|
9104
9096
|
F: __dxlog_file31,
|
|
9105
|
-
L:
|
|
9097
|
+
L: 273,
|
|
9106
9098
|
S: this,
|
|
9107
9099
|
C: (f, a) => f(...a)
|
|
9108
9100
|
});
|
|
@@ -9163,7 +9155,7 @@ var ClientServicesHost = class {
|
|
|
9163
9155
|
deviceKey
|
|
9164
9156
|
}, {
|
|
9165
9157
|
F: __dxlog_file31,
|
|
9166
|
-
L:
|
|
9158
|
+
L: 374,
|
|
9167
9159
|
S: this,
|
|
9168
9160
|
C: (f, a) => f(...a)
|
|
9169
9161
|
});
|
|
@@ -9171,7 +9163,7 @@ var ClientServicesHost = class {
|
|
|
9171
9163
|
id: traceId
|
|
9172
9164
|
}), {
|
|
9173
9165
|
F: __dxlog_file31,
|
|
9174
|
-
L:
|
|
9166
|
+
L: 375,
|
|
9175
9167
|
S: this,
|
|
9176
9168
|
C: (f, a) => f(...a)
|
|
9177
9169
|
});
|
|
@@ -9185,7 +9177,7 @@ var ClientServicesHost = class {
|
|
|
9185
9177
|
deviceKey
|
|
9186
9178
|
}, {
|
|
9187
9179
|
F: __dxlog_file31,
|
|
9188
|
-
L:
|
|
9180
|
+
L: 386,
|
|
9189
9181
|
S: this,
|
|
9190
9182
|
C: (f, a) => f(...a)
|
|
9191
9183
|
});
|
|
@@ -9203,7 +9195,7 @@ var ClientServicesHost = class {
|
|
|
9203
9195
|
deviceKey
|
|
9204
9196
|
}, {
|
|
9205
9197
|
F: __dxlog_file31,
|
|
9206
|
-
L:
|
|
9198
|
+
L: 395,
|
|
9207
9199
|
S: this,
|
|
9208
9200
|
C: (f, a) => f(...a)
|
|
9209
9201
|
});
|
|
@@ -9214,13 +9206,13 @@ var ClientServicesHost = class {
|
|
|
9214
9206
|
id: traceId
|
|
9215
9207
|
}), {
|
|
9216
9208
|
F: __dxlog_file31,
|
|
9217
|
-
L:
|
|
9209
|
+
L: 400,
|
|
9218
9210
|
S: this,
|
|
9219
9211
|
C: (f, a) => f(...a)
|
|
9220
9212
|
});
|
|
9221
9213
|
import_log26.log.info("resetting...", void 0, {
|
|
9222
9214
|
F: __dxlog_file31,
|
|
9223
|
-
L:
|
|
9215
|
+
L: 402,
|
|
9224
9216
|
S: this,
|
|
9225
9217
|
C: (f, a) => f(...a)
|
|
9226
9218
|
});
|
|
@@ -9230,7 +9222,7 @@ var ClientServicesHost = class {
|
|
|
9230
9222
|
await this._storage.reset();
|
|
9231
9223
|
import_log26.log.info("reset", void 0, {
|
|
9232
9224
|
F: __dxlog_file31,
|
|
9233
|
-
L:
|
|
9225
|
+
L: 409,
|
|
9234
9226
|
S: this,
|
|
9235
9227
|
C: (f, a) => f(...a)
|
|
9236
9228
|
});
|
|
@@ -9238,7 +9230,7 @@ var ClientServicesHost = class {
|
|
|
9238
9230
|
id: traceId
|
|
9239
9231
|
}), {
|
|
9240
9232
|
F: __dxlog_file31,
|
|
9241
|
-
L:
|
|
9233
|
+
L: 410,
|
|
9242
9234
|
S: this,
|
|
9243
9235
|
C: (f, a) => f(...a)
|
|
9244
9236
|
});
|
|
@@ -9316,4 +9308,4 @@ ClientServicesHost = _ts_decorate11([
|
|
|
9316
9308
|
subscribeToSpaces,
|
|
9317
9309
|
subscribeToSwarmInfo
|
|
9318
9310
|
});
|
|
9319
|
-
//# sourceMappingURL=chunk-
|
|
9311
|
+
//# sourceMappingURL=chunk-JC3EZ3VA.cjs.map
|