mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-17 05:20:23 -07:00
refactoring continued
This commit is contained in:
@@ -11,9 +11,15 @@ import type { ContextEnvironment } from './environment.js';
|
||||
import type { ContextEventBus } from '../eventBus.js';
|
||||
|
||||
import { ContextTokenCalculator } from '../utils/contextTokenCalculator.js';
|
||||
import type { IFileSystem } from '../system/IFileSystem.js';
|
||||
import { NodeFileSystem } from '../system/NodeFileSystem.js';
|
||||
import type { IIdGenerator } from '../system/IIdGenerator.js';
|
||||
import { NodeIdGenerator } from '../system/NodeIdGenerator.js';
|
||||
|
||||
export class ContextEnvironmentImpl implements ContextEnvironment {
|
||||
public readonly tokenCalculator: ContextTokenCalculator;
|
||||
public readonly fileSystem: IFileSystem;
|
||||
public readonly idGenerator: IIdGenerator;
|
||||
|
||||
constructor(
|
||||
public readonly llmClient: BaseLlmClient,
|
||||
@@ -24,7 +30,11 @@ export class ContextEnvironmentImpl implements ContextEnvironment {
|
||||
public readonly tracer: ContextTracer,
|
||||
public readonly charsPerToken: number,
|
||||
public readonly eventBus: ContextEventBus,
|
||||
fileSystem?: IFileSystem,
|
||||
idGenerator?: IIdGenerator,
|
||||
) {
|
||||
this.tokenCalculator = new ContextTokenCalculator(this.charsPerToken);
|
||||
this.fileSystem = fileSystem || new NodeFileSystem();
|
||||
this.idGenerator = idGenerator || new NodeIdGenerator();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user