@mindexec/cli 0.2.178 → 0.2.179
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 +1 -1
- package/scripts/remote-frame-ws-smoke.mjs +22 -0
- package/server.js +20 -1
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +14 -2
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-pipeline.js +2 -1
- package/wwwroot/index.html +3 -3
- package/wwwroot/service-worker-assets.js +4 -4
- package/wwwroot/service-worker.js +1 -1
package/package.json
CHANGED
|
@@ -185,6 +185,28 @@ async function main() {
|
|
|
185
185
|
assert.equal(frame.metadata.mimeType, 'image/png');
|
|
186
186
|
assert.ok(frame.payload.length > 0, 'payload should be non-empty');
|
|
187
187
|
|
|
188
|
+
const afterFirstAutoStart = await fetchJson(`${bridge.baseUrl}/api/remote/devices`);
|
|
189
|
+
const firstDeviceState = afterFirstAutoStart.payload?.devices?.find(item => item.deviceId === device.deviceId);
|
|
190
|
+
assert.equal(firstDeviceState?.activeLiveStream?.active, true, 'auto-start should mark the synthetic device live');
|
|
191
|
+
assert.equal(firstDeviceState?.counters?.liveStreamsStarted, 1, 'first subscribe should start one live stream');
|
|
192
|
+
|
|
193
|
+
ws.send(JSON.stringify({
|
|
194
|
+
type: 'subscribe',
|
|
195
|
+
deviceIds: [device.deviceId],
|
|
196
|
+
autoStartLive: true,
|
|
197
|
+
fps: 12,
|
|
198
|
+
maxWidth: 960,
|
|
199
|
+
maxHeight: 540,
|
|
200
|
+
quality: 60
|
|
201
|
+
}));
|
|
202
|
+
await wait(120);
|
|
203
|
+
const afterDuplicateSubscribe = await fetchJson(`${bridge.baseUrl}/api/remote/devices`);
|
|
204
|
+
const duplicateDeviceState = afterDuplicateSubscribe.payload?.devices?.find(item => item.deviceId === device.deviceId);
|
|
205
|
+
assert.equal(
|
|
206
|
+
duplicateDeviceState?.counters?.liveStreamsStarted,
|
|
207
|
+
1,
|
|
208
|
+
'duplicate keep-live subscribe must not restart a fresh live stream');
|
|
209
|
+
|
|
188
210
|
const frameStatus = await fetchJson(`${bridge.baseUrl}/api/status?remoteFrames=ws`);
|
|
189
211
|
assert.equal(frameStatus.ok, true);
|
|
190
212
|
assert.ok(frameStatus.payload?.remoteFrameWs?.clientCount >= 1, JSON.stringify(frameStatus.payload?.remoteFrameWs));
|
package/server.js
CHANGED
|
@@ -2185,6 +2185,7 @@ const REMOTE_FRAME_WS_DEFAULT_FPS = 12;
|
|
|
2185
2185
|
const REMOTE_FRAME_WS_DEFAULT_MAX_WIDTH = 960;
|
|
2186
2186
|
const REMOTE_FRAME_WS_DEFAULT_MAX_HEIGHT = 540;
|
|
2187
2187
|
const REMOTE_FRAME_WS_DEFAULT_QUALITY = 60;
|
|
2188
|
+
const REMOTE_FRAME_WS_LIVE_STALE_RESTART_MS = 6000;
|
|
2188
2189
|
|
|
2189
2190
|
httpServer.on('upgrade', (req, socket, head) => {
|
|
2190
2191
|
try {
|
|
@@ -2327,6 +2328,7 @@ function maybeAutoStartRemoteFrameLiveStreams(ws, deviceIds = []) {
|
|
|
2327
2328
|
const lookup = getRemoteFrameWsDeviceLookup();
|
|
2328
2329
|
const started = [];
|
|
2329
2330
|
const skipped = [];
|
|
2331
|
+
const nowMs = Date.now();
|
|
2330
2332
|
for (const deviceId of deviceIds.slice(0, REMOTE_FRAME_WS_AUTO_START_LIMIT)) {
|
|
2331
2333
|
const device = lookup.get(String(deviceId || '').trim());
|
|
2332
2334
|
if (!device?.connected) {
|
|
@@ -2334,7 +2336,24 @@ function maybeAutoStartRemoteFrameLiveStreams(ws, deviceIds = []) {
|
|
|
2334
2336
|
continue;
|
|
2335
2337
|
}
|
|
2336
2338
|
|
|
2337
|
-
|
|
2339
|
+
const activeLiveStream = device.activeLiveStream && typeof device.activeLiveStream === 'object'
|
|
2340
|
+
? device.activeLiveStream
|
|
2341
|
+
: null;
|
|
2342
|
+
const liveActive = device.liveStreamActive === true || activeLiveStream?.active === true;
|
|
2343
|
+
const liveStartedAtMs = Date.parse(activeLiveStream?.startedAt || device.liveStreamStartedAt || '');
|
|
2344
|
+
const liveLastFrameAtMs = Date.parse(
|
|
2345
|
+
activeLiveStream?.lastFrameAt
|
|
2346
|
+
|| device.liveStreamLastFrameAt
|
|
2347
|
+
|| device.latestLiveFrame?.receivedAt
|
|
2348
|
+
|| device.latestLiveFrame?.capturedAt
|
|
2349
|
+
|| '');
|
|
2350
|
+
const liveHasStartupGrace = liveActive
|
|
2351
|
+
&& Number.isFinite(liveStartedAtMs)
|
|
2352
|
+
&& nowMs - liveStartedAtMs < REMOTE_FRAME_WS_LIVE_STALE_RESTART_MS;
|
|
2353
|
+
const liveIsFresh = liveActive
|
|
2354
|
+
&& Number.isFinite(liveLastFrameAtMs)
|
|
2355
|
+
&& nowMs - liveLastFrameAtMs < REMOTE_FRAME_WS_LIVE_STALE_RESTART_MS;
|
|
2356
|
+
if (liveActive && (liveIsFresh || liveHasStartupGrace)) {
|
|
2338
2357
|
skipped.push({ deviceId, reason: 'already-live' });
|
|
2339
2358
|
continue;
|
|
2340
2359
|
}
|
|
@@ -12591,6 +12591,8 @@
|
|
|
12591
12591
|
|
|
12592
12592
|
handle.dataset.nodeId = nodeId;
|
|
12593
12593
|
handle.dataset.corner = handleInfo.corner;
|
|
12594
|
+
handle.dataset.remoteFleetResizeHandle = 'true';
|
|
12595
|
+
handle.draggable = false;
|
|
12594
12596
|
handle.style.cursor = getRemoteFleetResizeCursor(handleInfo.corner);
|
|
12595
12597
|
});
|
|
12596
12598
|
}
|
|
@@ -13583,6 +13585,7 @@
|
|
|
13583
13585
|
const REMOTE_FLEET_BINARY_FRAME_MAX_DECODE_IN_FLIGHT = 1;
|
|
13584
13586
|
const REMOTE_FLEET_BINARY_FRAME_WS_RECONNECT_MS = 1500;
|
|
13585
13587
|
const REMOTE_FLEET_BINARY_FRAME_SUBSCRIBE_MS = 1000;
|
|
13588
|
+
const REMOTE_FLEET_BINARY_FRAME_AUTOSTART_REFRESH_MS = 2500;
|
|
13586
13589
|
const REMOTE_FLEET_BINARY_FRAME_STALE_FALLBACK_MS = 1400;
|
|
13587
13590
|
const REMOTE_FLEET_BINARY_FRAME_CONNECT_GRACE_MS = 1600;
|
|
13588
13591
|
const REMOTE_FLEET_BINARY_FRAME_CACHE_MS = 10000;
|
|
@@ -14346,11 +14349,19 @@
|
|
|
14346
14349
|
String(liveOptions.mode || '')
|
|
14347
14350
|
].join('|');
|
|
14348
14351
|
const key = `${deviceIds.join('\n')}::${optionKey}`;
|
|
14349
|
-
|
|
14352
|
+
const now = getRemoteFleetFrameNow();
|
|
14353
|
+
const shouldRefreshAutoStart =
|
|
14354
|
+
liveOptions.autoStartLive === true
|
|
14355
|
+
&& deviceIds.length > 0
|
|
14356
|
+
&& now - Number(session.lastAutoStartSubscribeAt || 0) >= REMOTE_FLEET_BINARY_FRAME_AUTOSTART_REFRESH_MS;
|
|
14357
|
+
if (!force && session.subscriptionKey === key && !shouldRefreshAutoStart) {
|
|
14350
14358
|
return true;
|
|
14351
14359
|
}
|
|
14352
14360
|
|
|
14353
14361
|
session.subscriptionKey = key;
|
|
14362
|
+
if (liveOptions.autoStartLive === true) {
|
|
14363
|
+
session.lastAutoStartSubscribeAt = now;
|
|
14364
|
+
}
|
|
14354
14365
|
session.ws.send(JSON.stringify({
|
|
14355
14366
|
type: 'subscribe',
|
|
14356
14367
|
nodeId: session.nodeId,
|
|
@@ -22302,11 +22313,12 @@
|
|
|
22302
22313
|
const handle = document.createElement('div');
|
|
22303
22314
|
const remoteFleetClass = remoteFleetSurface ? ' remote-fleet-resize-handle' : '';
|
|
22304
22315
|
handle.className = `resize-handle css3d-resize-handle${remoteFleetClass} ${zone.className}`.trim();
|
|
22305
|
-
handle.dataset.nodeId = nodeModel.
|
|
22316
|
+
handle.dataset.nodeId = String(nodeModel?.id ?? nodeModel?.Id ?? '').trim();
|
|
22306
22317
|
handle.dataset.corner = zone.corner;
|
|
22307
22318
|
if (remoteFleetSurface) {
|
|
22308
22319
|
handle.dataset.remoteFleetResizeHandle = 'true';
|
|
22309
22320
|
}
|
|
22321
|
+
handle.draggable = false;
|
|
22310
22322
|
handle.style.cssText = `
|
|
22311
22323
|
position: absolute;
|
|
22312
22324
|
left: auto;
|
|
@@ -1050,9 +1050,10 @@
|
|
|
1050
1050
|
module.resizingNodeId = nodeId;
|
|
1051
1051
|
module.resizeCorner = corner; // TL, TR, BL, BR
|
|
1052
1052
|
const cssRendererEnabled = module?.renderDebugFlags?.enableCss3d !== false;
|
|
1053
|
+
const isCssOnlyInteractiveSurface = isRemoteFleetMonitorNodeModel(nodeEntry.model);
|
|
1053
1054
|
const shouldResizeCssObject = !!nodeEntry.cssObject &&
|
|
1054
1055
|
cssRendererEnabled &&
|
|
1055
|
-
(nodeEntry.currentType === 'CSS' || nodeEntry.cssObject.visible === true);
|
|
1056
|
+
(isCssOnlyInteractiveSurface || nodeEntry.currentType === 'CSS' || nodeEntry.cssObject.visible === true);
|
|
1056
1057
|
const activeResizeType = shouldResizeCssObject ? 'CSS' : 'GL';
|
|
1057
1058
|
module.resizeNodeObject = activeResizeType === 'CSS' ? nodeEntry.cssObject : nodeEntry.glObject;
|
|
1058
1059
|
if (!module.resizeNodeObject && nodeEntry.cssObject) {
|
package/wwwroot/index.html
CHANGED
|
@@ -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=20260617-
|
|
11
|
-
<link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-
|
|
10
|
+
<link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260617-mdm-resize-reconnect-v607" />
|
|
11
|
+
<link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-mdm-resize-reconnect-v607" />
|
|
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-
|
|
582
|
+
const scriptVersion = '20260617-mdm-resize-reconnect-v607';
|
|
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": "
|
|
2
|
+
"version": "PM6aErcF",
|
|
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-
|
|
89
|
+
"hash": "sha256-gBI36z4Y7+AjUkFA/hGi8vAMGy8n+P5UbYry3YiMhCw=",
|
|
90
90
|
"url": "_content/MindExecution.Shared/js/mind-map-css3d-manager.js"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"url": "_content/MindExecution.Shared/js/mind-map-object-manager.js.backup"
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
"hash": "sha256-
|
|
149
|
+
"hash": "sha256-U1ZZffxZdhXwwCRY4VLUKXOFUMGllD7/Wsno/iXNC2E=",
|
|
150
150
|
"url": "_content/MindExecution.Shared/js/mind-map-pipeline.js"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
@@ -834,7 +834,7 @@
|
|
|
834
834
|
"url": "image-manifest.json"
|
|
835
835
|
},
|
|
836
836
|
{
|
|
837
|
-
"hash": "sha256-
|
|
837
|
+
"hash": "sha256-En9zl1UbLcPA629rVN6zjIjavRORX4w86sx+o0/XEuQ=",
|
|
838
838
|
"url": "index.html"
|
|
839
839
|
},
|
|
840
840
|
{
|