Skip to content

feat(feeds): Live Tennis API feed + read-only /tennis skill (vendor-authored) - #64

Open
bensynapse wants to merge 1 commit into
alsk1992:mainfrom
bensynapse:feed/livetennis
Open

feat(feeds): Live Tennis API feed + read-only /tennis skill (vendor-authored)#64
bensynapse wants to merge 1 commit into
alsk1992:mainfrom
bensynapse:feed/livetennis

Conversation

@bensynapse

Copy link
Copy Markdown

Vendor disclosure up front: I run the Live Tennis API (livetennisapi.com), so this feed is vendor-authored — judge accordingly. Everything below follows the repo's documented feed pattern and ships with tests; nothing requires a paid plan.

What this adds

A new sports data feed + read-only skill, built per the "To add a new feed" instructions in src/feeds/descriptors.ts and modeled on the weather-nws feed (an existing non-venue ground-truth feed):

  • src/feeds/livetennis/index.ts — live scores, upcoming matches, scheduled fixtures, and player lookup (bio + the player's own current ranking) across ATP / WTA / Challenger / ITF / junior Grand Slams. Same EventEmitter-factory shape as createNWSFeed.
  • Descriptor + registration in src/feeds/descriptors.ts under a new SPORTS DATA section: category sports, FeedCapability.SPORTS, connectionType: 'polling', requiredEnv: ['LIVETENNIS_API_KEY'] — so it shows up in /feeds list with the usual ready/missing-env handling.
  • /tennis skill (src/skills/bundled/livetennis/) — live | upcoming | fixtures | player | match, wired into SKILL_MANIFEST, skill/command categories, and docs/SKILLS_CATALOG.md (counts bumped 119 → 120 everywhere they're stated). Read-only market context: it places no orders.
  • .env.exampleLIVETENNIS_API_KEY with the free-key link.
  • tests/unit/feeds/livetennis.test.ts — unit tests for the pure logic (break-point derivation + response mapping), no network.

Why it fits: Polymarket, Kalshi and Betfair all list tennis match-winner markets, and CloddsBot already ingests non-venue ground truth (weather, FRED, ACLED, news) to inform market decisions. A live tennis match-state feed is the same shape — the score object says who's serving, the set/game state, and whether the current point is a break point (derived: receiver at AD, or receiver at 40 with the server at 0/15/30; never during tiebreaks).

Honest tier statement

The feed uses the free keyed tier only: live scores, upcoming matches, fixtures, players — 30 requests/minute, 100 requests/day, no card required (https://livetennisapi.com/subscribe/free). That quota suits develop-and-test or ~15-minute-cadence checks, not continuous fast polling, so the feed carries an in-process TTL cache (live 60s / fixtures 10m / players 1h) to keep agent chatter from burning the daily quota. Historical results, market prices and the WebSocket stream are paid endpoints and are deliberately not exposed here. Docs: https://docs.livetennisapi.com

Checks

  • npm run typecheck — clean
  • npm test — 135/135 pass (11 of those are the new livetennis tests)
  • npm run build — green; dist/feeds/livetennis + dist/skills/bundled/livetennis (incl. SKILL.md copy) produced

Happy to adjust naming, category placement, or drop the skill and keep just the feed if you'd rather keep the surface smaller.

New sports data feed following the documented pattern in
src/feeds/descriptors.ts (feed module -> descriptor -> registry.register),
modeled on the weather-nws feed:

- src/feeds/livetennis/index.ts: live scores, upcoming matches, fixtures,
  and player lookup from the Live Tennis API free keyed tier, with an
  in-process TTL cache (live 60s / fixtures 10m / players 1h) sized to the
  free tier's honest limits (30 req/min, 100 req/day) so agent chatter
  doesn't burn the daily quota. Break points are derived from the score
  (receiver at AD, or at 40 vs server 0/15/30; never in tiebreaks).
- Descriptor registered under a new SPORTS DATA section (category 'sports',
  FeedCapability.SPORTS, requiredEnv LIVETENNIS_API_KEY).
- src/skills/bundled/livetennis: read-only /tennis skill (live, upcoming,
  fixtures, player, match) as match-state ground truth for tennis event
  markets; wired into SKILL_MANIFEST, skill categories, command categories,
  and docs/SKILLS_CATALOG.md (skill counts bumped 119 -> 120).
- .env.example: LIVETENNIS_API_KEY with the free-key link.
- tests/unit/feeds/livetennis.test.ts: break-point derivation + response
  mapping unit tests (no network).

npm run ci passes: typecheck clean, 135/135 tests, build green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant