MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / deriveKnowledgeFiles

Function deriveKnowledgeFiles

sdk/src/run-state.ts:442–453  ·  view source on GitHub ↗

* 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>,
)

Source from the content-addressed store, hash-verified

440 * Implements fallback priority: knowledge.md > AGENTS.md > CLAUDE.md per directory.
441 */
442function 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
455async function loadKnowledgeFilesFromPaths(params: {
456 cwd: string

Callers 2

initialSessionStateFunction · 0.85

Calls 1

selectKnowledgeFilePathsFunction · 0.85

Tested by

no test coverage detected