cito-mcp 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/live.js +16 -14
- package/dist/tools/match.js +30 -2
- package/package.json +1 -1
package/dist/tools/live.js
CHANGED
|
@@ -504,20 +504,22 @@ Example: { "game": "lol", "hours": 72, "team": "t1", "limit": 20 }`,
|
|
|
504
504
|
noteIgnored('tournamentId', 'pass event slug via event_card instead');
|
|
505
505
|
}
|
|
506
506
|
else if (game === 'tennis') {
|
|
507
|
-
//
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
507
|
+
// Scheduled fixtures for ~3 days out; ids are stable across
|
|
508
|
+
// upcoming -> live -> finished (same s365_{gid} id-space).
|
|
509
|
+
path = '/tennis/matches/upcoming';
|
|
510
|
+
query = { limit: Math.min(500, Math.max(limit, 1)) };
|
|
511
|
+
if (league)
|
|
512
|
+
noteIgnored('league', 'tennis fixtures have no league filter; filter by tournament name client-side');
|
|
513
|
+
if (tournamentId)
|
|
514
|
+
noteIgnored('tournamentId', 'tennis fixtures have no tournamentId filter');
|
|
515
|
+
if (team)
|
|
516
|
+
noteIgnored('team', 'tennis fixtures have no team filter; match player names client-side');
|
|
517
|
+
if (args.hours !== undefined)
|
|
518
|
+
noteIgnored('hours', 'tennis fixtures cover ~3 days; filter by startTime client-side');
|
|
519
|
+
if (from)
|
|
520
|
+
noteIgnored('from', 'tennis fixtures cover ~3 days; filter by startTime client-side');
|
|
521
|
+
if (to)
|
|
522
|
+
noteIgnored('to', 'tennis fixtures cover ~3 days; filter by startTime client-side');
|
|
521
523
|
}
|
|
522
524
|
const res = await fetchJson(ctx, path, { query });
|
|
523
525
|
if (!res.ok) {
|
package/dist/tools/match.js
CHANGED
|
@@ -36,8 +36,13 @@ function matchCore(game, matchId, raw) {
|
|
|
36
36
|
league: m.league,
|
|
37
37
|
method: pickString(r.method, r.resultMethod) ?? null,
|
|
38
38
|
winner: (() => {
|
|
39
|
-
//
|
|
40
|
-
|
|
39
|
+
// Never name a winner while play is in progress: the score fallback
|
|
40
|
+
// below reads "who is ahead", which mid-match is a lead, not a result.
|
|
41
|
+
if (m.status === 'live' || m.status === 'upcoming')
|
|
42
|
+
return null;
|
|
43
|
+
// UFC rows carry an explicit winner slug/fighter ref; tennis archive
|
|
44
|
+
// rows nest a winner object.
|
|
45
|
+
const explicit = pickString(r.winnerFighterSlug, r.winnerSlug, r.winner, asRecord(r.winner)?.id);
|
|
41
46
|
if (explicit)
|
|
42
47
|
return explicit;
|
|
43
48
|
if (game === 'ufc')
|
|
@@ -85,6 +90,18 @@ function matchCore(game, matchId, raw) {
|
|
|
85
90
|
};
|
|
86
91
|
})(),
|
|
87
92
|
rawStatus: pickString(r.status, r.state) ?? null,
|
|
93
|
+
// Point-level live state (tennis): current game score like "40-AD", which
|
|
94
|
+
// side is serving, and the set in progress. Absent for other games.
|
|
95
|
+
...(game === 'tennis' && (r.game_score || r.server)
|
|
96
|
+
? {
|
|
97
|
+
liveState: {
|
|
98
|
+
gameScore: pickString(r.game_score) ?? null,
|
|
99
|
+
server: typeof r.server === 'number' ? r.server : null,
|
|
100
|
+
currentSet: typeof r.current_set === 'number' ? r.current_set : null,
|
|
101
|
+
tiebreakScore: pickString(r.tiebreak_score) ?? null,
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
: {}),
|
|
88
105
|
};
|
|
89
106
|
}
|
|
90
107
|
function primaryPath(game, matchId) {
|
|
@@ -230,6 +247,17 @@ Example: { "game": "cs2", "matchId": "cs2-match-123", "view": "summary", "includ
|
|
|
230
247
|
upstreamCalls += 1;
|
|
231
248
|
rateLimit = { ...rateLimit, ...res.headers };
|
|
232
249
|
if (!res.ok) {
|
|
250
|
+
// Live tennis matches have no archive stats row yet, but the live
|
|
251
|
+
// detail payload (already fetched as `primary`) carries the full
|
|
252
|
+
// per-side stat block — serve that instead of a 404 partial.
|
|
253
|
+
if (game === 'tennis' && res.status === 404) {
|
|
254
|
+
const livePayload = asRecord(asRecord(primary.data)?.data) ?? asRecord(primary.data);
|
|
255
|
+
const liveStats = livePayload?.stats;
|
|
256
|
+
if (Array.isArray(liveStats) && liveStats.length) {
|
|
257
|
+
playerPerformances = liveStats;
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
233
261
|
partial.push(partialFromRejection('playerPerformances', {
|
|
234
262
|
code: mapHttpToCode(res.status),
|
|
235
263
|
message: `player stats HTTP ${res.status}`,
|
package/package.json
CHANGED