torrentclaw-mcp/tests/formatters
Deivid Soto bf459740fe feat: add response cache and compact output mode
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.
2026-02-09 17:57:11 +01:00
..
content.test.ts feat: add response cache and compact output mode 2026-02-09 17:57:11 +01:00
credits.test.ts feat: initial release of torrentclaw-mcp server 2026-02-09 17:26:23 +01:00
providers.test.ts feat: initial release of torrentclaw-mcp server 2026-02-09 17:26:23 +01:00