This commit introduces the hierarchical memory feature, allowing GEMI… (#327)

This commit is contained in:
Allen Hutchison
2025-05-14 12:37:17 -07:00
committed by GitHub
parent 1fa40405ea
commit 1245fe4885
16 changed files with 2047 additions and 73 deletions

View File

@@ -36,6 +36,7 @@ export class Config {
private readonly toolCallCommand: string | undefined,
private readonly mcpServerCommand: string | undefined,
private readonly userAgent: string,
private userMemory: string = '', // Made mutable for refresh
) {
// toolRegistry still needs initialization based on the instance
this.toolRegistry = createToolRegistry(this);
@@ -87,6 +88,15 @@ export class Config {
getUserAgent(): string {
return this.userAgent;
}
// Added getter for userMemory
getUserMemory(): string {
return this.userMemory;
}
setUserMemory(newUserMemory: string): void {
this.userMemory = newUserMemory;
}
}
function findEnvFile(startDir: string): string | null {
@@ -129,6 +139,7 @@ export function createServerConfig(
toolCallCommand?: string,
mcpServerCommand?: string,
userAgent?: string,
userMemory?: string, // Added userMemory parameter
): Config {
return new Config(
apiKey,
@@ -142,6 +153,7 @@ export function createServerConfig(
toolCallCommand,
mcpServerCommand,
userAgent ?? 'GeminiCLI/unknown', // Default user agent
userMemory ?? '', // Pass userMemory, default to empty string
);
}