@mindexec/cli 0.2.448 → 0.2.450

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 (24) hide show
  1. package/codex-runtime.js +65 -7
  2. package/package.json +5 -2
  3. package/scripts/codex-sdk-runtime-smoke.mjs +89 -0
  4. package/wwwroot/_content/MindExecution.Shared/css/app.css +1 -1
  5. package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js +204 -199
  6. package/wwwroot/_content/MindExecution.Shared/js/mind-map-interactions.js +12 -2
  7. package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-renderer.js +20 -106
  8. package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-video-placeholder.js +107 -0
  9. package/wwwroot/_framework/MindExecution.Core.9h7x2mjn0w.dll +0 -0
  10. package/wwwroot/_framework/{MindExecution.Kernel.zupeldfptg.dll → MindExecution.Kernel.8te3ay3qs6.dll} +0 -0
  11. package/wwwroot/_framework/{MindExecution.Plugins.Admin.hq0vyqnqtn.dll → MindExecution.Plugins.Admin.imt43kggvu.dll} +0 -0
  12. package/wwwroot/_framework/{MindExecution.Plugins.Business.pucw3o7rno.dll → MindExecution.Plugins.Business.26yozgyvan.dll} +0 -0
  13. package/wwwroot/_framework/{MindExecution.Plugins.Concept.557tzzkrrx.dll → MindExecution.Plugins.Concept.k7fd1qvmfx.dll} +0 -0
  14. package/wwwroot/_framework/{MindExecution.Plugins.Directory.zh1ddg1fn6.dll → MindExecution.Plugins.Directory.88ng22x3y0.dll} +0 -0
  15. package/wwwroot/_framework/{MindExecution.Plugins.PlanMaster.0z9pzynpu9.dll → MindExecution.Plugins.PlanMaster.ll20yqlc09.dll} +0 -0
  16. package/wwwroot/_framework/{MindExecution.Plugins.YouTube.y8g77r54fa.dll → MindExecution.Plugins.YouTube.gqu5xngvav.dll} +0 -0
  17. package/wwwroot/_framework/{MindExecution.Shared.1ymsdbwid2.dll → MindExecution.Shared.6ivt1fatt3.dll} +0 -0
  18. package/wwwroot/_framework/MindExecution.Web.7tki7xqpt0.dll +0 -0
  19. package/wwwroot/_framework/blazor.boot.json +21 -21
  20. package/wwwroot/index.html +2 -1
  21. package/wwwroot/service-worker-assets.js +31 -27
  22. package/wwwroot/service-worker.js +1 -1
  23. package/wwwroot/_framework/MindExecution.Core.mswl4wlkm9.dll +0 -0
  24. package/wwwroot/_framework/MindExecution.Web.bb1txupuv0.dll +0 -0
package/codex-runtime.js CHANGED
@@ -247,12 +247,28 @@ function makeEmptyResult(overrides = {}) {
247
247
  changedFiles: [],
248
248
  commandLogs: [],
249
249
  approvalEvents: [],
250
+ toolEvents: [],
250
251
  rawEventCount: 0,
251
252
  ...overrides
252
253
  };
253
254
  }
254
255
 
255
- function collectItem(result, item) {
256
+ function upsertToolEvent(result, event) {
257
+ const id = String(event?.id || '').trim();
258
+ const type = String(event?.type || '').trim();
259
+ const name = String(event?.name || '').trim();
260
+ const key = id || `${type}:${name}`;
261
+ const index = result.toolEvents.findIndex(existing =>
262
+ (String(existing?.id || '').trim() || `${existing?.type || ''}:${existing?.name || ''}`) === key);
263
+ if (index >= 0) {
264
+ result.toolEvents[index] = event;
265
+ return;
266
+ }
267
+
268
+ result.toolEvents.push(event);
269
+ }
270
+
271
+ function collectItem(result, item, eventType = '') {
256
272
  if (!item || typeof item !== 'object') {
257
273
  return;
258
274
  }
@@ -295,6 +311,51 @@ function collectItem(result, item) {
295
311
  exitCode: Number.isFinite(Number(item.exit_code)) ? Number(item.exit_code) : null,
296
312
  output: truncateLog(item.aggregated_output)
297
313
  });
314
+ upsertToolEvent(result, {
315
+ id: String(item.id || ''),
316
+ type: 'command_execution',
317
+ name: String(item.command || '').trim() || 'Shell',
318
+ status: String(item.status || eventType || ''),
319
+ summary: truncateLog(item.aggregated_output, 1200)
320
+ });
321
+ return;
322
+ }
323
+
324
+ if (item.type === 'web_search') {
325
+ upsertToolEvent(result, {
326
+ id: String(item.id || ''),
327
+ type: 'web_search',
328
+ name: 'WebSearch',
329
+ status: eventType === 'item.completed' ? 'completed' : 'running',
330
+ summary: truncateLog(item.query, 1200)
331
+ });
332
+ return;
333
+ }
334
+
335
+ if (item.type === 'mcp_tool_call') {
336
+ const server = String(item.server || '').trim();
337
+ const tool = String(item.tool || '').trim();
338
+ upsertToolEvent(result, {
339
+ id: String(item.id || ''),
340
+ type: 'mcp_tool_call',
341
+ name: [server, tool].filter(Boolean).join('.') || 'MCP',
342
+ status: String(item.status || eventType || ''),
343
+ summary: item.error?.message
344
+ ? truncateLog(item.error.message, 1200)
345
+ : truncateLog(JSON.stringify(item.arguments ?? {}), 1200)
346
+ });
347
+ return;
348
+ }
349
+
350
+ if (item.type === 'todo_list') {
351
+ const items = Array.isArray(item.items) ? item.items : [];
352
+ upsertToolEvent(result, {
353
+ id: String(item.id || ''),
354
+ type: 'todo_list',
355
+ name: 'Plan',
356
+ status: eventType === 'item.completed' ? 'completed' : 'running',
357
+ summary: truncateLog(items.map(entry => `${entry?.completed ? '[x]' : '[ ]'} ${entry?.text || ''}`).join('\n'), 1200)
358
+ });
298
359
  return;
299
360
  }
300
361
 
@@ -422,6 +483,8 @@ function serializeThreadOptionsForStatus(options) {
422
483
  sandboxMode: API_SANDBOX_BY_SDK_VALUE[options?.sandboxMode] || options?.sandboxMode || null,
423
484
  reasoningEffort: options?.modelReasoningEffort || null,
424
485
  approvalPolicy: options?.approvalPolicy || null,
486
+ networkAccessEnabled: options?.networkAccessEnabled ?? null,
487
+ webSearchMode: options?.webSearchMode || null,
425
488
  workingDirectory: options?.workingDirectory || null
426
489
  };
427
490
  }
@@ -548,11 +611,6 @@ export function createCodexRuntime(options) {
548
611
  return PROVIDER_KIND.legacyExec;
549
612
  }
550
613
 
551
- const fallbackLegacy = legacy || await checkLegacyAvailability();
552
- if (requested === PROVIDER_KIND.typeScriptSdk && fallbackLegacy?.available) {
553
- return PROVIDER_KIND.legacyExec;
554
- }
555
-
556
614
  return PROVIDER_KIND.unavailable;
557
615
  }
558
616
 
@@ -711,7 +769,7 @@ export function createCodexRuntime(options) {
711
769
  result.threadId = record.officialThreadId;
712
770
  threads.set(record.officialThreadId, record);
713
771
  } else if (event.type === 'item.completed' || event.type === 'item.updated' || event.type === 'item.started') {
714
- collectItem(result, event.item);
772
+ collectItem(result, event.item, event.type);
715
773
  } else if (event.type === 'turn.failed') {
716
774
  result.error = event.error?.message || 'Codex turn failed.';
717
775
  result.status = 'failed';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindexec/cli",
3
- "version": "0.2.448",
3
+ "version": "0.2.450",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
@@ -30,7 +30,10 @@
30
30
  "desktop:build:win": "electron-builder --win --x64 --publish never",
31
31
  "test:desktop": "node electron/source-smoke.mjs",
32
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/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",
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",
34
37
  "test:codex-model-catalog": "node scripts/codex-model-catalog-smoke.mjs",
35
38
  "test:codex-model-catalog:live": "node scripts/codex-model-catalog-smoke.mjs --live",
36
39
  "test:auth": "node scripts/auth-session-smoke.mjs",
@@ -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
+ }));