@mindexec/cli 0.2.210 → 0.2.212

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.210",
3
+ "version": "0.2.212",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
@@ -138,11 +138,25 @@ try {
138
138
  const sessionPayload = JSON.stringify({
139
139
  access_token: 'access-token-a',
140
140
  refresh_token: 'refresh-token-a',
141
+ expires_at: Math.floor(Date.now() / 1000) + 600,
141
142
  user: {
142
143
  id: 'user-a',
143
144
  email: 'auth-smoke@example.com'
144
145
  }
145
146
  });
147
+ let expectedStablePayload = sessionPayload;
148
+
149
+ function makeTimedSessionPayload(accessToken, refreshToken, expiresInSeconds) {
150
+ return JSON.stringify({
151
+ access_token: accessToken,
152
+ refresh_token: refreshToken,
153
+ expires_at: Math.floor(Date.now() / 1000) + expiresInSeconds,
154
+ user: {
155
+ id: 'user-a',
156
+ email: 'auth-smoke@example.com'
157
+ }
158
+ });
159
+ }
146
160
 
147
161
  await withBridge({ workspacePath: workspaceA, authDataRoot }, async (baseUrl) => {
148
162
  const unauthorized = await fetchJson(`${baseUrl}/api/auth/session`);
@@ -170,12 +184,41 @@ try {
170
184
  assert.equal(loaded.status, 200);
171
185
  assert.equal(loaded.payload?.content, sessionPayload);
172
186
  assert.equal(loaded.payload?.source, 'stable');
187
+
188
+ const newerPayload = makeTimedSessionPayload('access-token-newer', 'refresh-token-newer', 3600);
189
+ const newerSaved = await fetchJson(`${baseUrl}/api/auth/session`, {
190
+ method: 'POST',
191
+ token: BRIDGE_TOKEN,
192
+ body: JSON.stringify({ content: newerPayload })
193
+ });
194
+ assert.equal(newerSaved.status, 200);
195
+
196
+ const staleBrowserPayload = makeTimedSessionPayload('access-token-stale-browser', 'refresh-token-stale-browser', 120);
197
+ const staleSaved = await fetchJson(`${baseUrl}/api/auth/session`, {
198
+ method: 'POST',
199
+ token: BRIDGE_TOKEN,
200
+ body: JSON.stringify({ content: staleBrowserPayload })
201
+ });
202
+ assert.equal(staleSaved.status, 200);
203
+
204
+ const afterStale = await fetchJson(`${baseUrl}/api/auth/session`, { token: BRIDGE_TOKEN });
205
+ assert.equal(afterStale.status, 200);
206
+ assert.equal(JSON.parse(afterStale.payload?.content || '{}').access_token, 'access-token-newer');
207
+
208
+ const newestPayload = makeTimedSessionPayload('access-token-newest', 'refresh-token-newest', 7200);
209
+ const newestSaved = await fetchJson(`${baseUrl}/api/auth/session`, {
210
+ method: 'POST',
211
+ token: BRIDGE_TOKEN,
212
+ body: JSON.stringify({ content: newestPayload })
213
+ });
214
+ assert.equal(newestSaved.status, 200);
215
+ expectedStablePayload = newestPayload;
173
216
  });
174
217
 
175
218
  await withBridge({ workspacePath: workspaceB, authDataRoot }, async (baseUrl) => {
176
219
  const loaded = await fetchJson(`${baseUrl}/api/auth/session`, { token: BRIDGE_TOKEN });
177
220
  assert.equal(loaded.status, 200);
178
- assert.equal(loaded.payload?.content, sessionPayload);
221
+ assert.equal(loaded.payload?.content, expectedStablePayload);
179
222
  assert.equal(loaded.payload?.source, 'stable');
180
223
 
181
224
  const deleted = await fetchJson(`${baseUrl}/api/auth/session`, {
package/server.js CHANGED
@@ -669,10 +669,49 @@ async function readStableAuthSessionPayload() {
669
669
  async function writeStableAuthSessionPayload(content) {
670
670
  const payload = validateAuthSessionPayload(content);
671
671
  const stablePath = getStableSupabaseSessionPath();
672
+ const existingPayload = await tryReadTextFile(stablePath);
673
+ if (shouldKeepExistingAuthSessionPayload(existingPayload, payload)) {
674
+ return stablePath;
675
+ }
676
+
672
677
  await writePrivateTextFile(stablePath, payload);
673
678
  return stablePath;
674
679
  }
675
680
 
681
+ function shouldKeepExistingAuthSessionPayload(existingContent, incomingContent) {
682
+ if (!existingContent || !String(existingContent).trim()) {
683
+ return false;
684
+ }
685
+
686
+ const existing = parseSupabaseSessionForRegistry(existingContent);
687
+ const incoming = parseSupabaseSessionForRegistry(incomingContent);
688
+ if (!existing || !incoming) {
689
+ return false;
690
+ }
691
+
692
+ if (!existing.userId || !incoming.userId || existing.userId !== incoming.userId) {
693
+ return false;
694
+ }
695
+
696
+ if (!Number.isFinite(existing.expiresAtMs) || !Number.isFinite(incoming.expiresAtMs)) {
697
+ return false;
698
+ }
699
+
700
+ const now = Date.now();
701
+ const existingRemainingMs = existing.expiresAtMs - now;
702
+ const incomingRemainingMs = incoming.expiresAtMs - now;
703
+ const staleSkewMs = 30_000;
704
+ if (existingRemainingMs <= staleSkewMs || incoming.expiresAtMs + staleSkewMs >= existing.expiresAtMs) {
705
+ return false;
706
+ }
707
+
708
+ logEvent(
709
+ 'remote',
710
+ `auth session write ignored stale payload ${formatKeyValue('existingMs', Math.max(0, existingRemainingMs))} ${formatKeyValue('incomingMs', Math.max(0, incomingRemainingMs))}`,
711
+ 'remote');
712
+ return true;
713
+ }
714
+
676
715
  async function deleteStableAuthSessionPayload() {
677
716
  const paths = [
678
717
  getStableSupabaseSessionPath(),
@@ -5277,8 +5277,7 @@ ${summaryLines.map(line => `<div>${escapeNodeFrameDebugHtml(line)}</div>`).join(
5277
5277
  isCss3dEnabled &&
5278
5278
  !isInLodMode &&
5279
5279
  shouldUpdateCss3d &&
5280
- this.isPanning === true &&
5281
- this.isZooming !== true &&
5280
+ (this.isPanning === true || this.isZooming === true || isCameraMoving === true) &&
5282
5281
  isCameraMoving === true &&
5283
5282
  !isNodeInteracting &&
5284
5283
  !hasNonPanForcedUpdate &&
@@ -5401,13 +5400,19 @@ ${summaryLines.map(line => `<div>${escapeNodeFrameDebugHtml(line)}</div>`).join(
5401
5400
  _frameProfTimes.visibleNodes = profVisibleIds ? profVisibleIds.size : 0;
5402
5401
  }
5403
5402
 
5404
- if (isMenuOverlayUiEnabled && window.MindMapMenuManager) {
5403
+ const shouldDeferFloatingUiDuringMotion =
5404
+ (this.isPanning === true || this.isZooming === true || isCameraMoving === true) &&
5405
+ !isNodeInteracting &&
5406
+ !hasForcedUpdate &&
5407
+ !hasOverlayFocus &&
5408
+ !this.isWindowResizing;
5409
+ if (isMenuOverlayUiEnabled && window.MindMapMenuManager && shouldDeferFloatingUiDuringMotion !== true) {
5405
5410
  window.MindMapMenuManager.update();
5406
5411
  } else if (!isMenuOverlayUiEnabled && window.MindMapMenuManager?.hideMenu) {
5407
5412
  window.MindMapMenuManager.hideMenu();
5408
5413
  }
5409
5414
  _profileSection('menu');
5410
- if (isMultiSelectOverlayUiEnabled && window.MindMapMultiSelect) {
5415
+ if (isMultiSelectOverlayUiEnabled && window.MindMapMultiSelect && shouldDeferFloatingUiDuringMotion !== true) {
5411
5416
  window.MindMapMultiSelect.update();
5412
5417
  } else if (!isMultiSelectOverlayUiEnabled && window.MindMapMultiSelect?.hide) {
5413
5418
  window.MindMapMultiSelect.hide();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mainAssemblyName": "MindExecution.Web",
3
3
  "resources": {
4
- "hash": "sha256-Ny3t+3+wMEcLBIrH8PviSLxWnIKH3h8bXWdrXi8ESDY=",
4
+ "hash": "sha256-iiSeCvB5NpvqIW1+MQgzzc+UStFn80YeJUyFtdiuER8=",
5
5
  "fingerprinting": {
6
6
  "Google.Protobuf.9h59ukbel7.dll": "Google.Protobuf.dll",
7
7
  "Markdig.d1j7v41cl1.dll": "Markdig.dll",
@@ -132,7 +132,7 @@
132
132
  "MindExecution.Plugins.PlanMaster.kibqg6rvqh.dll": "MindExecution.Plugins.PlanMaster.dll",
133
133
  "MindExecution.Plugins.YouTube.089r64n2hv.dll": "MindExecution.Plugins.YouTube.dll",
134
134
  "MindExecution.Shared.p86iw1fhns.dll": "MindExecution.Shared.dll",
135
- "MindExecution.Web.aj117i28hy.dll": "MindExecution.Web.dll",
135
+ "MindExecution.Web.7axuoygrwi.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",
@@ -284,7 +284,7 @@
284
284
  "MindExecution.Plugins.Concept.u9kzsgf64o.dll": "sha256-Yp38m6zHe8EBxtm480N4LfcHRpzFZRhYpr1RsCgnlK8=",
285
285
  "MindExecution.Plugins.PlanMaster.kibqg6rvqh.dll": "sha256-NOtEHR8Y0rO8BguFvD1soa8jfB4YVQFydten0SzqBEg=",
286
286
  "MindExecution.Shared.p86iw1fhns.dll": "sha256-GeQGsY17FMYu6beNS1RDR7yJ/nNgfiix6rjORzhXnCY=",
287
- "MindExecution.Web.aj117i28hy.dll": "sha256-+jKjBygtNF6dsjwsyJ+O2NId2p7HeQk4rYksxd+SqPA="
287
+ "MindExecution.Web.7axuoygrwi.dll": "sha256-/6NQ8z9E7ixNwgYD71eh6M6YCGzctKodTWcZNJcNF8E="
288
288
  },
289
289
  "lazyAssembly": {
290
290
  "MindExecution.Plugins.Admin.29mytzdaun.dll": "sha256-2mHPbTPcHCi1xPuk3dNMVWxn42xZFUZ3QFhm3xIV/6E=",
@@ -1,5 +1,5 @@
1
1
  self.assetsManifest = {
2
- "version": "3ooTJksk",
2
+ "version": "yDUuMQhr",
3
3
  "assets": [
4
4
  {
5
5
  "hash": "sha256-+CSYMcqLNTsq3VnH11jgYyOCCdxvHzL74CBmo4sCmMU=",
@@ -78,7 +78,7 @@
78
78
  "url": "_content/MindExecution.Shared/js/marked.min.js"
79
79
  },
80
80
  {
81
- "hash": "sha256-5pU2z888/VshyV2A52dlTj5jip67W5Bwp/HlMmzblKg=",
81
+ "hash": "sha256-1lJ2AVs7KnxAb95JbWi1pq3LjvTHUuEU2AVPBXWGEaU=",
82
82
  "url": "_content/MindExecution.Shared/js/mind-map-core.js"
83
83
  },
84
84
  {
@@ -446,8 +446,8 @@
446
446
  "url": "_framework/MindExecution.Shared.p86iw1fhns.dll"
447
447
  },
448
448
  {
449
- "hash": "sha256-+jKjBygtNF6dsjwsyJ+O2NId2p7HeQk4rYksxd+SqPA=",
450
- "url": "_framework/MindExecution.Web.aj117i28hy.dll"
449
+ "hash": "sha256-/6NQ8z9E7ixNwgYD71eh6M6YCGzctKodTWcZNJcNF8E=",
450
+ "url": "_framework/MindExecution.Web.7axuoygrwi.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-txW3qdrqdJhTHyMMLK0IDsdhphqslC5BjXEhWNo5jpM=",
773
+ "hash": "sha256-xLiOU/vuEmRFIqaJXh1WMyuEaWcsagGwx5Uq71HsjkY=",
774
774
  "url": "_framework/blazor.boot.json"
775
775
  },
776
776
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: 3ooTJksk */
1
+ /* Manifest version: yDUuMQhr */
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