# Changelog

All notable changes to `pi-news-api` are documented here.

## Unreleased

### Added
- Agent-callable `news_get_latest`, `news_search`, and `news_configure` tools
  for natural-language headline retrieval, keyword search, and explicit
  category/language changes.
- Structured tool results with source URLs, descriptions, authors, published
  timestamps, categories, quota metadata, and untrusted-content guidance.
- Local topic-interest tracking from successful command and tool searches,
  recency-decayed category inference, and quota-neutral personalized briefing
  ranking.
- `/news_interests [on|off|clear]` and matching `news_configure` actions to
  inspect, pause, resume, or erase the local interest profile.

### Fixed
- Use a plan-safe Currents `page_size` of 20 for latest-news and search requests
  instead of values rejected by free-tier accounts with `400 Bad request`.
- Deduplicate articles without upstream IDs using a stable title-based fallback
  instead of an array-position-dependent identifier.

## 0.1.0 - 2026-07-12

### Added
- Initial release: Pi header widget, category manager, keyword search, and
  deep-dive handoff built on the Currents News API v2 endpoints.
- `/news_menu`, `/news_refresh`, `/news_categories`, `/news_enable`,
  `/news_disable`, `/news_search`, and `/news_language` commands.
- Category toggle list based on Currents' canonical 16-category taxonomy,
  with `general`, `politics_government`, and `science_technology` enabled by
  default.
- Single-request `/v2/latest-news` fetch across all enabled categories to
  conserve the free-tier daily quota.
- `/v2/search` keyword search independent of the category toggle list.
- Rate-limit header parsing (`X-RateLimit-Remaining`, `X-RateLimit-Limit`)
  surfaced through `/news_refresh`.
- Explicit widget and command messaging when `CURRENTS_API_KEY` is missing,
  invalid, or quota-exceeded.
- Category/language persistence in `~/.config/pi-news-api/config.json`, with
  legacy Pi session-branch entries used only for migration/fallback.
- Width-aware widget rendering with an ephemeral 60-second countdown banner
  that clears itself on active agent runs.
- Non-network test coverage for article normalization, category matching,
  widget formatting, rate-limit parsing, and package metadata.
