cito-mcp 0.3.3 → 0.3.5
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 +33 -14
- package/dist/tools/match.js +19 -2
- package/package.json +1 -1
package/dist/tools/live.js
CHANGED
|
@@ -504,20 +504,17 @@ 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
|
-
'Use call_api GET /tennis/tournaments/calendar?year=YYYY for the season schedule',
|
|
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
|
+
// hours / from / to applied client-side after fetch (below) — not warned as ignored.
|
|
521
518
|
}
|
|
522
519
|
const res = await fetchJson(ctx, path, { query });
|
|
523
520
|
if (!res.ok) {
|
|
@@ -598,6 +595,28 @@ Example: { "game": "lol", "hours": 72, "team": "t1", "limit": 20 }`,
|
|
|
598
595
|
}
|
|
599
596
|
}
|
|
600
597
|
}
|
|
598
|
+
// Tennis: client-side hours / from / to window (fixtures list has no time params)
|
|
599
|
+
if (game === 'tennis' && (args.hours !== undefined || from || to)) {
|
|
600
|
+
const now = Date.now();
|
|
601
|
+
const fromMs = from ? Date.parse(from) : now;
|
|
602
|
+
const toMs = to ? Date.parse(to) : now + hours * 3600_000;
|
|
603
|
+
if (Number.isFinite(fromMs) && Number.isFinite(toMs)) {
|
|
604
|
+
const before = rows.length;
|
|
605
|
+
rows = rows.filter((row) => {
|
|
606
|
+
const r = asRecord(row) ?? {};
|
|
607
|
+
const ts = pickString(r.startTime, r.start_time, r.startsAt);
|
|
608
|
+
if (!ts)
|
|
609
|
+
return true; // keep undated rows rather than drop them
|
|
610
|
+
const t = Date.parse(ts);
|
|
611
|
+
if (!Number.isFinite(t))
|
|
612
|
+
return true;
|
|
613
|
+
return t >= fromMs && t <= toMs;
|
|
614
|
+
});
|
|
615
|
+
if (before > 0 && rows.length === 0) {
|
|
616
|
+
warnings.push(`hours/from/to window matched 0 of ${before} tennis fixtures — widen hours or omit time filters`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
601
620
|
// Client-side team filter when API ignored it
|
|
602
621
|
if (team && (game === 'dota2' || game === 'cs2')) {
|
|
603
622
|
const t = team.toLowerCase();
|
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) {
|
package/package.json
CHANGED