@mindexec/cli 0.2.149 → 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.149",
3
+ "version": "0.2.151",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
@@ -945,12 +945,12 @@ try {
945
945
  assert.match(cards[0]?.title || '', /Seen:/);
946
946
  assert.match(cards[0]?.title || '', /Uptime:/);
947
947
  assert.equal(/\b(Seen|Uptime|Mem|Load)\b/.test(cards[0]?.textContent || ''), false);
948
- assert.match(deviceGrid.style.cssText, /minmax\(132px,\s*1fr\)/);
948
+ assert.match(deviceGrid.style.cssText, /minmax\(198px,\s*1fr\)/);
949
949
  sizeControls.querySelector('[data-remote-fleet-action="monitor-size-up"]').dispatchEvent({ type: 'click' });
950
950
  assert.equal(bodyView.dataset.remoteFleetDensity, 'large');
951
- assert.match(bodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(168px,\s*1fr\)/);
951
+ assert.match(bodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(297px,\s*1fr\)/);
952
952
  assert.equal(mirrorBodyView.dataset.remoteFleetDensity, 'large');
953
- assert.match(mirrorBodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(168px,\s*1fr\)/);
953
+ assert.match(mirrorBodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(297px,\s*1fr\)/);
954
954
  assert.ok(diagnostics.textOverlayInvalidations.some(entry =>
955
955
  entry.nodeId === 'remote-fleet-render-smoke'
956
956
  && entry.reason === 'remote-monitor-size'));
@@ -961,9 +961,15 @@ try {
961
961
  && entry.overlayInvalidated === true));
962
962
  bodyView.querySelector('[data-remote-fleet-action="monitor-size-down"]').dispatchEvent({ type: 'click' });
963
963
  assert.equal(bodyView.dataset.remoteFleetDensity, 'cards');
964
- assert.match(bodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(132px,\s*1fr\)/);
964
+ assert.match(bodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(198px,\s*1fr\)/);
965
965
  assert.equal(mirrorBodyView.dataset.remoteFleetDensity, 'cards');
966
- assert.match(mirrorBodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(132px,\s*1fr\)/);
966
+ assert.match(mirrorBodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(198px,\s*1fr\)/);
967
+ bodyView.querySelector('[data-remote-fleet-action="monitor-size-down"]').dispatchEvent({ type: 'click' });
968
+ assert.equal(bodyView.dataset.remoteFleetDensity, 'dense');
969
+ assert.match(bodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(132px,\s*1fr\)/);
970
+ bodyView.querySelector('[data-remote-fleet-action="monitor-size-up"]').dispatchEvent({ type: 'click' });
971
+ assert.equal(bodyView.dataset.remoteFleetDensity, 'cards');
972
+ assert.match(bodyView.querySelector('[data-remote-fleet-device-grid="true"]')?.style.cssText || '', /minmax\(198px,\s*1fr\)/);
967
973
  mirrorShell.remove();
968
974
  cards = bodyView.querySelectorAll('article[data-device-id]');
969
975
  const patchTarget = devices.find(device =>
@@ -1320,7 +1326,7 @@ try {
1320
1326
  assert.ok(emptyScreenShell);
1321
1327
  assert.match(emptyScreenShell.style.cssText, /padding:\s*2px 4px 6px 4px;/);
1322
1328
  const emptyScreens = emptyBody.querySelectorAll('[data-remote-fleet-empty-screen="true"]');
1323
- assert.ok(emptyScreens.length >= 24, `expected empty monitor to fill space, got ${emptyScreens.length}`);
1329
+ assert.ok(emptyScreens.length >= 12, `expected empty monitor to fill space, got ${emptyScreens.length}`);
1324
1330
  assert.notEqual(emptyScreens.length, 6);
1325
1331
  assert.match(emptyScreens[0].style.cssText, /border-radius:\s*0/);
1326
1332
  assert.ok(Array.from(emptyBody.children).map(child =>
@@ -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',
@@ -3813,13 +3813,13 @@
3813
3813
  const REMOTE_FLEET_DEVICE_SEMANTIC_TYPE = 'RemoteFleetDevice';
3814
3814
  const REMOTE_FLEET_CENTER_NUDGE_PX = 4;
3815
3815
  const REMOTE_FLEET_MONITOR_TILE_GAP_PX = 8;
3816
- const REMOTE_FLEET_EMPTY_SCREEN_MIN_WIDTH = 132;
3817
- const REMOTE_FLEET_EMPTY_SCREEN_MIN_HEIGHT = 72;
3816
+ const REMOTE_FLEET_EMPTY_SCREEN_MIN_WIDTH = 198;
3817
+ const REMOTE_FLEET_EMPTY_SCREEN_MIN_HEIGHT = 108;
3818
3818
  const REMOTE_FLEET_MONITOR_SIZE_LEVELS = Object.freeze(['dense', 'cards', 'large']);
3819
3819
  const REMOTE_FLEET_MONITOR_TILE_METRICS = Object.freeze({
3820
- dense: Object.freeze({ tileMinWidth: 104, tileMinHeight: 66, emptyMinWidth: 104, emptyMinHeight: 58 }),
3821
- cards: Object.freeze({ tileMinWidth: 132, tileMinHeight: 84, emptyMinWidth: 132, emptyMinHeight: 72 }),
3822
- large: Object.freeze({ tileMinWidth: 168, tileMinHeight: 106, emptyMinWidth: 168, emptyMinHeight: 94 })
3820
+ dense: Object.freeze({ tileMinWidth: 132, tileMinHeight: 84, emptyMinWidth: 132, emptyMinHeight: 72 }),
3821
+ cards: Object.freeze({ tileMinWidth: 198, tileMinHeight: 126, emptyMinWidth: 198, emptyMinHeight: 108 }),
3822
+ large: Object.freeze({ tileMinWidth: 297, tileMinHeight: 189, emptyMinWidth: 297, emptyMinHeight: 162 })
3823
3823
  });
3824
3824
  const AUTOMATION_NODE_KIND_METADATA_KEY = 'AutomationNodeKind';
3825
3825
  const AUTOMATION_NODE_LABEL_METADATA_KEY = 'AutomationNodeLabel';
@@ -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-host-lamp-v584" />
11
- <link rel="stylesheet" href="_content/MindExecution.Shared/css/mind-map-overrides.css?v=20260617-mdm-host-lamp-v584" />
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-host-lamp-v584';
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": "D5pcdHTt",
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-RSQ+302zp4KqLtkoQdqlFYULUOqzi/VO90NwHsGKcl8=",
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-cQP7X8qq+FUS4hnGN9p8Gya3DsWc9dEG/9XlQWuu1Ms=",
837
+ "hash": "sha256-428jP5ecE6zg8KQQ90OJuzhM+BUgcq4ko9pBmv1rm7Q=",
838
838
  "url": "index.html"
839
839
  },
840
840
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: D5pcdHTt */
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