@mindexec/cli 0.2.207 → 0.2.209

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.207",
3
+ "version": "0.2.209",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
package/server.js CHANGED
@@ -5632,6 +5632,39 @@ function readSupabaseSessionField(source, ...keys) {
5632
5632
  return '';
5633
5633
  }
5634
5634
 
5635
+ function unwrapSupabaseSessionCandidate(value, depth = 0) {
5636
+ if (!value || typeof value !== 'object' || depth > 4) {
5637
+ return value;
5638
+ }
5639
+
5640
+ const directAccessToken = readSupabaseSessionField(value, 'access_token', 'accessToken', 'AccessToken');
5641
+ const directUser = value.user || value.User;
5642
+ if (directAccessToken && directUser) {
5643
+ return value;
5644
+ }
5645
+
5646
+ const candidates = [
5647
+ value.session,
5648
+ value.Session,
5649
+ value.currentSession,
5650
+ value.CurrentSession,
5651
+ value.supabaseSession,
5652
+ value.SupabaseSession,
5653
+ value.authSession,
5654
+ value.AuthSession
5655
+ ];
5656
+ for (const candidate of candidates) {
5657
+ if (candidate && typeof candidate === 'object') {
5658
+ const unwrapped = unwrapSupabaseSessionCandidate(candidate, depth + 1);
5659
+ if (unwrapped && typeof unwrapped === 'object') {
5660
+ return unwrapped;
5661
+ }
5662
+ }
5663
+ }
5664
+
5665
+ return value;
5666
+ }
5667
+
5635
5668
  function parseSupabaseSessionExpiresAtMs(value) {
5636
5669
  if (value === undefined || value === null || String(value).trim() === '') {
5637
5670
  return 0;
@@ -5662,10 +5695,14 @@ function setSupabaseSessionKnownField(session, value, fallbackKey, ...keys) {
5662
5695
 
5663
5696
  function buildRefreshedSupabaseSessionPayload(content, refreshedSession) {
5664
5697
  const existing = JSON.parse(String(content || '{}'));
5698
+ const targetSession = unwrapSupabaseSessionCandidate(existing);
5699
+ const sessionToUpdate = targetSession && typeof targetSession === 'object' ? targetSession : existing;
5665
5700
  const accessToken = String(readSupabaseSessionField(refreshedSession, 'access_token', 'accessToken', 'AccessToken')).trim();
5666
5701
  const refreshToken = String(readSupabaseSessionField(refreshedSession, 'refresh_token', 'refreshToken', 'RefreshToken')).trim()
5702
+ || String(readSupabaseSessionField(sessionToUpdate, 'refresh_token', 'refreshToken', 'RefreshToken')).trim()
5667
5703
  || String(readSupabaseSessionField(existing, 'refresh_token', 'refreshToken', 'RefreshToken')).trim();
5668
5704
  const tokenType = String(readSupabaseSessionField(refreshedSession, 'token_type', 'tokenType', 'TokenType')).trim()
5705
+ || String(readSupabaseSessionField(sessionToUpdate, 'token_type', 'tokenType', 'TokenType')).trim()
5669
5706
  || String(readSupabaseSessionField(existing, 'token_type', 'tokenType', 'TokenType')).trim()
5670
5707
  || 'bearer';
5671
5708
  const expiresInRaw = Number(readSupabaseSessionField(refreshedSession, 'expires_in', 'expiresIn', 'ExpiresIn') || 0);
@@ -5680,21 +5717,21 @@ function buildRefreshedSupabaseSessionPayload(content, refreshedSession) {
5680
5717
  throw error;
5681
5718
  }
5682
5719
 
5683
- setSupabaseSessionKnownField(existing, accessToken, 'access_token', 'access_token', 'accessToken', 'AccessToken');
5684
- setSupabaseSessionKnownField(existing, refreshToken, 'refresh_token', 'refresh_token', 'refreshToken', 'RefreshToken');
5685
- setSupabaseSessionKnownField(existing, tokenType, 'token_type', 'token_type', 'tokenType', 'TokenType');
5686
- setSupabaseSessionKnownField(existing, expiresAtSeconds, 'expires_at', 'expires_at', 'expiresAt', 'ExpiresAt');
5720
+ setSupabaseSessionKnownField(sessionToUpdate, accessToken, 'access_token', 'access_token', 'accessToken', 'AccessToken');
5721
+ setSupabaseSessionKnownField(sessionToUpdate, refreshToken, 'refresh_token', 'refresh_token', 'refreshToken', 'RefreshToken');
5722
+ setSupabaseSessionKnownField(sessionToUpdate, tokenType, 'token_type', 'token_type', 'tokenType', 'TokenType');
5723
+ setSupabaseSessionKnownField(sessionToUpdate, expiresAtSeconds, 'expires_at', 'expires_at', 'expiresAt', 'ExpiresAt');
5687
5724
 
5688
5725
  if (Number.isFinite(expiresInRaw) && expiresInRaw > 0) {
5689
- setSupabaseSessionKnownField(existing, Math.floor(expiresInRaw), 'expires_in', 'expires_in', 'expiresIn', 'ExpiresIn');
5726
+ setSupabaseSessionKnownField(sessionToUpdate, Math.floor(expiresInRaw), 'expires_in', 'expires_in', 'expiresIn', 'ExpiresIn');
5690
5727
  }
5691
5728
 
5692
5729
  const user = refreshedSession?.user || refreshedSession?.User;
5693
5730
  if (user && typeof user === 'object') {
5694
- if (Object.prototype.hasOwnProperty.call(existing, 'User')) {
5695
- existing.User = user;
5731
+ if (Object.prototype.hasOwnProperty.call(sessionToUpdate, 'User')) {
5732
+ sessionToUpdate.User = user;
5696
5733
  } else {
5697
- existing.user = user;
5734
+ sessionToUpdate.user = user;
5698
5735
  }
5699
5736
  }
5700
5737
 
@@ -5704,18 +5741,27 @@ function buildRefreshedSupabaseSessionPayload(content, refreshedSession) {
5704
5741
  function parseSupabaseSessionForRegistry(content) {
5705
5742
  let session = null;
5706
5743
  try {
5707
- session = JSON.parse(String(content || ''));
5744
+ session = unwrapSupabaseSessionCandidate(JSON.parse(String(content || '')));
5708
5745
  } catch {
5709
5746
  return null;
5710
5747
  }
5711
5748
 
5712
5749
  const user = session?.user || session?.User || {};
5713
- const accessToken = String(readSupabaseSessionField(session, 'access_token', 'accessToken', 'AccessToken')).trim();
5750
+ const accessToken = String(readSupabaseSessionField(session, 'access_token', 'accessToken', 'AccessToken', 'token', 'Token')).trim();
5714
5751
  const refreshToken = String(readSupabaseSessionField(session, 'refresh_token', 'refreshToken', 'RefreshToken')).trim();
5715
5752
  const userId = String(
5716
5753
  readSupabaseSessionField(user, 'id', 'Id')
5717
5754
  || readSupabaseSessionField(session, 'user_id', 'userId', 'UserId')).trim();
5718
- const expiresAtMs = parseSupabaseSessionExpiresAtMs(readSupabaseSessionField(session, 'expires_at', 'expiresAt', 'ExpiresAt'));
5755
+ const expiresAtMs = parseSupabaseSessionExpiresAtMs(readSupabaseSessionField(
5756
+ session,
5757
+ 'expires_at',
5758
+ 'expiresAt',
5759
+ 'ExpiresAt',
5760
+ 'expires_at_ms',
5761
+ 'expiresAtMs',
5762
+ 'ExpiresAtMs',
5763
+ 'expiresAtUnixTime',
5764
+ 'ExpiresAtUnixTime'));
5719
5765
 
5720
5766
  if (!accessToken || !userId) {
5721
5767
  return null;
@@ -17928,6 +17928,10 @@
17928
17928
  if (controlTarget) {
17929
17929
  return;
17930
17930
  }
17931
+ const monitorTileTarget = event.target?.closest?.('[data-remote-fleet-action="select-device"], [data-remote-fleet-device-preview]');
17932
+ if (monitorTileTarget) {
17933
+ return;
17934
+ }
17931
17935
 
17932
17936
  selectRemoteFleetMonitorNodeFromPointer(bodyView.dataset.remoteFleetMonitorNodeId, event);
17933
17937
  }, true);
@@ -18965,15 +18969,17 @@
18965
18969
  });
18966
18970
  const applySelectedDeviceVisualState = selectedDeviceId => {
18967
18971
  const normalizedSelectedId = String(selectedDeviceId || '').trim();
18972
+ const previousSelectedId = String(bodyView.dataset.remoteFleetSelectedDeviceId || '').trim();
18968
18973
  if (normalizedSelectedId) {
18969
18974
  bodyView.dataset.remoteFleetSelectedDeviceId = normalizedSelectedId;
18970
18975
  } else {
18971
18976
  delete bodyView.dataset.remoteFleetSelectedDeviceId;
18972
18977
  }
18973
18978
 
18974
- getDeviceCards().forEach(card => {
18979
+ const updateCard = (card, isSelected) => {
18980
+ if (!card) return;
18975
18981
  const deviceId = String(card.dataset.deviceId || '').trim();
18976
- const isSelected = !!normalizedSelectedId && deviceId === normalizedSelectedId;
18982
+ if (!deviceId) return;
18977
18983
  card.dataset.remoteFleetSelected = isSelected ? 'true' : 'false';
18978
18984
  card.setAttribute('aria-pressed', isSelected ? 'true' : 'false');
18979
18985
 
@@ -18986,7 +18992,15 @@
18986
18992
  preview.style.outlineOffset = isSelected ? '-2px' : '0';
18987
18993
  preview.style.boxShadow = 'none';
18988
18994
  }
18989
- });
18995
+ };
18996
+
18997
+ if (previousSelectedId && previousSelectedId !== normalizedSelectedId) {
18998
+ updateCard(grid.querySelector(`article[data-device-id="${cssEscapeValue(previousSelectedId)}"]`), false);
18999
+ }
19000
+
19001
+ if (normalizedSelectedId) {
19002
+ updateCard(grid.querySelector(`article[data-device-id="${cssEscapeValue(normalizedSelectedId)}"]`), true);
19003
+ }
18990
19004
 
18991
19005
  window.RuntimeTrace?.emit?.('remote.monitor.deviceSelected', {
18992
19006
  nodeId,
@@ -18995,7 +19009,7 @@
18995
19009
  });
18996
19010
  };
18997
19011
  getDeviceCards().forEach(card => {
18998
- ['mousedown', 'mouseup', 'dblclick'].forEach(eventName => {
19012
+ ['pointerdown', 'mousedown', 'mouseup', 'dblclick'].forEach(eventName => {
18999
19013
  card.addEventListener(eventName, event => {
19000
19014
  if (event.button === 1 || event.button === 2) {
19001
19015
  if (eventName === 'mousedown') {
@@ -19005,11 +19019,13 @@
19005
19019
  }
19006
19020
 
19007
19021
  event.stopPropagation();
19022
+ event.stopImmediatePropagation?.();
19008
19023
  });
19009
19024
  });
19010
19025
  card.addEventListener('dblclick', event => {
19011
19026
  event.preventDefault();
19012
19027
  event.stopPropagation();
19028
+ event.stopImmediatePropagation?.();
19013
19029
  const deviceId = String(card.dataset.deviceId || '').trim();
19014
19030
  if (!deviceId) return;
19015
19031
  applySelectedDeviceVisualState(deviceId);
@@ -19043,6 +19059,7 @@
19043
19059
  const selectCard = event => {
19044
19060
  event.preventDefault();
19045
19061
  event.stopPropagation();
19062
+ event.stopImmediatePropagation?.();
19046
19063
  const deviceId = String(card.dataset.deviceId || '').trim();
19047
19064
  if (!deviceId) return;
19048
19065
  applySelectedDeviceVisualState(deviceId);
@@ -7,8 +7,8 @@
7
7
  <title>MindExec | Business Execution OS for solo builders</title>
8
8
  <meta name="description" content="MindExec is an AI business execution OS for solo builders who want to turn notes, research, assets, and repeatable execution Skills into revenue-producing work." />
9
9
  <base href="/" />
10
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260618-mdm-select-fast-v623-x1" />
11
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260618-mdm-select-fast-v623-x1" />
10
+ <link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260618-mdm-select-isolated-v624-x1" />
11
+ <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260618-mdm-select-isolated-v624-x1" />
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 = '20260618-mdm-select-fast-v623-x1';
582
+ const scriptVersion = '20260618-mdm-select-isolated-v624-x1';
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": "BR/oJzvr",
2
+ "version": "3ooTJksk",
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-SBzGzTPXsG6Y/wv5Gje22Ljhops+w3oQOecMgDEF1Xg=",
89
+ "hash": "sha256-gj/1Ji+BbpWEEXxsJO/G06JwsucL7DPWqcPqRHEXAMg=",
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-0JDdU0UMUh/6DXGHArgXB+qlJm2ozE+7SjrrKnKdipk=",
837
+ "hash": "sha256-G9VeNBViV+SdcI+K0CTSCBUeAPdnMjIquPkPHx3PKTE=",
838
838
  "url": "index.html"
839
839
  },
840
840
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: BR/oJzvr */
1
+ /* Manifest version: 3ooTJksk */
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