diff --git a/package-lock.json b/package-lock.json index 39b18d35..9c64924e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.44", "license": "Apache-2.0", "dependencies": { - "@agentclientprotocol/sdk": "^0.21.0", + "@agentclientprotocol/sdk": "^0.22.1", "@openai/codex": "^0.128.0", "diff": "^8.0.3", "open": "^11.0.0", @@ -28,9 +28,9 @@ } }, "node_modules/@agentclientprotocol/sdk": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-0.21.0.tgz", - "integrity": "sha512-ONj+Q8qOdNQp5XbH5jnMwzT9IKZJsSN0p0lkceS4GtUtNOPVLpNzSS8gqQdGMKfBvA0ESbkL8BTaSN1Rc9miEw==", + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-0.22.1.tgz", + "integrity": "sha512-DfqXtl/8gO9NImq094MTaCXEU2vkhh6v7q/kT+9UjZxUqj8hYaya2OjLVIqn16MzNHcXEpShTR2RIauLSYeDQQ==", "license": "Apache-2.0", "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" diff --git a/package.json b/package.json index 09ae5b96..9c35aa89 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "vitest": "^4.0.10" }, "dependencies": { - "@agentclientprotocol/sdk": "^0.21.0", + "@agentclientprotocol/sdk": "^0.22.1", "@openai/codex": "^0.128.0", "diff": "^8.0.3", "open": "^11.0.0", diff --git a/src/CodexAcpClient.ts b/src/CodexAcpClient.ts index 9f478110..4cc759b4 100644 --- a/src/CodexAcpClient.ts +++ b/src/CodexAcpClient.ts @@ -332,12 +332,16 @@ export class CodexAcpClient { */ private createMcpSeverConfig(mcpServer: McpServer): JsonObject { if ("type" in mcpServer) { - if (mcpServer.type == "sse") { - throw RequestError.invalidRequest("Codex doesn't support MCP SSE transport protocol") - } - return { - "url": mcpServer.url, - "http_headers": Object.fromEntries(mcpServer.headers.map(h => [h.name, h.value])), + switch (mcpServer.type) { + case "acp": + throw RequestError.invalidRequest("Codex doesn't support MCP ACP transport protocol") + case "sse": + throw RequestError.invalidRequest("Codex doesn't support MCP SSE transport protocol") + case "http": + return { + "url": mcpServer.url, + "http_headers": Object.fromEntries(mcpServer.headers.map(h => [h.name, h.value])), + } } } return { diff --git a/src/CodexAcpServer.ts b/src/CodexAcpServer.ts index 38b93d40..dbf05a91 100644 --- a/src/CodexAcpServer.ts +++ b/src/CodexAcpServer.ts @@ -113,6 +113,7 @@ export class CodexAcpServer implements acp.Agent { list: { } }, mcpCapabilities: { + acp: false, http: true, sse: false } diff --git a/src/__tests__/CodexACPAgent/initialize.test.ts b/src/__tests__/CodexACPAgent/initialize.test.ts index 372fee82..f9cf3f2e 100644 --- a/src/__tests__/CodexACPAgent/initialize.test.ts +++ b/src/__tests__/CodexACPAgent/initialize.test.ts @@ -44,6 +44,7 @@ describe('CodexACPAgent - initialize', () => { list: {}, }, mcpCapabilities: { + acp: false, http: true, sse: false, },