@mindexec/cli 0.2.447 → 0.2.449
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 +34 -4
- package/codex-runtime.js +65 -7
- package/electron/main.cjs +347 -0
- package/electron/source-smoke.mjs +39 -0
- package/electron/windows-package-smoke.mjs +147 -0
- package/package.json +76 -13
- package/scripts/codex-sdk-runtime-smoke.mjs +89 -0
- package/wwwroot/_content/MindExecution.Shared/css/app.css +1 -1
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-renderer.js +12 -98
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-video-placeholder.js +107 -0
- package/wwwroot/_framework/MindExecution.Core.ocmk8xd0dx.dll +0 -0
- package/wwwroot/_framework/{MindExecution.Kernel.zupeldfptg.dll → MindExecution.Kernel.fxnztqgsp3.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Admin.hq0vyqnqtn.dll → MindExecution.Plugins.Admin.vtp5nvymq9.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Business.pucw3o7rno.dll → MindExecution.Plugins.Business.o0bonn1p2f.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Concept.557tzzkrrx.dll → MindExecution.Plugins.Concept.1omsw5caki.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Directory.zh1ddg1fn6.dll → MindExecution.Plugins.Directory.imwo19wy9c.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.PlanMaster.0z9pzynpu9.dll → MindExecution.Plugins.PlanMaster.hakp8m5rxg.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.YouTube.y8g77r54fa.dll → MindExecution.Plugins.YouTube.2imuchw4ww.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Shared.1ymsdbwid2.dll → MindExecution.Shared.9podjbu7w7.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Web.bb1txupuv0.dll → MindExecution.Web.rck7kmuixn.dll} +0 -0
- package/wwwroot/_framework/blazor.boot.json +21 -21
- package/wwwroot/index.html +2 -1
- package/wwwroot/service-worker-assets.js +29 -25
- package/wwwroot/service-worker.js +1 -1
- package/wwwroot/_framework/MindExecution.Core.mswl4wlkm9.dll +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import net from 'node:net';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const electronDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const packageRoot = path.resolve(electronDirectory, '..');
|
|
11
|
+
const repositoryRoot = path.resolve(packageRoot, '..');
|
|
12
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
13
|
+
const outputDirectory = process.env.MINDEXEC_ELECTRON_OUTPUT
|
|
14
|
+
? path.resolve(process.env.MINDEXEC_ELECTRON_OUTPUT)
|
|
15
|
+
: path.join(repositoryRoot, 'artifacts', 'electron');
|
|
16
|
+
const executablePath = path.join(outputDirectory, 'win-unpacked', 'MindExec.exe');
|
|
17
|
+
|
|
18
|
+
assert.equal(process.platform, 'win32', 'The packaged Electron smoke test requires Windows.');
|
|
19
|
+
assert.ok(fs.existsSync(executablePath), `Packaged Electron executable is missing: ${executablePath}`);
|
|
20
|
+
|
|
21
|
+
function reservePort() {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const server = net.createServer();
|
|
24
|
+
server.once('error', reject);
|
|
25
|
+
server.listen({ host: '127.0.0.1', port: 0, exclusive: true }, () => {
|
|
26
|
+
const address = server.address();
|
|
27
|
+
server.close((error) => {
|
|
28
|
+
if (error) {
|
|
29
|
+
reject(error);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
resolve(address.port);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function waitForFile(filePath, child, timeoutMs) {
|
|
39
|
+
const deadline = Date.now() + timeoutMs;
|
|
40
|
+
while (Date.now() < deadline) {
|
|
41
|
+
if (fs.existsSync(filePath)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (child.exitCode !== null) {
|
|
45
|
+
throw new Error(`Packaged Electron exited before reporting smoke status (code ${child.exitCode}).`);
|
|
46
|
+
}
|
|
47
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
48
|
+
}
|
|
49
|
+
throw new Error(`Timed out waiting for packaged smoke result: ${filePath}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function waitForExit(child, timeoutMs) {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
if (child.exitCode !== null) {
|
|
55
|
+
resolve(child.exitCode);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const timeout = setTimeout(() => {
|
|
60
|
+
child.kill('SIGKILL');
|
|
61
|
+
reject(new Error('Packaged Electron did not exit after its smoke run.'));
|
|
62
|
+
}, timeoutMs);
|
|
63
|
+
|
|
64
|
+
child.once('error', (error) => {
|
|
65
|
+
clearTimeout(timeout);
|
|
66
|
+
reject(error);
|
|
67
|
+
});
|
|
68
|
+
child.once('exit', (code) => {
|
|
69
|
+
clearTimeout(timeout);
|
|
70
|
+
resolve(code);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function canBind(port) {
|
|
76
|
+
return new Promise((resolve) => {
|
|
77
|
+
const server = net.createServer();
|
|
78
|
+
server.once('error', () => resolve(false));
|
|
79
|
+
server.listen({ host: '127.0.0.1', port, exclusive: true }, () => {
|
|
80
|
+
server.close(() => resolve(true));
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const bridgePort = await reservePort();
|
|
86
|
+
const remoteHubPort = await reservePort();
|
|
87
|
+
const smokeRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'mindexec-electron-smoke-'));
|
|
88
|
+
const workspace = path.join(smokeRoot, 'workspace');
|
|
89
|
+
const resultPath = path.join(smokeRoot, 'result.json');
|
|
90
|
+
fs.mkdirSync(workspace, { recursive: true });
|
|
91
|
+
|
|
92
|
+
let child;
|
|
93
|
+
try {
|
|
94
|
+
child = spawn(executablePath, [`--user-data-dir=${path.join(smokeRoot, 'electron-profile')}`], {
|
|
95
|
+
cwd: path.dirname(executablePath),
|
|
96
|
+
env: {
|
|
97
|
+
...process.env,
|
|
98
|
+
MINDEXEC_DESKTOP_SMOKE: '1',
|
|
99
|
+
MINDEXEC_DESKTOP_SMOKE_RESULT: resultPath,
|
|
100
|
+
MINDEXEC_DESKTOP_WORKSPACE: workspace,
|
|
101
|
+
MINDEXEC_NO_OPEN: '1',
|
|
102
|
+
BRIDGE_PORT: String(bridgePort),
|
|
103
|
+
REMOTE_HUB_PORT: String(remoteHubPort)
|
|
104
|
+
},
|
|
105
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
106
|
+
windowsHide: true
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
let stdout = '';
|
|
110
|
+
let stderr = '';
|
|
111
|
+
child.stdout?.on('data', (chunk) => {
|
|
112
|
+
stdout += String(chunk);
|
|
113
|
+
});
|
|
114
|
+
child.stderr?.on('data', (chunk) => {
|
|
115
|
+
stderr += String(chunk);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
await waitForFile(resultPath, child, 90_000);
|
|
119
|
+
const result = JSON.parse(fs.readFileSync(resultPath, 'utf8'));
|
|
120
|
+
assert.equal(result.ok, true, `Packaged Electron smoke failed: ${result.error || stderr || stdout}`);
|
|
121
|
+
assert.equal(result.appVersion, packageJson.version, 'Electron app version does not match the npm package version.');
|
|
122
|
+
assert.equal(result.bridgeVersion, packageJson.version, 'Bundled LocalBridge version does not match Electron.');
|
|
123
|
+
assert.equal(result.runtimeMode, 'bundled', 'Electron did not use its bundled runtime.');
|
|
124
|
+
assert.equal(result.bridgePort, bridgePort, 'Packaged shell did not use the requested Bridge port.');
|
|
125
|
+
assert.equal(result.remoteHubPort, remoteHubPort, 'Packaged shell did not use the requested RemoteHub port.');
|
|
126
|
+
|
|
127
|
+
const exitCode = await waitForExit(child, 15_000);
|
|
128
|
+
assert.equal(exitCode, 0, `Packaged Electron smoke exited with code ${exitCode}.`);
|
|
129
|
+
|
|
130
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
131
|
+
assert.equal(await canBind(bridgePort), true, 'Bridge port was not released after Electron exit.');
|
|
132
|
+
assert.equal(await canBind(remoteHubPort), true, 'RemoteHub port was not released after Electron exit.');
|
|
133
|
+
|
|
134
|
+
console.log(JSON.stringify({
|
|
135
|
+
ok: true,
|
|
136
|
+
executablePath,
|
|
137
|
+
version: result.appVersion,
|
|
138
|
+
runtimeMode: result.runtimeMode,
|
|
139
|
+
bridgePortReleased: true,
|
|
140
|
+
remoteHubPortReleased: true
|
|
141
|
+
}));
|
|
142
|
+
} finally {
|
|
143
|
+
if (child && child.exitCode === null) {
|
|
144
|
+
child.kill('SIGKILL');
|
|
145
|
+
}
|
|
146
|
+
fs.rmSync(smokeRoot, { recursive: true, force: true });
|
|
147
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindexec/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.449",
|
|
4
4
|
"description": "MindExec local runtime and bridge CLI",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,16 +16,24 @@
|
|
|
16
16
|
"codex-runtime.js",
|
|
17
17
|
"codex-model-catalog.js",
|
|
18
18
|
"port-guard.cjs",
|
|
19
|
-
"remote-fast/",
|
|
20
|
-
"wwwroot/",
|
|
21
|
-
"
|
|
19
|
+
"remote-fast/",
|
|
20
|
+
"wwwroot/",
|
|
21
|
+
"electron/",
|
|
22
|
+
"scripts/",
|
|
22
23
|
"tree-sitter-grammars/",
|
|
23
24
|
"README.md"
|
|
24
25
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"start": "node launch-bridge.cjs",
|
|
27
|
-
"dev": "node launch-bridge.cjs --watch",
|
|
28
|
-
"
|
|
26
|
+
"scripts": {
|
|
27
|
+
"start": "node launch-bridge.cjs",
|
|
28
|
+
"dev": "node launch-bridge.cjs --watch",
|
|
29
|
+
"desktop:start": "electron electron/main.cjs",
|
|
30
|
+
"desktop:build:win": "electron-builder --win --x64 --publish never",
|
|
31
|
+
"test:desktop": "node electron/source-smoke.mjs",
|
|
32
|
+
"test:desktop:win": "node electron/windows-package-smoke.mjs",
|
|
33
|
+
"test:syntax": "node --check server.js && node --check remote-hub.js && node --check lzo1x.js && node --check mode4-atlas.js && node --check mode4-atlas-worker.js && node --check codex-runtime.js && node --check codex-model-catalog.js && node --check launch-bridge.cjs && node --check port-guard.cjs && node --check electron/main.cjs && node --check electron/source-smoke.mjs && node --check electron/windows-package-smoke.mjs && node --check scripts/setup-tree-sitter-grammars.mjs && node --check scripts/npm-fresh-install-smoke.mjs && node --check scripts/auth-session-smoke.mjs && node --check scripts/codex-model-catalog-smoke.mjs && node --check scripts/codex-sdk-runtime-smoke.mjs && node --check scripts/remote-hub-smoke.mjs && node --check scripts/remote-hub-scale-smoke.mjs && node --check scripts/remote-fleet-render-smoke.mjs && node --check scripts/remote-http-smoke.mjs && node --check scripts/remote-frame-ws-smoke.mjs && node --check scripts/remote-input-ws-smoke.mjs && node --check scripts/remote-agent-ws-smoke.mjs && node --check scripts/remote-agent-managed-smoke.mjs && node --check scripts/remote-registry-follower-smoke.mjs && node --check scripts/remote-agent-package-smoke.mjs && node --check scripts/remote-fast-live-rate-smoke.mjs && node --check scripts/remote-fast-mdm-browser-smoke.mjs",
|
|
34
|
+
"test:codex-sdk": "node scripts/codex-sdk-runtime-smoke.mjs",
|
|
35
|
+
"test:codex-sdk:live": "node scripts/codex-sdk-runtime-smoke.mjs --live",
|
|
36
|
+
"test:codex-sdk:live-tools": "node scripts/codex-sdk-runtime-smoke.mjs --live-tools",
|
|
29
37
|
"test:codex-model-catalog": "node scripts/codex-model-catalog-smoke.mjs",
|
|
30
38
|
"test:codex-model-catalog:live": "node scripts/codex-model-catalog-smoke.mjs --live",
|
|
31
39
|
"test:auth": "node scripts/auth-session-smoke.mjs",
|
|
@@ -53,7 +61,7 @@
|
|
|
53
61
|
"local",
|
|
54
62
|
"ai"
|
|
55
63
|
],
|
|
56
|
-
"author": "",
|
|
64
|
+
"author": "lovecrdm77",
|
|
57
65
|
"license": "MIT",
|
|
58
66
|
"publishConfig": {
|
|
59
67
|
"access": "public"
|
|
@@ -82,7 +90,62 @@
|
|
|
82
90
|
"mindexec": "launch-bridge.cjs",
|
|
83
91
|
"mind-bridge": "launch-bridge.cjs"
|
|
84
92
|
},
|
|
85
|
-
"devDependencies": {
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"electron": "43.2.0",
|
|
95
|
+
"electron-builder": "26.15.3",
|
|
96
|
+
"tree-sitter-wasms": "^0.1.13"
|
|
97
|
+
},
|
|
98
|
+
"build": {
|
|
99
|
+
"appId": "com.mindexec.desktop",
|
|
100
|
+
"productName": "MindExec",
|
|
101
|
+
"copyright": "Copyright © 2026 lovecrdm77",
|
|
102
|
+
"asar": false,
|
|
103
|
+
"extraMetadata": {
|
|
104
|
+
"main": "electron/main.cjs"
|
|
105
|
+
},
|
|
106
|
+
"directories": {
|
|
107
|
+
"output": "../artifacts/electron"
|
|
108
|
+
},
|
|
109
|
+
"files": [
|
|
110
|
+
"*.js",
|
|
111
|
+
"*.cjs",
|
|
112
|
+
"*.json",
|
|
113
|
+
"electron/main.cjs",
|
|
114
|
+
"remote-fast/**/*",
|
|
115
|
+
"scripts/**/*",
|
|
116
|
+
"tree-sitter-grammars/**/*",
|
|
117
|
+
"wwwroot/**/*",
|
|
118
|
+
"node_modules/**/*"
|
|
119
|
+
],
|
|
120
|
+
"win": {
|
|
121
|
+
"icon": "../MindExecution.Web/wwwroot/icon-512.png",
|
|
122
|
+
"executableName": "MindExec",
|
|
123
|
+
"target": [
|
|
124
|
+
{
|
|
125
|
+
"target": "nsis",
|
|
126
|
+
"arch": [
|
|
127
|
+
"x64"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"target": "portable",
|
|
132
|
+
"arch": [
|
|
133
|
+
"x64"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"nsis": {
|
|
139
|
+
"artifactName": "MindExec-Setup-${version}-${arch}.${ext}",
|
|
140
|
+
"oneClick": false,
|
|
141
|
+
"perMachine": false,
|
|
142
|
+
"allowToChangeInstallationDirectory": true,
|
|
143
|
+
"createDesktopShortcut": true,
|
|
144
|
+
"createStartMenuShortcut": true,
|
|
145
|
+
"shortcutName": "MindExec"
|
|
146
|
+
},
|
|
147
|
+
"portable": {
|
|
148
|
+
"artifactName": "MindExec-Portable-${version}-${arch}.${ext}"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { createCodexRuntime } from '../codex-runtime.js';
|
|
5
|
+
|
|
6
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const packageRoot = path.resolve(scriptDir, '..');
|
|
8
|
+
const workspaceRoot = path.resolve(packageRoot, '..');
|
|
9
|
+
const runLiveTurn = process.argv.includes('--live');
|
|
10
|
+
const runLiveTools = process.argv.includes('--live-tools');
|
|
11
|
+
|
|
12
|
+
const runtime = createCodexRuntime({
|
|
13
|
+
packageRoot,
|
|
14
|
+
resolveWorkingDirectory: async () => workspaceRoot,
|
|
15
|
+
getCurrentRuntime: () => ({}),
|
|
16
|
+
getModelCatalog: async () => ({
|
|
17
|
+
models: [],
|
|
18
|
+
source: 'smoke',
|
|
19
|
+
updatedAt: new Date().toISOString()
|
|
20
|
+
}),
|
|
21
|
+
log: () => {}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const capabilities = await runtime.getCapabilities();
|
|
25
|
+
const sdkProvider = capabilities.providers.find(provider => provider.kind === 'TypeScriptSdk');
|
|
26
|
+
assert.equal(sdkProvider?.available, true, sdkProvider?.error || 'Codex TypeScript SDK must be available.');
|
|
27
|
+
assert.equal(capabilities.preferredProviderKind, 'TypeScriptSdk');
|
|
28
|
+
|
|
29
|
+
const started = await runtime.startThread({
|
|
30
|
+
providerKind: 'TypeScriptSdk',
|
|
31
|
+
prompt: 'smoke',
|
|
32
|
+
workingDir: workspaceRoot,
|
|
33
|
+
sandbox: 'read_only',
|
|
34
|
+
approvalPolicy: 'on-request',
|
|
35
|
+
networkAccessEnabled: true,
|
|
36
|
+
webSearchMode: 'live'
|
|
37
|
+
});
|
|
38
|
+
assert.equal(started.success, true);
|
|
39
|
+
assert.equal(started.providerKind, 'TypeScriptSdk');
|
|
40
|
+
|
|
41
|
+
const status = runtime.getThreadStatus(started.threadId);
|
|
42
|
+
assert.equal(status.providerKind, 'TypeScriptSdk');
|
|
43
|
+
assert.equal(status.options.sandboxMode, 'read_only');
|
|
44
|
+
assert.equal(status.options.networkAccessEnabled, true);
|
|
45
|
+
assert.equal(status.options.webSearchMode, 'live');
|
|
46
|
+
|
|
47
|
+
if (runLiveTurn) {
|
|
48
|
+
const marker = `CODEX_SDK_RUNTIME_OK_${Date.now()}`;
|
|
49
|
+
const result = await runtime.runThread({
|
|
50
|
+
providerKind: 'TypeScriptSdk',
|
|
51
|
+
prompt: `Return exactly this marker and nothing else: ${marker}`,
|
|
52
|
+
workingDir: workspaceRoot,
|
|
53
|
+
sandbox: 'read_only',
|
|
54
|
+
approvalPolicy: 'on-request',
|
|
55
|
+
networkAccessEnabled: false,
|
|
56
|
+
webSearchMode: 'disabled'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
assert.equal(result.providerKind, 'TypeScriptSdk');
|
|
60
|
+
assert.equal(result.success, true, result.error || 'Codex SDK live turn failed.');
|
|
61
|
+
assert.match(result.finalResponse, new RegExp(marker));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (runLiveTools) {
|
|
65
|
+
const result = await runtime.runThread({
|
|
66
|
+
providerKind: 'TypeScriptSdk',
|
|
67
|
+
prompt: 'Use the built-in web search tool to find the title of the official OpenAI Codex SDK documentation page. Return the title and its source URL.',
|
|
68
|
+
workingDir: workspaceRoot,
|
|
69
|
+
sandbox: 'read_only',
|
|
70
|
+
approvalPolicy: 'on-request',
|
|
71
|
+
networkAccessEnabled: true,
|
|
72
|
+
webSearchMode: 'live'
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
assert.equal(result.providerKind, 'TypeScriptSdk');
|
|
76
|
+
assert.equal(result.success, true, result.error || 'Codex SDK live tool turn failed.');
|
|
77
|
+
assert.equal(
|
|
78
|
+
result.toolEvents.some(event => event.type === 'web_search'),
|
|
79
|
+
true,
|
|
80
|
+
`Expected a web_search tool event, got: ${JSON.stringify(result.toolEvents)}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
console.log(JSON.stringify({
|
|
84
|
+
ok: true,
|
|
85
|
+
providerKind: capabilities.preferredProviderKind,
|
|
86
|
+
sdkVersion: sdkProvider?.version || null,
|
|
87
|
+
liveTurn: runLiveTurn,
|
|
88
|
+
liveTools: runLiveTools
|
|
89
|
+
}));
|