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.
Files changed (99) hide show
  1. package/README.md +354 -0
  2. package/codex-runtime.js +1339 -0
  3. package/launch-bridge.cjs +236 -0
  4. package/package.json +77 -0
  5. package/port-guard.cjs +232 -0
  6. package/remote-fast/osx-arm64/mindexec-remote-fast +0 -0
  7. package/remote-fast/osx-arm64/mindexec-remote-fast.deps.json +24 -0
  8. package/remote-fast/osx-arm64/mindexec-remote-fast.dll +0 -0
  9. package/remote-fast/osx-arm64/mindexec-remote-fast.runtimeconfig.json +13 -0
  10. package/remote-fast/osx-x64/mindexec-remote-fast +0 -0
  11. package/remote-fast/osx-x64/mindexec-remote-fast.deps.json +24 -0
  12. package/remote-fast/osx-x64/mindexec-remote-fast.dll +0 -0
  13. package/remote-fast/osx-x64/mindexec-remote-fast.runtimeconfig.json +13 -0
  14. package/remote-fast/win-x64/mindexec-remote-fast.deps.json +24 -0
  15. package/remote-fast/win-x64/mindexec-remote-fast.dll +0 -0
  16. package/remote-fast/win-x64/mindexec-remote-fast.exe +0 -0
  17. package/remote-fast/win-x64/mindexec-remote-fast.runtimeconfig.json +20 -0
  18. package/remote-hub.js +3106 -0
  19. package/scripts/auth-session-smoke.mjs +262 -0
  20. package/scripts/remote-agent-managed-smoke.mjs +291 -0
  21. package/scripts/remote-agent-package-smoke.mjs +64 -0
  22. package/scripts/remote-agent-ws-smoke.mjs +202 -0
  23. package/scripts/remote-fast-live-rate-smoke.mjs +355 -0
  24. package/scripts/remote-fast-mdm-browser-smoke.mjs +476 -0
  25. package/scripts/remote-fleet-render-smoke.mjs +1491 -0
  26. package/scripts/remote-frame-ws-smoke.mjs +234 -0
  27. package/scripts/remote-http-smoke.mjs +592 -0
  28. package/scripts/remote-hub-identity-smoke.mjs +146 -0
  29. package/scripts/remote-hub-scale-smoke.mjs +124 -0
  30. package/scripts/remote-hub-smoke.mjs +631 -0
  31. package/scripts/remote-input-ws-smoke.mjs +263 -0
  32. package/scripts/remote-registry-follower-smoke.mjs +752 -0
  33. package/scripts/setup-tree-sitter-grammars.mjs +80 -0
  34. package/server.js +15709 -0
  35. package/start-bridge.bat +32 -0
  36. package/start-bridge.sh +81 -0
  37. package/tree-sitter-grammars/README.md +18 -0
  38. package/tree-sitter-grammars/tree-sitter-c_sharp.wasm +0 -0
  39. package/tree-sitter-grammars/tree-sitter-go.wasm +0 -0
  40. package/tree-sitter-grammars/tree-sitter-java.wasm +0 -0
  41. package/tree-sitter-grammars/tree-sitter-javascript.wasm +0 -0
  42. package/tree-sitter-grammars/tree-sitter-python.wasm +0 -0
  43. package/tree-sitter-grammars/tree-sitter-rust.wasm +0 -0
  44. package/tree-sitter-grammars/tree-sitter-tsx.wasm +0 -0
  45. package/tree-sitter-grammars/tree-sitter-typescript.wasm +0 -0
  46. package/wwwroot/_headers +73 -0
  47. package/wwwroot/_redirects +1 -0
  48. package/wwwroot/appsettings.json +83 -0
  49. package/wwwroot/assets/AdminDashboardPage-B2vz2Px9.css +1 -0
  50. package/wwwroot/assets/AdminDashboardPage-DnuCHywn.js +1 -0
  51. package/wwwroot/assets/AppSidebar-DU2OgSiv.js +2 -0
  52. package/wwwroot/assets/AuthPages-BrH6kRcv.css +1 -0
  53. package/wwwroot/assets/AuthPages-Dgezl7Vj.js +1 -0
  54. package/wwwroot/assets/CodePage-7kgZlB3O.js +87 -0
  55. package/wwwroot/assets/CodePage-Bncc352E.css +1 -0
  56. package/wwwroot/assets/CompanyCorePage-ChBnq1ve.css +1 -0
  57. package/wwwroot/assets/CompanyCorePage-CzIZIIU_.js +13 -0
  58. package/wwwroot/assets/ExecutionModePage-B-etp_mc.js +18 -0
  59. package/wwwroot/assets/ExecutionModePage-TLuld9l3.css +1 -0
  60. package/wwwroot/assets/LaunchLeadCapture-Bx9LM0IX.js +1 -0
  61. package/wwwroot/assets/LaunchLeadCapture-CiRI1shz.css +1 -0
  62. package/wwwroot/assets/MarketingHome-BsyerRpe.js +1 -0
  63. package/wwwroot/assets/MarketingHome-DPzaYzA_.css +1 -0
  64. package/wwwroot/assets/MindCanvas-DtqOZnoW.css +1 -0
  65. package/wwwroot/assets/MindCanvas-zEDXzaxW.js +49 -0
  66. package/wwwroot/assets/PlanMasterPage-CJ36rep-.css +1 -0
  67. package/wwwroot/assets/PlanMasterPage-NZ_mPvaE.js +4 -0
  68. package/wwwroot/assets/PricingPage-Cg_0i_ZR.css +1 -0
  69. package/wwwroot/assets/PricingPage-Ylrn8l2g.js +1 -0
  70. package/wwwroot/assets/ToolPages-3M2KqA9k.js +28 -0
  71. package/wwwroot/assets/ToolPages-DIB187pZ.css +1 -0
  72. package/wwwroot/assets/YouTubeSearchPage-COv1oAA7.js +4 -0
  73. package/wwwroot/assets/YouTubeSearchPage-IPPa_BIH.css +1 -0
  74. package/wwwroot/assets/app-runtime-xD2Z3NdN.js +1 -0
  75. package/wwwroot/assets/canvas-runtime-BbicBcOj.js +44 -0
  76. package/wwwroot/assets/code-agent-runtime-B5PPZd1t.js +74 -0
  77. package/wwwroot/assets/executionModeSettings-NJqurj-o.js +1 -0
  78. package/wwwroot/assets/index-CQMKCp-t.js +2 -0
  79. package/wwwroot/assets/index-yNpEK-gp.css +1 -0
  80. package/wwwroot/assets/marketingTools-DN_rnHeB.js +4 -0
  81. package/wwwroot/assets/mindCanvasSearchWorker-BzPMsHOB.js +1 -0
  82. package/wwwroot/assets/mindexecution-mindcanvas.png +0 -0
  83. package/wwwroot/assets/mindexecution-prod-home-current.png +0 -0
  84. package/wwwroot/assets/mindexecution-prod-pricing-current.png +0 -0
  85. package/wwwroot/assets/pricingCheckoutShell-O-DnwmbU.js +1 -0
  86. package/wwwroot/assets/productionAdapterConfig-C5jfk6oG.js +1 -0
  87. package/wwwroot/assets/runtimeSettingsPersistenceProjection-BoNWmYjU.js +1 -0
  88. package/wwwroot/assets/storage-TM3YrWaj.js +1 -0
  89. package/wwwroot/assets/supabaseAuthAdapter-DA43DeSY.js +44 -0
  90. package/wwwroot/assets/toolHandoff-D5e5f7t5.js +4 -0
  91. package/wwwroot/assets/vendor-icons-DE3gIReG.js +681 -0
  92. package/wwwroot/assets/vendor-msgpack-BE8aAsr3.js +1 -0
  93. package/wwwroot/assets/vendor-react-BXzpOyCS.js +40 -0
  94. package/wwwroot/favicon.svg +7 -0
  95. package/wwwroot/index.html +22 -0
  96. package/wwwroot/manifest.webmanifest +19 -0
  97. package/wwwroot/robots.txt +4 -0
  98. package/wwwroot/service-worker.js +7 -0
  99. package/wwwroot/sitemap.xml +39 -0
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env node
2
+
3
+ import assert from 'node:assert/strict';
4
+ import { spawn } from 'node:child_process';
5
+ import { mkdtemp, mkdir, rm } from 'node:fs/promises';
6
+ import net from 'node:net';
7
+ import os from 'node:os';
8
+ import path from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+
11
+ const BRIDGE_TOKEN = 'remote-hub-identity-smoke-token';
12
+ const LOCAL_BRIDGE_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
13
+
14
+ function wait(ms) {
15
+ return new Promise(resolve => setTimeout(resolve, ms));
16
+ }
17
+
18
+ async function findFreePort() {
19
+ return await new Promise((resolve, reject) => {
20
+ const server = net.createServer();
21
+ server.unref();
22
+ server.once('error', reject);
23
+ server.listen(0, '127.0.0.1', () => {
24
+ const address = server.address();
25
+ const port = typeof address === 'object' && address ? address.port : 0;
26
+ server.close(() => resolve(port));
27
+ });
28
+ });
29
+ }
30
+
31
+ async function fetchJson(url, options = {}) {
32
+ const response = await fetch(url, {
33
+ ...options,
34
+ headers: {
35
+ 'X-Bridge-Token': BRIDGE_TOKEN,
36
+ ...(options.headers || {})
37
+ }
38
+ });
39
+ let payload = null;
40
+ try {
41
+ payload = await response.json();
42
+ } catch {
43
+ // Ignore non-JSON diagnostics.
44
+ }
45
+ return { ok: response.ok, status: response.status, payload };
46
+ }
47
+
48
+ function spawnBridge({ bridgePort, remoteHubPort, workspacePath, authDataRoot, label }) {
49
+ const child = spawn(process.execPath, ['server.js'], {
50
+ cwd: LOCAL_BRIDGE_DIR,
51
+ stdio: ['ignore', 'pipe', 'pipe'],
52
+ windowsHide: true,
53
+ env: {
54
+ ...process.env,
55
+ BRIDGE_PORT: String(bridgePort),
56
+ BRIDGE_TOKEN,
57
+ BRIDGE_REQUIRE_TOKEN: '1',
58
+ MINDEXEC_REMOTE_HUB: '1',
59
+ MINDEXEC_REMOTE_REGISTRY_FOLLOWER: '0',
60
+ REMOTE_HUB_HOST: '127.0.0.1',
61
+ REMOTE_HUB_PORT: String(remoteHubPort),
62
+ WORKSPACE_PATH: workspacePath,
63
+ MINDEXEC_AUTH_DATA_ROOT: authDataRoot,
64
+ REMOTE_HUB_PAIR_TOKEN: '',
65
+ MINDEXEC_REMOTE_PAIR_TOKEN: '',
66
+ MINDEXEC_BRIDGE_INSTANCE_ID: '',
67
+ NO_COLOR: '1'
68
+ }
69
+ });
70
+
71
+ let stdout = '';
72
+ let stderr = '';
73
+ child.stdout.on('data', chunk => {
74
+ stdout += chunk.toString();
75
+ });
76
+ child.stderr.on('data', chunk => {
77
+ stderr += chunk.toString();
78
+ });
79
+
80
+ const exitPromise = new Promise(resolve => child.once('exit', resolve));
81
+ const details = () => `${label} stdout=${stdout}\n${label} stderr=${stderr}`;
82
+ const stop = async () => {
83
+ if (child.exitCode === null && !child.killed) {
84
+ child.kill('SIGTERM');
85
+ await Promise.race([exitPromise, wait(3000)]);
86
+ if (child.exitCode === null && !child.killed) {
87
+ child.kill('SIGKILL');
88
+ }
89
+ }
90
+ };
91
+
92
+ return {
93
+ baseUrl: `http://127.0.0.1:${bridgePort}`,
94
+ details,
95
+ stop
96
+ };
97
+ }
98
+
99
+ async function waitForStatus(bridge) {
100
+ const startedAt = Date.now();
101
+ while (Date.now() - startedAt < 30000) {
102
+ try {
103
+ const result = await fetchJson(`${bridge.baseUrl}/api/remote/status`);
104
+ if (result.ok && result.payload?.started === true) {
105
+ return result.payload;
106
+ }
107
+ } catch {
108
+ // Bridge still starting.
109
+ }
110
+ await wait(100);
111
+ }
112
+
113
+ throw new Error(`Timed out waiting for bridge status.\n${bridge.details()}`);
114
+ }
115
+
116
+ async function runOnce({ workspacePath, authDataRoot, label }) {
117
+ const bridgePort = await findFreePort();
118
+ const remoteHubPort = await findFreePort();
119
+ const bridge = spawnBridge({ bridgePort, remoteHubPort, workspacePath, authDataRoot, label });
120
+ try {
121
+ return await waitForStatus(bridge);
122
+ } finally {
123
+ await bridge.stop();
124
+ }
125
+ }
126
+
127
+ const tempRoot = await mkdtemp(path.join(os.tmpdir(), 'mindexec-remote-hub-identity-smoke-'));
128
+ try {
129
+ const workspacePath = path.join(tempRoot, 'workspace');
130
+ const authDataRoot = path.join(tempRoot, 'auth');
131
+ await mkdir(workspacePath, { recursive: true });
132
+ await mkdir(authDataRoot, { recursive: true });
133
+
134
+ const first = await runOnce({ workspacePath, authDataRoot, label: 'first' });
135
+ const second = await runOnce({ workspacePath, authDataRoot, label: 'second' });
136
+
137
+ assert.ok(first.pairToken, JSON.stringify(first));
138
+ assert.ok(first.hostInstanceId, JSON.stringify(first));
139
+ assert.equal(second.pairToken, first.pairToken);
140
+ assert.equal(second.hostInstanceId, first.hostInstanceId);
141
+ assert.match(first.hostInstanceId, /^bridge-[a-f0-9]{32}$/);
142
+
143
+ console.log('RemoteHub identity persistence smoke OK');
144
+ } finally {
145
+ await rm(tempRoot, { recursive: true, force: true });
146
+ }
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ import assert from 'assert/strict';
4
+ import { createRemoteHub } from '../remote-hub.js';
5
+
6
+ const SYNTHETIC_COUNT = Number(process.env.REMOTE_HUB_SCALE_SMOKE_COUNT || 500);
7
+
8
+ const hub = createRemoteHub({
9
+ env: {
10
+ MINDEXEC_REMOTE_HUB: '1',
11
+ REMOTE_HUB_HOST: '127.0.0.1',
12
+ REMOTE_HUB_PORT: '0',
13
+ REMOTE_HUB_PAIR_TOKEN: 'scale-smoke-token'
14
+ }
15
+ });
16
+
17
+ try {
18
+ await hub.start();
19
+
20
+ const seeded = hub.seedSyntheticFleet({
21
+ count: SYNTHETIC_COUNT,
22
+ connectedRatio: 0.84,
23
+ thumbnailRatio: 0.72,
24
+ aiAssistRatio: 0.42,
25
+ liveCount: 8
26
+ });
27
+ assert.equal(seeded.ok, true);
28
+ assert.equal(seeded.seeded, SYNTHETIC_COUNT);
29
+
30
+ const status = hub.getStatus();
31
+ assert.equal(status.started, true);
32
+ assert.equal(status.canvasPagination, 'none');
33
+ assert.equal(status.deviceCount, SYNTHETIC_COUNT);
34
+ assert.equal(status.connectedDeviceCount, seeded.connected);
35
+
36
+ const devices = hub.listDevices();
37
+ assert.equal(devices.length, SYNTHETIC_COUNT);
38
+ assert.equal(devices.filter(device => device.synthetic === true).length, SYNTHETIC_COUNT);
39
+ assert.equal(devices.some(device => device.connected === false), true);
40
+ assert.equal(devices.some(device => device.latestThumbnail && 'dataUrl' in device.latestThumbnail), false);
41
+ assert.equal(devices.some(device => device.activeLiveStream?.active === true), true);
42
+
43
+ const devicesWithDataUrl = hub.listDevices({ includeDataUrl: true });
44
+ assert.equal(devicesWithDataUrl.some(device => device.latestThumbnail?.dataUrl), true);
45
+
46
+ const deviceListPayload = {
47
+ total: devices.length,
48
+ pagination: 'none',
49
+ canvasDeviceListMode: 'all-devices',
50
+ devices
51
+ };
52
+ assert.ok(JSON.stringify(deviceListPayload).length < 8 * 1024 * 1024);
53
+
54
+ const thumbnailTarget = devices.find(device => device.connected && device.capabilities?.thumbnail);
55
+ assert.ok(thumbnailTarget);
56
+ const thumbnailResult = hub.requestThumbnail(thumbnailTarget.deviceId, {
57
+ streamId: 'scale-thumb',
58
+ maxWidth: 360,
59
+ maxHeight: 220,
60
+ quality: 50
61
+ });
62
+ assert.equal(thumbnailResult.ok, true);
63
+ assert.equal(hub.getDeviceThumbnail(thumbnailTarget.deviceId).streamId, 'scale-thumb');
64
+ assert.equal('dataUrl' in hub.getDeviceThumbnail(thumbnailTarget.deviceId), false);
65
+ assert.ok(hub.getDeviceThumbnail(thumbnailTarget.deviceId, { includeDataUrl: true }).dataUrl);
66
+
67
+ const liveTarget = devices.find(device => device.connected && device.capabilities?.liveStream);
68
+ assert.ok(liveTarget);
69
+ const liveResult = hub.startLiveStream(liveTarget.deviceId, {
70
+ streamId: 'scale-live',
71
+ fps: 20,
72
+ maxWidth: 960,
73
+ maxHeight: 540,
74
+ quality: 60
75
+ });
76
+ assert.equal(liveResult.ok, true);
77
+ assert.equal(hub.getDeviceLiveFrame(liveTarget.deviceId).streamId, 'scale-live');
78
+ assert.equal(hub.getDeviceLiveFrame(liveTarget.deviceId).fps, 20);
79
+ const stopResult = hub.stopLiveStream(liveTarget.deviceId, { streamId: 'scale-live' });
80
+ assert.equal(stopResult.ok, true);
81
+
82
+ const connectedTargets = hub.listDevices()
83
+ .filter(device => device.connected && device.capabilities?.taskDispatch)
84
+ .slice(0, 500);
85
+ assert.ok(connectedTargets.length >= 400);
86
+ const scaleBatch = hub.requestAgentTaskBatch(connectedTargets.map(device => device.deviceId), {
87
+ instruction: 'Synthetic scale task: report current status to the manager.',
88
+ title: 'Scale task batch'
89
+ });
90
+ assert.equal(scaleBatch.ok, true);
91
+ assert.equal(scaleBatch.total, connectedTargets.length);
92
+ assert.equal(scaleBatch.queued, connectedTargets.length);
93
+ assert.equal(scaleBatch.results.every(result => result.ok === true), true);
94
+ assert.equal(scaleBatch.batch?.completed, connectedTargets.length);
95
+ assert.equal(scaleBatch.batch?.failed, 0);
96
+ assert.equal(scaleBatch.batch?.status, 'completed');
97
+ const latestBatch = hub.getLatestTaskBatch();
98
+ assert.equal(latestBatch?.batchId, scaleBatch.batchId);
99
+ assert.equal(latestBatch?.completed, connectedTargets.length);
100
+
101
+ const aiTarget = hub.listDevices().find(device =>
102
+ device.connected && device.capabilities?.taskDispatch && device.capabilities?.aiAssist);
103
+ assert.ok(aiTarget);
104
+ const aiResult = hub.requestAgentTask(aiTarget.deviceId, {
105
+ instruction: 'Synthetic AI assist: summarize fleet condition.',
106
+ title: 'Scale AI task',
107
+ approvalLevel: 'ai-assist'
108
+ });
109
+ assert.equal(aiResult.ok, true);
110
+ assert.equal(aiResult.approvalLevel, 'ai-assist');
111
+ const updatedAiTarget = hub.listDevices().find(device => device.deviceId === aiTarget.deviceId);
112
+ assert.equal(updatedAiTarget?.latestTask?.approvalLevel, 'ai-assist');
113
+ assert.equal(updatedAiTarget?.latestTask?.resultModel, 'synthetic-ai');
114
+ assert.match(updatedAiTarget?.latestTask?.resultResponseId || '', /^synthetic-response-/);
115
+
116
+ const cleared = hub.clearSyntheticFleet();
117
+ assert.equal(cleared.ok, true);
118
+ assert.equal(cleared.removed, SYNTHETIC_COUNT);
119
+ assert.equal(hub.listDevices().length, 0);
120
+
121
+ console.log(`RemoteHub scale smoke OK (${SYNTHETIC_COUNT} synthetic devices)`);
122
+ } finally {
123
+ await hub.close();
124
+ }