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