@claudinho/core 0.11.0 → 0.11.1

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/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @claudinho/core ⚽
2
2
 
3
3
  **The engine behind Claudinho: the domain model, the provider adapters (ESPN), live scores
4
- and standings for the competition you follow (15 supported), the bundled 2026 World Cup
4
+ and standings for the competition you follow (16 supported), the bundled 2026 World Cup
5
5
  schedule with its knockout bracket and read-only Polymarket sidecar.** Claudinho puts live
6
6
  football in your dev environment for the competition you follow: the World Cup, the Premier
7
- League, LALIGA, the Champions League and 11 more. This package powers
7
+ League, LALIGA, the Champions League and 12 more. This package powers
8
8
  [`@claudinho/cli`](https://www.npmjs.com/package/@claudinho/cli) and
9
9
  [`@claudinho/mcp`](https://www.npmjs.com/package/@claudinho/mcp).
10
10
 
@@ -23,7 +23,7 @@ npm i @claudinho/core
23
23
  - **`ProviderAdapter`**: the swappable data-vendor interface (`fetchByDate`, `fetchLive`, optional `fetchWindow`/`fetchStandings`); `EspnAdapter` included. An adapter serves exactly one competition and states it (`competition`, required); a provider that knows which season a response belongs to attaches it to the returned array (`attachFetchMeta`, read with `fetchMeta`), with the seasons its parts stated (`seasons`) and the records it left out (`omitted`). A window whose parts state two seasons is refused unless it is asked `acrossSeasons`, which three callers that merge nothing do (the live read, and off the bundled competition the dated read and the match refresh); `getNextFixtureForTeam`, `getBracket`, `getMatchesForDate`, `getLiveMatches`, `getMatchById` and `marketFixtureForTeam` say `partial` when the read behind them was not whole (`dayAttribution` and the "none read" sentences in the card builders say what that means for a day), and `verdictExtras` / `verdictNotice` / `verdictQualifiers` turn a result's verdict into a key and a sentence
24
24
  - **Static schedule**: the World Cup's 104 fixtures (groups, venues, host cities, kickoffs) bundled (the other competitions' schedules are read from the feed); query with `allFixtures`, `fixturesByDate` (groups by your timezone), `fixturesByTeam`, `fixturesByGroup`, `nextFixtureForTeam`, `groups`
25
25
  - **Live overlay**: `makeAdapter(source, { competition })`, `getMatchesForDate`, `getLiveMatches`, `mergeLive` (static base + live state, with graceful degradation). The competition is resolved once by the caller (`resolveCompetition(explicit, env, saved)`: an alias or a slug, the first present source deciding (the flag, the environment, the saved choice the caller read with `readUserConfig`); with none it answers `none`, nothing chosen, never a default; anything else is refused with the aliases; core reads no environment and no file, the caller hands them in), and said by `modeLine` and `selectionExtras`; the bundled schedule is merged only for its own competition and edition (`bundleApplies`)
26
- - **The supported set**: `SUPPORTED`, ONE table of the fifteen competitions (slug, alias, name, teams, kind, season name, standings shape, bracket and markets capabilities, cadence); `deriveTables(table)` builds every written view from it, and `entryOf`, `capabilitiesOf`, `competitionLabel`, `listCompetitions` take a table, so a new row reaches every consumer
26
+ - **The supported set**: `SUPPORTED`, ONE table of the sixteen competitions (slug, alias, name, teams, kind, season name, standings shape, bracket and markets capabilities, cadence); `deriveTables(table)` builds every written view from it, and `entryOf`, `capabilitiesOf`, `competitionLabel`, `listCompetitions` take a table, so a new row reaches every consumer
27
27
  - **Standings**: `getStandings` fetches authoritative, cumulative tables from the provider (`GroupStandings`: a table has a key, `A`, `A1`, `A-B` or `LEAGUE`, and every table but a lettered group a `label`), failing closed when none is available, and saying `incomplete` when the provider sent a table that could not be read: the compatible bundled World Cup scope may return a degraded roster-at-zero, while custom competitions return empty + degraded rather than borrowing those teams; `computeStandings` derives a table from a set of matches (points / GD / GF tiebreak)
28
28
  - **Helpers**: emoji flags (`nationToFlag`), TZ-aware time (`formatKickoff`, `formatDate`, `formatTime`, `countdown`, `localDate`), location strings (`matchLocation`), localized commentary flair (`matchFlavor`, `flavorsFor` for a list with no phrase twice, `matchFlairs` for a list's flair slots, the cries included, and `matchFlair` for one line / `FlavorLevel`; the team rally cries, `rallyCryFor` / `RALLY_CRIES`, the pin deciding between two through `isPinnedSide`), validators (`isValidDate`, `isValidTimeZone`)
29
29
  - **Prediction-market signals (sidecar)**: read-only market signals kept *separate* from `Match`: the `MarketSignal` / `MarketProvider` model, the `PolymarketProvider` (public Gamma data only: no auth/trading/links; event slugs auto-derived per fixture, validation fails closed), a `FakeMarketProvider`, `makeMarketProvider`, `getMarketSignal` / `getMarketSignals`, the `isReliableMarketSignal` gate, and approved-copy formatters (`marketFavoriteText`, `marketProbabilityText`, `marketBlock`). Informational only, never betting advice.
package/dist/index.d.ts CHANGED
@@ -417,7 +417,7 @@ declare function stageLabel(m: Pick<Match, 'stage' | 'group' | 'stageLabel'>): s
417
417
  declare function joinSegments(segments: readonly (string | undefined)[]): string;
418
418
 
419
419
  /**
420
- * The supported set, as ONE table: the fifteen competitions the product
420
+ * The supported set, as ONE table: the sixteen competitions the product
421
421
  * answers for, one row each, and every written fact about a competition that
422
422
  * the rest of the code reads (its teams' kind, its own kind, a league's season
423
423
  * name, its standings shape, what `bracket` and the market sidecar offer, how
@@ -483,14 +483,15 @@ interface CompetitionEntry {
483
483
  readonly cadenceYears: 1 | 2 | 4;
484
484
  }
485
485
  /**
486
- * The fifteen, in the order they are listed.
486
+ * The sixteen, in the order they are listed.
487
487
  * - Nations: the World Cup, the Euro, the Copa America (four-yearly), the
488
488
  * UEFA Nations League, the Concacaf Nations League (its next editions are
489
489
  * 2026/27 and 2028/29, by Concacaf's published 2026 to 2030 calendar) and
490
490
  * the Gold Cup (two-yearly).
491
- * - The five leagues, yearly. A league's season name as measured on the real
492
- * feed (Oct 3, 2026); `mex.1` has none (its slugs are `torneo-apertura`,
493
- * `torneo-clausura` and its play-off rounds).
491
+ * - The six leagues, yearly. A league's season name as measured on the real
492
+ * feed (Oct 3, 2026); `mex.1` and `uru.1` have none (their slugs are
493
+ * `torneo-apertura`, `torneo-clausura` and, for `mex.1`, its play-off
494
+ * rounds).
494
495
  * - The four club cups. The Champions League's league phase reads as one
495
496
  * table; the Concacaf Champions Cup has none (knockout from the first
496
497
  * round); the Club World Cup is four-yearly.
@@ -521,8 +522,8 @@ interface DerivedTables {
521
522
  }
522
523
  /**
523
524
  * The views every consumer reads, derived from a table. A function of the
524
- * table, so a test can run it on one with a sixteenth row and see every view
525
- * carry it. Every view is frozen.
525
+ * table, so a test can run it on one with a row past the table's end and
526
+ * see every view carry it. Every view is frozen.
526
527
  *
527
528
  * A row that offers a bracket for any competition but the bundled one is
528
529
  * REFUSED here, at load, naming it: an offered bracket needs a knockout
@@ -2739,7 +2740,7 @@ type CompetitionKind = 'league' | 'cup' | 'friendly';
2739
2740
  /**
2740
2741
  * The teams each competition fields: the supported table's (`nation` for the
2741
2742
  * World Cup, the Euro, the Copa America, both Nations Leagues and the Gold
2742
- * Cup; `club` for the five leagues and the four club cups), and the friendly
2743
+ * Cup; `club` for the six leagues and the four club cups), and the friendly
2743
2744
  * competition's (`nation`). An unlisted competition fields clubs: a nations
2744
2745
  * competition the set does not list renders its teams by name until it is
2745
2746
  * written down.
@@ -2748,7 +2749,7 @@ declare const TEAM_KIND: Readonly<Record<string, TeamKind>>;
2748
2749
  /** The teams a competition fields; an unlisted (or absent) competition fields clubs. */
2749
2750
  declare function teamKind(competition: string | undefined): TeamKind;
2750
2751
  /**
2751
- * Each competition's kind: the supported table's (`league`: the five leagues,
2752
+ * Each competition's kind: the supported table's (`league`: the six leagues,
2752
2753
  * whose regular season the stage grammar reads as `REGULAR`; `cup`: the other
2753
2754
  * ten), and `friendly` for `fifa.friendly`, the one competition whose
2754
2755
  * `friendly` slug is the `FRIENDLY` stage.
package/dist/index.js CHANGED
@@ -4220,6 +4220,7 @@ var SUPPORTED = Object.freeze(
4220
4220
  { slug: "ita.1", alias: "serie-a", name: "Serie A", teams: "club", kind: "league", seasonSlug: "italian-serie-a", standings: "league", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
4221
4221
  { slug: "ger.1", alias: "bundesliga", name: "Bundesliga", teams: "club", kind: "league", seasonSlug: "german-bundesliga", standings: "league", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
4222
4222
  { slug: "mex.1", alias: "liga-mx", name: "Liga MX", teams: "club", kind: "league", standings: "league", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
4223
+ { slug: "uru.1", alias: "liga-auf", name: "Liga AUF Uruguaya", teams: "club", kind: "league", standings: "league", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
4223
4224
  { slug: "uefa.champions", alias: "champions-league", name: "Champions League", teams: "club", kind: "cup", standings: "league", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
4224
4225
  { slug: "conmebol.libertadores", alias: "libertadores", name: "Libertadores", teams: "club", kind: "cup", standings: "groups", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
4225
4226
  { slug: "concacaf.champions", alias: "concacaf-champions-cup", name: "Concacaf Champions Cup", teams: "club", kind: "cup", standings: "none", bracket: "not-offered-yet", markets: "not-offered-yet", cadenceYears: 1 },
@@ -4889,7 +4890,7 @@ function fetchMeta(result) {
4889
4890
  // src/adapters/espn.ts
4890
4891
  var ESPN_SOCCER = "https://site.api.espn.com/apis/site/v2/sports/soccer";
4891
4892
  var DEFAULT_COMPETITION = BUNDLED_SLUG;
4892
- var USER_AGENT = `claudinho/${"0.11.0"} (+https://github.com/arturogarrido/claudinho)`;
4893
+ var USER_AGENT = `claudinho/${"0.11.1"} (+https://github.com/arturogarrido/claudinho)`;
4893
4894
  var MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
4894
4895
  var DEFAULT_COOLDOWN_MS = 5 * 6e4;
4895
4896
  var MAX_COOLDOWN_MS = 15 * 6e4;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@claudinho/core",
3
- "version": "0.11.0",
4
- "description": "The engine behind Claudinho: the domain model, the provider adapters (ESPN), live scores and standings for the competition you follow (15 supported), the bundled 2026 World Cup schedule with its knockout bracket and read-only Polymarket sidecar. Independent fan project. Not affiliated with FIFA, any confederation, league or club, or Anthropic.",
3
+ "version": "0.11.1",
4
+ "description": "The engine behind Claudinho: the domain model, the provider adapters (ESPN), live scores and standings for the competition you follow (16 supported), the bundled 2026 World Cup schedule with its knockout bracket and read-only Polymarket sidecar. Independent fan project. Not affiliated with FIFA, any confederation, league or club, or Anthropic.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Arturo Garrido",
@@ -60,6 +60,7 @@
60
60
  "serie-a",
61
61
  "bundesliga",
62
62
  "liga-mx",
63
+ "liga-auf",
63
64
  "champions-league",
64
65
  "libertadores",
65
66
  "concacaf-champions-cup",