Read and write files through Zed (#6169)

Co-authored-by: Agus Zubiaga <agus@zed.dev>
This commit is contained in:
Conrad Irwin
2025-08-18 16:29:45 -06:00
committed by GitHub
parent 4394b6ab4f
commit fb3ceb0da4
17 changed files with 268 additions and 50 deletions

View File

@@ -47,6 +47,10 @@ import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
import { MCPOAuthConfig } from '../mcp/oauth-provider.js';
import { IdeClient } from '../ide/ide-client.js';
import type { Content } from '@google/genai';
import {
FileSystemService,
StandardFileSystemService,
} from '../services/fileSystemService.js';
import { logCliConfiguration, logIdeConnection } from '../telemetry/loggers.js';
import { IdeConnectionEvent, IdeConnectionType } from '../telemetry/types.js';
@@ -204,6 +208,7 @@ export class Config {
private toolRegistry!: ToolRegistry;
private promptRegistry!: PromptRegistry;
private readonly sessionId: string;
private fileSystemService: FileSystemService;
private contentGeneratorConfig!: ContentGeneratorConfig;
private readonly embeddingModel: string;
private readonly sandbox: SandboxConfig | undefined;
@@ -268,6 +273,7 @@ export class Config {
this.sessionId = params.sessionId;
this.embeddingModel =
params.embeddingModel ?? DEFAULT_GEMINI_EMBEDDING_MODEL;
this.fileSystemService = new StandardFileSystemService();
this.sandbox = params.sandbox;
this.targetDir = path.resolve(params.targetDir);
this.workspaceContext = new WorkspaceContext(
@@ -700,6 +706,20 @@ export class Config {
return this.ideClient;
}
/**
* Get the current FileSystemService
*/
getFileSystemService(): FileSystemService {
return this.fileSystemService;
}
/**
* Set a custom FileSystemService
*/
setFileSystemService(fileSystemService: FileSystemService): void {
this.fileSystemService = fileSystemService;
}
getChatCompression(): ChatCompressionSettings | undefined {
return this.chatCompression;
}