diff options
| author | Allen Hutchison <[email protected]> | 2025-05-14 15:19:45 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-14 15:19:45 -0700 |
| commit | 89aa1cad41eefc4e1e7e4b3cb9d4a495707dd33e (patch) | |
| tree | e99ffa87ae546fee6f5bc95249f1923564d3f1b4 /packages/cli/src/config/config.ts | |
| parent | 521708e294fe7eb16683d137e46aa36be4b9ddf5 (diff) | |
Add UI memory indicator. (#348)
Co-authored-by: Gregory Shikhman <[email protected]>
Diffstat (limited to 'packages/cli/src/config/config.ts')
| -rw-r--r-- | packages/cli/src/config/config.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index 7e564ee2..c8a2b0ef 100644 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -324,7 +324,7 @@ function concatenateInstructions( export async function loadHierarchicalGeminiMemory( currentWorkingDirectory: string, debugMode: boolean, -): Promise<string> { +): Promise<{ memoryContent: string; fileCount: number }> { if (debugMode) logger.debug( `Loading hierarchical memory for CWD: ${currentWorkingDirectory}`, @@ -337,7 +337,7 @@ export async function loadHierarchicalGeminiMemory( ); if (filePaths.length === 0) { if (debugMode) logger.debug('No GEMINI.md files found in hierarchy.'); - return ''; + return { memoryContent: '', fileCount: 0 }; } const contentsWithPaths = await readGeminiMdFiles(filePaths, debugMode); const combinedInstructions = concatenateInstructions(contentsWithPaths); @@ -349,7 +349,7 @@ export async function loadHierarchicalGeminiMemory( logger.debug( `Combined instructions (snippet): ${combinedInstructions.substring(0, 500)}...`, ); - return combinedInstructions; + return { memoryContent: combinedInstructions, fileCount: filePaths.length }; } export async function loadCliConfig(settings: Settings): Promise<Config> { @@ -368,7 +368,7 @@ export async function loadCliConfig(settings: Settings): Promise<Config> { const argv = await parseArguments(); const debugMode = argv.debug_mode || false; - const userMemory = await loadHierarchicalGeminiMemory( + const { memoryContent, fileCount } = await loadHierarchicalGeminiMemory( process.cwd(), debugMode, ); @@ -388,7 +388,8 @@ export async function loadCliConfig(settings: Settings): Promise<Config> { settings.toolCallCommand, settings.mcpServerCommand, userAgent, - userMemory, + memoryContent, + fileCount, ); } |
