Download projects/gemini-cli/packages/cli/src/zed-integration/fileSystemService.ts from LevelUp2x/adaptai: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/datasets/LevelUp2x/adaptai/resolve/2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/zed-integration/fileSystemService.ts
- Command line
-
hf download hf://datasets/LevelUp2x/adaptai@2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/zed-integration/fileSystemService.ts
-
curl -L -o fileSystemService.ts https://huggingface.co/datasets/LevelUp2x/adaptai/resolve/2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/zed-integration/fileSystemService.ts
1.19 kB
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import type { FileSystemService } from '@google/gemini-cli-core'; | |
| import type * as acp from './acp.js'; | |
| /** | |
| * ACP client-based implementation of FileSystemService | |
| */ | |
| export class AcpFileSystemService implements FileSystemService { | |
| constructor( | |
| private readonly client: acp.Client, | |
| private readonly sessionId: string, | |
| private readonly capabilities: acp.FileSystemCapability, | |
| private readonly fallback: FileSystemService, | |
| ) {} | |
| async readTextFile(filePath: string): Promise<string> { | |
| if (!this.capabilities.readTextFile) { | |
| return this.fallback.readTextFile(filePath); | |
| } | |
| const response = await this.client.readTextFile({ | |
| path: filePath, | |
| sessionId: this.sessionId, | |
| line: null, | |
| limit: null, | |
| }); | |
| return response.content; | |
| } | |
| async writeTextFile(filePath: string, content: string): Promise<void> { | |
| if (!this.capabilities.writeTextFile) { | |
| return this.fallback.writeTextFile(filePath, content); | |
| } | |
| await this.client.writeTextFile({ | |
| path: filePath, | |
| content, | |
| sessionId: this.sessionId, | |
| }); | |
| } | |
| } | |