@chrischall/warapp-mcp 0.4.0 → 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.
@@ -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;
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.4.0'; // 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.4.0",
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.4.0",
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.4.0",
9
+ "version": "0.5.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/warapp-mcp",
14
- "version": "0.4.0",
14
+ "version": "0.5.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },