Add UI memory indicator. (#348)

Co-authored-by: Gregory Shikhman <shikhman@google.com>
This commit is contained in:
Allen Hutchison
2025-05-14 15:19:45 -07:00
committed by GitHub
parent 521708e294
commit 89aa1cad41
3 changed files with 58 additions and 23 deletions

View File

@@ -37,6 +37,7 @@ export class Config {
private readonly mcpServerCommand: string | undefined,
private readonly userAgent: string,
private userMemory: string = '', // Made mutable for refresh
private geminiMdFileCount: number = 0,
) {
// toolRegistry still needs initialization based on the instance
this.toolRegistry = createToolRegistry(this);
@@ -89,7 +90,6 @@ export class Config {
return this.userAgent;
}
// Added getter for userMemory
getUserMemory(): string {
return this.userMemory;
}
@@ -97,6 +97,14 @@ export class Config {
setUserMemory(newUserMemory: string): void {
this.userMemory = newUserMemory;
}
getGeminiMdFileCount(): number {
return this.geminiMdFileCount;
}
setGeminiMdFileCount(count: number): void {
this.geminiMdFileCount = count;
}
}
function findEnvFile(startDir: string): string | null {
@@ -139,7 +147,8 @@ export function createServerConfig(
toolCallCommand?: string,
mcpServerCommand?: string,
userAgent?: string,
userMemory?: string, // Added userMemory parameter
userMemory?: string,
geminiMdFileCount?: number,
): Config {
return new Config(
apiKey,
@@ -153,7 +162,8 @@ export function createServerConfig(
toolCallCommand,
mcpServerCommand,
userAgent ?? 'GeminiCLI/unknown', // Default user agent
userMemory ?? '', // Pass userMemory, default to empty string
userMemory ?? '',
geminiMdFileCount ?? 0,
);
}