Response cache (api-client.ts):
- In-memory TTL cache (5 min default) avoids duplicate API calls
when LLMs repeat the same tool call within a conversation.
- Cache key = full URL with params; only 200 OK responses are cached.
- Exposed via client.cache for manual clear() if needed.
- Configurable TTL via TorrentClawClient constructor.
Compact mode (search_content tool):
- New compact boolean parameter (default: false).
- When true, magnet links use short form magnet:?xt=urn:btih:{hash}
(~60 chars) instead of full magnets with trackers (~300 chars).
- Short magnets are still valid and clickable (DHT peer discovery).
- Also generates a magnet from info_hash even when API returns null.
- Saves ~10K chars per typical search (5 torrents x 10 results).
Tests: 100 total (15 new), all passing.
|
||
|---|---|---|
| .. | ||
| content.test.ts | ||
| credits.test.ts | ||
| providers.test.ts | ||