@chrischall/warapp-mcp 0.7.0 → 0.8.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +2 -2
- package/dist/analysis/card-support.js +12 -4
- package/dist/analysis/coalition.js +55 -0
- package/dist/analysis/local-deploy.js +14 -0
- package/dist/analysis/opponents.js +2 -1
- package/dist/analysis/picks.js +270 -37
- package/dist/analysis/plan/after-leftover.js +26 -4
- package/dist/analysis/plan/captures.js +76 -13
- package/dist/analysis/plan/completed.js +8 -1
- package/dist/analysis/plan/conceded-out.js +16 -11
- package/dist/analysis/plan/deploy-estimates.js +513 -0
- package/dist/analysis/plan/doomed-out.js +135 -0
- package/dist/analysis/plan/estimates.js +3 -1
- package/dist/analysis/plan/free-capture.js +34 -0
- package/dist/analysis/plan/holds.js +8 -309
- package/dist/analysis/plan/horizon.js +42 -0
- package/dist/analysis/plan/leftover.js +43 -5
- package/dist/analysis/plan/observe.js +896 -0
- package/dist/analysis/plan/orders.js +35 -1
- package/dist/analysis/plan/report.js +10 -4
- package/dist/analysis/plan/shared.js +4 -1376
- package/dist/analysis/plan/stand-still.js +5 -3
- package/dist/analysis/plan/state.js +12 -0
- package/dist/analysis/plan/strike-stack.js +467 -0
- package/dist/analysis/plan/strike.js +3 -463
- package/dist/analysis/plan/targets.js +213 -26
- package/dist/analysis/plan/threats.js +12 -4
- package/dist/analysis/plan/transfers.js +24 -1
- package/dist/analysis/plan/two-move.js +1 -1
- package/dist/analysis/plan/withdraw.js +316 -0
- package/dist/analysis/planner.js +54 -11
- package/dist/analysis/player.js +4 -0
- package/dist/analysis/relations.js +8 -2
- package/dist/analysis/stress.js +1 -1
- package/dist/bundle.js +8008 -7184
- package/dist/my-games.js +2 -0
- package/dist/open-games.js +94 -10
- package/dist/tools/card-advice.js +26 -11
- package/dist/tools/card-support-advice.js +17 -1
- package/dist/tools/check-plan.js +2 -1
- package/dist/tools/commander-check.js +2 -1
- package/dist/tools/decision-capture.js +4 -2
- package/dist/tools/join-game.js +44 -8
- package/dist/tools/live.js +33 -5
- package/dist/tools/open-games.js +2 -2
- package/dist/tools/picks.js +120 -47
- package/dist/tools/turn.js +43 -4
- package/dist/version.js +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/tools/picks.js
CHANGED
|
@@ -21,6 +21,36 @@ import { keepPickable } from './where.js';
|
|
|
21
21
|
import { resolveTeams } from './team-source.js';
|
|
22
22
|
import { capturePicksAdvice, picksAdviceLog } from './decision-capture.js';
|
|
23
23
|
const VIEWS = ['compact', 'full'];
|
|
24
|
+
/** #(large maps) The time budget of one plan, milliseconds; `WARAPP_PICKS_BUDGET_MS` sets it (0 or less: none). */
|
|
25
|
+
export const DEFAULT_PICKS_BUDGET_MS = 20_000;
|
|
26
|
+
/** The compact view's caps, so its size does not grow with the map: lists beyond them become counts. `submitPicks` is never cut. */
|
|
27
|
+
export const COMPACT_REASONS = 8;
|
|
28
|
+
export const COMPACT_DETAILED_PICKS = 30;
|
|
29
|
+
export const COMPACT_THREATS = 6;
|
|
30
|
+
export const COMPACT_BONUSES = 15;
|
|
31
|
+
export const COMPACT_UNCOVERED = 15;
|
|
32
|
+
export const COMPACT_LINES = 15;
|
|
33
|
+
/** The compact view is capped only for a very large map or a list longer than this. */
|
|
34
|
+
export const COMPACT_LONG_LIST = 100;
|
|
35
|
+
const capped = (xs, n, full) => ({
|
|
36
|
+
items: full ? [...xs] : xs.slice(0, n),
|
|
37
|
+
omitted: full ? 0 : Math.max(0, xs.length - n),
|
|
38
|
+
});
|
|
39
|
+
/** `{ [key]: lines }` capped in the compact view, with `<key>Omitted` counting what was cut. */
|
|
40
|
+
function cappedLines(key, lines, full) {
|
|
41
|
+
const l = capped(lines, COMPACT_LINES, full);
|
|
42
|
+
return { [key]: l.items, ...(l.omitted ? { [`${key}Omitted`]: l.omitted } : {}) };
|
|
43
|
+
}
|
|
44
|
+
/** The plan's time budget in milliseconds from the environment (undefined: no budget). */
|
|
45
|
+
export function picksBudgetMs(env) {
|
|
46
|
+
const raw = (env ?? process.env).WARAPP_PICKS_BUDGET_MS;
|
|
47
|
+
if (raw === undefined || raw.trim() === '')
|
|
48
|
+
return DEFAULT_PICKS_BUDGET_MS;
|
|
49
|
+
const n = Number(raw);
|
|
50
|
+
if (!Number.isFinite(n))
|
|
51
|
+
return DEFAULT_PICKS_BUDGET_MS;
|
|
52
|
+
return n > 0 ? Math.floor(n) : undefined;
|
|
53
|
+
}
|
|
24
54
|
/** The only GameFeed state in which territories are picked. */
|
|
25
55
|
export const PICK_PHASE_STATE = 'DistributingTerritories';
|
|
26
56
|
/** TerritoryLimit assumed when the settings do not say (war.app's usual default; shared with the outlook). */
|
|
@@ -41,6 +71,7 @@ export function pickTerritoryLimit(settings, players, pickable) {
|
|
|
41
71
|
const limit = Math.max(1, Math.floor(pickable / n));
|
|
42
72
|
return {
|
|
43
73
|
limit,
|
|
74
|
+
fullDeal: true,
|
|
44
75
|
warning: `Full distribution (DistributionMode 0, no territory limit): every territory is dealt, so each of the ${n} players gets about ${limit} of the ${pickable} pickable; the list only says which you would rather hold.`,
|
|
45
76
|
};
|
|
46
77
|
}
|
|
@@ -130,6 +161,9 @@ export function registerPickTools(server, ctx, deps = {}) {
|
|
|
130
161
|
'way into every region matter more than the fastest start — the user chooses per game. ' +
|
|
131
162
|
'Its `submitPicks` is exactly what warapp_submit_picks ' +
|
|
132
163
|
'takes — review it with the user first. Refuses outside the picking stage or when nothing is pickable. ' +
|
|
164
|
+
'On a very large map (over 400 pickable territories) only the territories that score best alone are ranked, 400 at the default budget and more with a larger one (`candidates` says how many); ' +
|
|
165
|
+
'the plan has a time budget (20 s; `WARAPP_PICKS_BUDGET_MS` sets it, 0 for none) and, when it runs out, answers `partial: true` with a valid list; ' +
|
|
166
|
+
'the compact view caps its reasons, threats, coverage and warning lists (counts say what was cut; `submitPicks` is never cut). ' +
|
|
133
167
|
'In a team game only the players off your team are threats, `team` names your teammates, and the list is judged by both award ' +
|
|
134
168
|
"orders that fit (`award.orders`; a team game's is unverified). When a teammate's pick list can be read (unverified), each " +
|
|
135
169
|
"teammate carries `picks`, and `team.coordination` reports the overlap with your list, the bonuses their top picks into " +
|
|
@@ -189,44 +223,73 @@ export function registerPickTools(server, ctx, deps = {}) {
|
|
|
189
223
|
for (const mate of team)
|
|
190
224
|
mateLists.push(await readTeammatePicks(ctx, game.id, mate, entries?.find((e) => e.playerId === mate.id)));
|
|
191
225
|
}
|
|
226
|
+
// #435: an unread list is unknown, not empty: say to hold the submit (warapp_submit_picks refuses meanwhile).
|
|
227
|
+
const unreadMates = (team ?? []).filter((_, i) => mateLists[i] === null).map((p) => p.id);
|
|
228
|
+
if (unreadMates.length)
|
|
229
|
+
warnings.push(`Your teammate's list (player ${unreadMates.join(', ')}) could not be read, so this plan cannot avoid their picks: ` +
|
|
230
|
+
'hold the submit until it can be read or a list is agreed in team chat (warapp_submit_picks refuses meanwhile unless without_teammate_list: true).');
|
|
192
231
|
const lists = mateLists.map((l) => l?.territories ?? []);
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
232
|
+
const budgetMs = picksBudgetMs(deps.env);
|
|
233
|
+
let plan;
|
|
234
|
+
try {
|
|
235
|
+
plan = planPicks({
|
|
236
|
+
graph: graphOf(map),
|
|
237
|
+
pickable,
|
|
238
|
+
settings,
|
|
239
|
+
players,
|
|
240
|
+
territoryLimit,
|
|
241
|
+
maxPicks,
|
|
242
|
+
neutralArmies,
|
|
243
|
+
spread: spread === true,
|
|
244
|
+
...(team ? { team: { teammates: team.length, ...(lists.some((l) => l.length) ? { lists } : {}) } } : {}),
|
|
245
|
+
...(budgetMs !== undefined ? { budgetMs } : {}),
|
|
246
|
+
...(limitRead.fullDeal ? { fullDeal: true } : {}),
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
// A failure inside the advisor is a tool error with a reason, never a silent host failure.
|
|
251
|
+
throw new McpToolError(`The pick advisor failed on game ${game.id} (${map.territories.length} territories, ${players} players): ${e instanceof Error ? e.message : String(e)}`, {
|
|
252
|
+
hint: 'Nothing was submitted. Try again, or set WARAPP_PICKS_BUDGET_MS lower; report this if it repeats.',
|
|
253
|
+
});
|
|
254
|
+
}
|
|
204
255
|
const name = namer(map);
|
|
205
256
|
const bonusName = bonusNamer(map);
|
|
206
257
|
const coord = plan.team;
|
|
207
|
-
const groupView = (g) =>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
258
|
+
const groupView = (g, full) => {
|
|
259
|
+
const bs = capped(g.bonuses, COMPACT_BONUSES, full);
|
|
260
|
+
return {
|
|
261
|
+
territories: g.territoryIds.map(name),
|
|
262
|
+
score: g.score,
|
|
263
|
+
maxHops: g.maxHops,
|
|
264
|
+
bonuses: bs.items.map((b) => {
|
|
265
|
+
const th = capped(b.threats, COMPACT_THREATS, full);
|
|
266
|
+
return {
|
|
267
|
+
id: b.bonusId,
|
|
268
|
+
name: b.name,
|
|
269
|
+
value: b.value,
|
|
270
|
+
turn: b.turn,
|
|
271
|
+
threats: th.items.map(name),
|
|
272
|
+
...(th.omitted ? { threatsOmitted: th.omitted } : {}),
|
|
273
|
+
};
|
|
274
|
+
}),
|
|
275
|
+
...(bs.omitted ? { bonusesOmitted: bs.omitted } : {}),
|
|
276
|
+
twoOrderCaptures: g.twoOrderCaptures.map((c) => ({
|
|
277
|
+
turn: c.turn,
|
|
278
|
+
territory: name(c.territoryId),
|
|
279
|
+
orders: c.orders.map((o) => ({ from: name(o.from), armies: o.armies })),
|
|
280
|
+
})),
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
const coverageView = (c, full) => {
|
|
284
|
+
const u = capped(c.uncovered, COMPACT_UNCOVERED, full);
|
|
285
|
+
return {
|
|
286
|
+
share: c.share,
|
|
287
|
+
covered: c.covered,
|
|
288
|
+
reasonable: c.reasonable,
|
|
289
|
+
uncovered: u.items.map((b) => ({ id: b.bonusId, name: b.name })),
|
|
290
|
+
...(u.omitted ? { uncoveredOmitted: u.omitted } : {}),
|
|
291
|
+
};
|
|
292
|
+
};
|
|
230
293
|
const alt = plan.alternative;
|
|
231
294
|
// #312 E3: what my finished games on this map say (reported only: the ranking above never reads it).
|
|
232
295
|
const record = await mapRecordFor(ctx.dataDir, deps.env, game.settings?.mapId);
|
|
@@ -239,6 +302,9 @@ export function registerPickTools(server, ctx, deps = {}) {
|
|
|
239
302
|
warnings,
|
|
240
303
|
...(team ? { team: { teammates: team.map((p) => p.id), listsRead: mateLists.filter((l) => l !== null).length, mirrored: !!coord?.mirrored } } : {}),
|
|
241
304
|
}));
|
|
305
|
+
// The caps apply to the compact view of a game big enough to need them (a very large map, or a very long list);
|
|
306
|
+
// a small game's compact view is the whole answer, as before.
|
|
307
|
+
const lean = (rung) => rung !== 'full' && (plan.candidates !== undefined || plan.picks.length > COMPACT_LONG_LIST);
|
|
242
308
|
return respond(view, VIEWS, (rung) => ({
|
|
243
309
|
game: { id: game.id, name: game.name ?? null, state: game.state },
|
|
244
310
|
players,
|
|
@@ -291,16 +357,21 @@ export function registerPickTools(server, ctx, deps = {}) {
|
|
|
291
357
|
},
|
|
292
358
|
}
|
|
293
359
|
: {}),
|
|
294
|
-
picks: plan.picks.map((p, i) =>
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
360
|
+
picks: plan.picks.map((p, i) => {
|
|
361
|
+
// The compact view keeps the first picks' reasons (capped) and counts the rest, so it stays small on any map.
|
|
362
|
+
const r = capped(p.reasons, i < COMPACT_DETAILED_PICKS ? COMPACT_REASONS : 0, !lean(rung));
|
|
363
|
+
return {
|
|
364
|
+
priority: i + 1,
|
|
365
|
+
territory: name(p.territoryId),
|
|
366
|
+
group: p.group,
|
|
367
|
+
score: p.score,
|
|
368
|
+
reasons: r.items,
|
|
369
|
+
...(r.omitted ? { reasonsOmitted: r.omitted } : {}),
|
|
370
|
+
};
|
|
371
|
+
}),
|
|
301
372
|
groups: {
|
|
302
|
-
primary: { ...groupView(plan.groups.primary), coverage: coverageView(plan.coverage) },
|
|
303
|
-
fallback: groupView(plan.groups.fallback),
|
|
373
|
+
primary: { ...groupView(plan.groups.primary, !lean(rung)), coverage: coverageView(plan.coverage, !lean(rung)) },
|
|
374
|
+
fallback: groupView(plan.groups.fallback, !lean(rung)),
|
|
304
375
|
},
|
|
305
376
|
award: plan.award
|
|
306
377
|
? {
|
|
@@ -323,14 +394,16 @@ export function registerPickTools(server, ctx, deps = {}) {
|
|
|
323
394
|
...(plan.side.contested ? { contested: plan.side.contested } : {}),
|
|
324
395
|
...(plan.side.note ? { note: plan.side.note } : {}),
|
|
325
396
|
},
|
|
326
|
-
|
|
327
|
-
|
|
397
|
+
...(plan.partial ? { partial: true } : {}),
|
|
398
|
+
...(plan.candidates ? { candidates: plan.candidates } : {}),
|
|
399
|
+
...cappedLines('warnings', [...warnings, ...plan.warnings], !lean(rung)),
|
|
400
|
+
...cappedLines('rationale', plan.rationale, !lean(rung)),
|
|
328
401
|
submitPicks: { game_id: game.id, territories: plan.picks.map((p) => p.territoryId) },
|
|
329
402
|
...(alt
|
|
330
403
|
? {
|
|
331
404
|
alternative: {
|
|
332
|
-
...groupView(alt.group),
|
|
333
|
-
coverage: coverageView(alt.coverage),
|
|
405
|
+
...groupView(alt.group, !lean(rung)),
|
|
406
|
+
coverage: coverageView(alt.coverage, !lean(rung)),
|
|
334
407
|
fallback: alt.fallback.map(name),
|
|
335
408
|
submitPicks: { game_id: game.id, territories: alt.submitPicks },
|
|
336
409
|
},
|
package/dist/tools/turn.js
CHANGED
|
@@ -19,7 +19,7 @@ import { SERVER_ERROR_MESSAGES } from '../protocol/rpc.js';
|
|
|
19
19
|
import { inferFirstMover } from '../move-order.js';
|
|
20
20
|
import { assumedWarning, awardView, firstMoverFor, loadAward, openingThreat } from './award.js';
|
|
21
21
|
import { boardCardsInEffect, CARDS_IN_EFFECT_UNVERIFIED, sanctionMyIncome } from './card-effects.js';
|
|
22
|
-
import { adviseCards, cardGame, cardPieceOption, intelOrders, handOwners, opponentCanHold, opponentReinforcement, TEAM_HAND } from './card-advice.js';
|
|
22
|
+
import { adviseCards, cardGame, cardPieceOption, giftInOrders, intelOrders, handOwners, opponentCanHold, opponentReinforcement, TEAM_HAND } from './card-advice.js';
|
|
23
23
|
import { currentTurn, turnsCompleted, gameIdArg, knownIncomeArg, avoidPlayersArg, avoidTerritoriesArg, graphOf, namer, readAnnotations, respond, shownAccount, UNTRUSTED_PREVIEW_NOTE, untrustedDescription, untrustedText, viewArg, } from './common.js';
|
|
24
24
|
import { lookupMeta, mintMeta } from './hints.js';
|
|
25
25
|
import { chatSummary } from './chat.js';
|
|
@@ -43,6 +43,8 @@ import { checkCardFields, newCardPlaySeen, resolveCardTargets, } from './card-pl
|
|
|
43
43
|
import { boardFromHistory, CACHED_TURNS, readBoardHistory, readCachedOrders, readExpectedIncome, writeBoardCache, writeOrdersCache, } from '../trend.js';
|
|
44
44
|
import { writeGameRecord } from '../replay.js';
|
|
45
45
|
import { gameOutlook } from '../analysis/outlook.js';
|
|
46
|
+
import { coalitionAdvice } from '../analysis/coalition.js';
|
|
47
|
+
import { holdsSeat } from '../player-states.js';
|
|
46
48
|
import { neutralizeSeats, seatEndRules, staticSeats } from '../analysis/static-seats.js';
|
|
47
49
|
import { cardArmyCeiling, cardClock } from '../strategy/card-clock.js';
|
|
48
50
|
import { hasCostlyBonus, noteContext, notesFor } from '../strategy/notes.js';
|
|
@@ -55,6 +57,7 @@ import { readPickRecord } from '../pick-list.js';
|
|
|
55
57
|
import { commitmentWarnings } from '../analysis/commitments.js';
|
|
56
58
|
import { planRelationsFrom, truceBreaksIn } from '../analysis/relations.js';
|
|
57
59
|
import { recordBrokenByMe } from './relations.js';
|
|
60
|
+
import { readPlayerRecord } from '../player-record-store.js';
|
|
58
61
|
import { withTeammateOrders } from '../team-orders.js';
|
|
59
62
|
import { claimedCardUses, claimedCardWarning, teamCardClaims, teamCardLimit, teamCardRoles, teamHandLeft, unclaimedFirst, } from '../team-cards.js';
|
|
60
63
|
import { isTeamGame, teammatesOf } from '../teams.js';
|
|
@@ -1417,6 +1420,8 @@ export async function livePlanSetup(ctx, a) {
|
|
|
1417
1420
|
// PLAN-TEAMS C3.6: a joint capture under a cyclic order says whose attack must run first.
|
|
1418
1421
|
...(isTeamGame(game.players) && game.settings?.moveOrder !== undefined ? { moveOrder: game.settings.moveOrder } : {}),
|
|
1419
1422
|
cards: rules.inPlay.length > 0,
|
|
1423
|
+
// #435: the shared-bonus handover needs a Gift card in play.
|
|
1424
|
+
cardsInPlay: [...rules.inPlay],
|
|
1420
1425
|
// #119: a 1v1 that started even gets the fog prior (an opponent in the fog earns at least my income).
|
|
1421
1426
|
symmetricStart: symmetricStart(game.settings),
|
|
1422
1427
|
// #235: why not, when it was not (the plan says so in a free-for-all).
|
|
@@ -2154,14 +2159,19 @@ export function registerTurnTools(server, ctx, opts = {}) {
|
|
|
2154
2159
|
const plays = advised ? [...cards.plays, advised] : cards.plays;
|
|
2155
2160
|
// #163: an Order Delay that had to go is played where the plan advises it, not discarded.
|
|
2156
2161
|
const playedDelay = advice.view.orderDelay?.card;
|
|
2162
|
+
const gift = giftInOrders(advice.view);
|
|
2157
2163
|
const orders = [
|
|
2158
2164
|
...cards.discards.filter((c) => c.id !== playedDelay).map((c) => ({ kind: 'discard', card: c.id })),
|
|
2159
2165
|
...plays.map((c) => ({ kind: 'card', card: c.id })),
|
|
2160
2166
|
// #434: a spy card advised in heavy fog whose play is verified live (none yet: all are UNVERIFIED_CARD_PLAYS).
|
|
2161
2167
|
...intelOrders(advice.view),
|
|
2168
|
+
// #435: a completing Gift whose play is verified live (Gift is not yet), with the transfers it drops left out.
|
|
2169
|
+
...gift.cards,
|
|
2162
2170
|
...plan.deploys.map((d) => ({ kind: 'deploy', territory: d.territoryId, armies: d.armies })),
|
|
2163
2171
|
// #274: my commander's walk takes it along (the #165 option, encoding unverified live).
|
|
2164
|
-
...plan.moves
|
|
2172
|
+
...plan.moves
|
|
2173
|
+
.filter((m) => !gift.drops(m))
|
|
2174
|
+
.map((m) => ({ kind: 'move', from: m.from, to: m.to, armies: m.armies, ...(m.commander ? { commander: true } : {}) })),
|
|
2165
2175
|
// #186: the advised Order Delay, placed above its move (war.app accepted the placement live;
|
|
2166
2176
|
// whether the later moves wait for the opponent's is not yet seen in a replay).
|
|
2167
2177
|
...(advice.view.orderDelay ? [advice.view.orderDelay.order] : []),
|
|
@@ -2280,6 +2290,34 @@ export function registerTurnTools(server, ctx, opts = {}) {
|
|
|
2280
2290
|
warnings.push(`siege_target is ignored: it applies only with goal "siege" (this plan's goal is ${goal ?? 'chosen by the game profile'}).`);
|
|
2281
2291
|
// #317: a surrender waiting on my acceptance is the first thing said, before the commander's line.
|
|
2282
2292
|
// #436: the surrender line, advice only (the server never acts on it): said up front once crossed.
|
|
2293
|
+
// #445: in a free-for-all of three or more, a coalition against the leader comes before the surrender advice.
|
|
2294
|
+
const ranking = plan.profile.ranking;
|
|
2295
|
+
// #445 (owner, 2026-11-22): a player that broke a truce is never a partner; the cross-game record says who.
|
|
2296
|
+
const breakers = new Set();
|
|
2297
|
+
if (outlook.surrenderLine?.crossed && plan.profile.format === 'ffa' && ranking && ctx.dataDir)
|
|
2298
|
+
for (const r of ranking.players) {
|
|
2299
|
+
if (r.playerId === me.id || r.playerId === ranking.leader)
|
|
2300
|
+
continue;
|
|
2301
|
+
const rec = await readPlayerRecord(ctx.dataDir, r.playerId, opts.env);
|
|
2302
|
+
if (rec && rec !== 'off' && rec !== 'unreadable' && rec.tallies.brokenByThem > 0)
|
|
2303
|
+
breakers.add(r.playerId);
|
|
2304
|
+
}
|
|
2305
|
+
const coalition = outlook.surrenderLine?.crossed && plan.profile.format === 'ffa' && ranking && ranking.leader !== me.id
|
|
2306
|
+
? (() => {
|
|
2307
|
+
const leaderLand = new Set();
|
|
2308
|
+
for (const t of board.territories)
|
|
2309
|
+
if (t.owner.kind === 'player' && t.owner.playerId === ranking.leader)
|
|
2310
|
+
leaderLand.add(t.territoryId);
|
|
2311
|
+
const beside = new Set();
|
|
2312
|
+
for (const t of board.territories)
|
|
2313
|
+
if (t.owner.kind === 'player' && t.owner.playerId !== ranking.leader && neighborsOf(graph, t.territoryId).some((n) => leaderLand.has(n)))
|
|
2314
|
+
beside.add(t.owner.playerId);
|
|
2315
|
+
const out = new Set(game.players.filter((p) => !holdsSeat(p.state)).map((p) => Number(p.id)));
|
|
2316
|
+
return coalitionAdvice({ rows: ranking.players, me: me.id, leader: ranking.leader, bordersLeader: beside, excluded: out, breakers });
|
|
2317
|
+
})()
|
|
2318
|
+
: null;
|
|
2319
|
+
if (coalition?.viable)
|
|
2320
|
+
warnings.unshift(coalition.advice);
|
|
2283
2321
|
if (outlook.surrenderLine?.crossed)
|
|
2284
2322
|
warnings.unshift(outlook.surrenderLine.advice);
|
|
2285
2323
|
const owedLine = surrenderOwedLine(surrenders);
|
|
@@ -2352,6 +2390,7 @@ export function registerTurnTools(server, ctx, opts = {}) {
|
|
|
2352
2390
|
...(plan.jabs ? { jabs: plan.jabs } : {}),
|
|
2353
2391
|
// #298: the contested bonuses pushed all-in or dropped after repeated failed attempts; absent with none.
|
|
2354
2392
|
...(plan.bonusPush ? { bonusPush: plan.bonusPush } : {}),
|
|
2393
|
+
...(coalition ? { coalition } : {}),
|
|
2355
2394
|
// #276: the guard case first, on or off, with what it means for interior defence.
|
|
2356
2395
|
profile: rung === 'full'
|
|
2357
2396
|
? { guard: guardCase(game.settings), ...plan.profile }
|
|
@@ -2513,8 +2552,8 @@ export function registerTurnTools(server, ctx, opts = {}) {
|
|
|
2513
2552
|
...(advice.view.orderDelay && orders.some((o) => o.kind === 'card' && o.card === advice.view.orderDelay.card)
|
|
2514
2553
|
? myHand.filter((c) => c.id === advice.view.orderDelay.card)
|
|
2515
2554
|
: []),
|
|
2516
|
-
// #434: a verified spy-card play the orders carry.
|
|
2517
|
-
...myHand.filter((c) => intelOrders(advice.view).some((o) => o.card === c.id)),
|
|
2555
|
+
// #434: a verified spy-card play the orders carry; #435: a verified completing Gift.
|
|
2556
|
+
...myHand.filter((c) => [...intelOrders(advice.view), ...gift.cards].some((o) => o.card === c.id)),
|
|
2518
2557
|
],
|
|
2519
2558
|
discards: cards.discards,
|
|
2520
2559
|
}).map((r) => ({ ...r, by: r.by === null || r.by === 'me' ? r.by : playerRef(r.by) })),
|
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
|
+
export const VERSION = '0.8.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.
|
|
6
|
+
"version": "0.8.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, 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.
|
|
3
|
+
"version": "0.8.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.
|
|
9
|
+
"version": "0.8.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@chrischall/warapp-mcp",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.8.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|