feat: add StaleExpirationMap utility for TTL-based cache expiration

- Automatically removes entries not accessed within TTL
- Periodic cleanup with configurable interval
- Optional onExpire callback for cleanup notifications
- Refresh TTL on get (configurable)
- Touch, peek, getAge, getRemainingTtl methods
- Full iteration support
- Implements Disposable interface

Useful for caching ephemeral data like pending tool calls, subagent activity.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-28 04:41:49 +01:00
co-authored by Claude Opus 4.5
parent 63d2265316
commit 596098015f
3 changed files with 682 additions and 0 deletions
+1
View File
@@ -9,3 +9,4 @@
export { BufferAccumulator } from './buffer-accumulator.js';
export { LRUMap, type LRUMapOptions } from './lru-map.js';
export { CleanupManager, type TimerOptions } from './cleanup-manager.js';
export { StaleExpirationMap, type StaleExpirationMapOptions } from './stale-expiration-map.js';