@claudinho/mcp 0.8.16 → 0.8.17

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 +44 -11
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -4129,7 +4129,8 @@ var PolymarketProvider = class {
4129
4129
  opts;
4130
4130
  name = "polymarket";
4131
4131
  async findSignal(match, options) {
4132
- return (await this.resolveOne(match, options)).signal;
4132
+ const deadline = options?.deadlineMs != null ? Date.now() + options.deadlineMs : Number.POSITIVE_INFINITY;
4133
+ return (await this.resolveOne(match, options, deadline)).signal;
4133
4134
  }
4134
4135
  async findSignals(matches, options) {
4135
4136
  const signals = /* @__PURE__ */ new Map();
@@ -4137,7 +4138,7 @@ var PolymarketProvider = class {
4137
4138
  const deadline = options?.deadlineMs != null ? Date.now() + options.deadlineMs : Number.POSITIVE_INFINITY;
4138
4139
  for (const m of matches) {
4139
4140
  if (Date.now() >= deadline) break;
4140
- const r = await this.resolveOne(m, options);
4141
+ const r = await this.resolveOne(m, options, deadline);
4141
4142
  if (r.checked) checked.add(m.id);
4142
4143
  if (r.signal) signals.set(m.id, r.signal);
4143
4144
  }
@@ -4149,13 +4150,16 @@ var PolymarketProvider = class {
4149
4150
  * provider/network error — so transient failures are retried, not
4150
4151
  * negative-cached.
4151
4152
  */
4152
- async resolveOne(match, options) {
4153
+ async resolveOne(match, options, deadline = Number.POSITIVE_INFINITY) {
4153
4154
  const entry = (this.opts.mapping ?? BUNDLED_MAPPING)[match.id];
4154
4155
  const slugs = entry?.eventSlug ? [entry.eventSlug] : deriveEventSlugs(match);
4155
4156
  if (slugs.length === 0) return { checked: true };
4157
+ const configured = options?.timeoutMs ?? this.opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
4156
4158
  try {
4157
4159
  for (const slug of slugs) {
4158
- const event = await this.fetchEvent(slug, options?.timeoutMs);
4160
+ const remaining = deadline - Date.now();
4161
+ if (remaining <= 0) return { checked: false };
4162
+ const event = await this.fetchEvent(slug, Math.min(configured, remaining));
4159
4163
  const signal = event ? this.toSignal(match, slug, event, options) : void 0;
4160
4164
  if (signal) return { signal, checked: true };
4161
4165
  }
@@ -4235,6 +4239,27 @@ var PolymarketProvider = class {
4235
4239
  return signal.ambiguous ? void 0 : signal;
4236
4240
  }
4237
4241
  };
4242
+ var POLYMARKET_TOKEN = {
4243
+ SUI: "che",
4244
+ // Switzerland
4245
+ NED: "nld",
4246
+ // Netherlands
4247
+ URU: "ury",
4248
+ // Uruguay
4249
+ POR: "prt",
4250
+ // Portugal
4251
+ CRO: "hrv",
4252
+ // Croatia
4253
+ COD: "cdr",
4254
+ // DR Congo
4255
+ CPV: "cvi"
4256
+ // Cabo Verde
4257
+ };
4258
+ function pmTokens(code) {
4259
+ const c = code.toLowerCase();
4260
+ const alias = POLYMARKET_TOKEN[code.toUpperCase()];
4261
+ return alias && alias !== c ? [alias, c] : [c];
4262
+ }
4238
4263
  function deriveEventSlugs(match) {
4239
4264
  const home = match.home.code.toLowerCase();
4240
4265
  const away = match.away.code.toLowerCase();
@@ -4242,10 +4267,18 @@ function deriveEventSlugs(match) {
4242
4267
  if (!/^[a-z]{3}$/.test(home) || !/^[a-z]{3}$/.test(away)) return [];
4243
4268
  const utcDate = match.kickoff.slice(0, 10);
4244
4269
  if (!/^\d{4}-\d{2}-\d{2}$/.test(utcDate)) return [];
4245
- return [
4246
- `fifwc-${home}-${away}-${utcDate}`,
4247
- `fifwc-${home}-${away}-${shiftUtcDate(utcDate, -1)}`
4248
- ];
4270
+ const dates = [utcDate, shiftUtcDate(utcDate, -1)];
4271
+ const homeToks = pmTokens(match.home.code);
4272
+ const awayToks = pmTokens(match.away.code);
4273
+ const slugs = [];
4274
+ for (const d of dates) {
4275
+ for (const h of homeToks) {
4276
+ for (const a of awayToks) {
4277
+ slugs.push(`fifwc-${h}-${a}-${d}`);
4278
+ }
4279
+ }
4280
+ }
4281
+ return [...new Set(slugs)];
4249
4282
  }
4250
4283
  function slugToken(m) {
4251
4284
  return (m.slug ?? "").toLowerCase().split("-").pop() ?? "";
@@ -4254,10 +4287,10 @@ function isDrawMarket(m) {
4254
4287
  return slugToken(m) === "draw" || (m.groupItemTitle ?? "").trim().toLowerCase().startsWith("draw");
4255
4288
  }
4256
4289
  function pickMarket(markets, teamCode, teamName) {
4257
- const code = teamCode.toLowerCase();
4290
+ const tokens = pmTokens(teamCode);
4258
4291
  const name = teamName.trim().toLowerCase();
4259
4292
  const teamMarkets = markets.filter((m) => !isDrawMarket(m));
4260
- const bySlug = teamMarkets.find((m) => slugToken(m) === code);
4293
+ const bySlug = teamMarkets.find((m) => tokens.includes(slugToken(m)));
4261
4294
  if (bySlug) return bySlug;
4262
4295
  return teamMarkets.find((m) => (m.groupItemTitle ?? "").trim().toLowerCase() === name);
4263
4296
  }
@@ -5119,7 +5152,7 @@ async function toolGetShareSnippet(args) {
5119
5152
 
5120
5153
  // src/server.ts
5121
5154
  var SERVER_NAME = "claudinho";
5122
- var SERVER_VERSION = "0.8.16";
5155
+ var SERVER_VERSION = "0.8.17";
5123
5156
  var VOICE = asFlavorLevel(process.env.CLAUDINHO_FLAVOR) === "off" ? "" : `
5124
5157
  Voice: when relaying scores, narrate with lively, regionally-appropriate football-commentary energy in the user's language. Each match line may end with a short exclamation ("\u2014 \xA1GOOOOL!") \u2014 use it as a tone cue. Keep every fact exact; never invent details and never impersonate or name a real commentator.`;
5125
5158
  var INSTRUCTIONS = `Claudinho serves live scores, fixtures, and group standings for the 2026 men's football tournament.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudinho/mcp",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "mcpName": "io.github.arturogarrido/claudinho",
5
5
  "description": "MCP server for the 2026 men's football tournament — live scores, fixtures, standings, read-only prediction-market signals, and paste-ready match cards. Works with Claude Code, Cursor, Codex, Windsurf, Zed. Not affiliated with FIFA or Anthropic.",
6
6
  "type": "module",
@@ -57,7 +57,7 @@
57
57
  "tsup": "^8.0.0",
58
58
  "typescript": "^5.7.0",
59
59
  "vitest": "^4.1.9",
60
- "@claudinho/core": "0.8.16"
60
+ "@claudinho/core": "0.8.17"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "tsup",