@mindexec/cli 0.2.150 → 0.2.151

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/codex-runtime.js CHANGED
@@ -38,6 +38,11 @@ const MAX_LOG_CHARS = 4000;
38
38
  const MAX_EVENT_LOG = 120;
39
39
  const TEMP_DIR = '.ai/codex';
40
40
  const CODEX_CONFIG_PATH = path.join(os.homedir(), '.codex', 'config.toml');
41
+ const CODEX_SOURCE_HOME = path.join(os.homedir(), '.codex');
42
+ const CODEX_RUNTIME_HOME_ENV = 'MINDEXEC_CODEX_HOME';
43
+ const DEFAULT_CODEX_RUNTIME_HOME = path.join(os.homedir(), '.mindexec', 'codex-runtime');
44
+ const CODEX_RUNTIME_CONFIG_MARKER = '# Generated by MindExec LocalBridge for isolated AI node runs.';
45
+ const CODEX_RUNTIME_AUTH_FILES = ['auth.json'];
41
46
 
42
47
  let cachedSdkModule = null;
43
48
  let cachedSdkLoadError = null;
@@ -153,6 +158,70 @@ function buildCodexSdkConfigOverrides() {
153
158
  return { mcp_servers: mcpServers };
154
159
  }
155
160
 
161
+ function resolveCodexRuntimeHome() {
162
+ const configured = String(process.env[CODEX_RUNTIME_HOME_ENV] || '').trim();
163
+ return path.resolve(configured || DEFAULT_CODEX_RUNTIME_HOME);
164
+ }
165
+
166
+ async function copyCodexRuntimeFileIfPresent(fileName, runtimeHome) {
167
+ const source = path.join(CODEX_SOURCE_HOME, fileName);
168
+ const target = path.join(runtimeHome, fileName);
169
+ try {
170
+ const sourceStat = await fs.stat(source);
171
+ if (!sourceStat.isFile()) {
172
+ return false;
173
+ }
174
+
175
+ await fs.copyFile(source, target);
176
+ return true;
177
+ } catch {
178
+ return false;
179
+ }
180
+ }
181
+
182
+ async function ensureCodexRuntimeHome() {
183
+ const runtimeHome = resolveCodexRuntimeHome();
184
+ await fs.mkdir(runtimeHome, { recursive: true });
185
+ await fs.mkdir(path.join(runtimeHome, 'sessions'), { recursive: true });
186
+ await fs.mkdir(path.join(runtimeHome, 'generated_images'), { recursive: true });
187
+
188
+ for (const fileName of CODEX_RUNTIME_AUTH_FILES) {
189
+ await copyCodexRuntimeFileIfPresent(fileName, runtimeHome);
190
+ }
191
+
192
+ const configPath = path.join(runtimeHome, 'config.toml');
193
+ let shouldWriteConfig = true;
194
+ try {
195
+ const existing = await fs.readFile(configPath, 'utf8');
196
+ shouldWriteConfig = existing.trim().length === 0 || existing.includes(CODEX_RUNTIME_CONFIG_MARKER);
197
+ } catch {
198
+ shouldWriteConfig = true;
199
+ }
200
+
201
+ if (shouldWriteConfig) {
202
+ await fs.writeFile(
203
+ configPath,
204
+ `${CODEX_RUNTIME_CONFIG_MARKER}\n# User MCP server definitions are intentionally not inherited here.\n# LocalBridge passes model, sandbox, and reasoning options per run.\n`,
205
+ 'utf8'
206
+ );
207
+ }
208
+
209
+ return runtimeHome;
210
+ }
211
+
212
+ function buildCodexChildEnv() {
213
+ const env = {};
214
+ for (const [key, value] of Object.entries(process.env)) {
215
+ if (value !== undefined) {
216
+ env[key] = value;
217
+ }
218
+ }
219
+
220
+ env.CODEX_HOME = resolveCodexRuntimeHome();
221
+ env.MINDEXEC_CODEX_ISOLATED_HOME = '1';
222
+ return env;
223
+ }
224
+
156
225
  function appendCodexIsolationConfigArgs(args) {
157
226
  for (const name of readConfiguredMcpServerNames()) {
158
227
  args.push('--config', `mcp_servers.${name}.enabled=false`);
@@ -562,7 +631,11 @@ export function createCodexRuntime(options) {
562
631
 
563
632
  if (providerKind === PROVIDER_KIND.typeScriptSdk) {
564
633
  const sdk = await loadCodexSdk();
565
- const codex = new sdk.Codex({ config: buildCodexSdkConfigOverrides() });
634
+ await ensureCodexRuntimeHome();
635
+ const codex = new sdk.Codex({
636
+ env: buildCodexChildEnv(),
637
+ config: buildCodexSdkConfigOverrides()
638
+ });
566
639
  const thread = codex.startThread(threadOptions);
567
640
  const localThreadId = `local_${crypto.randomUUID()}`;
568
641
  threads.set(localThreadId, {
@@ -624,7 +697,11 @@ export function createCodexRuntime(options) {
624
697
  }
625
698
 
626
699
  const sdk = await loadCodexSdk();
627
- const codex = new sdk.Codex({ config: buildCodexSdkConfigOverrides() });
700
+ await ensureCodexRuntimeHome();
701
+ const codex = new sdk.Codex({
702
+ env: buildCodexChildEnv(),
703
+ config: buildCodexSdkConfigOverrides()
704
+ });
628
705
  const officialId = requestedThreadId && !requestedThreadId.startsWith('local_')
629
706
  ? requestedThreadId
630
707
  : '';
@@ -765,6 +842,7 @@ export function createCodexRuntime(options) {
765
842
  const tempDir = path.join(workingDirectory, TEMP_DIR);
766
843
  const schema = normalizeOutputSchema(body.outputSchema || body.outputSchemaJson);
767
844
  let schemaPath = null;
845
+ await ensureCodexRuntimeHome();
768
846
  const args = [
769
847
  'exec',
770
848
  '-',
@@ -806,6 +884,7 @@ export function createCodexRuntime(options) {
806
884
  const childResult = await new Promise((resolve) => {
807
885
  const child = spawn('codex', args, {
808
886
  cwd: workingDirectory,
887
+ env: buildCodexChildEnv(),
809
888
  windowsHide: true,
810
889
  signal: abortController.signal
811
890
  });
@@ -935,7 +1014,11 @@ export function createCodexRuntime(options) {
935
1014
  const workingDirectory = await resolveWorkingDirectory(body.workingDir || body.workingDirectory || '');
936
1015
  const threadOptions = buildThreadOptions(body, workingDirectory);
937
1016
  const sdk = await loadCodexSdk();
938
- const codex = new sdk.Codex({ config: buildCodexSdkConfigOverrides() });
1017
+ await ensureCodexRuntimeHome();
1018
+ const codex = new sdk.Codex({
1019
+ env: buildCodexChildEnv(),
1020
+ config: buildCodexSdkConfigOverrides()
1021
+ });
939
1022
  const thread = codex.resumeThread(threadId, threadOptions);
940
1023
  threads.set(threadId, {
941
1024
  providerKind,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindexec/cli",
3
- "version": "0.2.150",
3
+ "version": "0.2.151",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
@@ -5,7 +5,7 @@
5
5
  const DEBUG = false;
6
6
  const FPS_DEBUG = false;
7
7
  const FRAME_PERF_DEBUG = false;
8
- const MINDMAP_CORE_BUILD_ID = '20260616-remote-ws-control-frames-v573';
8
+ const MINDMAP_CORE_BUILD_ID = '20260617-flow-run-hitfix-v586';
9
9
  const CanvasPhase = Object.freeze({
10
10
  Booting: 'booting',
11
11
  BoardFileLoading: 'board-file-loading',
@@ -8524,6 +8524,7 @@
8524
8524
  const AUTOMATION_RESULT_PIN_HELP_TEXT = 'Drag to connect this result to an input pin. Click to view the result.';
8525
8525
  const BUSINESS_AUTOMATION_PIN_HIT_PADDING = 8;
8526
8526
  const BUSINESS_AUTOMATION_PIN_DROP_PADDING = 24;
8527
+ const BUSINESS_AUTOMATION_RESULT_PIN_EDGE_PADDING = 18;
8527
8528
 
8528
8529
  function getAutomationPinTheme(type) {
8529
8530
  const normalized = String(type || '').trim().toLowerCase();
@@ -8580,7 +8581,7 @@
8580
8581
  width: ${compact ? '24px' : 'auto'};
8581
8582
  height: ${compact ? '24px' : '22px'};
8582
8583
  max-width: ${compact ? '24px' : '124px'};
8583
- pointer-events: ${side === 'result' ? 'none' : 'auto'};
8584
+ pointer-events: ${resultTooltipPin ? 'auto' : (side === 'result' ? 'none' : 'auto')};
8584
8585
  user-select: none;
8585
8586
  -webkit-user-select: none;
8586
8587
  white-space: nowrap;
@@ -8667,13 +8668,14 @@
8667
8668
  }
8668
8669
 
8669
8670
  const placement = String(options.placement || '').trim().toLowerCase();
8671
+ const hasInteractiveResultPin = pins.some(pin => isAutomationResultTooltipPinDefinition(pin, side));
8670
8672
  const group = document.createElement('div');
8671
8673
  group.className = `map-node-memo__automation-pins is-${side}${placement ? ` is-placement-${placement}` : ''}`;
8672
8674
  group.style.cssText = `
8673
8675
  position: absolute;
8674
8676
  display: flex;
8675
8677
  gap: ${options.compact === true ? '0' : (side === 'result' ? '8px' : '7px')};
8676
- pointer-events: ${side === 'result' ? 'none' : 'auto'};
8678
+ pointer-events: ${hasInteractiveResultPin ? 'auto' : (side === 'result' ? 'none' : 'auto')};
8677
8679
  z-index: 7;
8678
8680
  ${getAutomationPinGroupPlacementStyle(side, placement)}
8679
8681
  `;
@@ -9137,11 +9139,14 @@
9137
9139
  }
9138
9140
 
9139
9141
  function handleBusinessAutomationDocumentPointerDown(event) {
9142
+ const resultPin = findBusinessAutomationResultPinAtEvent(event, {
9143
+ geometryPadding: BUSINESS_AUTOMATION_RESULT_PIN_EDGE_PADDING
9144
+ })?.pin || null;
9140
9145
  const targetPin = event.target?.closest?.('.map-node-memo__automation-pin') || null;
9141
9146
  const stackedPin = findBusinessAutomationPinAtEvent(event, '.map-node-memo__automation-pin', {
9142
9147
  geometryPadding: BUSINESS_AUTOMATION_PIN_HIT_PADDING
9143
9148
  })?.pin || null;
9144
- const pin = targetPin || stackedPin;
9149
+ const pin = resultPin || targetPin || stackedPin;
9145
9150
  const edge = event.target?.closest?.('.mind-map-business-automation-edge-hit, .mind-map-business-automation-edge-path') || null;
9146
9151
 
9147
9152
  if (!pin && !edge) {
@@ -10140,7 +10145,17 @@
10140
10145
  return;
10141
10146
  }
10142
10147
 
10143
- const pinHit = findBusinessAutomationPinAtEvent(event, '.map-node-memo__automation-pin');
10148
+ const resultPinHit = findBusinessAutomationResultPinAtEvent(event, {
10149
+ geometryPadding: BUSINESS_AUTOMATION_RESULT_PIN_EDGE_PADDING
10150
+ });
10151
+ if (resultPinHit?.pin) {
10152
+ handleBusinessAutomationPinPointerDown(event, resultPinHit.pin);
10153
+ return;
10154
+ }
10155
+
10156
+ const pinHit = findBusinessAutomationPinAtEvent(event, '.map-node-memo__automation-pin', {
10157
+ geometryPadding: BUSINESS_AUTOMATION_PIN_HIT_PADDING
10158
+ });
10144
10159
  if (pinHit?.pin) {
10145
10160
  handleBusinessAutomationPinPointerDown(event, pinHit.pin);
10146
10161
  return;
@@ -10202,6 +10217,19 @@
10202
10217
  return;
10203
10218
  }
10204
10219
 
10220
+ const resultPinHit = findBusinessAutomationResultPinAtEvent(event, {
10221
+ geometryPadding: BUSINESS_AUTOMATION_RESULT_PIN_EDGE_PADDING
10222
+ });
10223
+ const resultPin = resultPinHit?.pin || null;
10224
+ const container = resultPin?.closest?.('.map-node-automation') || null;
10225
+ if (resultPin && container && !isBusinessAutomationTooltipDragClick(event, container)) {
10226
+ event.preventDefault();
10227
+ event.stopPropagation();
10228
+ event.stopImmediatePropagation?.();
10229
+ openBusinessAutomationTooltipFromResultPin(resultPin, event);
10230
+ return;
10231
+ }
10232
+
10205
10233
  event.preventDefault();
10206
10234
  event.stopPropagation();
10207
10235
  event.stopImmediatePropagation?.();
@@ -7,8 +7,8 @@
7
7
  <title>MindExec | Run your ideas as AI task graphs</title>
8
8
  <meta name="description" content="MindExec is an AI execution canvas for solo builders, researchers, developers, and creators. Start with free browser tools, then move serious work into saved MindCanvas projects." />
9
9
  <base href="/" />
10
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260617-mdm-tile-scale-v585" />
11
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-mdm-tile-scale-v585" />
10
+ <link rel="stylesheet" href="_content/MindExecution.Shared/css/app.css?v=20260617-flow-run-hitfix-v586" />
11
+ <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-flow-run-hitfix-v586" />
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-mdm-tile-scale-v585';
582
+ const scriptVersion = '20260617-flow-run-hitfix-v586';
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": "ZfLSWK2O",
2
+ "version": "20SB8UIp",
3
3
  "assets": [
4
4
  {
5
5
  "hash": "sha256-+CSYMcqLNTsq3VnH11jgYyOCCdxvHzL74CBmo4sCmMU=",
@@ -78,7 +78,7 @@
78
78
  "url": "_content/MindExecution.Shared/js/marked.min.js"
79
79
  },
80
80
  {
81
- "hash": "sha256-oDfBxq3aqmSU1z5MGGpE9ZeTdsBtrykHEBnygOVFJtE=",
81
+ "hash": "sha256-y/ehxOpFseX3lMFu+VGjbL4lTMmQ0kEmj5QIRldR2S4=",
82
82
  "url": "_content/MindExecution.Shared/js/mind-map-core.js"
83
83
  },
84
84
  {
@@ -86,7 +86,7 @@
86
86
  "url": "_content/MindExecution.Shared/js/mind-map-core.js.backup"
87
87
  },
88
88
  {
89
- "hash": "sha256-Ma2j27vONNBesOrw65Auhtvwr3a5NFSp7sDag7VUo38=",
89
+ "hash": "sha256-CXwos9ge49EzJij/kELHzhWSDGBSR3fbqqW7hBxARCI=",
90
90
  "url": "_content/MindExecution.Shared/js/mind-map-css3d-manager.js"
91
91
  },
92
92
  {
@@ -834,7 +834,7 @@
834
834
  "url": "image-manifest.json"
835
835
  },
836
836
  {
837
- "hash": "sha256-uZsIbGZb6Q24FUaQCppHT2DCnj7ae7QpkaKq6YnmLIY=",
837
+ "hash": "sha256-428jP5ecE6zg8KQQ90OJuzhM+BUgcq4ko9pBmv1rm7Q=",
838
838
  "url": "index.html"
839
839
  },
840
840
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: ZfLSWK2O */
1
+ /* Manifest version: 20SB8UIp */
2
2
  // Hosted deployments should prefer the network over stale offline caches.
3
3
  // This service worker immediately clears old Blazor offline caches and unregisters itself.
4
4