cloudflare-mcp-smart-proxy 1.5.18 → 1.5.19

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/connector-cli.js CHANGED
@@ -300,6 +300,9 @@ function printInstallResult(result, { includeContent = false, includeSecrets = f
300
300
  }
301
301
  if (result.activation) {
302
302
  console.error(`activation: ${result.activation.status}`);
303
+ if (result.activation.reason) {
304
+ console.error(`activation reason: ${result.activation.reason}`);
305
+ }
303
306
  if (Number.isInteger(result.activation.toolCount)) {
304
307
  console.error(`tools: ${result.activation.toolCount}`);
305
308
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-mcp-smart-proxy",
3
- "version": "1.5.18",
3
+ "version": "1.5.19",
4
4
  "description": "Smart proxy for Cloudflare MCP - routes tools to cloud or local execution",
5
5
  "repository": {
6
6
  "type": "git",
@@ -276,18 +276,25 @@ export function resolveCodexAppServerSocket({
276
276
  homeDir = os.homedir(),
277
277
  codexHome = '',
278
278
  socketPath = '',
279
- runtimeDir = process.env.XDG_RUNTIME_DIR || '',
280
- pathExists = fs.existsSync
279
+ runtimeDir = process.env.XDG_RUNTIME_DIR || ''
281
280
  } = {}) {
282
281
  const explicitSocketPath = socketPath || process.env.CODEX_APP_SERVER_SOCKET || '';
283
282
  if (explicitSocketPath) return path.resolve(explicitSocketPath);
284
283
  if (runtimeDir) return path.join(path.resolve(runtimeDir), 'codex', 'app-server.sock');
285
284
  const resolvedCodexHome = codexHome || process.env.CODEX_HOME || path.join(homeDir, '.codex');
286
- const ipcSocketPath = path.join(path.resolve(resolvedCodexHome), 'ipc', 'ipc.sock');
287
- if (pathExists(ipcSocketPath)) return ipcSocketPath;
288
285
  return path.join(resolvedCodexHome, 'app-server-control', 'app-server-control.sock');
289
286
  }
290
287
 
288
+ function assertCodexAppServerSocket({ socketPath, homeDir, codexHome }) {
289
+ const resolvedCodexHome = codexHome || process.env.CODEX_HOME || path.join(homeDir, '.codex');
290
+ const chatGptIpcSocket = path.join(path.resolve(resolvedCodexHome), 'ipc', 'ipc.sock');
291
+ if (path.resolve(socketPath) === chatGptIpcSocket) {
292
+ throw new Error(
293
+ `Refusing ChatGPT IPC socket as a Codex app-server endpoint: socket=${socketPath}`
294
+ );
295
+ }
296
+ }
297
+
291
298
  function assertIsolatedSocketPath({ socketPath, homeDir, codexHome, isolationMode }) {
292
299
  if (!isolationMode) return;
293
300
  const resolvedCodexHome = codexHome || process.env.CODEX_HOME || path.join(homeDir, '.codex');
@@ -454,6 +461,11 @@ export async function reloadCodexMcpServer({
454
461
  socketPath,
455
462
  runtimeDir
456
463
  });
464
+ assertCodexAppServerSocket({
465
+ socketPath: resolvedSocketPath,
466
+ homeDir,
467
+ codexHome
468
+ });
457
469
  assertIsolatedSocketPath({
458
470
  socketPath: resolvedSocketPath,
459
471
  homeDir,
@@ -461,11 +473,26 @@ export async function reloadCodexMcpServer({
461
473
  isolationMode
462
474
  });
463
475
  if (!rpcClient && !fs.existsSync(resolvedSocketPath)) {
476
+ const resolvedConfigPath = configPath
477
+ || path.join(path.resolve(codexHome || path.join(homeDir, '.codex')), 'config.toml');
478
+ const probeResult = toolProbe
479
+ ? await toolProbe({ serverName, configPath: resolvedConfigPath, timeoutMs })
480
+ : (fs.existsSync(resolvedConfigPath)
481
+ ? await probeCodexMcpServer({
482
+ configPath: resolvedConfigPath,
483
+ serverName,
484
+ timeoutMs
485
+ })
486
+ : null);
464
487
  return {
465
488
  status: 'next_start',
489
+ reason: 'app_server_control_unavailable',
466
490
  serverName,
467
491
  socketPath: resolvedSocketPath,
468
- toolCount: null
492
+ toolCount: Number.isInteger(probeResult?.toolCount) ? probeResult.toolCount : null,
493
+ workspaceId: probeResult?.workspaceId || null,
494
+ workspaceRoot: probeResult?.workspaceRoot || null,
495
+ workspaceResolution: probeResult?.workspaceResolution || null
469
496
  };
470
497
  }
471
498