()
| 521 | * Use this when dynamic skills are added to invalidate cached command lists. |
| 522 | */ |
| 523 | export function clearCommandMemoizationCaches(): void { |
| 524 | loadAllCommands.cache?.clear?.() |
| 525 | getSkillToolCommands.cache?.clear?.() |
| 526 | getSlashCommandToolSkills.cache?.clear?.() |
| 527 | // getSkillIndex in skillSearch/localSearch.ts is a separate memoization layer |
| 528 | // built ON TOP of getSkillToolCommands/getCommands. Clearing only the inner |
| 529 | // caches is a no-op for the outer — lodash memoize returns the cached result |
| 530 | // without ever reaching the cleared inners. Must clear it explicitly. |
| 531 | clearSkillIndexCache?.() |
| 532 | } |
| 533 | |
| 534 | export function clearCommandsCache(): void { |
| 535 | clearCommandMemoizationCaches() |
no test coverage detected