cloudflare-mcp-smart-proxy 1.5.17 → 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 +3 -0
- package/package.json +1 -1
- package/src/codex-app-server.js +31 -1
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
package/src/codex-app-server.js
CHANGED
|
@@ -285,6 +285,16 @@ export function resolveCodexAppServerSocket({
|
|
|
285
285
|
return path.join(resolvedCodexHome, 'app-server-control', 'app-server-control.sock');
|
|
286
286
|
}
|
|
287
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
|
+
|
|
288
298
|
function assertIsolatedSocketPath({ socketPath, homeDir, codexHome, isolationMode }) {
|
|
289
299
|
if (!isolationMode) return;
|
|
290
300
|
const resolvedCodexHome = codexHome || process.env.CODEX_HOME || path.join(homeDir, '.codex');
|
|
@@ -451,6 +461,11 @@ export async function reloadCodexMcpServer({
|
|
|
451
461
|
socketPath,
|
|
452
462
|
runtimeDir
|
|
453
463
|
});
|
|
464
|
+
assertCodexAppServerSocket({
|
|
465
|
+
socketPath: resolvedSocketPath,
|
|
466
|
+
homeDir,
|
|
467
|
+
codexHome
|
|
468
|
+
});
|
|
454
469
|
assertIsolatedSocketPath({
|
|
455
470
|
socketPath: resolvedSocketPath,
|
|
456
471
|
homeDir,
|
|
@@ -458,11 +473,26 @@ export async function reloadCodexMcpServer({
|
|
|
458
473
|
isolationMode
|
|
459
474
|
});
|
|
460
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);
|
|
461
487
|
return {
|
|
462
488
|
status: 'next_start',
|
|
489
|
+
reason: 'app_server_control_unavailable',
|
|
463
490
|
serverName,
|
|
464
491
|
socketPath: resolvedSocketPath,
|
|
465
|
-
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
|
|
466
496
|
};
|
|
467
497
|
}
|
|
468
498
|
|