@chrischall/warapp-mcp 0.3.1 → 0.5.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.
@@ -274,7 +274,8 @@ export function registerPushTools(server, ctx, push, deps = {}) {
274
274
  'through your signed-in war.app tab (ContextMint Bridge) — and re-checks a game whenever war.app says it ' +
275
275
  'changed, and every game after the push socket reconnects. It also returns (status `surrender_pending`) when ' +
276
276
  'another player\'s surrender waits for you to accept it (each game\'s `surrenderPending`, read from the game ' +
277
- 'details, unverified live: null when unreadable, never "none"; after one failed read it stops asking for the ' +
277
+ 'details, unverified live: null when unreadable, never "none"; empty without a read for a lobby, a finished ' +
278
+ 'game or one you no longer play in; after one failed read it stops asking for the ' +
278
279
  'rest of the wait and says why in `surrenderUnread`), unless `ignore_surrenders`. ' +
279
280
  'Pass the game ids to watch (1–20), or omit them to watch every game ' +
280
281
  'of yours being played or picked (the first 20, as warapp_my_games lists them). Reports progress while it ' +
@@ -70,9 +70,14 @@ export function registerSessionTools(server, deps) {
70
70
  return {
71
71
  decoder: {
72
72
  ...d,
73
- ...(d.fallback
74
- ? { note: "A cached copy of war.app's client is decoding boards: the current version could not be looked up." }
75
- : {}),
73
+ ...(d.standInFor
74
+ ? {
75
+ note: `war.app's current client (${d.standInFor.version}) cannot be read by this server, so the client release ` +
76
+ 'it was written for (still served by war.app) is decoding boards; war.app answers this server in that layout.',
77
+ }
78
+ : d.fallback
79
+ ? { note: "A cached copy of war.app's client is decoding boards: the current version could not be looked up." }
80
+ : {}),
76
81
  },
77
82
  };
78
83
  };
@@ -102,11 +107,13 @@ export function registerSessionTools(server, deps) {
102
107
  }, async () => {
103
108
  if (hosted && hostToken === 'ok') {
104
109
  const pt = deps.pushTransport?.();
110
+ const wall = deps.transport.wall?.() ?? null;
105
111
  const base = {
106
112
  hosted: true,
107
113
  linked: true,
108
114
  linkedBy: 'host',
109
115
  activeTransport: deps.transport.activeLeg(),
116
+ ...(wall ? { wall } : {}),
110
117
  ...(pt ? { pushTransport: pt } : {}),
111
118
  ...decoderView(),
112
119
  hostedNote: NOTE_HOSTED_DIRECT,
@@ -132,7 +139,16 @@ export function registerSessionTools(server, deps) {
132
139
  if (!session)
133
140
  return { linked: false, activeTransport, ...push, hint: HINT_NOT_LINKED };
134
141
  const ageSeconds = Math.max(0, Math.round((now() - Date.parse(session.capturedAt)) / 1000));
135
- const base = { linked: true, host: session.host, capturedAt: session.capturedAt, ageSeconds, activeTransport, ...push };
142
+ const wall = deps.transport.wall?.() ?? null;
143
+ const base = {
144
+ linked: true,
145
+ host: session.host,
146
+ capturedAt: session.capturedAt,
147
+ ageSeconds,
148
+ activeTransport,
149
+ ...(wall ? { wall } : {}),
150
+ ...push,
151
+ };
136
152
  return deps.transport.sessionStale() ? { ...base, sessionExpired: true, hint: HINT_EXPIRED } : base;
137
153
  });
138
154
  });
@@ -1,6 +1,6 @@
1
1
  // Reading the surrenders pending in a game (#317), for warapp_my_games, warapp_wait_for_turn and
2
2
  // warapp_plan_turn. A pending surrender lives only in the game details (src/surrender-pending.ts):
3
- // one GameRefresh (39) asked for the details and not the chat. UNVERIFIED live.
3
+ // one GameRefresh (40) asked for the details and not the chat. UNVERIFIED live.
4
4
  //
5
5
  // Never throws: a failed or unreadable read is `null` (unknown), never an empty list — an empty list
6
6
  // is a game whose details were read and showed no surrender pending.
@@ -10,14 +10,16 @@ import { pendingSurrenders, readGameDetailsSeats } from '../surrender-pending.js
10
10
  import { untrustedText } from './common.js';
11
11
  /** Where the read comes from, for a result's note. */
12
12
  export const SURRENDER_PENDING_NOTE = "Read from the game details (the web client's GameRefresh), UNVERIFIED live: a list is what the details showed " +
13
- '(empty: no surrender pending); null means they could not be read, not that none is pending. owedByMe true: the ' +
13
+ '(empty: no surrender pending); null means they could not be read, not that none is pending. A lobby, a finished ' +
14
+ 'game and a game you no longer play in are empty without a read (#327): no surrender there can wait on you. owedByMe true: the ' +
14
15
  'player is waiting for you to accept its surrender. Accepting is the owner\'s decision (it hands that player\'s land ' +
15
16
  'on and can end the game).';
16
17
  /** Game states in which a surrender can be pending. */
17
18
  const IN_PLAY = new Set(['Playing', 'DistributingTerritories']);
18
19
  /**
19
20
  * Whether a pending surrender can matter to me in a game: it is being played or picked and my seat is
20
- * still playing. Elsewhere no read is made (and the answer is `null`).
21
+ * still playing. Elsewhere no read is made, and the answer is an empty list (#327: a lobby or a finished
22
+ * game has no surrender pending, and a game I am out of owes none from me — nothing failed to read).
21
23
  */
22
24
  export function surrenderMayBePending(state, mySeatState) {
23
25
  return IN_PLAY.has(state) && mySeatState === 'Playing';
@@ -42,12 +44,15 @@ export async function readDetailsSeats(ctx, gameId) {
42
44
  }
43
45
  /**
44
46
  * The surrenders pending in a GameFeed game (`me`: my GameFeed seat), each with the player's GameFeed id
45
- * and name; `null` when the details could not be read, or when no surrender can matter to me there (the
46
- * game not being played or picked, or my seat out).
47
+ * and name; `null` when the details could not be read or my seat is unknown, and an empty list, read from
48
+ * nothing, when no surrender can matter to me there (the game not being played or picked, or my seat out:
49
+ * {@link surrenderMayBePending}, #327).
47
50
  */
48
51
  export async function readPendingSurrenders(ctx, game, me, read = (id) => readDetailsSeats(ctx, id)) {
49
- if (!me || !surrenderMayBePending(game.state, me.state))
52
+ if (!me)
50
53
  return null;
54
+ if (!surrenderMayBePending(game.state, me.state))
55
+ return [];
51
56
  const seats = await read(game.id);
52
57
  if (!seats)
53
58
  return null;
@@ -21,7 +21,7 @@ import { currentTurn, turnsCompleted, gameIdArg, graphOf, namer, readAnnotations
21
21
  import { lookupMeta, mintMeta } from './hints.js';
22
22
  import { chatSummary } from './chat.js';
23
23
  import { readPendingSurrenders, surrenderOwedLine } from './surrender-pending.js';
24
- import { failureText, loadLiveGame, requireApprovedAccount, writeAccount } from './live-context.js';
24
+ import { failureText, loadLiveGame, requireApprovedAccount, standInLine, standInOf, writeAccount } from './live-context.js';
25
25
  import { BRIDGE_NOTE, playerArg, resolveMe } from './live.js';
26
26
  import { guessOrdersOf, guessView } from './guess-view.js';
27
27
  import { guessSalt, peekGuessSalt } from '../guess-salt.js';
@@ -1904,6 +1904,10 @@ export function registerTurnTools(server, ctx, opts = {}) {
1904
1904
  const owedLine = surrenderOwedLine(surrenders);
1905
1905
  if (owedLine)
1906
1906
  warnings.unshift(owedLine);
1907
+ // The owner, 2026-11-17: while an older build stands in for a client this server cannot read, say so first.
1908
+ const standInNote = standInLine(standInOf(ctx));
1909
+ if (standInNote)
1910
+ warnings.unshift(standInNote);
1907
1911
  // #312 E3: after turns 4 and 8, my income beside the pace my finished games on this map set
1908
1912
  // (reported only: read after the plan is made, never an input to it).
1909
1913
  const paceRecord = PACE_TURNS.includes(turnsCompleted(game))
@@ -2669,6 +2673,10 @@ export function registerTurnTools(server, ctx, opts = {}) {
2669
2673
  }));
2670
2674
  if (belowPlan)
2671
2675
  warnings.push(belowPlan);
2676
+ // The owner, 2026-11-17: while an older build stands in for a client this server cannot read, say so first.
2677
+ const standInNote = standInLine(standInOf(ctx));
2678
+ if (standInNote)
2679
+ warnings.unshift(standInNote);
2672
2680
  // Deploys first (as the client sends them), merged per territory.
2673
2681
  const merged = new Map();
2674
2682
  for (const d of deploys) {
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.3.1'; // x-release-please-version
4
+ export const VERSION = '0.5.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.3.1",
6
+ "version": "0.5.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, 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 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.3.1",
3
+ "version": "0.5.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>",
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.3.1",
9
+ "version": "0.5.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/warapp-mcp",
14
- "version": "0.3.1",
14
+ "version": "0.5.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },