diff options
| author | matt korwel <[email protected]> | 2025-06-11 13:34:35 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-11 20:34:35 +0000 |
| commit | 4160d904da8328eb7168b5b652d4c0f17682546c (patch) | |
| tree | d73968337c4b1f241ab2165f40bafe7fbbd6cea8 /packages/core/src/utils/memoryDiscovery.ts | |
| parent | 24c61147b839b3173fa1ad79781f3c4c0f4144fa (diff) | |
Extensibility: Gemini.md files (#944)
Diffstat (limited to 'packages/core/src/utils/memoryDiscovery.ts')
| -rw-r--r-- | packages/core/src/utils/memoryDiscovery.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/core/src/utils/memoryDiscovery.ts b/packages/core/src/utils/memoryDiscovery.ts index 6e822145..07649415 100644 --- a/packages/core/src/utils/memoryDiscovery.ts +++ b/packages/core/src/utils/memoryDiscovery.ts @@ -81,6 +81,7 @@ async function getGeminiMdFilePathsInternal( currentWorkingDirectory: string, userHomePath: string, debugMode: boolean, + extensionContextFilePaths: string[] = [], ): Promise<string[]> { const resolvedCwd = path.resolve(currentWorkingDirectory); const resolvedHome = path.resolve(userHomePath); @@ -195,6 +196,13 @@ async function getGeminiMdFilePathsInternal( } } + // Add extension context file paths + for (const extensionPath of extensionContextFilePaths) { + if (!paths.includes(extensionPath)) { + paths.push(extensionPath); + } + } + if (debugMode) logger.debug( `Final ordered ${getCurrentGeminiMdFilename()} paths to read: ${JSON.stringify(paths)}`, @@ -258,6 +266,7 @@ function concatenateInstructions( export async function loadServerHierarchicalMemory( currentWorkingDirectory: string, debugMode: boolean, + extensionContextFilePaths: string[] = [], ): Promise<{ memoryContent: string; fileCount: number }> { if (debugMode) logger.debug( @@ -270,6 +279,7 @@ export async function loadServerHierarchicalMemory( currentWorkingDirectory, userHomePath, debugMode, + extensionContextFilePaths, ); if (filePaths.length === 0) { if (debugMode) logger.debug('No GEMINI.md files found in hierarchy.'); |
