diff options
| author | Allen Hutchison <[email protected]> | 2025-05-31 12:49:28 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-31 12:49:28 -0700 |
| commit | 53bf77849760593cc9c1af9a4fb110a1a74acc4f (patch) | |
| tree | c188b0fa9c295faa198b65d80143491858c18048 /packages/core/src/tools/memoryTool.ts | |
| parent | cbc1614b8441dc3dcf35cf4f2e6b3c3457045fcb (diff) | |
feat: allow custom filename for context files (#654)
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'packages/core/src/tools/memoryTool.ts')
| -rw-r--r-- | packages/core/src/tools/memoryTool.ts | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/core/src/tools/memoryTool.ts b/packages/core/src/tools/memoryTool.ts index 49dce59d..a0c62eae 100644 --- a/packages/core/src/tools/memoryTool.ts +++ b/packages/core/src/tools/memoryTool.ts @@ -46,15 +46,29 @@ Do NOT use this tool: `; export const GEMINI_CONFIG_DIR = '.gemini'; -export const GEMINI_MD_FILENAME = 'GEMINI.md'; +export const DEFAULT_CONTEXT_FILENAME = 'GEMINI.md'; export const MEMORY_SECTION_HEADER = '## Gemini Added Memories'; +// This variable will hold the currently configured filename for GEMINI.md context files. +// It defaults to DEFAULT_CONTEXT_FILENAME but can be overridden by setGeminiMdFilename. +let currentGeminiMdFilename = DEFAULT_CONTEXT_FILENAME; + +export function setGeminiMdFilename(newFilename: string): void { + if (newFilename && newFilename.trim() !== '') { + currentGeminiMdFilename = newFilename.trim(); + } +} + +export function getCurrentGeminiMdFilename(): string { + return currentGeminiMdFilename; +} + interface SaveMemoryParams { fact: string; } function getGlobalMemoryFilePath(): string { - return path.join(homedir(), GEMINI_CONFIG_DIR, GEMINI_MD_FILENAME); + return path.join(homedir(), GEMINI_CONFIG_DIR, getCurrentGeminiMdFilename()); } /** |
