@dxos/client-services 0.7.3-staging.cc8dd3e → 0.7.3
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-2IFJRELF.mjs → chunk-KRN6GUJU.mjs} +25 -13
- package/dist/lib/browser/{chunk-2IFJRELF.mjs.map → chunk-KRN6GUJU.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-ALAI4CDC.cjs → chunk-RDZO3VFF.cjs} +28 -16
- package/dist/lib/node/chunk-RDZO3VFF.cjs.map +7 -0
- package/dist/lib/node/index.cjs +47 -47
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node-esm/{chunk-2PCKHPU3.mjs → chunk-RRH6HPCT.mjs} +25 -13
- package/dist/lib/node-esm/{chunk-2PCKHPU3.mjs.map → chunk-RRH6HPCT.mjs.map} +3 -3
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/packlets/agents/edge-agent-manager.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 +38 -38
- package/src/packlets/agents/edge-agent-manager.ts +14 -0
- package/src/version.ts +5 -1
- package/dist/lib/node/chunk-ALAI4CDC.cjs.map +0 -7
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
InvitationsManager,
|
|
7
7
|
ServiceContext,
|
|
8
8
|
SpaceInvitationProtocol
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-KRN6GUJU.mjs";
|
|
10
10
|
|
|
11
11
|
// packages/sdk/client-services/src/packlets/testing/credential-utils.ts
|
|
12
12
|
import { createCredential } from "@dxos/credentials";
|
|
@@ -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_RDZO3VFF_exports = {};
|
|
30
|
+
__export(chunk_RDZO3VFF_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
DataSpace: () => DataSpace,
|
|
@@ -72,7 +72,7 @@ __export(chunk_ALAI4CDC_exports, {
|
|
|
72
72
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
73
73
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
74
74
|
});
|
|
75
|
-
module.exports = __toCommonJS(
|
|
75
|
+
module.exports = __toCommonJS(chunk_RDZO3VFF_exports);
|
|
76
76
|
var import_async = require("@dxos/async");
|
|
77
77
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
78
78
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -304,6 +304,7 @@ var import_keys15 = require("@dxos/keys");
|
|
|
304
304
|
var import_log21 = require("@dxos/log");
|
|
305
305
|
var import_protocols14 = require("@dxos/protocols");
|
|
306
306
|
var import_services19 = require("@dxos/protocols/proto/dxos/client/services");
|
|
307
|
+
var import_metadata2 = require("@dxos/protocols/proto/dxos/echo/metadata");
|
|
307
308
|
var import_codec_protobuf12 = require("@dxos/codec-protobuf");
|
|
308
309
|
var import_protocols15 = require("@dxos/protocols");
|
|
309
310
|
var import_services20 = require("@dxos/protocols/proto/dxos/client/services");
|
|
@@ -734,7 +735,7 @@ var DevtoolsServiceImpl = class {
|
|
|
734
735
|
});
|
|
735
736
|
}
|
|
736
737
|
};
|
|
737
|
-
var DXOS_VERSION = "0.7.3
|
|
738
|
+
var DXOS_VERSION = "0.7.3";
|
|
738
739
|
var getPlatform = () => {
|
|
739
740
|
if (process.browser) {
|
|
740
741
|
if (typeof window !== "undefined") {
|
|
@@ -7003,6 +7004,7 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
7003
7004
|
var __dxlog_file25 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/agents/edge-agent-manager.ts";
|
|
7004
7005
|
var AGENT_STATUS_QUERY_RETRY_INTERVAL = 5e3;
|
|
7005
7006
|
var AGENT_STATUS_QUERY_RETRY_JITTER = 1e3;
|
|
7007
|
+
var AGENT_FEED_ADDED_CHECK_INTERVAL_MS = 3e3;
|
|
7006
7008
|
var EdgeAgentManager = class extends import_context15.Resource {
|
|
7007
7009
|
constructor(_edgeFeatures, _edgeHttpClient, _dataSpaceManager, _identity) {
|
|
7008
7010
|
super();
|
|
@@ -7022,7 +7024,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7022
7024
|
async createAgent() {
|
|
7023
7025
|
(0, import_invariant20.invariant)(this.isOpen, void 0, {
|
|
7024
7026
|
F: __dxlog_file25,
|
|
7025
|
-
L:
|
|
7027
|
+
L: 54,
|
|
7026
7028
|
S: this,
|
|
7027
7029
|
A: [
|
|
7028
7030
|
"this.isOpen",
|
|
@@ -7031,7 +7033,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7031
7033
|
});
|
|
7032
7034
|
(0, import_invariant20.invariant)(this._edgeHttpClient, void 0, {
|
|
7033
7035
|
F: __dxlog_file25,
|
|
7034
|
-
L:
|
|
7036
|
+
L: 55,
|
|
7035
7037
|
S: this,
|
|
7036
7038
|
A: [
|
|
7037
7039
|
"this._edgeHttpClient",
|
|
@@ -7040,7 +7042,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7040
7042
|
});
|
|
7041
7043
|
(0, import_invariant20.invariant)(this._edgeFeatures?.agents, void 0, {
|
|
7042
7044
|
F: __dxlog_file25,
|
|
7043
|
-
L:
|
|
7045
|
+
L: 56,
|
|
7044
7046
|
S: this,
|
|
7045
7047
|
A: [
|
|
7046
7048
|
"this._edgeFeatures?.agents",
|
|
@@ -7061,7 +7063,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7061
7063
|
});
|
|
7062
7064
|
(0, import_log21.log)("agent created", response, {
|
|
7063
7065
|
F: __dxlog_file25,
|
|
7064
|
-
L:
|
|
7066
|
+
L: 73,
|
|
7065
7067
|
S: this,
|
|
7066
7068
|
C: (f, a) => f(...a)
|
|
7067
7069
|
});
|
|
@@ -7073,7 +7075,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7073
7075
|
isEnabled
|
|
7074
7076
|
}, {
|
|
7075
7077
|
F: __dxlog_file25,
|
|
7076
|
-
L:
|
|
7078
|
+
L: 81,
|
|
7077
7079
|
S: this,
|
|
7078
7080
|
C: (f, a) => f(...a)
|
|
7079
7081
|
});
|
|
@@ -7106,7 +7108,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7106
7108
|
async _fetchAgentStatus() {
|
|
7107
7109
|
(0, import_invariant20.invariant)(this._edgeHttpClient, void 0, {
|
|
7108
7110
|
F: __dxlog_file25,
|
|
7109
|
-
L:
|
|
7111
|
+
L: 115,
|
|
7110
7112
|
S: this,
|
|
7111
7113
|
A: [
|
|
7112
7114
|
"this._edgeHttpClient",
|
|
@@ -7116,7 +7118,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7116
7118
|
try {
|
|
7117
7119
|
(0, import_log21.log)("fetching agent status", void 0, {
|
|
7118
7120
|
F: __dxlog_file25,
|
|
7119
|
-
L:
|
|
7121
|
+
L: 117,
|
|
7120
7122
|
S: this,
|
|
7121
7123
|
C: (f, a) => f(...a)
|
|
7122
7124
|
});
|
|
@@ -7135,7 +7137,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7135
7137
|
err
|
|
7136
7138
|
}, {
|
|
7137
7139
|
F: __dxlog_file25,
|
|
7138
|
-
L:
|
|
7140
|
+
L: 127,
|
|
7139
7141
|
S: this,
|
|
7140
7142
|
C: (f, a) => f(...a)
|
|
7141
7143
|
});
|
|
@@ -7148,7 +7150,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7148
7150
|
retryAfterMs
|
|
7149
7151
|
}, {
|
|
7150
7152
|
F: __dxlog_file25,
|
|
7151
|
-
L:
|
|
7153
|
+
L: 132,
|
|
7152
7154
|
S: this,
|
|
7153
7155
|
C: (f, a) => f(...a)
|
|
7154
7156
|
});
|
|
@@ -7161,27 +7163,37 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7161
7163
|
* Instead, we stay in active polling mode while there are spaces where we don't see our agent's feed.
|
|
7162
7164
|
*/
|
|
7163
7165
|
_ensureAgentIsInSpaces(agentDeviceKey) {
|
|
7166
|
+
let activePollingEnabled = false;
|
|
7164
7167
|
for (const space of this._dataSpaceManager.spaces.values()) {
|
|
7168
|
+
if (space.getEdgeReplicationSetting() === import_metadata2.EdgeReplicationSetting.DISABLED) {
|
|
7169
|
+
space.notarizationPlugin.setActiveEdgePollingEnabled(false);
|
|
7170
|
+
continue;
|
|
7171
|
+
}
|
|
7165
7172
|
if ([
|
|
7166
7173
|
import_services19.SpaceState.SPACE_INACTIVE,
|
|
7167
7174
|
import_services19.SpaceState.SPACE_CLOSED
|
|
7168
7175
|
].includes(space.state)) {
|
|
7176
|
+
space.notarizationPlugin.setActiveEdgePollingEnabled(false);
|
|
7169
7177
|
continue;
|
|
7170
7178
|
}
|
|
7171
7179
|
const agentFeedNeedsNotarization = ![
|
|
7172
7180
|
...space.inner.spaceState.feeds.values()
|
|
7173
7181
|
].some((feed) => feed.assertion.deviceKey.equals(agentDeviceKey));
|
|
7174
7182
|
space.notarizationPlugin.setActiveEdgePollingEnabled(agentFeedNeedsNotarization);
|
|
7183
|
+
activePollingEnabled = activePollingEnabled || agentFeedNeedsNotarization;
|
|
7175
7184
|
import_log21.log.info("set active edge polling", {
|
|
7176
7185
|
enabled: agentFeedNeedsNotarization,
|
|
7177
7186
|
spaceId: space.id
|
|
7178
7187
|
}, {
|
|
7179
7188
|
F: __dxlog_file25,
|
|
7180
|
-
L:
|
|
7189
|
+
L: 159,
|
|
7181
7190
|
S: this,
|
|
7182
7191
|
C: (f, a) => f(...a)
|
|
7183
7192
|
});
|
|
7184
7193
|
}
|
|
7194
|
+
if (activePollingEnabled) {
|
|
7195
|
+
(0, import_async21.scheduleTask)(this._ctx, () => this._ensureAgentIsInSpaces(agentDeviceKey), AGENT_FEED_ADDED_CHECK_INTERVAL_MS);
|
|
7196
|
+
}
|
|
7185
7197
|
}
|
|
7186
7198
|
_updateStatus(status, deviceKey) {
|
|
7187
7199
|
this._agentStatus = status;
|
|
@@ -7194,7 +7206,7 @@ var EdgeAgentManager = class extends import_context15.Resource {
|
|
|
7194
7206
|
status
|
|
7195
7207
|
}, {
|
|
7196
7208
|
F: __dxlog_file25,
|
|
7197
|
-
L:
|
|
7209
|
+
L: 175,
|
|
7198
7210
|
S: this,
|
|
7199
7211
|
C: (f, a) => f(...a)
|
|
7200
7212
|
});
|
|
@@ -8838,4 +8850,4 @@ ClientServicesHost = _ts_decorate11([
|
|
|
8838
8850
|
subscribeToSpaces,
|
|
8839
8851
|
subscribeToSwarmInfo
|
|
8840
8852
|
});
|
|
8841
|
-
//# sourceMappingURL=chunk-
|
|
8853
|
+
//# sourceMappingURL=chunk-RDZO3VFF.cjs.map
|