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