@chrischall/warapp-mcp 0.22.1 → 0.23.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.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +49 -3
- package/dist/analysis/coalition.js +3 -2
- package/dist/analysis/outlook.js +42 -2
- package/dist/analysis/plan/captures.js +3 -1
- package/dist/analysis/plan/relations.js +1 -1
- package/dist/analysis/plan/report.js +2 -2
- package/dist/analysis/plan/targets.js +48 -12
- package/dist/analysis/plan/threats.js +55 -2
- package/dist/analysis/planner.js +2 -1
- package/dist/analysis/relations.js +40 -7
- package/dist/bundle.js +10250 -3744
- package/dist/chat.js +93 -3
- package/dist/clans.js +308 -0
- package/dist/forums.js +70 -0
- package/dist/friends.js +83 -0
- package/dist/index.js +1 -1
- package/dist/invite-code.js +46 -0
- package/dist/join-color.js +23 -13
- package/dist/ladders.js +360 -0
- package/dist/mail.js +295 -0
- package/dist/my-games.js +18 -1
- package/dist/notifications.js +22 -4
- package/dist/open-games.js +29 -2
- package/dist/outlook-log.js +1 -0
- package/dist/protocol/bundle.js +4 -4
- package/dist/protocol/codec.js +1 -1
- package/dist/protocol/methods.js +690 -8
- package/dist/protocol/rpc.js +28 -3
- package/dist/push/socketio.js +2 -2
- package/dist/quickmatch.js +264 -0
- package/dist/surrender-pending.js +62 -2
- package/dist/templates.js +451 -0
- package/dist/tools/boot-player.js +165 -0
- package/dist/tools/calibration-harness.js +8 -1
- package/dist/tools/calibration.js +14 -2
- package/dist/tools/chat.js +19 -0
- package/dist/tools/clan-writes.js +208 -0
- package/dist/tools/clans.js +181 -0
- package/dist/tools/end-game-common.js +49 -0
- package/dist/tools/forums.js +535 -0
- package/dist/tools/friends.js +50 -0
- package/dist/tools/game.js +21 -3
- package/dist/tools/index.js +39 -0
- package/dist/tools/invites.js +347 -0
- package/dist/tools/join-game.js +4 -4
- package/dist/tools/ladders.js +418 -0
- package/dist/tools/leave-game.js +85 -27
- package/dist/tools/live-context.js +2 -2
- package/dist/tools/mail.js +600 -0
- package/dist/tools/my-games.js +50 -6
- package/dist/tools/notifications.js +12 -3
- package/dist/tools/nudge.js +178 -0
- package/dist/tools/quickmatch.js +481 -0
- package/dist/tools/react.js +177 -0
- package/dist/tools/relations.js +3 -2
- package/dist/tools/session.js +6 -2
- package/dist/tools/team-surrender.js +206 -0
- package/dist/tools/templates.js +342 -0
- package/dist/tools/tournaments.js +495 -0
- package/dist/tools/turn.js +4 -1
- package/dist/tools/vote-to-end.js +142 -0
- package/dist/tools/write-kit.js +22 -1
- package/dist/tournaments.js +321 -0
- package/dist/trend.js +1 -0
- package/dist/version.js +1 -1
- package/manifest.json +190 -2
- package/mint.yaml +3 -4
- package/package.json +1 -1
- package/server.json +2 -2
- package/skills/warapp-mcp/SKILL.md +39 -6
|
@@ -226,7 +226,10 @@ function territoryMap(board) {
|
|
|
226
226
|
function mineOn(board, me) {
|
|
227
227
|
return new Set(board.territories.filter((t) => ownerShown(t) && ownerOn(t) === me).map((t) => t.territoryId));
|
|
228
228
|
}
|
|
229
|
-
/**
|
|
229
|
+
/**
|
|
230
|
+
* What my orders say should stand on `t` after the turn (deploys, moves out, moves in from mine, and
|
|
231
|
+
* #665: my Airlifts out and in, when the cache kept their count).
|
|
232
|
+
*/
|
|
230
233
|
function expectedArmies(t, before, orders, mine) {
|
|
231
234
|
let n = before;
|
|
232
235
|
for (const d of orders.deploys)
|
|
@@ -238,8 +241,32 @@ function expectedArmies(t, before, orders, mine) {
|
|
|
238
241
|
if (m.to === t && mine.has(m.from))
|
|
239
242
|
n += m.armies;
|
|
240
243
|
}
|
|
244
|
+
for (const c of orders.cards ?? []) {
|
|
245
|
+
if (c.card !== 'Airlift' || c.armies === undefined)
|
|
246
|
+
continue;
|
|
247
|
+
if (c.from === t)
|
|
248
|
+
n -= c.armies;
|
|
249
|
+
if (c.to === t && c.from !== undefined && mine.has(c.from))
|
|
250
|
+
n += c.armies;
|
|
251
|
+
}
|
|
241
252
|
return n;
|
|
242
253
|
}
|
|
254
|
+
/** #665: my card plays that hand a territory over (to a player, or to the neutral). */
|
|
255
|
+
const GIVES_AWAY = new Set(['Gift', 'Blockade', 'EmergencyBlockade']);
|
|
256
|
+
/** #665: whether my own card play gave `t` away this turn (its new owner is no evidence against anyone). */
|
|
257
|
+
function gaveAway(t, orders) {
|
|
258
|
+
return (orders?.cards ?? []).some((c) => GIVES_AWAY.has(c.card) && c.target === t);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* #665: whether an Airlift of mine may have moved armies on `t` that my orders do not count: one touching
|
|
262
|
+
* it cached without its count, or card plays not recorded at all (an older cache) in a game that may have
|
|
263
|
+
* Airlift (`cards` absent: the settings were not read, any card may be).
|
|
264
|
+
*/
|
|
265
|
+
function airliftUncounted(t, orders, cards) {
|
|
266
|
+
if (orders.cards === undefined)
|
|
267
|
+
return cards === undefined || cards.includes('Airlift');
|
|
268
|
+
return orders.cards.some((c) => c.card === 'Airlift' && c.armies === undefined && (c.from === t || c.to === t));
|
|
269
|
+
}
|
|
243
270
|
/**
|
|
244
271
|
* Whether a transfer of mine into `t` may not have arrived in full: its source is no longer shown
|
|
245
272
|
* as mine, or holds fewer armies than my orders leave there (it was hit, so the move may never have
|
|
@@ -292,9 +319,10 @@ export function capSelfCheck(a, boards, me) {
|
|
|
292
319
|
/**
|
|
293
320
|
* What my boards say about the partner keeping `agreement`, over the consecutive turns from the
|
|
294
321
|
* one it was agreed (and before it ended), as flags with their turn and evidence:
|
|
295
|
-
* - `broken`: the partner took a covered territory of mine
|
|
296
|
-
*
|
|
297
|
-
*
|
|
322
|
+
* - `broken`: the partner took a covered territory of mine (not one my own Gift or Blockade handed
|
|
323
|
+
* over, #665), or attacked one (my orders known, armies lost there beyond my deploys, moves and
|
|
324
|
+
* Airlifts, only the partner — visibly — borders it, no transfer of mine in came from a source taken
|
|
325
|
+
* or hit, which may never have arrived, and no Airlift of mine there went uncounted, #665);
|
|
298
326
|
* - `cap-exceeded` (newest board): a visible partner territory beside a covered one holds more
|
|
299
327
|
* than the cap;
|
|
300
328
|
* - `massing`: the partner's visible armies within {@link TRUCE_MASSING_REACH} steps of the
|
|
@@ -340,6 +368,9 @@ export function breachWatch(input) {
|
|
|
340
368
|
const shown = ownerShown(after);
|
|
341
369
|
const neighbours = neighborsOf(graph, c);
|
|
342
370
|
const partnerNext = neighbours.some((n) => ownerOn(ownerShown(was.get(n))) === partner || ownerOn(ownerShown(now.get(n))) === partner);
|
|
371
|
+
// #665: my own Gift or Blockade handed it over.
|
|
372
|
+
if (gaveAway(c, from.orders))
|
|
373
|
+
continue;
|
|
343
374
|
if (shown && ownerOn(shown) === partner) {
|
|
344
375
|
taken.push(c);
|
|
345
376
|
continue;
|
|
@@ -362,8 +393,9 @@ export function breachWatch(input) {
|
|
|
362
393
|
// cannot; a fogged neighbour or another player could.
|
|
363
394
|
if (!partnerNext)
|
|
364
395
|
continue;
|
|
365
|
-
// A transfer of mine in whose source was taken or hit may never have arrived
|
|
366
|
-
|
|
396
|
+
// A transfer of mine in whose source was taken or hit may never have arrived, and (#665) an Airlift of
|
|
397
|
+
// mine my orders cannot count may have moved them: open, not a break.
|
|
398
|
+
if (fedByHitSource(c, from.orders, mine, was, now, me) || airliftUncounted(c, from.orders, input.cards)) {
|
|
367
399
|
ambiguous.push(c);
|
|
368
400
|
continue;
|
|
369
401
|
}
|
|
@@ -631,6 +663,7 @@ export function planRelationsFrom(input) {
|
|
|
631
663
|
boards: input.boards,
|
|
632
664
|
me,
|
|
633
665
|
...(incomes.mine !== null ? { incomes: { mine: incomes.mine, partner: partnerIncome ?? null } } : {}),
|
|
666
|
+
...(input.cards ? { cards: input.cards } : {}),
|
|
634
667
|
});
|
|
635
668
|
const others = [...incomes.opponents].filter(([id]) => id !== a.with);
|
|
636
669
|
const endgame = incomes.mine !== null && partnerIncome !== null && partnerIncome !== undefined && others.every(([, v]) => v !== null)
|
|
@@ -920,7 +953,7 @@ export function truceVerdict(price, income) {
|
|
|
920
953
|
return {
|
|
921
954
|
verdict: 'no',
|
|
922
955
|
reasons: [
|
|
923
|
-
`player ${p} broke the truce${b ? `: ${b.term} on turn ${b.turn} (${b.evidence})` : ''}; it is an ordinary opponent now, and no truce is priced as trusted (T8)`,
|
|
956
|
+
`player ${p} broke the truce${b ? `: ${b.term} on turn ${b.turn} (${b.evidence})` : ''}; it is an ordinary opponent now, and no truce is priced as trusted (T8). If the partner had agreed to that move, record a \`theirs\` exception with warapp_record_agreement instead (#665)`,
|
|
924
957
|
],
|
|
925
958
|
};
|
|
926
959
|
}
|