mindexec-ai 0.2.385
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/README.md +354 -0
- package/codex-runtime.js +1339 -0
- package/launch-bridge.cjs +236 -0
- package/package.json +77 -0
- package/port-guard.cjs +232 -0
- package/remote-fast/osx-arm64/mindexec-remote-fast +0 -0
- package/remote-fast/osx-arm64/mindexec-remote-fast.deps.json +24 -0
- package/remote-fast/osx-arm64/mindexec-remote-fast.dll +0 -0
- package/remote-fast/osx-arm64/mindexec-remote-fast.runtimeconfig.json +13 -0
- package/remote-fast/osx-x64/mindexec-remote-fast +0 -0
- package/remote-fast/osx-x64/mindexec-remote-fast.deps.json +24 -0
- package/remote-fast/osx-x64/mindexec-remote-fast.dll +0 -0
- package/remote-fast/osx-x64/mindexec-remote-fast.runtimeconfig.json +13 -0
- package/remote-fast/win-x64/mindexec-remote-fast.deps.json +24 -0
- package/remote-fast/win-x64/mindexec-remote-fast.dll +0 -0
- package/remote-fast/win-x64/mindexec-remote-fast.exe +0 -0
- package/remote-fast/win-x64/mindexec-remote-fast.runtimeconfig.json +20 -0
- package/remote-hub.js +3106 -0
- package/scripts/auth-session-smoke.mjs +262 -0
- package/scripts/remote-agent-managed-smoke.mjs +291 -0
- package/scripts/remote-agent-package-smoke.mjs +64 -0
- package/scripts/remote-agent-ws-smoke.mjs +202 -0
- package/scripts/remote-fast-live-rate-smoke.mjs +355 -0
- package/scripts/remote-fast-mdm-browser-smoke.mjs +476 -0
- package/scripts/remote-fleet-render-smoke.mjs +1491 -0
- package/scripts/remote-frame-ws-smoke.mjs +234 -0
- package/scripts/remote-http-smoke.mjs +592 -0
- package/scripts/remote-hub-identity-smoke.mjs +146 -0
- package/scripts/remote-hub-scale-smoke.mjs +124 -0
- package/scripts/remote-hub-smoke.mjs +631 -0
- package/scripts/remote-input-ws-smoke.mjs +263 -0
- package/scripts/remote-registry-follower-smoke.mjs +752 -0
- package/scripts/setup-tree-sitter-grammars.mjs +80 -0
- package/server.js +15709 -0
- package/start-bridge.bat +32 -0
- package/start-bridge.sh +81 -0
- package/tree-sitter-grammars/README.md +18 -0
- package/tree-sitter-grammars/tree-sitter-c_sharp.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-go.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-java.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-python.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-rust.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-tsx.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-typescript.wasm +0 -0
- package/wwwroot/_headers +73 -0
- package/wwwroot/_redirects +1 -0
- package/wwwroot/appsettings.json +83 -0
- package/wwwroot/assets/AdminDashboardPage-B2vz2Px9.css +1 -0
- package/wwwroot/assets/AdminDashboardPage-DnuCHywn.js +1 -0
- package/wwwroot/assets/AppSidebar-DU2OgSiv.js +2 -0
- package/wwwroot/assets/AuthPages-BrH6kRcv.css +1 -0
- package/wwwroot/assets/AuthPages-Dgezl7Vj.js +1 -0
- package/wwwroot/assets/CodePage-7kgZlB3O.js +87 -0
- package/wwwroot/assets/CodePage-Bncc352E.css +1 -0
- package/wwwroot/assets/CompanyCorePage-ChBnq1ve.css +1 -0
- package/wwwroot/assets/CompanyCorePage-CzIZIIU_.js +13 -0
- package/wwwroot/assets/ExecutionModePage-B-etp_mc.js +18 -0
- package/wwwroot/assets/ExecutionModePage-TLuld9l3.css +1 -0
- package/wwwroot/assets/LaunchLeadCapture-Bx9LM0IX.js +1 -0
- package/wwwroot/assets/LaunchLeadCapture-CiRI1shz.css +1 -0
- package/wwwroot/assets/MarketingHome-BsyerRpe.js +1 -0
- package/wwwroot/assets/MarketingHome-DPzaYzA_.css +1 -0
- package/wwwroot/assets/MindCanvas-DtqOZnoW.css +1 -0
- package/wwwroot/assets/MindCanvas-zEDXzaxW.js +49 -0
- package/wwwroot/assets/PlanMasterPage-CJ36rep-.css +1 -0
- package/wwwroot/assets/PlanMasterPage-NZ_mPvaE.js +4 -0
- package/wwwroot/assets/PricingPage-Cg_0i_ZR.css +1 -0
- package/wwwroot/assets/PricingPage-Ylrn8l2g.js +1 -0
- package/wwwroot/assets/ToolPages-3M2KqA9k.js +28 -0
- package/wwwroot/assets/ToolPages-DIB187pZ.css +1 -0
- package/wwwroot/assets/YouTubeSearchPage-COv1oAA7.js +4 -0
- package/wwwroot/assets/YouTubeSearchPage-IPPa_BIH.css +1 -0
- package/wwwroot/assets/app-runtime-xD2Z3NdN.js +1 -0
- package/wwwroot/assets/canvas-runtime-BbicBcOj.js +44 -0
- package/wwwroot/assets/code-agent-runtime-B5PPZd1t.js +74 -0
- package/wwwroot/assets/executionModeSettings-NJqurj-o.js +1 -0
- package/wwwroot/assets/index-CQMKCp-t.js +2 -0
- package/wwwroot/assets/index-yNpEK-gp.css +1 -0
- package/wwwroot/assets/marketingTools-DN_rnHeB.js +4 -0
- package/wwwroot/assets/mindCanvasSearchWorker-BzPMsHOB.js +1 -0
- package/wwwroot/assets/mindexecution-mindcanvas.png +0 -0
- package/wwwroot/assets/mindexecution-prod-home-current.png +0 -0
- package/wwwroot/assets/mindexecution-prod-pricing-current.png +0 -0
- package/wwwroot/assets/pricingCheckoutShell-O-DnwmbU.js +1 -0
- package/wwwroot/assets/productionAdapterConfig-C5jfk6oG.js +1 -0
- package/wwwroot/assets/runtimeSettingsPersistenceProjection-BoNWmYjU.js +1 -0
- package/wwwroot/assets/storage-TM3YrWaj.js +1 -0
- package/wwwroot/assets/supabaseAuthAdapter-DA43DeSY.js +44 -0
- package/wwwroot/assets/toolHandoff-D5e5f7t5.js +4 -0
- package/wwwroot/assets/vendor-icons-DE3gIReG.js +681 -0
- package/wwwroot/assets/vendor-msgpack-BE8aAsr3.js +1 -0
- package/wwwroot/assets/vendor-react-BXzpOyCS.js +40 -0
- package/wwwroot/favicon.svg +7 -0
- package/wwwroot/index.html +22 -0
- package/wwwroot/manifest.webmanifest +19 -0
- package/wwwroot/robots.txt +4 -0
- package/wwwroot/service-worker.js +7 -0
- package/wwwroot/sitemap.xml +39 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import net from 'node:net';
|
|
5
|
+
import { spawn } from 'node:child_process';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { WebSocket } from 'ws';
|
|
9
|
+
|
|
10
|
+
const BRIDGE_TOKEN = 'remote-frame-ws-smoke-token';
|
|
11
|
+
const PAIR_TOKEN = 'remote-frame-ws-pair-token';
|
|
12
|
+
|
|
13
|
+
function wait(ms) {
|
|
14
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function findFreePort() {
|
|
18
|
+
return await new Promise((resolve, reject) => {
|
|
19
|
+
const server = net.createServer();
|
|
20
|
+
server.unref();
|
|
21
|
+
server.once('error', reject);
|
|
22
|
+
server.listen(0, '127.0.0.1', () => {
|
|
23
|
+
const address = server.address();
|
|
24
|
+
const port = typeof address === 'object' && address ? address.port : 0;
|
|
25
|
+
server.close(() => resolve(port));
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function fetchJson(url, options = {}) {
|
|
31
|
+
const response = await fetch(url, {
|
|
32
|
+
...options,
|
|
33
|
+
headers: {
|
|
34
|
+
...(options.body ? { 'Content-Type': 'application/json' } : {}),
|
|
35
|
+
'X-Bridge-Token': BRIDGE_TOKEN,
|
|
36
|
+
...(options.headers || {})
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const payload = await response.json().catch(() => null);
|
|
40
|
+
return { ok: response.ok, status: response.status, payload };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function waitForBridge(baseUrl, details) {
|
|
44
|
+
const startedAt = Date.now();
|
|
45
|
+
while (Date.now() - startedAt < 30000) {
|
|
46
|
+
try {
|
|
47
|
+
const result = await fetchJson(`${baseUrl}/api/remote/status`);
|
|
48
|
+
if (result.ok && result.payload?.started === true) {
|
|
49
|
+
return result.payload;
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
// Server is still starting.
|
|
53
|
+
}
|
|
54
|
+
await wait(100);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
throw new Error(`Timed out waiting for LocalBridge.\n${details()}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function spawnBridge({ bridgePort, remoteHubPort }) {
|
|
61
|
+
const bridgeRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
62
|
+
const env = {
|
|
63
|
+
...process.env,
|
|
64
|
+
BRIDGE_PORT: String(bridgePort),
|
|
65
|
+
BRIDGE_TOKEN,
|
|
66
|
+
BRIDGE_REQUIRE_TOKEN: '1',
|
|
67
|
+
MINDEXEC_REMOTE_HUB: '1',
|
|
68
|
+
MINDEXEC_REMOTE_SYNTHETIC_FLEET: '1',
|
|
69
|
+
REMOTE_HUB_HOST: '127.0.0.1',
|
|
70
|
+
REMOTE_HUB_PORT: String(remoteHubPort),
|
|
71
|
+
REMOTE_HUB_PAIR_TOKEN: PAIR_TOKEN,
|
|
72
|
+
NO_COLOR: '1'
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const child = spawn(process.execPath, ['server.js'], {
|
|
76
|
+
cwd: bridgeRoot,
|
|
77
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
78
|
+
windowsHide: true,
|
|
79
|
+
env
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
let stdout = '';
|
|
83
|
+
let stderr = '';
|
|
84
|
+
child.stdout.on('data', chunk => {
|
|
85
|
+
stdout += chunk.toString();
|
|
86
|
+
});
|
|
87
|
+
child.stderr.on('data', chunk => {
|
|
88
|
+
stderr += chunk.toString();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const exitPromise = new Promise(resolve => child.once('exit', resolve));
|
|
92
|
+
const stop = async () => {
|
|
93
|
+
if (child.exitCode === null && !child.killed) {
|
|
94
|
+
child.kill('SIGTERM');
|
|
95
|
+
await Promise.race([exitPromise, wait(5000)]);
|
|
96
|
+
if (child.exitCode === null && !child.killed) {
|
|
97
|
+
child.kill('SIGKILL');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
baseUrl: `http://127.0.0.1:${bridgePort}`,
|
|
104
|
+
details: () => `stdout=${stdout}\nstderr=${stderr}`,
|
|
105
|
+
stop
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function parseFramePacket(data) {
|
|
110
|
+
const buffer = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
111
|
+
assert.ok(buffer.length > 8, 'binary frame packet should include header, metadata, and payload');
|
|
112
|
+
const metaLength = buffer.readUInt32BE(0);
|
|
113
|
+
assert.ok(metaLength > 0 && metaLength < 64 * 1024, 'metadata length should be bounded');
|
|
114
|
+
assert.ok(4 + metaLength < buffer.length, 'packet should include binary payload after metadata');
|
|
115
|
+
const metadata = JSON.parse(buffer.subarray(4, 4 + metaLength).toString('utf8'));
|
|
116
|
+
const payload = buffer.subarray(4 + metaLength);
|
|
117
|
+
return { metadata, payload };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function waitForBinaryFrame(ws) {
|
|
121
|
+
return await new Promise((resolve, reject) => {
|
|
122
|
+
const timeout = setTimeout(() => reject(new Error('timed out waiting for binary frame')), 10000);
|
|
123
|
+
ws.on('message', data => {
|
|
124
|
+
if (typeof data === 'string') {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const raw = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
128
|
+
if (raw[0] === 0x7b || raw[0] === 0x5b) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
clearTimeout(timeout);
|
|
132
|
+
try {
|
|
133
|
+
resolve(parseFramePacket(raw));
|
|
134
|
+
} catch (error) {
|
|
135
|
+
reject(error);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
ws.on('error', reject);
|
|
139
|
+
ws.on('close', () => reject(new Error('websocket closed before binary frame')));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function main() {
|
|
144
|
+
const bridgePort = await findFreePort();
|
|
145
|
+
const remoteHubPort = await findFreePort();
|
|
146
|
+
const bridge = spawnBridge({ bridgePort, remoteHubPort });
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
const status = await waitForBridge(bridge.baseUrl, bridge.details);
|
|
150
|
+
assert.equal(status.started, true);
|
|
151
|
+
|
|
152
|
+
const seed = await fetchJson(`${bridge.baseUrl}/api/remote/synthetic/seed`, {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
body: JSON.stringify({ count: 4, connectedRatio: 1, thumbnailRatio: 1, liveCount: 0 })
|
|
155
|
+
});
|
|
156
|
+
assert.equal(seed.ok, true);
|
|
157
|
+
|
|
158
|
+
const devicesResult = await fetchJson(`${bridge.baseUrl}/api/remote/devices`);
|
|
159
|
+
assert.equal(devicesResult.ok, true);
|
|
160
|
+
const device = devicesResult.payload?.devices?.find(item => item.connected === true);
|
|
161
|
+
assert.ok(device?.deviceId, 'expected connected synthetic device');
|
|
162
|
+
|
|
163
|
+
const ws = new WebSocket(`${bridge.baseUrl.replace(/^http:/, 'ws:')}/api/remote/frames/ws?token=${encodeURIComponent(BRIDGE_TOKEN)}`);
|
|
164
|
+
await new Promise((resolve, reject) => {
|
|
165
|
+
ws.once('open', resolve);
|
|
166
|
+
ws.once('error', reject);
|
|
167
|
+
});
|
|
168
|
+
ws.send(JSON.stringify({
|
|
169
|
+
type: 'subscribe',
|
|
170
|
+
deviceIds: [device.deviceId],
|
|
171
|
+
autoStartLive: true,
|
|
172
|
+
fps: 12,
|
|
173
|
+
maxWidth: 960,
|
|
174
|
+
maxHeight: 540,
|
|
175
|
+
quality: 60
|
|
176
|
+
}));
|
|
177
|
+
|
|
178
|
+
const framePromise = waitForBinaryFrame(ws);
|
|
179
|
+
const frame = await framePromise;
|
|
180
|
+
assert.equal(frame.metadata.type, 'remote.frame.binary');
|
|
181
|
+
assert.equal(frame.metadata.kind, 'live');
|
|
182
|
+
assert.equal(frame.metadata.deviceId, device.deviceId);
|
|
183
|
+
assert.equal(frame.metadata.fps, 12);
|
|
184
|
+
assert.ok(frame.metadata.frameSeq > 0, 'frameSeq should be positive');
|
|
185
|
+
assert.equal(frame.metadata.mimeType, 'image/png');
|
|
186
|
+
assert.ok(frame.payload.length > 0, 'payload should be non-empty');
|
|
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
|
+
|
|
210
|
+
const frameStatus = await fetchJson(`${bridge.baseUrl}/api/status?remoteFrames=ws`);
|
|
211
|
+
assert.equal(frameStatus.ok, true);
|
|
212
|
+
assert.ok(frameStatus.payload?.remoteFrameWs?.clientCount >= 1, JSON.stringify(frameStatus.payload?.remoteFrameWs));
|
|
213
|
+
assert.ok(frameStatus.payload?.remoteFrameWs?.framesSent >= 1, JSON.stringify(frameStatus.payload?.remoteFrameWs));
|
|
214
|
+
assert.equal(frameStatus.payload?.remoteFrameWs?.lastFrameDeviceId, device.deviceId);
|
|
215
|
+
assert.equal(frameStatus.payload?.remoteFrameWs?.lastFrameSeq, frame.metadata.frameSeq);
|
|
216
|
+
assert.ok(
|
|
217
|
+
frameStatus.payload?.remoteFrameWs?.clients?.some(client =>
|
|
218
|
+
Array.isArray(client.deviceIds)
|
|
219
|
+
&& client.deviceIds.includes(device.deviceId)
|
|
220
|
+
&& client.autoStartLive === true
|
|
221
|
+
&& client.sent >= 1),
|
|
222
|
+
JSON.stringify(frameStatus.payload?.remoteFrameWs));
|
|
223
|
+
ws.close();
|
|
224
|
+
|
|
225
|
+
console.log('Remote frame WebSocket smoke OK');
|
|
226
|
+
} finally {
|
|
227
|
+
await bridge.stop();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
main().catch(error => {
|
|
232
|
+
console.error(error);
|
|
233
|
+
process.exitCode = 1;
|
|
234
|
+
});
|