@turns/dev 0.0.20 → 0.0.21
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/dist/agent-anchor.js +7 -1
- package/package.json +1 -1
package/dist/agent-anchor.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
3
4
|
import fs from 'node:fs';
|
|
4
5
|
import net from 'node:net';
|
|
5
6
|
import os from 'node:os';
|
|
@@ -598,7 +599,12 @@ class CodexAppServerTransport extends LineTransport {
|
|
|
598
599
|
asyncQuestionsSeen = new Set();
|
|
599
600
|
constructor(anchor) {
|
|
600
601
|
const profile = { command: 'codex' };
|
|
601
|
-
|
|
602
|
+
// Codex deep-merges CLI overrides with configured MCP servers. Reusing
|
|
603
|
+
// "turns" mixes our stdio command with a user's HTTP URL and prevents even
|
|
604
|
+
// thread/start from loading its config. Keep the helper stable per anchor,
|
|
605
|
+
// but outside user-configured names, without rewriting their config.
|
|
606
|
+
const mcpName = `turns_anchor_${createHash('sha256').update(socketPath).digest('hex').slice(0, 12)}`;
|
|
607
|
+
const mcp = `mcp_servers.${mcpName}={command=${JSON.stringify(process.execPath)},args=[${JSON.stringify(questionMcpPath)}],env={TURNS_AGENT_ANCHOR_SOCKET=${JSON.stringify(socketPath)}}}`;
|
|
602
608
|
super(anchor, 'app-server', resolveHarnessCommand('codex', profile), ['-c', mcp, 'app-server', '--listen', 'stdio://'], anchor.cwd);
|
|
603
609
|
this.threadId = anchor.agentSessionId;
|
|
604
610
|
this.permissionMode = anchor.permissionMode;
|