Use official ACP SDK and support HTTP/SSE based MCP servers (#13856)

This commit is contained in:
Steffen Deusch
2025-12-17 00:28:27 +01:00
committed by GitHub
parent cc52839f19
commit ba100642e3
11 changed files with 120 additions and 1420 deletions

View File

@@ -5,14 +5,14 @@
*/
import type { FileSystemService } from '@google/gemini-cli-core';
import type * as acp from './acp.js';
import type * as acp from '@agentclientprotocol/sdk';
/**
* ACP client-based implementation of FileSystemService
*/
export class AcpFileSystemService implements FileSystemService {
constructor(
private readonly client: acp.Client,
private readonly connection: acp.AgentSideConnection,
private readonly sessionId: string,
private readonly capabilities: acp.FileSystemCapability,
private readonly fallback: FileSystemService,
@@ -23,11 +23,9 @@ export class AcpFileSystemService implements FileSystemService {
return this.fallback.readTextFile(filePath);
}
const response = await this.client.readTextFile({
const response = await this.connection.readTextFile({
path: filePath,
sessionId: this.sessionId,
line: null,
limit: null,
});
return response.content;
@@ -38,7 +36,7 @@ export class AcpFileSystemService implements FileSystemService {
return this.fallback.writeTextFile(filePath, content);
}
await this.client.writeTextFile({
await this.connection.writeTextFile({
path: filePath,
content,
sessionId: this.sessionId,