@mindexec/cli 0.2.389 → 0.2.390
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/package.json +1 -1
- package/scripts/remote-agent-managed-smoke.mjs +3 -0
- package/scripts/remote-fast-mdm-browser-smoke.mjs +3 -0
- package/server.js +25 -1
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +9 -2
- package/wwwroot/service-worker-assets.js +2 -2
- package/wwwroot/service-worker.js +1 -1
package/package.json
CHANGED
|
@@ -84,6 +84,9 @@ function spawnBridge({ bridgePort, remoteHubPort, workspacePath, label }) {
|
|
|
84
84
|
BRIDGE_TOKEN,
|
|
85
85
|
BRIDGE_REQUIRE_TOKEN: '1',
|
|
86
86
|
MINDEXEC_REMOTE_HUB: '1',
|
|
87
|
+
MINDEXEC_REMOTE_REGISTRY_FOLLOWER: '0',
|
|
88
|
+
MINDEXEC_REMOTE_REGISTRY_REALTIME: '0',
|
|
89
|
+
MINDEXEC_REMOTE_HOST_TARGET_AUTO_RENEW: '0',
|
|
87
90
|
REMOTE_HUB_HOST: '127.0.0.1',
|
|
88
91
|
REMOTE_HUB_PORT: String(remoteHubPort),
|
|
89
92
|
REMOTE_HUB_PAIR_TOKEN: PAIR_TOKEN,
|
|
@@ -78,6 +78,9 @@ function spawnBridge({ bridgePort, remoteHubPort, workspacePath, label, traceFra
|
|
|
78
78
|
BRIDGE_REQUIRE_TOKEN: '1',
|
|
79
79
|
MINDEXEC_REMOTE_HUB: '1',
|
|
80
80
|
MINDEXEC_REMOTE_TRACE_FRAMES: traceFrames ? '1' : '',
|
|
81
|
+
MINDEXEC_REMOTE_REGISTRY_FOLLOWER: '0',
|
|
82
|
+
MINDEXEC_REMOTE_REGISTRY_REALTIME: '0',
|
|
83
|
+
MINDEXEC_REMOTE_HOST_TARGET_AUTO_RENEW: '0',
|
|
81
84
|
REMOTE_HUB_HOST: '127.0.0.1',
|
|
82
85
|
REMOTE_HUB_PORT: String(remoteHubPort),
|
|
83
86
|
REMOTE_HUB_PAIR_TOKEN: PAIR_TOKEN,
|
package/server.js
CHANGED
|
@@ -3618,6 +3618,9 @@ const REMOTE_AGENT_READY_TIMEOUT_MS = 5000;
|
|
|
3618
3618
|
const REMOTE_AGENT_READY_STALE_MS = Math.max(
|
|
3619
3619
|
REMOTE_AGENT_READY_TIMEOUT_MS + 1000,
|
|
3620
3620
|
Number(process.env.MINDEXEC_REMOTE_AGENT_READY_STALE_MS || 8000) || 8000);
|
|
3621
|
+
const REMOTE_AGENT_OUTPUT_RECONNECT_GRACE_MS = Math.max(
|
|
3622
|
+
1000,
|
|
3623
|
+
Number(process.env.MINDEXEC_REMOTE_AGENT_OUTPUT_RECONNECT_GRACE_MS || 6000) || 6000);
|
|
3621
3624
|
const REMOTE_AGENT_DEFAULT_ENGINE = 'auto';
|
|
3622
3625
|
const REMOTE_AGENT_SYNC_REPORT_LOG_REPEAT_MS = 30000;
|
|
3623
3626
|
const REMOTE_AGENT_SYNC_REPORT_WAKE_MS = Math.max(500, Number(process.env.MINDEXEC_REMOTE_AGENT_SYNC_REPORT_WAKE_MS || 1500) || 1500);
|
|
@@ -3773,6 +3776,7 @@ function createRemoteAgentIdleState(overrides = {}) {
|
|
|
3773
3776
|
connectedAt: '',
|
|
3774
3777
|
needsReconnect: false,
|
|
3775
3778
|
reconnectReason: '',
|
|
3779
|
+
reconnectRequestedAt: '',
|
|
3776
3780
|
exitedAt: '',
|
|
3777
3781
|
exitCode: null,
|
|
3778
3782
|
signal: '',
|
|
@@ -3884,6 +3888,9 @@ function shouldRestartRemoteAgentForTarget(managers = [], leaseId = '') {
|
|
|
3884
3888
|
}
|
|
3885
3889
|
|
|
3886
3890
|
if (remoteAgentState.needsReconnect === true) {
|
|
3891
|
+
if (isRemoteAgentReconnectGraceActive()) {
|
|
3892
|
+
return false;
|
|
3893
|
+
}
|
|
3887
3894
|
return true;
|
|
3888
3895
|
}
|
|
3889
3896
|
|
|
@@ -3896,23 +3903,39 @@ function shouldRestartRemoteAgentForTarget(managers = [], leaseId = '') {
|
|
|
3896
3903
|
&& isRemoteAgentSyncReportForManagers(remoteAgentSyncReportState, managers, leaseId);
|
|
3897
3904
|
}
|
|
3898
3905
|
|
|
3906
|
+
function getRemoteAgentReconnectAgeMs() {
|
|
3907
|
+
const markedAt = Date.parse(remoteAgentState.reconnectRequestedAt || '');
|
|
3908
|
+
return Number.isFinite(markedAt) ? Math.max(0, Date.now() - markedAt) : Number.POSITIVE_INFINITY;
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
function isRemoteAgentReconnectGraceActive() {
|
|
3912
|
+
return remoteAgentState.needsReconnect === true
|
|
3913
|
+
&& remoteAgentState.reconnectReason === 'process-output-disconnected'
|
|
3914
|
+
&& isRemoteAgentProcessRunning()
|
|
3915
|
+
&& getRemoteAgentReconnectAgeMs() < REMOTE_AGENT_OUTPUT_RECONNECT_GRACE_MS;
|
|
3916
|
+
}
|
|
3917
|
+
|
|
3899
3918
|
function markRemoteAgentReconnectNeeded(reason = 'agent-disconnected', wakeReason = 'agent-disconnected') {
|
|
3900
3919
|
if (!isRemoteAgentRegistryOwned()) {
|
|
3901
3920
|
return false;
|
|
3902
3921
|
}
|
|
3903
3922
|
|
|
3904
3923
|
const safeReason = safeRemoteAgentField(reason || 'agent-disconnected', 160);
|
|
3924
|
+
const now = new Date().toISOString();
|
|
3905
3925
|
if (remoteAgentState.needsReconnect !== true) {
|
|
3906
3926
|
logWarn(
|
|
3907
3927
|
'remote',
|
|
3908
3928
|
`managed RemoteAgent marked stale ${formatKeyValue('reason', safeReason)} ${formatKeyValue('manager', remoteAgentState.manager || '-')}`);
|
|
3909
3929
|
}
|
|
3930
|
+
if (remoteAgentState.needsReconnect !== true || remoteAgentState.reconnectReason !== safeReason) {
|
|
3931
|
+
remoteAgentState.reconnectRequestedAt = now;
|
|
3932
|
+
}
|
|
3910
3933
|
|
|
3911
3934
|
remoteAgentState.ready = false;
|
|
3912
3935
|
remoteAgentState.needsReconnect = true;
|
|
3913
3936
|
remoteAgentState.reconnectReason = safeReason;
|
|
3914
3937
|
remoteAgentState.lastError = safeReason;
|
|
3915
|
-
remoteAgentState.updatedAt =
|
|
3938
|
+
remoteAgentState.updatedAt = now;
|
|
3916
3939
|
emitBridgeEvent('RemoteAgentNeedsReconnect', serializeRemoteAgentState());
|
|
3917
3940
|
scheduleRemoteRegistryFollower(0, wakeReason || safeReason);
|
|
3918
3941
|
return true;
|
|
@@ -4055,6 +4078,7 @@ function appendRemoteAgentOutput(stream, chunk, stateConnectionKey = '') {
|
|
|
4055
4078
|
remoteAgentState.connectedAt = new Date().toISOString();
|
|
4056
4079
|
remoteAgentState.needsReconnect = false;
|
|
4057
4080
|
remoteAgentState.reconnectReason = '';
|
|
4081
|
+
remoteAgentState.reconnectRequestedAt = '';
|
|
4058
4082
|
}
|
|
4059
4083
|
if (isRemoteAgentOutputReconnectSignal(text)) {
|
|
4060
4084
|
markRemoteAgentReconnectNeeded('process-output-disconnected', 'agent-process-output-disconnected');
|
|
@@ -20269,9 +20269,14 @@
|
|
|
20269
20269
|
}, 250);
|
|
20270
20270
|
}
|
|
20271
20271
|
|
|
20272
|
+
const visibleFrameDeviceIds = getVisibleFrameDeviceIds();
|
|
20273
|
+
const hasVisibleFrameTarget = visibleFrameDeviceIds.length > 0;
|
|
20272
20274
|
const hasVisibleLiveTarget = getVisibleLiveFrameDeviceIds().length > 0
|
|
20273
20275
|
|| devices.some(device => isRemoteFleetDeviceConnected(device) && isRemoteFleetLiveCapable(device));
|
|
20274
|
-
|
|
20276
|
+
const shouldUseBinaryFrameSocket = hasVisibleLiveTarget
|
|
20277
|
+
|| hasActiveLiveStream
|
|
20278
|
+
|| (autoMonitorState && hasVisibleFrameTarget);
|
|
20279
|
+
if (shouldUseBinaryFrameSocket) {
|
|
20275
20280
|
const binaryFrameSocketStarted = startRemoteFleetBinaryFrameSocket(bodyView, () => {
|
|
20276
20281
|
const liveIds = getVisibleLiveFrameDeviceIds();
|
|
20277
20282
|
return liveIds.length > 0 ? liveIds : getVisibleFrameDeviceIds();
|
|
@@ -20298,7 +20303,9 @@
|
|
|
20298
20303
|
window.RuntimeTrace?.emit?.('remote.live.wsAutoStartRequested', {
|
|
20299
20304
|
nodeId,
|
|
20300
20305
|
transport: 'ws-binary',
|
|
20301
|
-
fps: REMOTE_FLEET_MONITOR_LIVE_FPS
|
|
20306
|
+
fps: REMOTE_FLEET_MONITOR_LIVE_FPS,
|
|
20307
|
+
visibleFrameTargets: visibleFrameDeviceIds.length,
|
|
20308
|
+
visibleLiveTargets: getVisibleLiveFrameDeviceIds().length
|
|
20302
20309
|
});
|
|
20303
20310
|
}
|
|
20304
20311
|
bodyView._remoteFleetLiveRefreshTimer = setInterval(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
self.assetsManifest = {
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "cg72W2vT",
|
|
3
3
|
"assets": [
|
|
4
4
|
{
|
|
5
5
|
"hash": "sha256-+CSYMcqLNTsq3VnH11jgYyOCCdxvHzL74CBmo4sCmMU=",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"url": "_content/MindExecution.Shared/js/mind-map-core.js.backup"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
"hash": "sha256-
|
|
89
|
+
"hash": "sha256-s8Rvi0Kg/2CMufFj5r6d3q65xJTaDJX2+x2Pp4s25Jk=",
|
|
90
90
|
"url": "_content/MindExecution.Shared/js/mind-map-css3d-manager.js"
|
|
91
91
|
},
|
|
92
92
|
{
|