()
| 24 | const CLEANUP_AGE_MS = 7 * 24 * 60 * 60 * 1000 // 7 days |
| 25 | |
| 26 | export function clearAllPluginCaches(): void { |
| 27 | clearPluginCache() |
| 28 | clearPluginCommandCache() |
| 29 | clearPluginAgentCache() |
| 30 | clearPluginHookCache() |
| 31 | // Prune hooks from plugins no longer in the enabled set so uninstalled/ |
| 32 | // disabled plugins stop firing immediately (gh-36995). Prune-only: hooks |
| 33 | // from newly-enabled plugins are NOT added here — they wait for |
| 34 | // /reload-plugins like commands/agents/MCP do. Fire-and-forget: old hooks |
| 35 | // stay valid until the prune completes (preserves gh-29767). No-op when |
| 36 | // STATE.registeredHooks is empty (test/preload.ts beforeEach clears it via |
| 37 | // resetStateForTests before reaching here). |
| 38 | pruneRemovedPluginHooks().catch(e => logError(e)) |
| 39 | clearPluginOptionsCache() |
| 40 | clearPluginOutputStyleCache() |
| 41 | clearAllOutputStylesCache() |
| 42 | } |
| 43 | |
| 44 | export function clearAllCaches(): void { |
| 45 | clearAllPluginCaches() |
no test coverage detected