@mindexec/cli 0.2.163 → 0.2.165

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.163",
3
+ "version": "0.2.165",
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) => {
@@ -14046,6 +14046,33 @@
14046
14046
  : 0;
14047
14047
  }
14048
14048
 
14049
+ function primeRemoteFleetRenderedFrameSurfaces(bodyView, reason = 'render') {
14050
+ if (!bodyView) {
14051
+ return 0;
14052
+ }
14053
+
14054
+ const nodeId = getRemoteFleetBodyNodeId(bodyView);
14055
+ const session = bodyView._remoteFleetBinaryFrameSession
14056
+ || (nodeId ? remoteFleetBinaryFrameSessions.get(nodeId) : null)
14057
+ || null;
14058
+ const primedFrames = applyRemoteFleetBinaryFrameCacheToBody(bodyView, session);
14059
+ if (primedFrames > 0) {
14060
+ bodyView._remoteFleetLastBinaryFrameAt = getRemoteFleetFrameNow();
14061
+ if (reason === 'ws-start') {
14062
+ window.RuntimeTrace?.emit?.('remote.frame.wsCachePrimed', {
14063
+ nodeId,
14064
+ count: primedFrames
14065
+ });
14066
+ }
14067
+ window.RuntimeTrace?.emit?.('remote.frame.surfaceCachePrimed', {
14068
+ nodeId,
14069
+ count: primedFrames,
14070
+ reason: String(reason || 'render')
14071
+ });
14072
+ }
14073
+ return primedFrames;
14074
+ }
14075
+
14049
14076
  function getRemoteFleetBodyNodeId(bodyView) {
14050
14077
  return String(
14051
14078
  bodyView?.dataset?.nodeId
@@ -14566,14 +14593,7 @@
14566
14593
  mode: String(options.mode || 'remote-fast')
14567
14594
  };
14568
14595
  bodyView._remoteFleetBinaryFrameSession = session;
14569
- const primedFrames = applyRemoteFleetBinaryFrameCacheToBody(bodyView, session);
14570
- if (primedFrames > 0) {
14571
- bodyView._remoteFleetLastBinaryFrameAt = getRemoteFleetFrameNow();
14572
- window.RuntimeTrace?.emit?.('remote.frame.wsCachePrimed', {
14573
- nodeId,
14574
- count: primedFrames
14575
- });
14576
- }
14596
+ primeRemoteFleetRenderedFrameSurfaces(bodyView, 'ws-start');
14577
14597
  openRemoteFleetBinaryFrameSocket(session).catch(() => undefined);
14578
14598
  return true;
14579
14599
  }
@@ -14820,7 +14840,14 @@
14820
14840
  image.alt = frame.kind === 'live' ? 'Live screen' : 'Remote screen';
14821
14841
  image.loading = frame.kind === 'thumbnail' ? 'lazy' : 'eager';
14822
14842
  image.decoding = 'async';
