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

Function selectHighestPriorityKnowledgeFile

sdk/src/run-state.ts:51–60  ·  view source on GitHub ↗
(
  candidates: string[],
)

Source from the content-addressed store, hash-verified

49 * @internal Exported for testing
50 */
51export function selectHighestPriorityKnowledgeFile(
52 candidates: string[],
53): string | undefined {
54 // Loop through priorities and find the first match directly
55 for (const priorityName of KNOWLEDGE_FILE_NAMES_LOWERCASE) {
56 const match = candidates.find((f) => f.toLowerCase().endsWith(priorityName))
57 if (match) return match
58 }
59 return undefined
60}
61
62export type RunState = {
63 sessionState?: SessionState

Calls

no outgoing calls

Tested by

no test coverage detected