@chrischall/warapp-mcp 0.7.0 → 0.9.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.
Files changed (65) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +5 -4
  4. package/dist/analysis/card-support.js +12 -4
  5. package/dist/analysis/coalition.js +55 -0
  6. package/dist/analysis/local-deploy.js +14 -0
  7. package/dist/analysis/opponents.js +2 -1
  8. package/dist/analysis/picks.js +270 -37
  9. package/dist/analysis/plan/after-leftover.js +26 -4
  10. package/dist/analysis/plan/captures.js +86 -14
  11. package/dist/analysis/plan/completed.js +8 -1
  12. package/dist/analysis/plan/conceded-out.js +16 -11
  13. package/dist/analysis/plan/deploy-estimates.js +544 -0
  14. package/dist/analysis/plan/doomed-out.js +135 -0
  15. package/dist/analysis/plan/estimates.js +4 -1
  16. package/dist/analysis/plan/free-capture.js +34 -0
  17. package/dist/analysis/plan/holds.js +8 -309
  18. package/dist/analysis/plan/horizon.js +42 -0
  19. package/dist/analysis/plan/leftover.js +43 -5
  20. package/dist/analysis/plan/observe.js +896 -0
  21. package/dist/analysis/plan/orders.js +35 -1
  22. package/dist/analysis/plan/report.js +10 -4
  23. package/dist/analysis/plan/shared.js +4 -1376
  24. package/dist/analysis/plan/spread-bind.js +49 -0
  25. package/dist/analysis/plan/stand-still.js +5 -3
  26. package/dist/analysis/plan/state.js +12 -0
  27. package/dist/analysis/plan/strike-stack.js +467 -0
  28. package/dist/analysis/plan/strike.js +3 -463
  29. package/dist/analysis/plan/targets.js +219 -28
  30. package/dist/analysis/plan/threats.js +23 -9
  31. package/dist/analysis/plan/transfers.js +24 -1
  32. package/dist/analysis/plan/two-move.js +1 -1
  33. package/dist/analysis/plan/withdraw.js +316 -0
  34. package/dist/analysis/planner.js +106 -43
  35. package/dist/analysis/player.js +4 -0
  36. package/dist/analysis/relations.js +8 -2
  37. package/dist/analysis/stress.js +1 -1
  38. package/dist/bundle.js +4578 -3405
  39. package/dist/cards.js +37 -0
  40. package/dist/my-games.js +2 -0
  41. package/dist/my-orders.js +134 -0
  42. package/dist/open-games.js +94 -10
  43. package/dist/team-cards.js +2 -2
  44. package/dist/team-orders.js +51 -23
  45. package/dist/tools/card-advice.js +57 -13
  46. package/dist/tools/card-support-advice.js +17 -1
  47. package/dist/tools/check-plan.js +2 -1
  48. package/dist/tools/commander-check.js +2 -1
  49. package/dist/tools/decision-capture.js +4 -2
  50. package/dist/tools/index.js +3 -0
  51. package/dist/tools/join-game.js +44 -8
  52. package/dist/tools/live.js +43 -5
  53. package/dist/tools/my-orders.js +110 -0
  54. package/dist/tools/open-games.js +2 -2
  55. package/dist/tools/picks.js +128 -51
  56. package/dist/tools/team-brief.js +1 -1
  57. package/dist/tools/team.js +25 -9
  58. package/dist/tools/turn.js +61 -6
  59. package/dist/tools/uncommit.js +27 -5
  60. package/dist/trend.js +36 -1
  61. package/dist/version.js +1 -1
  62. package/manifest.json +5 -1
  63. package/package.json +1 -1
  64. package/server.json +2 -2
  65. package/skills/warapp-mcp/SKILL.md +9 -2
@@ -98,6 +98,10 @@ export function armyCapPoolsUncertainty(c, localDeployments) {
98
98
  }
99
99
  /** What the army cap's figure rests on: six live cases, and the card armies' place (from the client's guide, unverified). */
100
100
  export const ARMY_CAP_BASIS = "the formula is verified by six live cases (2026-11-15: received 41, 49, 25, 27 and 71 where the cap bit, among them the binding case sent through warapp_submit_turn, and a room of 61 it did not bind), the cap taken on this turn's income; Reinforcement card armies are outside it (the client's guide: they are not income and always pay in full, unverified live)";
101
+ /** #433: the game's own base income (`MinimumArmyBonus`; 0 and 3 exist), the default only when it does not say. One accessor for the planner and the stress test. */
102
+ export function gameBaseIncome(settings) {
103
+ return Math.max(0, Math.floor(settings?.baseIncome ?? settings?.minimumArmyBonus ?? DEFAULT_BASE_INCOME));
104
+ }
101
105
  /** {@link IncomeRules} from a game's settings (the defaults when it does not say). */
102
106
  export function incomeRules(settings) {
103
107
  return { base: settings?.minimumArmyBonus ?? DEFAULT_BASE_INCOME, per: settings?.bonusArmyPer ?? 0 };
@@ -1,4 +1,4 @@
1
- import { carriesTeam } from '../teams.js';
1
+ import { carriesTeam, teammatesOf } from '../teams.js';
2
2
  import { bonusTerritories } from './bonuses.js';
3
3
  import { bfsDistances, neighborsOf } from './graph.js';
4
4
  import { ownerShown, OWNERS_SHOWN_FOG, visibleState, } from './plan/shared.js';
@@ -606,7 +606,13 @@ export function planRelationsFrom(input) {
606
606
  card: 'Diplomacy',
607
607
  });
608
608
  }
609
- const open = new Set(input.agreements.filter((a) => !TERMINAL_STATUSES.has(a.status)).map((a) => a.with));
609
+ // #435: a teammate's quiet border is no tacit truce (#246): left out like a partner with an open
610
+ // agreement, as warapp_get_relations already did — plan_turn, check_plan and advise_diplomacy listed them.
611
+ const self = players.find((p) => p.id === me);
612
+ const open = new Set([
613
+ ...input.agreements.filter((a) => !TERMINAL_STATUSES.has(a.status)).map((a) => a.with),
614
+ ...(self ? teammatesOf(players, self).map((p) => p.id) : []),
615
+ ]);
610
616
  return { relations, tacit: tacitTruces({ graph, boards: input.boards, me, exclude: open }) };
611
617
  }
612
618
  // ---------- B3: pricing a deal (docs/PLAN-TEAMS.md section 8 B3) ----------
@@ -134,7 +134,7 @@ export function stressPlan(input) {
134
134
  const pools = input.localDeployments ? couldHoldBonusPools(graph, input.opponents.map((o) => o.id), shownOwner) : undefined;
135
135
  const deployOn = (opp, on) => {
136
136
  const all = Math.max(0, Math.floor(opp.deploy));
137
- return pools ? enemyDeployReaching(all, freeIncome(opp.base ?? 0, DEFAULT_BASE_INCOME, opp.card ?? 0), pools.get(opp.id) ?? [], [on], input.perTerritoryIncome === true) : all;
137
+ return pools ? enemyDeployReaching(all, freeIncome(opp.base ?? 0, input.baseIncome ?? DEFAULT_BASE_INCOME, opp.card ?? 0), pools.get(opp.id) ?? [], [on], input.perTerritoryIncome === true) : all;
138
138
  };
139
139
  /** Luck-free: `sent` armies (and a commander, when it goes along) take `t` as it stands. */
140
140
  const breaks = (sent, withCommander, t) => breaksLuckFree(sent, withCommander, t, { offensiveKillRate: off, defensiveKillRate: def });