@mindexec/cli 0.2.164 → 0.2.166

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindexec/cli",
3
- "version": "0.2.164",
3
+ "version": "0.2.166",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
package/server.js CHANGED
@@ -2045,6 +2045,7 @@ app.post('/api/auth/session', async (req, res) => {
2045
2045
  const content = req.body?.content;
2046
2046
  await writeStableAuthSessionPayload(content);
2047
2047
  await wakeRemoteRegistryFollower('auth-session-saved');
2048
+ scheduleRemoteHostTargetRenewWake('auth-session-saved', { throttleMs: 0 });
2048
2049
  res.json({
2049
2050
  success: true
2050
2051
  });
@@ -3351,6 +3352,7 @@ const REMOTE_AGENT_EARLY_EXIT_MS = 1200;
3351
3352
  const REMOTE_AGENT_READY_TIMEOUT_MS = 5000;
3352
3353
  const REMOTE_AGENT_DEFAULT_ENGINE = 'auto';
3353
3354
  const REMOTE_AGENT_SYNC_REPORT_LOG_REPEAT_MS = 30000;
3355
+ const REMOTE_AGENT_SYNC_REPORT_WAKE_MS = Math.max(500, Number(process.env.MINDEXEC_REMOTE_AGENT_SYNC_REPORT_WAKE_MS || 1500) || 1500);
3354
3356
  const REMOTE_AGENT_RACE_START_STAGGER_MS = Math.max(0, Number(process.env.MINDEXEC_REMOTE_AGENT_RACE_STAGGER_MS ?? 0) || 0);
3355
3357
  const REMOTE_AGENT_MAX_PARALLEL_CANDIDATES = 6;
3356
3358
  const REMOTE_AGENT_RECENT_MANAGER_CACHE_TTL_MS = 30 * 24 * 60 * 60 * 1000;
@@ -3376,6 +3378,7 @@ const REMOTE_HOST_TARGET_RENEW_MS = Math.max(
3376
3378
  Math.floor(REMOTE_HOST_TARGET_LEASE_MS / 2),
3377
3379
  Number(process.env.MINDEXEC_REMOTE_HOST_TARGET_RENEW_MS || 25000) || 25000));
3378
3380
  const REMOTE_HOST_TARGET_RENEW_LOG_REPEAT_MS = 60000;
3381
+ const REMOTE_HOST_TARGET_WAKE_RENEW_MS = Math.max(3000, Number(process.env.MINDEXEC_REMOTE_HOST_TARGET_WAKE_RENEW_MS || 5000) || 5000);
3379
3382
  const REMOTE_SYSTEM_RESUME_CHECK_MS = Math.max(1000, Number(process.env.MINDEXEC_REMOTE_RESUME_CHECK_MS || 5000) || 5000);
3380
3383
  const REMOTE_SYSTEM_RESUME_DRIFT_MS = Math.max(
3381
3384
  REMOTE_SYSTEM_RESUME_CHECK_MS + 5000,
@@ -3384,6 +3387,7 @@ let remoteAgentState = createRemoteAgentIdleState();
3384
3387
  let remoteAgentSyncReportState = null;
3385
3388
  let remoteAgentSyncReportLogKey = '';
3386
3389
  let remoteAgentSyncReportLogAt = 0;
3390
+ let remoteAgentSyncReportWakeAt = 0;
3387
3391
  let remoteAgentConnectPromise = null;
3388
3392
  const remoteAgentIntentionalStopKeys = new Set();
3389
3393
  const remoteAgentRecentSuccessfulManagers = new Map();
@@ -3409,6 +3413,7 @@ let remoteHostTargetRenewTimer = null;
3409
3413
  let remoteHostTargetRenewInFlight = false;
3410
3414
  let remoteHostTargetRenewLogKey = '';
3411
3415
  let remoteHostTargetRenewLogAt = 0;
3416
+ let remoteHostTargetWakeRenewAt = 0;
3412
3417
  let remoteSystemResumeTimer = null;
3413
3418
  let remoteSystemResumeExpectedAt = 0;
3414
3419
  let remoteSystemResumeInFlight = false;
@@ -5966,6 +5971,60 @@ async function wakeRemoteRegistryFollower(reason = 'wake') {
5966
5971
  scheduleRemoteRegistryFollower(0, reason);
5967
5972
  }
5968
5973
 
5974
+ function scheduleRemoteHostTargetRenewWake(reason = 'wake', options = {}) {
5975
+ if (!isLocalRemoteHostTargetActive()) {
5976
+ return false;
5977
+ }
5978
+
5979
+ const throttleMs = Math.max(0, Number(options.throttleMs ?? REMOTE_HOST_TARGET_WAKE_RENEW_MS) || 0);
5980
+ const now = Date.now();
5981
+ if (throttleMs > 0 && now - remoteHostTargetWakeRenewAt < throttleMs) {
5982
+ return false;
5983
+ }
5984
+
5985
+ remoteHostTargetWakeRenewAt = now;
5986
+ const wakeReason = safeRemoteAgentField(reason, 80) || 'wake';
5987
+ const timer = setTimeout(() => {
5988
+ runRemoteHostTargetRenewOnce(wakeReason, { takeover: options.takeover === true })
5989
+ .catch(error => {
5990
+ logWarn(
5991
+ 'remote',
5992
+ `host target renew wake failed ${formatKeyValue('reason', wakeReason)} ${formatKeyValue('error', error?.message || String(error || ''))}`);
5993
+ });
5994
+ }, 0);
5995
+ timer?.unref?.();
5996
+ return true;
5997
+ }
5998
+
5999
+ function scheduleRemoteRegistryWakeFromSyncReport(report) {
6000
+ if (!report?.authenticated) {
6001
+ return {
6002
+ follower: false,
6003
+ hostRenew: false,
6004
+ reason: 'not-authenticated'
6005
+ };
6006
+ }
6007
+
6008
+ const now = Date.now();
6009
+ let follower = false;
6010
+ if (now - remoteAgentSyncReportWakeAt >= REMOTE_AGENT_SYNC_REPORT_WAKE_MS) {
6011
+ remoteAgentSyncReportWakeAt = now;
6012
+ follower = true;
6013
+ wakeRemoteRegistryFollower('agent-sync-report')
6014
+ .catch(error => {
6015
+ logWarn(
6016
+ 'remote',
6017
+ `registry follower wake failed ${formatKeyValue('reason', 'agent-sync-report')} ${formatKeyValue('error', error?.message || String(error || ''))}`);
6018
+ });
6019
+ }
6020
+
6021
+ return {
6022
+ follower,
6023
+ hostRenew: scheduleRemoteHostTargetRenewWake('agent-sync-report'),
6024
+ reason: 'ok'
6025
+ };
6026
+ }
6027
+
5969
6028
  async function runRemoteRegistryFollowerOnce(trigger = 'timer') {
5970
6029
  if (!REMOTE_REGISTRY_FOLLOWER_ENABLED || remoteRegistryFollowerInFlight) {
5971
6030
  return serializeRemoteRegistryFollowerState();
@@ -6112,6 +6171,7 @@ async function runRemoteRegistryFollowerOnce(trigger = 'timer') {
6112
6171
  localHostTargetLeaseId: localHub.hostTargetLeaseId,
6113
6172
  localHostTargetNodeId: localHub.hostTargetNodeId
6114
6173
  });
6174
+ scheduleRemoteHostTargetRenewWake('local-monitor-is-host');
6115
6175
  scheduleRemoteRegistryFollower(REMOTE_REGISTRY_FOLLOWER_POLL_MS, 'local-host');
6116
6176
  return serializeRemoteRegistryFollowerState();
6117
6177
  }
@@ -10931,7 +10991,8 @@ app.post('/api/remote/agent/sync-report', (req, res) => {
10931
10991
  res.setHeader('Cache-Control', 'no-store');
10932
10992
  const report = createRemoteAgentSyncReport(req.body || {});
10933
10993
  rememberRemoteAgentSyncReport(report);
10934
- res.json({ ok: true, report });
10994
+ const wake = scheduleRemoteRegistryWakeFromSyncReport(report);
10995
+ res.json({ ok: true, report, wake });
10935
10996
  });
10936
10997
 
10937
10998
  app.post('/api/remote/agent/connect', async (req, res) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mainAssemblyName": "MindExecution.Web",
3
3
  "resources": {
4
- "hash": "sha256-McKhTanAbQy94ZRRcnz0n0MaS+r4uMcYXTXrUHpgjAo=",
4
+ "hash": "sha256-mdoRB869qA6fwLJuYEh2K9bL+crvydN1XK8eOuPlpjI=",
5
5
  "fingerprinting": {
6
6
  "Google.Protobuf.9h59ukbel7.dll": "Google.Protobuf.dll",
7
7
  "Markdig.d1j7v41cl1.dll": "Markdig.dll",
@@ -127,12 +127,12 @@
127
127
  "MindExecution.Kernel.3zom09ir6j.dll": "MindExecution.Kernel.dll",
128
128
  "MindExecution.Plugins.Admin.bk23zzy6wc.dll": "MindExecution.Plugins.Admin.dll",
129
129
  "MindExecution.Plugins.Business.zwcvc8wufe.dll": "MindExecution.Plugins.Business.dll",
130
- "MindExecution.Plugins.Concept.9igh5dsuw9.dll": "MindExecution.Plugins.Concept.dll",
130
+ "MindExecution.Plugins.Concept.hzy6ckp8bp.dll": "MindExecution.Plugins.Concept.dll",
131
131
  "MindExecution.Plugins.Directory.jc0g7fvyzv.dll": "MindExecution.Plugins.Directory.dll",
132
- "MindExecution.Plugins.PlanMaster.g9r2lbhihg.dll": "MindExecution.Plugins.PlanMaster.dll",
133
- "MindExecution.Plugins.YouTube.6ni889qas8.dll": "MindExecution.Plugins.YouTube.dll",
134
- "MindExecution.Shared.dctgk9zjvp.dll": "MindExecution.Shared.dll",
135
- "MindExecution.Web.cg3mse80dr.dll": "MindExecution.Web.dll",
132
+ "MindExecution.Plugins.PlanMaster.h4q1zpcnm6.dll": "MindExecution.Plugins.PlanMaster.dll",
133
+ "MindExecution.Plugins.YouTube.aw4eop3zxh.dll": "MindExecution.Plugins.YouTube.dll",
134
+ "MindExecution.Shared.pisrcwynz7.dll": "MindExecution.Shared.dll",
135
+ "MindExecution.Web.n3x3b2w06f.dll": "MindExecution.Web.dll",
136
136
  "dotnet.js": "dotnet.js",
137
137
  "dotnet.native.qc8g39g30v.js": "dotnet.native.js",
138
138
  "dotnet.native.boem75ye5i.wasm": "dotnet.native.wasm",
@@ -280,16 +280,16 @@
280
280
  "netstandard.yvr3prsx0x.dll": "sha256-EksNn8Luo4bOWqJ6X7dIe9qG9oOqwOVzjH2xYyMNi+E=",
281
281
  "MindExecution.Core.asayb4hw1o.dll": "sha256-5gla4JTR/zbvkGpneSt6S7ItE51+MjWgjW6L+B6Yevk=",
282
282
  "MindExecution.Kernel.3zom09ir6j.dll": "sha256-78vR2SNkF9FwdQv0fEItSyz4HzgyzwGUROJAnpripPA=",
283
- "MindExecution.Plugins.Concept.9igh5dsuw9.dll": "sha256-L9kDRKc/l7qDyrpHv3nP2eZJFl3hiTKzobGq+1Ir1u4=",
284
- "MindExecution.Plugins.PlanMaster.g9r2lbhihg.dll": "sha256-hMdypae7YThv34t4g0TL/iI1GF/vQsZVQgEehe1AXt8=",
285
- "MindExecution.Shared.dctgk9zjvp.dll": "sha256-jUAtMp/bR4Zd3OFIJIhYFsbFDWCq2Md+YiEpbO7Q628=",
286
- "MindExecution.Web.cg3mse80dr.dll": "sha256-BDF8hVymVem3X/dB9iKv2S6Vohz7y9CKSYMQOattgaA="
283
+ "MindExecution.Plugins.Concept.hzy6ckp8bp.dll": "sha256-Yx3Z2nR6P/mhNZEI13zfuJqN2IoQ3WBZUmyDikxOsOY=",
284
+ "MindExecution.Plugins.PlanMaster.h4q1zpcnm6.dll": "sha256-gcFGHM9Kin1knglciWRS0x0cr/k44ekq1XkOa2CDrL4=",
285
+ "MindExecution.Shared.pisrcwynz7.dll": "sha256-30oNKBWe6wq3n0GdB+3Bi7a3EdB7OawIfVa6XDdI2Xg=",
286
+ "MindExecution.Web.n3x3b2w06f.dll": "sha256-rQIK8//mXHO4tM4vSPUeNDnk5gSO6j81whLtRNPZpqM="
287
287
  },
288
288
  "lazyAssembly": {
289
289
  "MindExecution.Plugins.Admin.bk23zzy6wc.dll": "sha256-uz7Nz0OZ8BBESp2Nr9YocyzV0dUrn7szPuD4/m/RWL8=",
290
290
  "MindExecution.Plugins.Business.zwcvc8wufe.dll": "sha256-3YDsB2/uNI+feWqJk+cesLHgNt8s2/8hXxGPO6CRZZE=",
291
291
  "MindExecution.Plugins.Directory.jc0g7fvyzv.dll": "sha256-PSe7135JPpTBmu4j+rGLF0Dc/6w/wDJNPi8zlfTmSMk=",
292
- "MindExecution.Plugins.YouTube.6ni889qas8.dll": "sha256-ngO7cBhZwzW2Sx9TqcTZj/3TW3lOkcluXr76P2oH9X8="
292
+ "MindExecution.Plugins.YouTube.aw4eop3zxh.dll": "sha256-tuN/y+STBiSqx5+l58CJzN1KR2f6pvd6Pc7NO26rY08="
293
293
  }
294
294
  },
295
295
  "cacheBootResources": true,
@@ -1,5 +1,5 @@
1
1
  self.assetsManifest = {
2
- "version": "eKb1dZVH",
2
+ "version": "xibdL/2q",
3
3
  "assets": [
4
4
  {
5
5
  "hash": "sha256-+CSYMcqLNTsq3VnH11jgYyOCCdxvHzL74CBmo4sCmMU=",
@@ -426,28 +426,28 @@
426
426
  "url": "_framework/MindExecution.Plugins.Business.zwcvc8wufe.dll"
427
427
  },
428
428
  {
429
- "hash": "sha256-L9kDRKc/l7qDyrpHv3nP2eZJFl3hiTKzobGq+1Ir1u4=",
430
- "url": "_framework/MindExecution.Plugins.Concept.9igh5dsuw9.dll"
429
+ "hash": "sha256-Yx3Z2nR6P/mhNZEI13zfuJqN2IoQ3WBZUmyDikxOsOY=",
430
+ "url": "_framework/MindExecution.Plugins.Concept.hzy6ckp8bp.dll"
431
431
  },
432
432
  {
433
433
  "hash": "sha256-PSe7135JPpTBmu4j+rGLF0Dc/6w/wDJNPi8zlfTmSMk=",
434
434
  "url": "_framework/MindExecution.Plugins.Directory.jc0g7fvyzv.dll"
435
435
  },
436
436
  {
437
- "hash": "sha256-hMdypae7YThv34t4g0TL/iI1GF/vQsZVQgEehe1AXt8=",
438
- "url": "_framework/MindExecution.Plugins.PlanMaster.g9r2lbhihg.dll"
437
+ "hash": "sha256-gcFGHM9Kin1knglciWRS0x0cr/k44ekq1XkOa2CDrL4=",
438
+ "url": "_framework/MindExecution.Plugins.PlanMaster.h4q1zpcnm6.dll"
439
439
  },
440
440
  {
441
- "hash": "sha256-ngO7cBhZwzW2Sx9TqcTZj/3TW3lOkcluXr76P2oH9X8=",
442
- "url": "_framework/MindExecution.Plugins.YouTube.6ni889qas8.dll"
441
+ "hash": "sha256-tuN/y+STBiSqx5+l58CJzN1KR2f6pvd6Pc7NO26rY08=",
442
+ "url": "_framework/MindExecution.Plugins.YouTube.aw4eop3zxh.dll"
443
443
  },
444
444
  {
445
- "hash": "sha256-jUAtMp/bR4Zd3OFIJIhYFsbFDWCq2Md+YiEpbO7Q628=",
446
- "url": "_framework/MindExecution.Shared.dctgk9zjvp.dll"
445
+ "hash": "sha256-30oNKBWe6wq3n0GdB+3Bi7a3EdB7OawIfVa6XDdI2Xg=",
446
+ "url": "_framework/MindExecution.Shared.pisrcwynz7.dll"
447
447
  },
448
448
  {
449
- "hash": "sha256-BDF8hVymVem3X/dB9iKv2S6Vohz7y9CKSYMQOattgaA=",
450
- "url": "_framework/MindExecution.Web.cg3mse80dr.dll"
449
+ "hash": "sha256-rQIK8//mXHO4tM4vSPUeNDnk5gSO6j81whLtRNPZpqM=",
450
+ "url": "_framework/MindExecution.Web.n3x3b2w06f.dll"
451
451
  },
452
452
  {
453
453
  "hash": "sha256-IsZJ91/OW+fHzNqIgEc7Y072ns8z9dGritiSyvR9Wgc=",
@@ -770,7 +770,7 @@
770
770
  "url": "_framework/Websocket.Client.vapounvmnl.dll"
771
771
  },
772
772
  {
773
- "hash": "sha256-D8Q3RQGgMZkBO5BKZ8K5zaLGkjSYT4MlCKCtiel5Ujg=",
773
+ "hash": "sha256-7dQRpQUPVtOpkTezx6+zpAuSCJj+hqvcySneMN57Dqo=",
774
774
  "url": "_framework/blazor.boot.json"
775
775
  },
776
776
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: eKb1dZVH */
1
+ /* Manifest version: xibdL/2q */
2
2
  // Hosted deployments should prefer the network over stale offline caches.
3
3
  // This service worker immediately clears old Blazor offline caches and unregisters itself.
4
4