14823
- image.style.cssText = 'width:100%;height:100%;object-fit:cover;display:block;';
14843
+ image.style.cssText = `
14844
+ position: absolute;
14845
+ inset: 0;
14846
+ width: 100%;
14847
+ height: 100%;
14848
+ object-fit: cover;
14849
+ display: none;
14850
+ `;
14824
14851
  if (typeof preview?.insertBefore === 'function') {
14825
14852
  preview.insertBefore(image, preview.firstChild || null);
14826
14853
  } else {
@@ -18229,6 +18256,7 @@
18229
18256
  const previewSource = hasLiveFrame
18230
18257
  ? getRemoteFleetFrameSource(device, 'live')
18231
18258
  : getRemoteFleetFrameSource(device, 'thumbnail');
18259
+ const hasPreviewSource = isRemoteFleetFrameSource(previewSource);
18232
18260
  const isDetail = mode === 'detail';
18233
18261
 
18234
18262
  const preview = document.createElement('div');
@@ -18245,12 +18273,13 @@
18245
18273
  aspect-ratio: 16 / 9;
18246
18274
  overflow: hidden;
18247
18275
  border-radius: 0;
18248
- background: ${(hasLiveFrame || hasThumbnail) ? 'linear-gradient(135deg, #0f172a 0%, #1e293b 100%)' : '#ffffff'};
18276
+ background: ${hasPreviewSource ? 'linear-gradient(135deg, #0f172a 0%, #1e293b 100%)' : '#ffffff'};
18249
18277
  border: 1px solid rgba(148, 163, 184, ${isDetail ? '0.34' : '0.24'});
18250
18278
  box-shadow: none;
18251
18279
  `;
18280
+ ensureRemoteFleetFrameCanvas(preview);
18252
18281
 
18253
- if (hasLiveFrame || hasThumbnail) {
18282
+ if ((hasLiveFrame || hasThumbnail) && hasPreviewSource) {
18254
18283
  const image = document.createElement('img');
18255
18284
  image.dataset.remoteFleetFrameImage = 'true';
18256
18285
  image.dataset.remoteFleetFrameKind = hasLiveFrame ? 'live' : 'thumbnail';
@@ -18921,6 +18950,8 @@
18921
18950
  scheduleRemoteFleetTaskFollow();
18922
18951
  }
18923
18952
 
18953
+ primeRemoteFleetRenderedFrameSurfaces(bodyView, 'monitor-render');
18954
+
18924
18955
  sendVisibleButton.addEventListener('click', async event => {
18925
18956
  event.preventDefault();
18926
18957
  event.stopPropagation();
@@ -7,8 +7,8 @@
7
7
  <title>MindExec | Run your ideas as AI task graphs</title>
8
8
  <meta name="description" content="MindExec is an AI execution canvas for solo builders, researchers, developers, and creators. Start with free browser tools, then move serious work into saved MindCanvas projects." />
9
9
  <base href="/" />
10
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260617-smart-managed-ai-provider-v594" />
11
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-smart-managed-ai-provider-v594" />
10
+ <link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260617-mdm-css3d-frame-v595" />
11
+ <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-mdm-css3d-frame-v595" />
12
12
  <!-- ?쇄뼹??Font Awesome (local) ?쇄뼹??-->
13
13
  <link rel="stylesheet" href="_content/MindExecution.Shared/lib/font-awesome/css/all.min.css" />
14
14
  <!-- ?꿎뼯??-->
@@ -579,7 +579,7 @@
579
579
  }
580
580
 
581
581
  const base = '_content/MindExecution.Shared/js/';
582
- const scriptVersion = '20260617-smart-managed-ai-provider-v594';
582
+ const scriptVersion = '20260617-mdm-css3d-frame-v595';
583
583
  const scriptUrl = (script) => `${base}${script}?v=${scriptVersion}`;
584
584
  console.log(`[Script Loader] Shared JS version: ${scriptVersion}`);
585
585
  const criticalScripts = [
@@ -1,5 +1,5 @@
1
1
  self.assetsManifest = {
2
- "version": "0GKxFZhB",
2
+ "version": "eKb1dZVH",
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-5NeWmkeG5tE20WMmpOO59SkGuCFv+yk/h6kOeYeOmJA=",
89
+ "hash": "sha256-tVOXwWraF08ndMMJrGJhC6xbwLyBxzNsmLbDDcWNh60=",
90
90
  "url": "_content/MindExecution.Shared/js/mind-map-css3d-manager.js"
91
91
  },
92
92
  {
@@ -834,7 +834,7 @@
834
834
  "url": "image-manifest.json"
835
835
  },
836
836
  {
837
- "hash": "sha256-/Ws+j7NCsAaRO5sbCiC2iKq64N9cAUPlERjtIR5wWlA=",
837
+ "hash": "sha256-GvBsY/r4ImlQfWqoXQmfjnNBl7zvIg8QOJyoBBRGNCY=",
838
838
  "url": "index.html"
839
839
  },
840
840
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: 0GKxFZhB */
1
+ /* Manifest version: eKb1dZVH */
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