@claudinho/core 0.8.2 → 0.8.3

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.d.ts CHANGED
@@ -601,7 +601,7 @@ interface StandingsResult {
601
601
  declare function getStandings(adapter: ProviderAdapter, group?: string): Promise<StandingsResult>;
602
602
  /**
603
603
  * Knockout bracket with hybrid slot resolution: confirmed FT winners/losers from
604
- * the live overlay; group slots project only when the group is fully played.
604
+ * the live overlay; group slots project from live standings once a group has started.
605
605
  */
606
606
  declare function getBracket(adapter: ProviderAdapter, opts?: {
607
607
  stage?: Stage;
@@ -1051,7 +1051,7 @@ declare function parseTeamSlot(team: Team): SlotRef | null;
1051
1051
 
1052
1052
  /**
1053
1053
  * Resolve the bundled topology against merged knockout matches and standings.
1054
- * Group slots project only when the group is fully played; winner/loser slots
1054
+ * Group slots project from live standings once a group has started; winner/loser slots
1055
1055
  * require a confirmed FT result on the source match.
1056
1056
  */
1057
1057
  declare function buildBracketView(topology: BracketTopology, matches: Match[], tables: GroupStandings[], standingsDegraded: boolean, liveDegraded: boolean, filterStage?: string, lang?: string): BracketView;
package/dist/index.js CHANGED
@@ -3341,18 +3341,17 @@ function validateThirdPlace(nodes, problems) {
3341
3341
  }
3342
3342
 
3343
3343
  // src/bracket/resolve.ts
3344
- function isGroupComplete(group, tables, standingsDegraded) {
3345
- if (standingsDegraded) return false;
3346
- const table = tables.find((t2) => t2.group === group);
3347
- if (!table?.rows.length || table.rows.length !== 4) return false;
3348
- return table.rows.every((r) => r.played >= 3);
3349
- }
3350
3344
  function teamFromStandings(group, position, tables) {
3351
3345
  const table = tables.find((t2) => t2.group === group);
3352
3346
  if (!table) return void 0;
3353
3347
  const row = table.rows[position - 1];
3354
3348
  return row?.team;
3355
3349
  }
3350
+ function hasGroupStarted(group, tables) {
3351
+ const table = tables.find((t2) => t2.group === group);
3352
+ if (!table?.rows.length) return false;
3353
+ return table.rows.some((r) => r.played > 0);
3354
+ }
3356
3355
  function resolveWinner(match) {
3357
3356
  if (!isFinished(match.status)) return void 0;
3358
3357
  if (match.winnerCode) {
@@ -3399,7 +3398,7 @@ function resolveSlot(ref, ctx) {
3399
3398
  case "seed":
3400
3399
  return tbd(ref.label);
3401
3400
  case "group": {
3402
- if (isGroupComplete(ref.group, ctx.tables, ctx.standingsDegraded)) {
3401
+ if (!ctx.standingsDegraded && hasGroupStarted(ref.group, ctx.tables)) {
3403
3402
  const team = teamFromStandings(ref.group, ref.position, ctx.tables);
3404
3403
  if (team) return participant(team, "projected");
3405
3404
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudinho/core",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Domain model, provider adapters (ESPN), standings, bundled schedule, and the read-only Polymarket market-signal sidecar powering Claudinho. Not affiliated with FIFA or Anthropic.",
5
5
  "type": "module",
6
6
  "license": "MIT",