diff options
| author | Niladri Das <[email protected]> | 2025-06-30 04:21:47 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-29 22:51:47 +0000 |
| commit | f848d3575822703e7cedb3ae987a0e7341b6b390 (patch) | |
| tree | 094512c57072c975248f138c4c1d8ce6fc91475e /packages/core/src/utils/memoryDiscovery.ts | |
| parent | ada4061a458c78c9241439e5a8cfa4893cb4ab5a (diff) | |
feat: modular GEMINI.md imports with @file.md syntax (#1585) (#2230)
Diffstat (limited to 'packages/core/src/utils/memoryDiscovery.ts')
| -rw-r--r-- | packages/core/src/utils/memoryDiscovery.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/core/src/utils/memoryDiscovery.ts b/packages/core/src/utils/memoryDiscovery.ts index 47d9f9a1..ab240ea8 100644 --- a/packages/core/src/utils/memoryDiscovery.ts +++ b/packages/core/src/utils/memoryDiscovery.ts @@ -14,6 +14,7 @@ import { getAllGeminiMdFilenames, } from '../tools/memoryTool.js'; import { FileDiscoveryService } from '../services/fileDiscoveryService.js'; +import { processImports } from './memoryImportProcessor.js'; // Simple console logger, similar to the one previously in CLI's config.ts // TODO: Integrate with a more robust server-side logger if available/appropriate. @@ -223,10 +224,18 @@ async function readGeminiMdFiles( for (const filePath of filePaths) { try { const content = await fs.readFile(filePath, 'utf-8'); - results.push({ filePath, content }); + + // Process imports in the content + const processedContent = await processImports( + content, + path.dirname(filePath), + debugMode, + ); + + results.push({ filePath, content: processedContent }); if (debugMode) logger.debug( - `Successfully read: ${filePath} (Length: ${content.length})`, + `Successfully read and processed imports: ${filePath} (Length: ${processedContent.length})`, ); } catch (error: unknown) { const isTestEnv = process.env.NODE_ENV === 'test' || process.env.VITEST; |
