( candidates: string[], )
| 49 | * @internal Exported for testing |
| 50 | */ |
| 51 | export 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 | |
| 62 | export type RunState = { |
| 63 | sessionState?: SessionState |
no outgoing calls
no test coverage detected