@claudinho/cli 0.5.0 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +29 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3460,6 +3460,9 @@ function formatShareSnippet(input, options = {}) {
3460
3460
  blocks.push(card.join("\n"));
3461
3461
  }
3462
3462
  }
3463
+ if (input.degraded && input.matches.length > 0) {
3464
+ blocks.push("(Live data unavailable \u2014 showing the bundled schedule, not live scores.)");
3465
+ }
3463
3466
  blocks.push(
3464
3467
  shareFooter({
3465
3468
  source: input.source,
@@ -3557,6 +3560,8 @@ var EN = {
3557
3560
  "today.none": "No matches scheduled for this date.",
3558
3561
  "live.title": "Live now",
3559
3562
  "live.none": "No matches in play right now.",
3563
+ "live.degraded": "Live scores unavailable right now \u2014 couldn't reach the data provider.",
3564
+ "feed.degraded": "Live scores unavailable \u2014 showing the bundled schedule.",
3560
3565
  "next.none": "No upcoming fixture found for {team}.",
3561
3566
  "next.label": "Next up for {team}",
3562
3567
  "next.in": "in {countdown}",
@@ -3589,6 +3594,8 @@ var ES = {
3589
3594
  "today.none": "No hay partidos para esta fecha.",
3590
3595
  "live.title": "En vivo",
3591
3596
  "live.none": "No hay partidos en juego ahora mismo.",
3597
+ "live.degraded": "Marcadores en vivo no disponibles \u2014 no se pudo conectar con el proveedor de datos.",
3598
+ "feed.degraded": "Marcadores en vivo no disponibles \u2014 mostrando el calendario.",
3592
3599
  "next.none": "No se encontr\xF3 pr\xF3ximo partido para {team}.",
3593
3600
  "next.label": "Pr\xF3ximo partido de {team}",
3594
3601
  "next.in": "en {countdown}",
@@ -3621,6 +3628,8 @@ var PT = {
3621
3628
  "today.none": "Nenhum jogo para esta data.",
3622
3629
  "live.title": "Ao vivo",
3623
3630
  "live.none": "Nenhum jogo em andamento agora.",
3631
+ "live.degraded": "Placar ao vivo indispon\xEDvel \u2014 n\xE3o foi poss\xEDvel conectar ao provedor de dados.",
3632
+ "feed.degraded": "Placar ao vivo indispon\xEDvel \u2014 mostrando a tabela de jogos.",
3624
3633
  "next.none": "Nenhum pr\xF3ximo jogo encontrado para {team}.",
3625
3634
  "next.label": "Pr\xF3ximo jogo de {team}",
3626
3635
  "next.in": "em {countdown}",
@@ -3653,6 +3662,8 @@ var FR = {
3653
3662
  "today.none": "Aucun match pr\xE9vu pour cette date.",
3654
3663
  "live.title": "En direct",
3655
3664
  "live.none": "Aucun match en cours pour l'instant.",
3665
+ "live.degraded": "Scores en direct indisponibles \u2014 impossible de joindre le fournisseur de donn\xE9es.",
3666
+ "feed.degraded": "Scores en direct indisponibles \u2014 affichage du calendrier.",
3656
3667
  "next.none": "Aucun prochain match trouv\xE9 pour {team}.",
3657
3668
  "next.label": "Prochain match de {team}",
3658
3669
  "next.in": "dans {countdown}",
@@ -4296,6 +4307,7 @@ async function cmdToday(date, ctx) {
4296
4307
  }
4297
4308
  }
4298
4309
  out();
4310
+ if (degraded) out(c.dim(" " + t("feed.degraded")));
4299
4311
  const src = dataSource(source, c);
4300
4312
  if (src) out(src);
4301
4313
  out(disclaimer(t, c));
@@ -4313,7 +4325,9 @@ async function cmdLive(ctx) {
4313
4325
  out();
4314
4326
  out(header(t("live.title"), c));
4315
4327
  out();
4316
- if (matches.length === 0) {
4328
+ if (degraded) {
4329
+ out(c.dim(" " + t("live.degraded")));
4330
+ } else if (matches.length === 0) {
4317
4331
  out(c.dim(" " + t("live.none")));
4318
4332
  } else {
4319
4333
  for (const m of matches) out(matchLine(m, cfg, t, c));
@@ -4502,6 +4516,7 @@ async function cmdMatch(id, ctx) {
4502
4516
  for (const mline of marketBlock(marketSignal, match)) out(" " + c.dim(mline));
4503
4517
  }
4504
4518
  out();
4519
+ if (degraded) out(c.dim(" " + t("feed.degraded")));
4505
4520
  const src = dataSource(liveSource, c);
4506
4521
  if (src) out(src);
4507
4522
  out(disclaimer(t, c));
@@ -4629,6 +4644,7 @@ function emitShare(ctx, e, copy) {
4629
4644
  target: e.target,
4630
4645
  ...e.team ? { team: e.team } : {},
4631
4646
  source: e.input.source ?? null,
4647
+ degraded: e.input.degraded ?? false,
4632
4648
  informationalOnly: true,
4633
4649
  style: e.options.style ?? "social",
4634
4650
  snippet,
@@ -4688,7 +4704,7 @@ async function cmdShare(target, team, opts, ctx) {
4688
4704
  const copy = opts.copy === true;
4689
4705
  if (target === "live") {
4690
4706
  precheck(cfg, t);
4691
- const { matches, source: source2 } = await getLiveMatches(adapterFor(ctx));
4707
+ const { matches, degraded: degraded2, source: source2 } = await getLiveMatches(adapterFor(ctx));
4692
4708
  emitShare(
4693
4709
  ctx,
4694
4710
  {
@@ -4698,7 +4714,9 @@ async function cmdShare(target, team, opts, ctx) {
4698
4714
  title: "Live match pulse",
4699
4715
  matches,
4700
4716
  source: source2,
4701
- emptyNote: "No matches in play right now.",
4717
+ degraded: degraded2,
4718
+ // Degraded ⇒ feed down, not "nothing's on" — say so on the public card.
4719
+ emptyNote: degraded2 ? "Live scores unavailable right now \u2014 couldn't reach the data provider." : "No matches in play right now.",
4702
4720
  installLine: "npx @claudinho/cli live",
4703
4721
  tz: cfg.tz,
4704
4722
  locale: cfg.lang
@@ -4713,15 +4731,15 @@ async function cmdShare(target, team, opts, ctx) {
4713
4731
  if (target === "table") {
4714
4732
  precheck(cfg, t);
4715
4733
  const group = team?.toUpperCase();
4716
- const { tables, degraded, source: source2 } = await getStandings(adapterFor(ctx), group);
4734
+ const { tables, degraded: degraded2, source: source2 } = await getStandings(adapterFor(ctx), group);
4717
4735
  emitShareTable(
4718
4736
  ctx,
4719
4737
  {
4720
4738
  group,
4721
4739
  tables,
4722
4740
  // Degraded ⇒ a static roster, served by no live provider: no attribution.
4723
- source: degraded ? void 0 : source2,
4724
- degraded,
4741
+ source: degraded2 ? void 0 : source2,
4742
+ degraded: degraded2,
4725
4743
  installLine: group ? `npx @claudinho/cli table ${group}` : "npx @claudinho/cli table",
4726
4744
  emptyNote: group ? `No group ${group}.` : "No standings available.",
4727
4745
  options: baseOptions
@@ -4760,7 +4778,7 @@ async function cmdShare(target, team, opts, ctx) {
4760
4778
  }
4761
4779
  if (target && target !== "today" && !isValidDate(target)) {
4762
4780
  precheck(cfg, t);
4763
- const { match, source: source2 } = await getMatchById(adapterFor(ctx), target);
4781
+ const { match, degraded: degraded2, source: source2 } = await getMatchById(adapterFor(ctx), target);
4764
4782
  const matches = match ? [match] : [];
4765
4783
  const signals2 = await reliableShareSignals(ctx, matches);
4766
4784
  emitShare(
@@ -4773,6 +4791,7 @@ async function cmdShare(target, team, opts, ctx) {
4773
4791
  matches,
4774
4792
  marketSignals: signals2,
4775
4793
  source: source2,
4794
+ degraded: degraded2,
4776
4795
  emptyNote: `No match found with id ${target}.`,
4777
4796
  installLine: `npx @claudinho/cli match ${target}`,
4778
4797
  tz: cfg.tz,
@@ -4787,7 +4806,7 @@ async function cmdShare(target, team, opts, ctx) {
4787
4806
  const explicitDate = target && target !== "today" ? target : void 0;
4788
4807
  precheck(cfg, t, explicitDate);
4789
4808
  const date = explicitDate ?? localDate((/* @__PURE__ */ new Date()).toISOString(), cfg.tz);
4790
- const { matches: all, source } = await getMatchesForDate(adapterFor(ctx), date);
4809
+ const { matches: all, degraded, source } = await getMatchesForDate(adapterFor(ctx), date);
4791
4810
  const todays = fixturesByDate(date, all, cfg.tz);
4792
4811
  const signals = await reliableShareSignals(ctx, todays);
4793
4812
  const human = formatDate(`${date}T12:00:00.000Z`, { tz: cfg.tz, locale: cfg.lang });
@@ -4802,6 +4821,7 @@ async function cmdShare(target, team, opts, ctx) {
4802
4821
  matches: todays,
4803
4822
  marketSignals: signals,
4804
4823
  source,
4824
+ degraded,
4805
4825
  emptyNote: `No matches scheduled for ${human}.`,
4806
4826
  installLine: "npx @claudinho/cli today",
4807
4827
  tz: cfg.tz,
@@ -4882,7 +4902,7 @@ function handlePipeError(stream) {
4882
4902
  }
4883
4903
  handlePipeError(process.stdout);
4884
4904
  handlePipeError(process.stderr);
4885
- var VERSION = "0.5.0";
4905
+ var VERSION = "0.5.1";
4886
4906
  var DISCLAIMER = "Claudinho is an independent fan project. Not affiliated with or endorsed by FIFA or Anthropic.";
4887
4907
  function ctxFrom(cmd) {
4888
4908
  const root = cmd.parent ?? cmd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudinho/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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.0"
59
+ "@claudinho/core": "0.5.1"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsup",