* Auto-derives knowledge files from project files if knowledgeFiles is undefined. * Implements fallback priority: knowledge.md > AGENTS.md > CLAUDE.md per directory.
( projectFiles: Record<string, string>, )
| 440 | * Implements fallback priority: knowledge.md > AGENTS.md > CLAUDE.md per directory. |
| 441 | */ |
| 442 | function deriveKnowledgeFiles( |
| 443 | projectFiles: Record<string, string>, |
| 444 | ): Record<string, string> { |
| 445 | const allFilePaths = Object.keys(projectFiles) |
| 446 | const selectedFilePaths = selectKnowledgeFilePaths(allFilePaths) |
| 447 | |
| 448 | const knowledgeFiles: Record<string, string> = {} |
| 449 | for (const filePath of selectedFilePaths) { |
| 450 | knowledgeFiles[filePath] = projectFiles[filePath] |
| 451 | } |
| 452 | return knowledgeFiles |
| 453 | } |
| 454 | |
| 455 | async function loadKnowledgeFilesFromPaths(params: { |
| 456 | cwd: string |
no test coverage detected