@claudinho/cli 0.5.1 → 0.5.2
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/index.js +17 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2814,9 +2814,15 @@ var EspnAdapter = class {
|
|
|
2814
2814
|
async fetchWindow(startDate, endDate) {
|
|
2815
2815
|
return this.fetchScoreboard(`${toEspnDate(startDate)}-${toEspnDate(endDate)}`);
|
|
2816
2816
|
}
|
|
2817
|
+
/**
|
|
2818
|
+
* In-play matches from ESPN's DEFAULT scoreboard bucket only (no `dates`). This
|
|
2819
|
+
* single bucket misses a late kickoff ESPN files under an adjacent day, so it
|
|
2820
|
+
* is a fallback for window-less callers — the domain `getLiveMatches` wraps a
|
|
2821
|
+
* ±1-day window around this to catch boundary-crossing matches. Prefer it.
|
|
2822
|
+
*/
|
|
2817
2823
|
async fetchLive() {
|
|
2818
2824
|
const today = await this.fetchScoreboard();
|
|
2819
|
-
return today.filter((m) => m.status
|
|
2825
|
+
return today.filter((m) => isLive(m.status));
|
|
2820
2826
|
}
|
|
2821
2827
|
/** Standings endpoint URL (lives under apis/v2, not site/v2; derived from base). */
|
|
2822
2828
|
standingsUrl() {
|
|
@@ -2959,9 +2965,13 @@ async function getMatchById(adapter, id) {
|
|
|
2959
2965
|
return { match: base, degraded: true };
|
|
2960
2966
|
}
|
|
2961
2967
|
}
|
|
2962
|
-
async function getLiveMatches(adapter) {
|
|
2968
|
+
async function getLiveMatches(adapter, now = /* @__PURE__ */ new Date()) {
|
|
2963
2969
|
try {
|
|
2964
|
-
|
|
2970
|
+
const day = now.toISOString().slice(0, 10);
|
|
2971
|
+
const matches = adapter.fetchWindow ? (await adapter.fetchWindow(shiftUtcDate(day, -1), shiftUtcDate(day, 1))).filter(
|
|
2972
|
+
(m) => isLive(m.status)
|
|
2973
|
+
) : await adapter.fetchLive();
|
|
2974
|
+
return { matches, degraded: false, source: adapter.name };
|
|
2965
2975
|
} catch {
|
|
2966
2976
|
return { matches: [], degraded: true };
|
|
2967
2977
|
}
|
|
@@ -4074,7 +4084,9 @@ async function runRefresh(opts = {}) {
|
|
|
4074
4084
|
let degraded = false;
|
|
4075
4085
|
if (liveWindowActive(now.getTime())) {
|
|
4076
4086
|
try {
|
|
4077
|
-
|
|
4087
|
+
const r = await getLiveMatches(liveAdapter(), now);
|
|
4088
|
+
live = r.matches;
|
|
4089
|
+
degraded = r.degraded;
|
|
4078
4090
|
} catch {
|
|
4079
4091
|
degraded = true;
|
|
4080
4092
|
}
|
|
@@ -4902,7 +4914,7 @@ function handlePipeError(stream) {
|
|
|
4902
4914
|
}
|
|
4903
4915
|
handlePipeError(process.stdout);
|
|
4904
4916
|
handlePipeError(process.stderr);
|
|
4905
|
-
var VERSION = "0.5.
|
|
4917
|
+
var VERSION = "0.5.2";
|
|
4906
4918
|
var DISCLAIMER = "Claudinho is an independent fan project. Not affiliated with or endorsed by FIFA or Anthropic.";
|
|
4907
4919
|
function ctxFrom(cmd) {
|
|
4908
4920
|
const root = cmd.parent ?? cmd;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudinho/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Live scores, fixtures, group tables, and read-only prediction-market signals for the 2026 men's football tournament — in your terminal and Claude Code statusline. No API keys. Not affiliated with FIFA or Anthropic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"tsup": "^8.0.0",
|
|
57
57
|
"typescript": "^5.7.0",
|
|
58
58
|
"vitest": "^4.1.0",
|
|
59
|
-
"@claudinho/core": "0.5.
|
|
59
|
+
"@claudinho/core": "0.5.2"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsup",
|