cito-mcp 0.3.6 → 0.3.8
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 +24 -6
- package/dist/tools/normalize.js +1 -1
- package/package.json +1 -1
package/dist/tools/live.js
CHANGED
|
@@ -634,14 +634,32 @@ Example: { "game": "lol", "hours": 72, "team": "t1", "limit": 20 }`,
|
|
|
634
634
|
if (team && (game === 'dota2' || game === 'cs2' || clientTeamFilter)) {
|
|
635
635
|
beforeTeamFilter = rows.length;
|
|
636
636
|
const t = team.toLowerCase();
|
|
637
|
-
|
|
637
|
+
// Exact identity first. A joined-substring match made "t1" hit "T1
|
|
638
|
+
// Esports Academy", so asking for T1 returned the academy's fixtures --
|
|
639
|
+
// a different team, quietly. Substring is still useful for partial names
|
|
640
|
+
// ("vitality"), so it stays as a fallback only when nothing matched
|
|
641
|
+
// exactly.
|
|
642
|
+
const sides = (row) => {
|
|
638
643
|
const m = normalizeMatch(game, row, 'upcoming');
|
|
639
|
-
|
|
644
|
+
return [m.team1, m.team2];
|
|
645
|
+
};
|
|
646
|
+
const exact = rows.filter((row) => sides(row).some((s) => [s?.id, s?.slug].filter(Boolean).some((v) => String(v).toLowerCase() === t)));
|
|
647
|
+
if (exact.length > 0) {
|
|
648
|
+
rows = exact;
|
|
649
|
+
}
|
|
650
|
+
else if (t.length <= 4) {
|
|
651
|
+
// A short term is an identifier, not a search phrase, so it is exact or
|
|
652
|
+
// nothing. T1 had no fixture in the window and the substring fallback
|
|
653
|
+
// answered with "T1 Esports Academy" (slugs t1a and t1-challengers) --
|
|
654
|
+
// a different team, presented as if it were the one asked for. An empty
|
|
655
|
+
// list is the correct answer here.
|
|
656
|
+
rows = [];
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
rows = rows.filter((row) => sides(row).some((s) => [s?.id, s?.slug, s?.name]
|
|
640
660
|
.filter(Boolean)
|
|
641
|
-
.
|
|
642
|
-
|
|
643
|
-
return hay.includes(t);
|
|
644
|
-
});
|
|
661
|
+
.some((v) => String(v).toLowerCase().includes(t))));
|
|
662
|
+
}
|
|
645
663
|
}
|
|
646
664
|
if (team && beforeTeamFilter > 0 && rows.length === 0) {
|
|
647
665
|
warnings.push(`team "${team}" matched 0 of ${beforeTeamFilter} upcoming fixtures in this window — widen hours or check the slug`);
|
package/dist/tools/normalize.js
CHANGED
|
@@ -280,7 +280,7 @@ export function normalizeMatch(game, row, forcedStatus) {
|
|
|
280
280
|
else if (/complete|finished|ended|final|closed|done|official|result/.test(statusRaw) || hasResult) {
|
|
281
281
|
status = 'completed';
|
|
282
282
|
}
|
|
283
|
-
else if (/upcoming|scheduled|
|
|
283
|
+
else if (/upcoming|scheduled|not_?started|unstarted|pending|soon|booked|confirmed|announced|tbd/.test(statusRaw) ||
|
|
284
284
|
(game === 'ufc' && !hasResult && (startTime || statusRaw === '' || statusRaw === 'unknown'))) {
|
|
285
285
|
// UFC bouts often omit status or use sparse values; default upcoming when no result yet.
|
|
286
286
|
if (hasResult)
|
package/package.json
CHANGED