@chrischall/warapp-mcp 0.18.0 → 0.20.0

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.
@@ -11,7 +11,7 @@ import { stressPlan } from '../analysis/stress.js';
11
11
  import { neutralizeSeats, seatTerritories, staticSeats } from '../analysis/static-seats.js';
12
12
  import { profileFormatOf } from '../analysis/opponent-profile.js';
13
13
  import { handOwners } from './card-advice.js';
14
- import { fogPaceFor, mapMatchOf } from './past-games.js';
14
+ import { fogPaceFor, mapMatchOf, outlookCalibrationFor } from './past-games.js';
15
15
  import { sanctionMyIncome } from './card-effects.js';
16
16
  import { cardTypeByName, cardTypeName, normalizeGuid, readHand } from '../cards.js';
17
17
  import { claimedCardUses, claimedCardWarning, teamCardClaims, teamHandLeft, unclaimedFirst } from '../team-cards.js';
@@ -216,6 +216,8 @@ export function registerCheckPlanTool(server, ctx) {
216
216
  const settings = plannerSettings(game.settings);
217
217
  // #419: the past winners' pace, as warapp_plan_turn reads it (thin evidence's upper bound).
218
218
  const mapPace = await fogPaceFor(ctx.dataDir, undefined, game.settings?.mapId ?? map.id, mapMatchOf(profileFormatOf(game.players), game.settings), turn === null ? null : turn - 1);
219
+ // #568: past games' calibration of the tracked figures, as warapp_plan_turn reads it.
220
+ const trackCalibration = await outlookCalibrationFor(ctx.dataDir, undefined, profileFormatOf(game.players));
219
221
  const deploys = [];
220
222
  const moves = [];
221
223
  /** Options the game would refuse (#165): the orders are still tried, and the warning says so. */
@@ -378,6 +380,7 @@ export function registerCheckPlanTool(server, ctx) {
378
380
  info,
379
381
  ...(opening ? { opening } : {}),
380
382
  ...(mapPace ? { mapPace } : {}),
383
+ ...(trackCalibration ? { trackCalibration } : {}),
381
384
  ...(enemy_deploy !== undefined ? { enemyDeploy: enemy_deploy } : {}),
382
385
  assumeCards,
383
386
  // #444: the stated incomes scale the other opponents' prior, as warapp_plan_turn has them.
@@ -63,6 +63,7 @@ export function stressOpponents(input) {
63
63
  ...(unevenStart(game.settings) ? { unevenStart: unevenStart(game.settings) } : {}),
64
64
  ...(input.opening ? { opening: input.opening } : {}),
65
65
  ...(input.mapPace ? { mapPace: input.mapPace } : {}),
66
+ ...(input.trackCalibration ? { trackCalibration: input.trackCalibration } : {}),
66
67
  ...(game.settings?.fog !== undefined ? { fog: game.settings.fog } : {}),
67
68
  ...(opponentReinforcement(game.settings, hand) ? { reinforcement: opponentReinforcement(game.settings, hand) } : {}),
68
69
  },
@@ -1512,6 +1512,8 @@ export async function livePlanSetup(ctx, a) {
1512
1512
  // #166: the opponent's opening simulated from the starts the award proved, as the prior.
1513
1513
  ...(opening ? { opening } : {}),
1514
1514
  ...(mapPace ? { mapPace } : {}),
1515
+ // #568: the same calibration raises each tracked figure by its coverage band's damped factor.
1516
+ ...(calibration ? { trackCalibration: calibration } : {}),
1515
1517
  // #164: an opponent's Reinforcement card, from the turn the card clock says one can be in hand.
1516
1518
  ...(opponentReinforcement(game.settings, hand) ? { reinforcement: opponentReinforcement(game.settings, hand) } : {}),
1517
1519
  // #427: the Reinforcement plays seen in the turns' orders (card plays not fogged): a play restarts the clock.
@@ -1986,6 +1988,8 @@ async function commanderCheck(ctx, a) {
1986
1988
  const opening = openingThreat(award, a.game, graph, a.seen, a.turn);
1987
1989
  // #419: the past winners' pace, as the plan reads it.
1988
1990
  const mapPace = await fogPaceFor(ctx.dataDir, undefined, a.game.settings?.mapId ?? a.map.id, mapMatchOf(profileFormatOf(a.game.players), a.game.settings), a.turn === null ? null : a.turn - 1);
1991
+ // #568: past games' calibration of the tracked figures, as the plan reads it.
1992
+ const trackCalibration = await outlookCalibrationFor(ctx.dataDir, undefined, profileFormatOf(a.game.players));
1989
1993
  // stressOpponents reads a static seat's territories as neutrals (#270), on its own `board` too.
1990
1994
  const so = stressOpponents({
1991
1995
  graph,
@@ -2002,6 +2006,7 @@ async function commanderCheck(ctx, a) {
2002
2006
  info: a.info,
2003
2007
  ...(opening ? { opening } : {}),
2004
2008
  ...(mapPace ? { mapPace } : {}),
2009
+ ...(trackCalibration ? { trackCalibration } : {}),
2005
2010
  });
2006
2011
  // #275: an untrusted opponent's reply is sized at least at the figure its tripwire gave it, as
2007
2012
  // warapp_check_plan's stress test tries it (read only: warapp_plan_turn keeps the marks).
@@ -2213,9 +2218,7 @@ export function registerTurnTools(server, ctx, opts = {}) {
2213
2218
  'an opponent is bounded above by all it can have received (its start, or an even share of the map; each turn\'s most it could earn; ' +
2214
2219
  'a fixed Reinforcement card by the card clock) — a scenario\'s starts, a Gift card or a progressive Reinforcement card leave it unbounded, and then `winning` is never read; ' +
2215
2220
  'once winning or losing, payback tests count the turns the game has left instead of 10). With no `goal` the profile picks and tunes it (`goalSource` ' +
2216
- '"profile"): siege when it fits (in contact, not ahead, one target — in an FFA the leader, earning 1.5× any other ' +
2217
- 'opponent beside me — with a sure break costing at most 2 turns of its bonus and at most my income; handed back ' +
2218
- 'once its assault trigger fires), else defend when behind outside a 1v1, else balanced — in an FFA with two or more opponents, no ' +
2221
+ '"profile"): defend when behind outside a 1v1, else balanced — in an FFA with two or more opponents, no ' +
2219
2222
  'second front; in a 1v1, one strike stack facing the opponent; ahead in a 1v1, fog pressure ' +
2220
2223
  `up to ${AHEAD_PRESSURE_FACTOR}× a typical neutral capture. Goals: "balanced" (default) — income per army ` +
2221
2224
  'across holds, bonuses and breaking enemy bonuses, at least 30% on expansion; "expand" — neutrals only; ' +
@@ -2342,7 +2345,7 @@ export function registerTurnTools(server, ctx, opts = {}) {
2342
2345
  goal: z
2343
2346
  .enum(GOALS)
2344
2347
  .optional()
2345
- .describe('Omit to let the game profile pick (siege when it fits, else defend when behind on income outside a 1v1, else balanced, tuned to the format). ' +
2348
+ .describe('Omit to let the game profile pick (defend when behind on income outside a 1v1, else balanced, tuned to the format). ' +
2346
2349
  'balanced (default): best income per army across holds, bonuses and breaking enemy bonuses; expand: take ' +
2347
2350
  'neutrals only; complete-bonus: also attack players to finish bonuses; defend: hold threatened borders first; ' +
2348
2351
  "siege: against one opponent (siege_target), fund its cheapest bonus breaks first and build one strike stack " +
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Single source of truth for the server version. release-please bumps the
2
2
  // literal on the marked line (registered in release-please-config.json
3
3
  // extra-files); every other module imports VERSION from here.
4
- export const VERSION = '0.18.0'; // x-release-please-version
4
+ export const VERSION = '0.20.0'; // x-release-please-version
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "warapp-mcp",
5
5
  "display_name": "war.app (Warzone)",
6
- "version": "0.18.0",
6
+ "version": "0.20.0",
7
7
  "description": "war.app (Warzone) game advisor for Claude — your games, maps, bonuses, board analysis and routes via the GameFeed API, plus your games list (waiting on you first), opponent scouting with your head-to-head, the live board, territory picks, cards, turn planning and submission, turn notifications, and chat through your signed-in war.app tab (ContextMint Bridge). Joining, leaving or surrendering a game, closing out a finished game, accepting another player's surrender, Begin on a speed first turn, picks, turn orders, withdrawing them, chat sends, marking notifications and chat read, deleting notifications, importing local history into a hosted server and linking a session (local only) are confirm-gated.",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/warapp-mcp",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "mcpName": "io.github.chrischall/warapp-mcp",
5
5
  "description": "war.app (Warzone) game advisor MCP server for Claude — games, maps, bonuses and board analysis via the GameFeed API, plus your games list, opponent scouting, the live board, territory picks, cards, turn planning and submission, turn notifications and chat through your signed-in war.app tab. Developed and maintained by AI (Claude Code).",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -52,14 +52,14 @@
52
52
  "@modelcontextprotocol/server": "^2.4.0",
53
53
  "acorn": "^8.19.0",
54
54
  "dotenv": "^18.0.1",
55
- "undici": "^8.12.4",
55
+ "undici": "^8.13.1",
56
56
  "zod": "^4.6.7"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@biomejs/biome": "^2.6.8",
60
60
  "@modelcontextprotocol/client": "^2.4.0",
61
61
  "@types/node": "^26.0.1",
62
- "@vitest/coverage-v8": "^5.0.0",
62
+ "@vitest/coverage-v8": "^5.1.1",
63
63
  "esbuild": "^0.28.1",
64
64
  "typescript": "^7.0.2",
65
65
  "vitest": "^5.0.0"
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/warapp-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.18.0",
9
+ "version": "0.20.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/warapp-mcp",
14
- "version": "0.18.0",
14
+ "version": "0.20.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -1,42 +0,0 @@
1
- /** #432: the payback horizon, in turns, of a 1v1 whose gates are short at the start of the turn. */
2
- export const SHORT_GATES_PAYBACK_TURNS = 5;
3
- /**
4
- * The start-of-turn gate budget (#297's arithmetic on my start-of-turn holdings and armies), and the shorter horizon
5
- * when it is short: adapting only (as #201), a 1v1 only, in contact, the gates' summed shortfall over my income, and
6
- * only when that horizon is shorter than the one the plan already counts (a decided game's may be shorter still).
7
- * `undefined` otherwise.
8
- */
9
- export function shortGatesHorizon(pc, threats) {
10
- if (!pc.auto || pc.profile.format !== '1v1' || pc.capturePaybackTurns <= SHORT_GATES_PAYBACK_TURNS)
11
- return undefined;
12
- const ours = (n) => pc.mineSet.has(n);
13
- let deficit = 0;
14
- let player;
15
- for (const x of pc.mine) {
16
- const th = threats.nextTurnAt(x, ours);
17
- if (!th)
18
- continue;
19
- player ??= th.player;
20
- deficit += Math.max(0, threats.holdArmies(th.threat) - pc.armiesOf(x) - pc.unitsAt(x));
21
- }
22
- if (player === undefined || deficit <= pc.income)
23
- return undefined;
24
- return { player, deficit, turns: SHORT_GATES_PAYBACK_TURNS };
25
- }
26
- /** The rationale line for {@link shortGatesHorizon}'s reading. */
27
- export function shortGatesLine(pc, s) {
28
- return `Gate budget short (#432): in this 1v1 the gates facing player ${s.player} need ${s.deficit} more than stands on them against its one floating deploy, more than my income of ${pc.income}, so every capture's payback test counts ${s.turns} turns instead of ${pc.capturePaybackTurns} (holds keep ${pc.paybackTurns}).`;
29
- }
30
- /**
31
- * Apply {@link shortGatesHorizon} to the plan: its rationale line, and the shorter horizon every later phase reads
32
- * from `pc.capturePaybackTurns` (holds keep `pc.paybackTurns`). Run right after the threats phase (nothing before it applies a payback test).
33
- */
34
- export function applyShortGates(pc, ps, threats) {
35
- const sg = shortGatesHorizon(pc, threats);
36
- if (!sg)
37
- return undefined;
38
- ps.rationale.push(shortGatesLine(pc, sg));
39
- pc.capturePaybackTurns = sg.turns;
40
- pc.shortGates = sg;
41
- return sg;
42
- }