@mindexec/cli 0.2.405 → 0.2.407

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.405",
3
+ "version": "0.2.407",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
package/port-guard.cjs CHANGED
@@ -1,9 +1,11 @@
1
1
  const { execFile } = require('child_process');
2
+ const http = require('http');
2
3
  const path = require('path');
3
4
  const { promisify } = require('util');
4
5
 
5
6
  const execFileAsync = promisify(execFile);
6
7
  const DEFAULT_WAIT_MS = 3500;
8
+ const STATUS_PROBE_TIMEOUT_MS = 650;
7
9
 
8
10
  function normalizePort(value, fallback = 5147) {
9
11
  const parsed = Number.parseInt(String(value || '').trim(), 10);
@@ -141,6 +143,55 @@ function looksLikeMindExecBridge(details, bridgeRoot) {
141
143
  || /\bmindexec(\.cmd|\.ps1|\.exe)?\b/i.test(text);
142
144
  }
143
145
 
146
+ async function probeMindExecStatus(port) {
147
+ return await new Promise(resolve => {
148
+ const request = http.request({
149
+ hostname: '127.0.0.1',
150
+ port,
151
+ path: '/api/status',
152
+ method: 'GET',
153
+ timeout: STATUS_PROBE_TIMEOUT_MS,
154
+ headers: {
155
+ Accept: 'application/json'
156
+ }
157
+ }, response => {
158
+ let body = '';
159
+ response.setEncoding('utf8');
160
+ response.on('data', chunk => {
161
+ body += chunk;
162
+ if (body.length > 64 * 1024) {
163
+ request.destroy();
164
+ resolve(false);
165
+ }
166
+ });
167
+ response.on('end', () => {
168
+ if (response.statusCode !== 200) {
169
+ resolve(false);
170
+ return;
171
+ }
172
+
173
+ try {
174
+ const payload = JSON.parse(body || '{}');
175
+ resolve(
176
+ payload?.app === 'MindExec' &&
177
+ payload?.packageName === '@mindexec/cli' &&
178
+ payload?.status === 'ok'
179
+ );
180
+ } catch {
181
+ resolve(false);
182
+ }
183
+ });
184
+ });
185
+
186
+ request.on('timeout', () => {
187
+ request.destroy();
188
+ resolve(false);
189
+ });
190
+ request.on('error', () => resolve(false));
191
+ request.end();
192
+ });
193
+ }
194
+
144
195
  async function waitForPortRelease(port, timeoutMs = DEFAULT_WAIT_MS) {
145
196
  const started = Date.now();
146
197
  while (Date.now() - started < timeoutMs) {
@@ -182,7 +233,9 @@ async function releaseBridgePort(options = {}) {
182
233
 
183
234
  for (const pid of pids) {
184
235
  const details = await getProcessDetails(pid);
185
- const canKill = force || looksLikeMindExecBridge(details, bridgeRoot);
236
+ const canKill = force ||
237
+ looksLikeMindExecBridge(details, bridgeRoot) ||
238
+ await probeMindExecStatus(port);
186
239
  if (!canKill) {
187
240
  skipped.push(details);
188
241
  continue;
@@ -5,7 +5,7 @@
5
5
  const DEBUG = false;
6
6
  const FPS_DEBUG = false;
7
7
  const FRAME_PERF_DEBUG = false;
8
- const MINDMAP_CORE_BUILD_ID = '20260628-pan-wheel-resident-defer-v840';
8
+ const MINDMAP_CORE_BUILD_ID = '20260628-local-grid-null-pointer-v841';
9
9
  const CanvasPhase = Object.freeze({
10
10
  Booting: 'booting',
11
11
  BoardFileLoading: 'board-file-loading',
@@ -3677,6 +3677,10 @@ ${summaryLines.map(line => `<div>${escapeNodeFrameDebugHtml(line)}</div>`).join(
3677
3677
  const left = Number(viewportMetrics.left || 0);
3678
3678
  const top = Number(viewportMetrics.top || 0);
3679
3679
  const hasPointer =
3680
+ this._lastSnapGridClientX !== null &&
3681
+ this._lastSnapGridClientX !== undefined &&
3682
+ this._lastSnapGridClientY !== null &&
3683
+ this._lastSnapGridClientY !== undefined &&
3680
3684
  Number.isFinite(Number(this._lastSnapGridClientX)) &&
3681
3685
  Number.isFinite(Number(this._lastSnapGridClientY));
3682
3686
  const centerX = hasPointer
@@ -3791,6 +3795,10 @@ ${summaryLines.map(line => `<div>${escapeNodeFrameDebugHtml(line)}</div>`).join(
3791
3795
  const left = Number(viewportMetrics.left || 0);
3792
3796
  const top = Number(viewportMetrics.top || 0);
3793
3797
  const hasPointer =
3798
+ this._lastSnapGridClientX !== null &&
3799
+ this._lastSnapGridClientX !== undefined &&
3800
+ this._lastSnapGridClientY !== null &&
3801
+ this._lastSnapGridClientY !== undefined &&
3794
3802
  Number.isFinite(Number(this._lastSnapGridClientX)) &&
3795
3803
  Number.isFinite(Number(this._lastSnapGridClientY));
3796
3804
  const centerX = hasPointer
@@ -579,7 +579,7 @@
579
579
  }
580
580
 
581
581
  const base = '_content/MindExecution.Shared/js/';
582
- const scriptVersion = '20260628-pan-wheel-resident-defer-v840';
582
+ const scriptVersion = '20260628-local-grid-null-pointer-v841';
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": "XYf0od9b",
2
+ "version": "4eOXZ4N/",
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-wF7sNtiWqtPIT1yTShG5wGJcivHKBmeSGeQb74YmpXY=",
81
+ "hash": "sha256-9DQzC60xfV16Y02CgzgifUHD5AEXGy7zHA7+lkrWe5s=",
82
82
  "url": "_content/MindExecution.Shared/js/mind-map-core.js"
83
83
  },
84
84
  {
@@ -826,7 +826,7 @@
826
826
  "url": "icon-512.png"
827
827
  },
828
828
  {
829
- "hash": "sha256-V3WKTP7gwOIAz2U2CHddB9UiDVeemE29Fgo0Ng4Z2EI=",
829
+ "hash": "sha256-bLpiP/ywiAFLflFuYzyRFy07OpsOaSe3zVg2cOYW4Ko=",
830
830
  "url": "index.html"
831
831
  },
832
832
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: XYf0od9b */
1
+ /* Manifest version: 4eOXZ4N/ */
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