()
| 608 | * Use this when dynamic skills are added to invalidate cached command lists. |
| 609 | */ |
| 610 | export function clearCommandMemoizationCaches(): void { |
| 611 | loadAllCommands.cache?.clear?.() |
| 612 | getSkillToolCommands.cache?.clear?.() |
| 613 | getSlashCommandToolSkills.cache?.clear?.() |
| 614 | // getSkillIndex in skillSearch/localSearch.ts is a separate memoization layer |
| 615 | // built ON TOP of getSkillToolCommands/getCommands. Clearing only the inner |
| 616 | // caches is a no-op for the outer — lodash memoize returns the cached result |
| 617 | // without ever reaching the cleared inners. Must clear it explicitly. |
| 618 | clearSkillIndexCache?.() |
| 619 | } |
| 620 | |
| 621 | export function clearCommandsCache(): void { |
| 622 | clearCommandMemoizationCaches() |
no test coverage detected