@claudinho/core 0.8.4 → 0.8.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/index.d.ts CHANGED
@@ -1053,8 +1053,8 @@ declare function parseTeamSlot(team: Team): SlotRef | null;
1053
1053
 
1054
1054
  /**
1055
1055
  * Resolve the bundled topology against merged knockout matches and standings.
1056
- * Group slots project from live standings once a group has started; winner/loser slots
1057
- * require a confirmed FT result on the source match.
1056
+ * Group slots project from live standings once a group has started; confirmed when
1057
+ * the group is fully played. Winner/loser slots require a confirmed FT result.
1058
1058
  */
1059
1059
  declare function buildBracketView(topology: BracketTopology, matches: Match[], tables: GroupStandings[], standingsDegraded: boolean, liveDegraded: boolean, filterStage?: string, lang?: string): BracketView;
1060
1060
 
package/dist/index.js CHANGED
@@ -3353,6 +3353,18 @@ function hasGroupStarted(group, tables) {
3353
3353
  if (!table?.rows.length) return false;
3354
3354
  return table.rows.some((r) => r.played > 0);
3355
3355
  }
3356
+ function matchesPerTeamInGroup(teamCount) {
3357
+ return Math.max(0, teamCount - 1);
3358
+ }
3359
+ function isGroupStandingsComplete(table) {
3360
+ const n = table?.rows.length ?? 0;
3361
+ if (n < 2) return false;
3362
+ const required = matchesPerTeamInGroup(n);
3363
+ return table.rows.every((r) => r.played >= required);
3364
+ }
3365
+ function isGroupComplete(group, tables) {
3366
+ return isGroupStandingsComplete(tables.find((t2) => t2.group === group));
3367
+ }
3356
3368
  function resolveWinner(match) {
3357
3369
  if (!isFinished(match.status)) return void 0;
3358
3370
  if (match.winnerCode) {
@@ -3401,7 +3413,10 @@ function resolveSlot(ref, ctx) {
3401
3413
  case "group": {
3402
3414
  if (!ctx.standingsDegraded && hasGroupStarted(ref.group, ctx.tables)) {
3403
3415
  const team = teamFromStandings(ref.group, ref.position, ctx.tables);
3404
- if (team) return participant(team, "projected");
3416
+ if (team) {
3417
+ const status = isGroupComplete(ref.group, ctx.tables) ? "confirmed" : "projected";
3418
+ return participant(team, status);
3419
+ }
3405
3420
  }
3406
3421
  const label = ref.position === 1 ? t(ctx.lang, "bracket.slot.groupWinner", { group: ref.group }) : t(ctx.lang, "bracket.slot.groupSecond", { group: ref.group });
3407
3422
  return tbd(label);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudinho/core",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
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",