@chrischall/warapp-mcp 0.23.1 → 0.24.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/dist/analysis/calibrate.js +54 -0
- package/dist/analysis/commitments.js +8 -2
- package/dist/analysis/plan/deploy-estimates.js +17 -6
- package/dist/analysis/plan/estimates.js +1 -0
- package/dist/analysis/plan/threats.js +1 -1
- package/dist/bundle.js +445 -57
- package/dist/chat.js +73 -0
- package/dist/protocol/methods.js +29 -3
- package/dist/tools/calibration-harness.js +22 -6
- package/dist/tools/calibration-job.js +133 -0
- package/dist/tools/calibration-worker.js +10 -0
- package/dist/tools/calibration.js +53 -22
- package/dist/tools/chat.js +204 -30
- package/dist/tools/check-plan.js +2 -1
- package/dist/tools/turn.js +3 -2
- package/dist/version.js +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -45745,7 +45745,7 @@ var require_snapshot_utils = __commonJS({
|
|
|
45745
45745
|
var require_snapshot_recorder = __commonJS({
|
|
45746
45746
|
"node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
45747
45747
|
"use strict";
|
|
45748
|
-
var { writeFile: writeFile18, readFile:
|
|
45748
|
+
var { writeFile: writeFile18, readFile: readFile27, mkdir: mkdir19 } = __require("node:fs/promises");
|
|
45749
45749
|
var { dirname: dirname4, resolve: resolve6 } = __require("node:path");
|
|
45750
45750
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
45751
45751
|
var { InvalidArgumentError, UndiciError } = require_errors4();
|
|
@@ -45963,7 +45963,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
45963
45963
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
45964
45964
|
}
|
|
45965
45965
|
try {
|
|
45966
|
-
const data2 = await
|
|
45966
|
+
const data2 = await readFile27(resolve6(path), "utf8");
|
|
45967
45967
|
const parsed = JSON.parse(data2);
|
|
45968
45968
|
if (Array.isArray(parsed)) {
|
|
45969
45969
|
this.#snapshots.clear();
|
|
@@ -102448,7 +102448,8 @@ function planEnemyEstimates(input2) {
|
|
|
102448
102448
|
reinforcement: ctx.reinforcement,
|
|
102449
102449
|
...ctx.reinforcementPlays ? { plays: ctx.reinforcementPlays } : {},
|
|
102450
102450
|
...previousBoard && input2.previousOrders ? { previousOrders: input2.previousOrders } : {},
|
|
102451
|
-
...ctx.trackCalibration ? { calibration: ctx.trackCalibration } : {}
|
|
102451
|
+
...ctx.trackCalibration ? { calibration: ctx.trackCalibration } : {},
|
|
102452
|
+
...ctx.trackCalibrationDamping !== void 0 ? { damping: ctx.trackCalibrationDamping } : {}
|
|
102452
102453
|
});
|
|
102453
102454
|
const priced = applyKnown(
|
|
102454
102455
|
applyArmyPrice(applySanctions(estimates, input2.sanctions ?? [], turn), input2.settings?.armyCostMultiplier ?? 0),
|
|
@@ -106022,7 +106023,7 @@ function borderThreats(pc, ps, input2, src, forces) {
|
|
|
106022
106023
|
if (e.trackCalibration) {
|
|
106023
106024
|
const c = e.trackCalibration;
|
|
106024
106025
|
warnings.push(
|
|
106025
|
-
`Player ${p}'s tracked income ~${c.raw} is raised to ~${c.figure} (#568, draft): past games' tracker read ${c.geoMean.toFixed(2)}\xD7 the true income at this frontier coverage (${c.band}, ${c.n} samples), divided by its square root (${c.factor.toFixed(2)}).`
|
|
106026
|
+
`Player ${p}'s tracked income ~${c.raw} is raised to ~${c.figure} (#568, draft): past games' tracker read ${c.geoMean.toFixed(2)}\xD7 the true income at this frontier coverage (${c.band}, ${c.n} samples), divided by ${c.damping === 0.5 ? "its square root" : `it to the ${c.damping} power`} (${c.factor.toFixed(2)}).`
|
|
106026
106027
|
);
|
|
106027
106028
|
}
|
|
106028
106029
|
if (e.cardInTrack) {
|
|
@@ -114769,11 +114770,15 @@ function trackOpponents(g, boards, me, settings = {}, game) {
|
|
|
114769
114770
|
// src/analysis/plan/deploy-estimates.ts
|
|
114770
114771
|
var MIN_TRACK_CALIBRATION_SAMPLES = 5;
|
|
114771
114772
|
var TRACK_CALIBRATION_DAMPING = 0.5;
|
|
114772
|
-
|
|
114773
|
+
var FFA_TRACK_CALIBRATION_DAMPING = 0.75;
|
|
114774
|
+
function trackCalibrationDampingFor(format) {
|
|
114775
|
+
return format === "ffa" ? FFA_TRACK_CALIBRATION_DAMPING : TRACK_CALIBRATION_DAMPING;
|
|
114776
|
+
}
|
|
114777
|
+
function trackCalibrationFactor(calibration, share, damping = TRACK_CALIBRATION_DAMPING) {
|
|
114773
114778
|
const band = coverageBucket(share);
|
|
114774
114779
|
const c = calibration?.[band];
|
|
114775
114780
|
if (!c || c.n < MIN_TRACK_CALIBRATION_SAMPLES || !(c.geoMean > 0) || c.geoMean >= 1) return void 0;
|
|
114776
|
-
return { band, geoMean: c.geoMean, n: c.n, factor: c.geoMean **
|
|
114781
|
+
return { band, geoMean: c.geoMean, n: c.n, factor: c.geoMean ** damping, damping };
|
|
114777
114782
|
}
|
|
114778
114783
|
function openingArmies(g, board, when = {}) {
|
|
114779
114784
|
if (when.previous !== void 0 || when.turn !== null && when.turn !== void 0 && when.turn > 1) return null;
|
|
@@ -114937,10 +114942,10 @@ function enemyDeployEstimates(g, board, me, settings = {}, previous, tracks, pri
|
|
|
114937
114942
|
const coverage2 = usable2 ? trackCoverage(usable2.turns.filter((x) => usable2.incomeTurns.includes(x.from))) : null;
|
|
114938
114943
|
let trackCalibration = null;
|
|
114939
114944
|
if (usable2 && tracked !== null && tracked > 0) {
|
|
114940
|
-
const c = trackCalibrationFactor(when.calibration, coverage2 ? coverage2.share : null);
|
|
114945
|
+
const c = trackCalibrationFactor(when.calibration, coverage2 ? coverage2.share : null, when.damping);
|
|
114941
114946
|
const figure = c ? Math.min(Math.max(couldEarn, tracked), Math.round(tracked / c.factor)) : tracked;
|
|
114942
114947
|
if (c && figure > tracked) {
|
|
114943
|
-
trackCalibration = { raw: tracked, band: c.band, geoMean: c.geoMean, n: c.n, factor: c.factor, figure };
|
|
114948
|
+
trackCalibration = { raw: tracked, band: c.band, geoMean: c.geoMean, n: c.n, factor: c.factor, damping: c.damping, figure };
|
|
114944
114949
|
tracked = figure;
|
|
114945
114950
|
}
|
|
114946
114951
|
}
|
|
@@ -116229,7 +116234,7 @@ function serverBuild() {
|
|
|
116229
116234
|
}
|
|
116230
116235
|
|
|
116231
116236
|
// src/version.ts
|
|
116232
|
-
var VERSION2 = "0.
|
|
116237
|
+
var VERSION2 = "0.24.0";
|
|
116233
116238
|
|
|
116234
116239
|
// src/decision-log.ts
|
|
116235
116240
|
var DECISION_LOG_VERSION = 1;
|
|
@@ -116811,9 +116816,9 @@ async function recordGameEvent(dir, gameId, playerId, ev, o = {}, opts = {}) {
|
|
|
116811
116816
|
return false;
|
|
116812
116817
|
}
|
|
116813
116818
|
}
|
|
116814
|
-
async function recordJoin(dir, gameId, playerId,
|
|
116819
|
+
async function recordJoin(dir, gameId, playerId, join32, opts = {}) {
|
|
116815
116820
|
try {
|
|
116816
|
-
const kept = encodeValue(
|
|
116821
|
+
const kept = encodeValue(join32);
|
|
116817
116822
|
return await updateDecisionLog(dir, gameId, playerId, (log) => ({ ...log, join: kept }), opts);
|
|
116818
116823
|
} catch {
|
|
116819
116824
|
return false;
|
|
@@ -118074,6 +118079,10 @@ function audienceRefusal(audience, partner, players) {
|
|
|
118074
118079
|
if (audience.kind === "public") return void 0;
|
|
118075
118080
|
if (audience.kind === "private")
|
|
118076
118081
|
return audience.to === partner ? void 0 : `the message goes privately to player ${audience.to}, so player ${partner}, the truce's partner, would never read it (D3: a truce changes only with the partner told)`;
|
|
118082
|
+
if (audience.kind === "group") {
|
|
118083
|
+
const ids2 = audience.to.length > 1 ? `${audience.to.slice(0, -1).join(", ")} and ${audience.to.at(-1)}` : String(audience.to[0]);
|
|
118084
|
+
return audience.to.includes(partner) ? void 0 : `the message goes to a group of players ${ids2}, so player ${partner}, the truce's partner, would never read it (D3: a truce changes only with the partner told)`;
|
|
118085
|
+
}
|
|
118077
118086
|
const p = players.find((x) => x.id === partner);
|
|
118078
118087
|
return p?.team === audience.team ? void 0 : `the message goes to team ${audience.team} only, and player ${partner}, the truce's partner, is not on it: it would never read it (D3: a truce changes only with the partner told)`;
|
|
118079
118088
|
}
|
|
@@ -120019,6 +120028,8 @@ var Method = {
|
|
|
120019
120028
|
ForumVote: 204,
|
|
120020
120029
|
WatchForumThread: 328,
|
|
120021
120030
|
GetGroupForumThreads: 354,
|
|
120031
|
+
/** A game group: a private conversation of several players in one game (the bundle's writer; UNVERIFIED live). */
|
|
120032
|
+
CreateGameGroup: 356,
|
|
120022
120033
|
Subscribe: 243,
|
|
120023
120034
|
/** #633: the client's "Game Invite Code" screen (`GameInviteCode` reply); read from the bundle, UNVERIFIED live. */
|
|
120024
120035
|
GetGameByInviteCode: 295,
|
|
@@ -120221,6 +120232,14 @@ function checkIds(ids2, what) {
|
|
|
120221
120232
|
function writeOptionalIntList(w, ids2) {
|
|
120222
120233
|
w.bool(true).list(ids2, (ww, id) => ww.int32(id));
|
|
120223
120234
|
}
|
|
120235
|
+
var GAME_GROUP_COLOUR = 13811880;
|
|
120236
|
+
function writeCreateGameGroupParams(w, p) {
|
|
120237
|
+
if (p.members.length === 0) throw new RangeError("no members");
|
|
120238
|
+
checkIds(p.members, "player id");
|
|
120239
|
+
if (p.name.trim() === "") throw new RangeError("a game group needs a name");
|
|
120240
|
+
w.int32(p.gameId).string(p.name).int32(GAME_GROUP_COLOUR);
|
|
120241
|
+
writeOptionalIntList(w, p.members);
|
|
120242
|
+
}
|
|
120224
120243
|
function writeCreatePrivateDiscussionParams(w, p) {
|
|
120225
120244
|
if (p.recipients.length === 0) throw new RangeError("no recipients");
|
|
120226
120245
|
checkIds(p.recipients, "player id");
|
|
@@ -120397,10 +120416,16 @@ function writeRetrievePrivateMessageHistoryParams(w, p) {
|
|
|
120397
120416
|
w.int32(p.gameId).string(beforeMarker(p.before)).int32(p.counterpart);
|
|
120398
120417
|
}
|
|
120399
120418
|
function writeSendChatParams(w, p) {
|
|
120419
|
+
if (p.group !== void 0 && p.recipient !== void 0) throw new RangeError("a message cannot go both to a group and privately");
|
|
120400
120420
|
w.int32(p.gameId).string(p.text).int32(p.channel ?? CHAT_CHANNEL_PUBLIC);
|
|
120401
120421
|
if (p.recipient === void 0) w.bool(false);
|
|
120402
120422
|
else w.bool(true).int32(p.recipient);
|
|
120403
|
-
|
|
120423
|
+
if (p.group === void 0) w.bool(false);
|
|
120424
|
+
else {
|
|
120425
|
+
checkIds([p.group], "game group id");
|
|
120426
|
+
w.bool(true).int32(p.group);
|
|
120427
|
+
}
|
|
120428
|
+
w.string(NO_CHAT_MARKER).string(NO_CHAT_MARKER).bool(false).bool(false).bool(false);
|
|
120404
120429
|
}
|
|
120405
120430
|
var ReactionTarget = { GameMessage: 0 };
|
|
120406
120431
|
var REACTION_TIMED_OUT = 639;
|
|
@@ -137860,9 +137885,9 @@ function parseEndRules(raw) {
|
|
|
137860
137885
|
function parseFeedTime(s) {
|
|
137861
137886
|
if (s === void 0) return void 0;
|
|
137862
137887
|
const us = /^\s*(\d{1,2})\/(\d{1,2})\/(\d{4})\s+(\d{1,2}):(\d{2}):(\d{2})\s*$/.exec(s);
|
|
137863
|
-
const
|
|
137864
|
-
if (!us && !
|
|
137865
|
-
const [, mo, d, y, h, mi, se] = us ? us.map(Number) : [0,
|
|
137888
|
+
const iso5 = /^\s*(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?Z?\s*$/.exec(s);
|
|
137889
|
+
if (!us && !iso5) return void 0;
|
|
137890
|
+
const [, mo, d, y, h, mi, se] = us ? us.map(Number) : [0, iso5[2], iso5[3], iso5[1], iso5[4], iso5[5], iso5[6]].map(Number);
|
|
137866
137891
|
const t = Date.UTC(y, mo - 1, d, h, mi, se);
|
|
137867
137892
|
return Number.isFinite(t) ? t : void 0;
|
|
137868
137893
|
}
|
|
@@ -139973,9 +139998,9 @@ async function captureGameEvent(ctx, gameId, me, ev, o = {}) {
|
|
|
139973
139998
|
if (!ctx.dataDir) return;
|
|
139974
139999
|
await recordGameEvent(ctx.dataDir, gameId, me, ev, o, modeOf2(ctx));
|
|
139975
140000
|
}
|
|
139976
|
-
async function captureJoin(ctx, gameId, me,
|
|
140001
|
+
async function captureJoin(ctx, gameId, me, join32) {
|
|
139977
140002
|
if (!ctx.dataDir) return;
|
|
139978
|
-
await recordJoin(ctx.dataDir, gameId, me,
|
|
140003
|
+
await recordJoin(ctx.dataDir, gameId, me, join32, modeOf2(ctx));
|
|
139979
140004
|
}
|
|
139980
140005
|
async function captureOpponentRead(ctx, gameId, me, player2, read) {
|
|
139981
140006
|
if (!ctx.dataDir) return;
|
|
@@ -143898,8 +143923,12 @@ function registerBoardTool(server, client, live) {
|
|
|
143898
143923
|
var GAME_DETAILS_AND_CHAT = "warlight.shared.GameDetailsAndChat";
|
|
143899
143924
|
var GAME_MESSAGE = "warlight.shared.GameMessage";
|
|
143900
143925
|
var MESSAGE_REACTION = "warlight.shared.MessageReaction";
|
|
143926
|
+
var GAME_GROUP = "warlight.shared.GameGroup";
|
|
143901
143927
|
var REACTION_TYPES = ["thumbs-up", "thumbs-down", "heart", "laugh", "angry"];
|
|
143902
143928
|
var GDC_REACTIONS = 5;
|
|
143929
|
+
var GDC_GROUPS = 6;
|
|
143930
|
+
var GG = { creator: 1, gameId: 3, id: 4, name: 6, members: 7 };
|
|
143931
|
+
var GAME_GROUP_FIELDS = 8;
|
|
143903
143932
|
var GM = { date: 0, sender: 1, group: 2, id: 4, images: 5, text: 6, reactions: 7, channel: 8, to: 9, turn: 11 };
|
|
143904
143933
|
var GAME_MESSAGE_FIELDS = 12;
|
|
143905
143934
|
var PUBLIC_CHANNEL = -1;
|
|
@@ -144019,6 +144048,48 @@ function applyReactionsDict(lines, dict2) {
|
|
|
144019
144048
|
if (line2.id !== void 0 && byId2.has(line2.id)) setReactions(line2, byId2.get(line2.id));
|
|
144020
144049
|
}
|
|
144021
144050
|
}
|
|
144051
|
+
function groupMembers(text2) {
|
|
144052
|
+
if (typeof text2 !== "string") return null;
|
|
144053
|
+
try {
|
|
144054
|
+
const v = JSON.parse(text2);
|
|
144055
|
+
if (!Array.isArray(v)) return null;
|
|
144056
|
+
const ids2 = v.map((x) => typeof x === "string" && /^-?\d+$/.test(x) ? Number(x) : x);
|
|
144057
|
+
return ids2.every(isInt12) ? ids2 : null;
|
|
144058
|
+
} catch {
|
|
144059
|
+
return null;
|
|
144060
|
+
}
|
|
144061
|
+
}
|
|
144062
|
+
function readGameGroups(bundle, body) {
|
|
144063
|
+
try {
|
|
144064
|
+
if (!body.bool()) return void 0;
|
|
144065
|
+
const ret = bundle.readClass(GAME_DETAILS_AND_CHAT, body);
|
|
144066
|
+
if (!isObj(ret) || ret.$type !== GAME_DETAILS_AND_CHAT) return void 0;
|
|
144067
|
+
const list4 = fields(ret)[GDC_GROUPS];
|
|
144068
|
+
if (!Array.isArray(list4)) return void 0;
|
|
144069
|
+
const out = [];
|
|
144070
|
+
for (const g of list4) {
|
|
144071
|
+
if (g === null) continue;
|
|
144072
|
+
if (!isObj(g) || g.$type !== GAME_GROUP) return void 0;
|
|
144073
|
+
const f = fields(g);
|
|
144074
|
+
if (f.length !== GAME_GROUP_FIELDS) return void 0;
|
|
144075
|
+
const [id, gameId, creator, name2] = [f[GG.id], f[GG.gameId], f[GG.creator], f[GG.name]];
|
|
144076
|
+
if (!isInt12(id) || !isInt12(gameId) || !isInt12(creator) || typeof name2 !== "string") return void 0;
|
|
144077
|
+
out.push({ id, gameId, creator, name: name2, members: groupMembers(f[GG.members]) });
|
|
144078
|
+
}
|
|
144079
|
+
return out;
|
|
144080
|
+
} catch {
|
|
144081
|
+
return void 0;
|
|
144082
|
+
}
|
|
144083
|
+
}
|
|
144084
|
+
function readCreateGameGroupReply(bundle, body) {
|
|
144085
|
+
try {
|
|
144086
|
+
if (!body.bool()) return void 0;
|
|
144087
|
+
const line2 = webLine(bundle.readClass(GAME_MESSAGE, body));
|
|
144088
|
+
return line2?.group;
|
|
144089
|
+
} catch {
|
|
144090
|
+
return void 0;
|
|
144091
|
+
}
|
|
144092
|
+
}
|
|
144022
144093
|
function readSendChatReply(bundle, body) {
|
|
144023
144094
|
try {
|
|
144024
144095
|
if (!body.bool()) return void 0;
|
|
@@ -156081,7 +156152,7 @@ async function livePlanSetup(ctx, a) {
|
|
|
156081
156152
|
...mapPace ? { mapPace } : {},
|
|
156082
156153
|
// #568: this format's own calibration raises each tracked figure by its coverage band's damped factor
|
|
156083
156154
|
// (none in a 1v1, where the fog prior already lifts the tracker: trackCalibrationFor).
|
|
156084
|
-
...trackCalibration ? { trackCalibration } : {},
|
|
156155
|
+
...trackCalibration ? { trackCalibration, trackCalibrationDamping: trackCalibrationDampingFor(profileFormatOf(game.players)) } : {},
|
|
156085
156156
|
// #164: an opponent's Reinforcement card, from the turn the card clock says one can be in hand.
|
|
156086
156157
|
...opponentReinforcement(game.settings, hand) ? { reinforcement: opponentReinforcement(game.settings, hand) } : {},
|
|
156087
156158
|
// #427: the Reinforcement plays seen in the turns' orders (card plays not fogged): a play restarts the clock.
|
|
@@ -156541,7 +156612,7 @@ async function commanderCheck(ctx, a) {
|
|
|
156541
156612
|
info: a.info,
|
|
156542
156613
|
...opening ? { opening } : {},
|
|
156543
156614
|
...mapPace ? { mapPace } : {},
|
|
156544
|
-
...trackCalibration ? { trackCalibration } : {}
|
|
156615
|
+
...trackCalibration ? { trackCalibration, trackCalibrationDamping: trackCalibrationDampingFor(profileFormatOf(a.game.players)) } : {}
|
|
156545
156616
|
});
|
|
156546
156617
|
const tripwires = a.tripwires ?? (await readTripwires({
|
|
156547
156618
|
dataDir: ctx.dataDir,
|
|
@@ -160703,6 +160774,31 @@ async function checkMessageCommitments(ctx, game, me, args, audience, teamsKnown
|
|
|
160703
160774
|
// src/tools/chat.ts
|
|
160704
160775
|
var DEFAULT_LIMIT2 = 50;
|
|
160705
160776
|
var MAX_CHAT_LENGTH = 2e3;
|
|
160777
|
+
var MAX_GROUP_RECIPIENTS = 10;
|
|
160778
|
+
var MAX_GROUP_NAME = 50;
|
|
160779
|
+
var DEFAULT_GROUP_NAME = "Group chat";
|
|
160780
|
+
var GROUP_REFUSALS = {
|
|
160781
|
+
227: "a player in it has blocked you",
|
|
160782
|
+
751: "this game does not allow game groups"
|
|
160783
|
+
};
|
|
160784
|
+
var listIds = (ids2) => ids2.length > 1 ? `${ids2.slice(0, -1).join(", ")} and ${ids2.at(-1)}` : String(ids2[0]);
|
|
160785
|
+
async function existingGroup(ctx, game, meInGame2, members2) {
|
|
160786
|
+
try {
|
|
160787
|
+
const env = await ctx.rpc.call(
|
|
160788
|
+
"GameRefresh",
|
|
160789
|
+
Method.GameRefresh,
|
|
160790
|
+
(w) => writeGameRefreshParams(w, { gameId: game.id, chat: false, nonChat: true, lobby: game.state === "WaitingForPlayers" })
|
|
160791
|
+
);
|
|
160792
|
+
const groups = readGameGroups(await ctx.bundle(), env.body);
|
|
160793
|
+
if (!groups) return { read: false };
|
|
160794
|
+
const want = /* @__PURE__ */ new Set([meInGame2, ...members2]);
|
|
160795
|
+
const same3 = groups.filter((g) => g.gameId === game.id && g.members !== null && new Set(g.members).size === want.size && g.members.every((m) => want.has(m))).sort((a, b) => b.id - a.id);
|
|
160796
|
+
return same3[0] ? { read: true, group: same3[0] } : { read: true };
|
|
160797
|
+
} catch {
|
|
160798
|
+
return { read: false };
|
|
160799
|
+
}
|
|
160800
|
+
}
|
|
160801
|
+
var GROUP_UNVERIFIED = "Game groups (creating one, and a message to one) are read from the client bundle and UNVERIFIED live.";
|
|
160706
160802
|
var LINKS_NOTE = "Each link goes out as the client's token (`<a t=ID>` territory, `<a b=ID>` bonus) and players see the name from the map. Territory and bonus links are verified live (2026-11-23).";
|
|
160707
160803
|
var CHAT_SOURCE_NOTES = {
|
|
160708
160804
|
web: "Read from the web client's GameRefresh reply; its channel, recipient and turn fields come from the client bundle and are UNVERIFIED live.",
|
|
@@ -161000,7 +161096,7 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161000
161096
|
},
|
|
161001
161097
|
{
|
|
161002
161098
|
name: "warapp_send_chat",
|
|
161003
|
-
description: `Post a chat message in a war.app (Warzone) game \u2014 to the whole game, to your team (\`channel: "team"\`, in a team game), or privately to one named player (\`to\`; refused when the game turns private messages off
|
|
161099
|
+
description: `Post a chat message in a war.app (Warzone) game \u2014 to the whole game, to your team (\`channel: "team"\`, in a team game), or privately to one named player (\`to\`), or to several together (\`to\` as a list: a war.app game group, reused when one of exactly you and them exists, else created first, named by \`group_name\`; UNVERIFIED live); private sends are refused when the game turns private messages off. The message reaches other players and cannot be unsent. Sent through your signed-in war.app tab (ContextMint Bridge); the game is read from GameFeed first, so the GameFeed credentials are needed too. The result's \`outcome\` is \`confirmed\` when war.app's reply lists it as your newest message on that channel, \`accepted\` when the reply cannot be read, \`unconfirmed\` when it does not show it. Whatever the message promises must be declared in \`commitments\` (no-attack, will-attack, notice, propose, accept; the text is never read): each is checked against this turn's plan (re-planned in the call, or the orders already submitted) and the agreement ledger, a commitment they do not carry refuses the send, and once the message is confirmed or accepted they are recorded in the ledger as yours (a propose or accept creates or advances the agreement, a notice moves it to notice-by-me); warapp_submit_turn warns when later orders break one. Pass \`automated: true\` for a reply the owner did not tell you to send (e.g. an advice's \`send\`): it is refused unless WARAPP_CHAT_AUTOMATION is on (off by default: the owner sends replies), and even then it is confirm-gated. Link a territory or bonus as players see it in the official client with \`[[t:<id or name>]]\` / \`[[b:<id or name>]]\` in the message, or set \`link_territories\` to link every territory name it mentions: names resolve against the game's map (exact, case-insensitive; an unknown or shared name is refused, listing the ids), and the preview shows the message as rendered with its \`links\`. ${CONFIRM_INJECTION_RULE}`,
|
|
161004
161100
|
annotations: toolAnnotations({
|
|
161005
161101
|
title: "Send a war.app chat message",
|
|
161006
161102
|
readOnly: false,
|
|
@@ -161015,13 +161111,18 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161015
161111
|
"true: also link every whole-word mention of a territory name in the message, repeats included (the longest name where names overlap; never inside a [[\u2026]] link). Default false."
|
|
161016
161112
|
),
|
|
161017
161113
|
channel: external_exports.enum(["public", "team"]).optional().describe('"public" (default): the whole game. "team": your team only (a team game). Not with `to`.'),
|
|
161018
|
-
to: external_exports.union([external_exports.string(), external_exports.number()]).
|
|
161114
|
+
to: external_exports.union([external_exports.string(), external_exports.number(), external_exports.array(external_exports.union([external_exports.string(), external_exports.number()])).min(1).max(MAX_GROUP_RECIPIENTS)]).optional().describe(
|
|
161115
|
+
`A player (name or GameFeed id) to message privately, or a list of 2 to ${MAX_GROUP_RECIPIENTS} players to message together in a game group (one private conversation they all read). Omit to post to a channel.`
|
|
161116
|
+
),
|
|
161117
|
+
group_name: external_exports.string().trim().min(1).max(MAX_GROUP_NAME).optional().describe(
|
|
161118
|
+
`A list \`to\` only: the name of the game group if one has to be created (default "${DEFAULT_GROUP_NAME}"; the members see it). An existing group of exactly these players is reused, keeping its name.`
|
|
161119
|
+
),
|
|
161019
161120
|
commitments: commitmentsArg,
|
|
161020
161121
|
automated: external_exports.boolean().optional().describe(
|
|
161021
161122
|
"true when you send a reply the owner did not tell you to send (an automated reply). Refused unless WARAPP_CHAT_AUTOMATION is on; default false (a send the owner asked for)."
|
|
161022
161123
|
)
|
|
161023
161124
|
}),
|
|
161024
|
-
async plan({ game_id, message, channel, to, commitments, automated, link_territories }) {
|
|
161125
|
+
async plan({ game_id, message, channel, to, group_name, commitments, automated, link_territories }) {
|
|
161025
161126
|
const auto = automated === true;
|
|
161026
161127
|
if (auto && (ctx.chatAutomation ?? chatAutomationMode(opts.env ?? process.env)) !== "on") {
|
|
161027
161128
|
throw new McpToolError(`Refused: ${AUTOMATED_CHAT_OFF}. Nothing was sent.`, {
|
|
@@ -161029,7 +161130,18 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161029
161130
|
});
|
|
161030
161131
|
}
|
|
161031
161132
|
const gameId = parseGameId(game_id);
|
|
161032
|
-
const
|
|
161133
|
+
const toList = Array.isArray(to) ? to.filter((x) => String(x).trim() !== "") : void 0;
|
|
161134
|
+
const grouped = toList !== void 0 && toList.length >= 2;
|
|
161135
|
+
const single = toList ? toList.length === 1 ? toList[0] : void 0 : Array.isArray(to) ? void 0 : to;
|
|
161136
|
+
const privately = grouped || single !== void 0 && String(single).trim() !== "";
|
|
161137
|
+
if (toList !== void 0 && toList.length === 0) {
|
|
161138
|
+
throw new McpToolError("`to` lists no player: nothing was sent.", { hint: "Name the players to message, or omit `to` to post to the whole game." });
|
|
161139
|
+
}
|
|
161140
|
+
if (group_name !== void 0 && !grouped) {
|
|
161141
|
+
throw new McpToolError("`group_name` names a game group, which only a list of two or more players in `to` uses: nothing was sent.", {
|
|
161142
|
+
hint: "Pass `to` as a list of the players to message together, or drop `group_name`."
|
|
161143
|
+
});
|
|
161144
|
+
}
|
|
161033
161145
|
if (privately && channel === "team") {
|
|
161034
161146
|
throw new McpToolError("A private message (`to`) cannot also go to the team channel: nothing was sent.", {
|
|
161035
161147
|
hint: "Omit `to` to message your team, or omit `channel` to message one player privately."
|
|
@@ -161059,6 +161171,8 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161059
161171
|
let chatChannel = CHAT_CHANNEL_PUBLIC;
|
|
161060
161172
|
let recipient;
|
|
161061
161173
|
let shownRecipient;
|
|
161174
|
+
let group;
|
|
161175
|
+
let groupsRead = true;
|
|
161062
161176
|
if (privately) {
|
|
161063
161177
|
if (game.settings?.privateMessaging === false) {
|
|
161064
161178
|
throw new McpToolError(
|
|
@@ -161066,7 +161180,35 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161066
161180
|
{ hint: "Post to the whole game instead: the host turned private messages off." }
|
|
161067
161181
|
);
|
|
161068
161182
|
}
|
|
161069
|
-
|
|
161183
|
+
}
|
|
161184
|
+
if (grouped) {
|
|
161185
|
+
const people = toList.map((x) => resolvePlayer(game.players, x));
|
|
161186
|
+
const mine3 = people.find((p) => p.id === me);
|
|
161187
|
+
if (mine3) {
|
|
161188
|
+
throw new McpToolError(`${untrustedText(mine3.name)} (${mine3.id}) is you: list only the other players in \`to\`. Nothing was sent.`, {
|
|
161189
|
+
hint: "The group includes you anyway: name the players to message with you."
|
|
161190
|
+
});
|
|
161191
|
+
}
|
|
161192
|
+
const twice = people.find((p, i2) => people.findIndex((q) => q.id === p.id) !== i2);
|
|
161193
|
+
if (twice) {
|
|
161194
|
+
throw new McpToolError(`Player ${twice.id} is named twice in \`to\`: nothing was sent.`, { hint: "Name each player once." });
|
|
161195
|
+
}
|
|
161196
|
+
if (meInGame2 === void 0) {
|
|
161197
|
+
throw new McpToolError(`Your seat in game ${gameId} has no in-game id, so a game group cannot be made: nothing was sent.`, {
|
|
161198
|
+
hint: "Message each player privately instead."
|
|
161199
|
+
});
|
|
161200
|
+
}
|
|
161201
|
+
kind = "group";
|
|
161202
|
+
const members2 = people.map((p) => inGameId(p));
|
|
161203
|
+
const found = await existingGroup(ctx, game, meInGame2, members2);
|
|
161204
|
+
groupsRead = found.read;
|
|
161205
|
+
group = {
|
|
161206
|
+
...found.group ? { id: found.group.id, name: untrustedText(found.group.name) } : { name: group_name ?? DEFAULT_GROUP_NAME },
|
|
161207
|
+
members: members2,
|
|
161208
|
+
recipients: people.map((p) => ({ id: p.id, name: untrustedText(p.name) }))
|
|
161209
|
+
};
|
|
161210
|
+
} else if (privately) {
|
|
161211
|
+
const p = resolvePlayer(game.players, single);
|
|
161070
161212
|
if (p.id === me) {
|
|
161071
161213
|
throw new McpToolError(`${untrustedText(p.name)} (${p.id}) is you: a private message to yourself was not sent.`, {
|
|
161072
161214
|
hint: "Name another player in `to`, or omit it to post to the whole game."
|
|
@@ -161092,15 +161234,16 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161092
161234
|
hint: "Send the message without `commitments` \u2014 and then without any promise in it."
|
|
161093
161235
|
});
|
|
161094
161236
|
}
|
|
161095
|
-
const audience = kind === "private" ? { kind: "private", to: shownRecipient.id } : kind === "team" ? { kind: "team", team: chatChannel } : { kind: "public" };
|
|
161237
|
+
const audience = kind === "private" ? { kind: "private", to: shownRecipient.id } : kind === "group" ? { kind: "group", to: group.recipients.map((r) => r.id) } : kind === "team" ? { kind: "team", team: chatChannel } : { kind: "public" };
|
|
161096
161238
|
promised = await checkMessageCommitments(ctx, game, seat, promises, audience, teamsKnown);
|
|
161097
161239
|
}
|
|
161098
|
-
const
|
|
161240
|
+
const groupIds = group ? listIds(group.recipients.map((r) => r.id)) : "";
|
|
161241
|
+
const words = kind === "group" ? `privately to players ${groupIds} only, in a game group (${group.id !== void 0 ? `group ${group.id}, which exists` : "created first"})` : kind === "private" ? `privately to player ${shownRecipient.id} only` : kind === "team" ? `to your team (team ${chatChannel}) only` : "to everyone in the game";
|
|
161099
161242
|
const teamName = `your team (team ${chatChannel})`;
|
|
161100
161243
|
return {
|
|
161101
161244
|
gate: {
|
|
161102
161245
|
action: "warapp.send_chat",
|
|
161103
|
-
summary: kind === "private" ? `Send a private chat message to player ${shownRecipient.id} in game ${gameId}` : kind === "team" ? `Send a chat message to ${teamName} in game ${gameId}` : `Post a chat message to everyone in game ${gameId}`,
|
|
161246
|
+
summary: kind === "group" ? `Send a group chat message to players ${groupIds} in game ${gameId}` : kind === "private" ? `Send a private chat message to player ${shownRecipient.id} in game ${gameId}` : kind === "team" ? `Send a chat message to ${teamName} in game ${gameId}` : `Post a chat message to everyone in game ${gameId}`,
|
|
161104
161247
|
account,
|
|
161105
161248
|
target: gameId,
|
|
161106
161249
|
payload: {
|
|
@@ -161109,11 +161252,12 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161109
161252
|
text: text2,
|
|
161110
161253
|
channel: chatChannel,
|
|
161111
161254
|
recipient: recipient?.id ?? null,
|
|
161255
|
+
...group ? { group: group.id ?? null, createGroup: group.id === void 0 ? { name: group.name, members: group.members } : null } : {},
|
|
161112
161256
|
...promised ? { commitments: promised.commitments } : {}
|
|
161113
161257
|
},
|
|
161114
161258
|
willSend: {
|
|
161115
161259
|
game: gameId,
|
|
161116
|
-
to: shownRecipient?.name ?? (kind === "team" ? teamName : "everyone in the game"),
|
|
161260
|
+
to: group ? group.recipients.map((r) => r.name).join(", ") : shownRecipient?.name ?? (kind === "team" ? teamName : "everyone in the game"),
|
|
161117
161261
|
message
|
|
161118
161262
|
},
|
|
161119
161263
|
preview: {
|
|
@@ -161123,6 +161267,11 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161123
161267
|
note: kind === "team" ? "Your teammates will see this message; it cannot be unsent. The team channel value is UNVERIFIED live." : "Other players will see this message; it cannot be unsent.",
|
|
161124
161268
|
game: { id: game.id, name: game.name === void 0 ? null : untrustedText(game.name), state: game.state },
|
|
161125
161269
|
...shownRecipient ? { recipient: shownRecipient } : {},
|
|
161270
|
+
...group ? {
|
|
161271
|
+
recipients: group.recipients,
|
|
161272
|
+
group: group.id !== void 0 ? { id: group.id, name: group.name, reused: true } : { create: true, name: untrustedText(group.name) },
|
|
161273
|
+
groupNote: (group.id !== void 0 ? `The game's group ${group.id} holds exactly you and these players: the message goes there.` : groupsRead ? "No game group of exactly you and these players exists: one is created first, named as shown (the members see the name)." : "The game's groups could not be read, so a new group is created first, named as shown (the members see the name), even if one of exactly these players exists.") + ` ${GROUP_UNVERIFIED}`
|
|
161274
|
+
} : {},
|
|
161126
161275
|
...links ? {
|
|
161127
161276
|
rendered: untrustedBody(links.rendered),
|
|
161128
161277
|
links: links.links.map((l) => ({ ...l, name: l.name === null ? null : untrustedText(l.name) })),
|
|
@@ -161146,6 +161295,7 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161146
161295
|
kind,
|
|
161147
161296
|
channel: chatChannel,
|
|
161148
161297
|
...recipient ? { recipient } : {},
|
|
161298
|
+
...group ? { group } : {},
|
|
161149
161299
|
...meInGame2 !== void 0 ? { meInGame: meInGame2 } : {},
|
|
161150
161300
|
...auto ? { automated: true } : {},
|
|
161151
161301
|
account,
|
|
@@ -161160,18 +161310,74 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161160
161310
|
}
|
|
161161
161311
|
};
|
|
161162
161312
|
},
|
|
161163
|
-
async execute({ gameId, text: text2, kind, channel, recipient, meInGame: meInGame2, account, commitments, automated }) {
|
|
161313
|
+
async execute({ gameId, text: text2, kind, channel, recipient, group, meInGame: meInGame2, account, commitments, automated }) {
|
|
161164
161314
|
await requireApprovedAccount(ctx, account);
|
|
161165
|
-
const to = recipient?.name ?? (kind === "team" ? `your team (team ${channel})` : "everyone in the game");
|
|
161315
|
+
const to = group?.recipients ?? recipient?.name ?? (kind === "team" ? `your team (team ${channel})` : "everyone in the game");
|
|
161166
161316
|
const marked = automated ? { automated: true } : {};
|
|
161167
|
-
|
|
161317
|
+
let groupId = group?.id;
|
|
161318
|
+
if (group && groupId === void 0) {
|
|
161319
|
+
let createReply;
|
|
161320
|
+
const notSent2 = (warning) => ({
|
|
161321
|
+
status: "unknown",
|
|
161322
|
+
outcome: "unknown",
|
|
161323
|
+
game: gameId,
|
|
161324
|
+
channel: kind,
|
|
161325
|
+
to,
|
|
161326
|
+
...marked,
|
|
161327
|
+
group: { id: null, created: "unknown" },
|
|
161328
|
+
warning
|
|
161329
|
+
});
|
|
161330
|
+
const made = await sendAndVerify({
|
|
161331
|
+
send: async () => {
|
|
161332
|
+
createReply = await ctx.rpc.call(
|
|
161333
|
+
"CreateGameGroup",
|
|
161334
|
+
Method.CreateGameGroup,
|
|
161335
|
+
(w) => writeCreateGameGroupParams(w, { gameId, name: group.name, members: group.members })
|
|
161336
|
+
);
|
|
161337
|
+
},
|
|
161338
|
+
refused: (e) => new McpToolError(
|
|
161339
|
+
`war.app refused to create the game group (${GROUP_REFUSALS[e.code] ?? e.message}; war.app error ${e.code}): nothing was sent.`,
|
|
161340
|
+
{ hint: "Message each player privately instead, or post to the whole game." }
|
|
161341
|
+
),
|
|
161342
|
+
unanswered: (failure2) => notSent2(
|
|
161343
|
+
`war.app did not answer the game group's creation (${failure2}), so a group may now exist, but the message was NOT sent. Look at the game's groups in the web client before sending again.`
|
|
161344
|
+
),
|
|
161345
|
+
readBack: async () => {
|
|
161346
|
+
const id = createReply ? readCreateGameGroupReply(await ctx.bundle(), createReply.body) : void 0;
|
|
161347
|
+
if (id === void 0) throw new Error("its reply named no group");
|
|
161348
|
+
return id;
|
|
161349
|
+
},
|
|
161350
|
+
unreadable: (failure2) => notSent2(
|
|
161351
|
+
`war.app accepted the game group's creation, but ${failure2}, so the message was NOT sent. Look at the game's groups in the web client, then send it again (an existing group of exactly these players is reused).`
|
|
161352
|
+
),
|
|
161353
|
+
classify: (id) => id
|
|
161354
|
+
});
|
|
161355
|
+
if (typeof made !== "number") {
|
|
161356
|
+
return commitments ? {
|
|
161357
|
+
...made,
|
|
161358
|
+
commitments: {
|
|
161359
|
+
recorded: [],
|
|
161360
|
+
why: "The message was NOT sent (the game group could not be confirmed), so its commitments were not made: nothing to record."
|
|
161361
|
+
}
|
|
161362
|
+
} : made;
|
|
161363
|
+
}
|
|
161364
|
+
groupId = made;
|
|
161365
|
+
}
|
|
161366
|
+
const groupOut = group ? { group: { id: groupId, created: group.id === void 0 } } : {};
|
|
161367
|
+
const base = { status: "sent", game: gameId, channel: kind, to, ...groupOut, ...marked };
|
|
161168
161368
|
let reply;
|
|
161169
161369
|
const result2 = await sendAndVerify({
|
|
161170
161370
|
send: async () => {
|
|
161171
161371
|
reply = await ctx.rpc.call(
|
|
161172
161372
|
"SendChat",
|
|
161173
161373
|
Method.SendChat,
|
|
161174
|
-
(w) => writeSendChatParams(w, {
|
|
161374
|
+
(w) => writeSendChatParams(w, {
|
|
161375
|
+
gameId,
|
|
161376
|
+
text: text2,
|
|
161377
|
+
channel,
|
|
161378
|
+
...recipient ? { recipient: recipient.id } : {},
|
|
161379
|
+
...groupId !== void 0 ? { group: groupId } : {}
|
|
161380
|
+
})
|
|
161175
161381
|
);
|
|
161176
161382
|
},
|
|
161177
161383
|
// A refusal is rethrown (nothing was posted; 36, too many messages, is never retried).
|
|
@@ -161181,6 +161387,7 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161181
161387
|
game: gameId,
|
|
161182
161388
|
channel: kind,
|
|
161183
161389
|
to,
|
|
161390
|
+
...groupOut,
|
|
161184
161391
|
...marked,
|
|
161185
161392
|
warning: `war.app did not confirm this message (${failure2}), so it may already have been posted. Check warapp_get_chat before sending it again.`
|
|
161186
161393
|
}),
|
|
@@ -161193,7 +161400,7 @@ function registerChatTools(server, ctx, opts = {}) {
|
|
|
161193
161400
|
// A reply this server cannot read: war.app's acceptance is all there is.
|
|
161194
161401
|
unreadable: () => ({ ...base, outcome: "accepted" }),
|
|
161195
161402
|
classify: (lines) => {
|
|
161196
|
-
const onChannel = (l) => kind === "private" ? l.channel === "private" && l.to === recipient?.id : kind === "team" ? l.channel === "team" && l.team === channel : l.channel === "public";
|
|
161403
|
+
const onChannel = (l) => kind === "group" ? l.group === groupId : kind === "private" ? l.channel === "private" && l.to === recipient?.id : kind === "team" ? l.channel === "team" && l.team === channel : l.channel === "public";
|
|
161197
161404
|
const newest = lines.filter((l) => meInGame2 !== void 0 && l.sender === meInGame2 && onChannel(l)).at(-1);
|
|
161198
161405
|
const same3 = (a) => a.replace(/\s+/g, " ").trim() === text2.replace(/\s+/g, " ").trim();
|
|
161199
161406
|
if (newest && same3(newest.text)) return { ...base, outcome: "confirmed" };
|
|
@@ -162100,7 +162307,7 @@ function registerCheckPlanTool(server, ctx) {
|
|
|
162100
162307
|
info,
|
|
162101
162308
|
...opening ? { opening } : {},
|
|
162102
162309
|
...mapPace ? { mapPace } : {},
|
|
162103
|
-
...trackCalibration ? { trackCalibration } : {},
|
|
162310
|
+
...trackCalibration ? { trackCalibration, trackCalibrationDamping: trackCalibrationDampingFor(profileFormatOf(game.players)) } : {},
|
|
162104
162311
|
...enemy_deploy !== void 0 ? { enemyDeploy: enemy_deploy } : {},
|
|
162105
162312
|
assumeCards,
|
|
162106
162313
|
// #444: the stated incomes scale the other opponents' prior, as warapp_plan_turn has them.
|
|
@@ -163657,7 +163864,7 @@ function registerJoinGameTool(server, ctx) {
|
|
|
163657
163864
|
}
|
|
163658
163865
|
};
|
|
163659
163866
|
},
|
|
163660
|
-
async execute({ gameId, name: name2, url: url4, team, color, account, join:
|
|
163867
|
+
async execute({ gameId, name: name2, url: url4, team, color, account, join: join32 }) {
|
|
163661
163868
|
await requireApprovedAccount(ctx, account);
|
|
163662
163869
|
const game = { id: gameId, name: name2, url: url4 };
|
|
163663
163870
|
let vacationEnded = false;
|
|
@@ -163695,7 +163902,7 @@ function registerJoinGameTool(server, ctx) {
|
|
|
163695
163902
|
unreadable: () => notShown(),
|
|
163696
163903
|
classify: (seated) => seated ? { status: "joined", outcome: "confirmed", game, ...extra() } : notShown()
|
|
163697
163904
|
});
|
|
163698
|
-
if (result2.outcome === "confirmed" &&
|
|
163905
|
+
if (result2.outcome === "confirmed" && join32) await captureJoin(ctx, gameId, Number(account), join32);
|
|
163699
163906
|
return result2;
|
|
163700
163907
|
}
|
|
163701
163908
|
}
|
|
@@ -166538,8 +166745,8 @@ function readTemplateLengths(body) {
|
|
|
166538
166745
|
const n = body.int32();
|
|
166539
166746
|
for (let i2 = 0; i2 < n; i2++) {
|
|
166540
166747
|
const id = body.int32();
|
|
166541
|
-
const
|
|
166542
|
-
if (Number.isFinite(
|
|
166748
|
+
const minutes3 = body.float64();
|
|
166749
|
+
if (Number.isFinite(minutes3)) out.set(id, minutes3);
|
|
166543
166750
|
}
|
|
166544
166751
|
return out;
|
|
166545
166752
|
}
|
|
@@ -166605,7 +166812,7 @@ function registerSettingsRead(server, ctx) {
|
|
|
166605
166812
|
},
|
|
166606
166813
|
async ({ lengths }) => {
|
|
166607
166814
|
const { settings, unlocked } = await readSettings2(ctx);
|
|
166608
|
-
let
|
|
166815
|
+
let minutes3;
|
|
166609
166816
|
let lengthsNote;
|
|
166610
166817
|
if (lengths === true && unlocked.length > 0) {
|
|
166611
166818
|
try {
|
|
@@ -166614,7 +166821,7 @@ function registerSettingsRead(server, ctx) {
|
|
|
166614
166821
|
Method.GetTemplateLengths,
|
|
166615
166822
|
(w) => writeGetTemplateLengthsParams(w, unlocked.map((t) => t.id))
|
|
166616
166823
|
);
|
|
166617
|
-
|
|
166824
|
+
minutes3 = readTemplateLengths(env.body);
|
|
166618
166825
|
} catch (e) {
|
|
166619
166826
|
lengthsNote = `The template lengths could not be read (${failureText(e)}).`;
|
|
166620
166827
|
}
|
|
@@ -166624,7 +166831,7 @@ function registerSettingsRead(server, ctx) {
|
|
|
166624
166831
|
name: shownName2(t.name),
|
|
166625
166832
|
mapId: t.mapId,
|
|
166626
166833
|
...templateView(settings.templates.get(t.id) ?? QUICKMATCH_TEMPLATE_SETTINGS.off),
|
|
166627
|
-
...
|
|
166834
|
+
...minutes3 ? { averageMinutes: minutes3.has(t.id) ? Math.round(minutes3.get(t.id)) : null } : {}
|
|
166628
166835
|
}));
|
|
166629
166836
|
return respond(void 0, ["compact"], () => ({
|
|
166630
166837
|
...settingsView(settings),
|
|
@@ -171366,7 +171573,7 @@ function registerAcceptInviteTool(server, ctx) {
|
|
|
171366
171573
|
}
|
|
171367
171574
|
};
|
|
171368
171575
|
},
|
|
171369
|
-
async execute({ gameId, name: name2, url: url4, color, account, join:
|
|
171576
|
+
async execute({ gameId, name: name2, url: url4, color, account, join: join32 }) {
|
|
171370
171577
|
await requireApprovedAccount(ctx, account);
|
|
171371
171578
|
const game = { id: gameId, name: untrustedText(name2), url: url4 };
|
|
171372
171579
|
let vacationEnded = false;
|
|
@@ -171399,7 +171606,7 @@ function registerAcceptInviteTool(server, ctx) {
|
|
|
171399
171606
|
unreadable: () => notShown(),
|
|
171400
171607
|
classify: (seated) => seated ? { status: "accepted", outcome: "confirmed", game, ...extra() } : notShown()
|
|
171401
171608
|
});
|
|
171402
|
-
if (result2.outcome === "confirmed" &&
|
|
171609
|
+
if (result2.outcome === "confirmed" && join32) await captureJoin(ctx, gameId, Number(account), join32);
|
|
171403
171610
|
return result2;
|
|
171404
171611
|
}
|
|
171405
171612
|
}
|
|
@@ -173334,6 +173541,50 @@ function openingFlags(input2) {
|
|
|
173334
173541
|
const bt = input2.booted?.turn ?? null;
|
|
173335
173542
|
return { noOrderTurns, bootedTurn: bt !== null && bt >= 1 && bt <= window ? bt : null };
|
|
173336
173543
|
}
|
|
173544
|
+
function openingLosses(input2) {
|
|
173545
|
+
const window = input2.window ?? OPENING_WINDOW;
|
|
173546
|
+
const boards = new Map(input2.history.map((b) => [b.turn, b.board]));
|
|
173547
|
+
const friends = /* @__PURE__ */ new Set([input2.player, ...input2.allies ?? []]);
|
|
173548
|
+
let territories = 0;
|
|
173549
|
+
const turns = [];
|
|
173550
|
+
for (let n = 1; n <= window; n++) {
|
|
173551
|
+
const before = boards.get(n - 1);
|
|
173552
|
+
const after = boards.get(n);
|
|
173553
|
+
if (!before || !after) continue;
|
|
173554
|
+
const had = landOf3(before, input2.player);
|
|
173555
|
+
let lost = 0;
|
|
173556
|
+
for (const t of after.territories)
|
|
173557
|
+
if (had.has(t.territoryId) && t.owner.kind === "player" && !friends.has(t.owner.playerId)) lost++;
|
|
173558
|
+
if (lost) {
|
|
173559
|
+
territories += lost;
|
|
173560
|
+
turns.push(n);
|
|
173561
|
+
}
|
|
173562
|
+
}
|
|
173563
|
+
return { territories, turns };
|
|
173564
|
+
}
|
|
173565
|
+
function lossAggregate(entries2) {
|
|
173566
|
+
const won = entries2.filter((e) => e.winner !== null);
|
|
173567
|
+
return {
|
|
173568
|
+
games: entries2.length,
|
|
173569
|
+
withWinner: won.length,
|
|
173570
|
+
iWon: entries2.filter((e) => e.iWon).length,
|
|
173571
|
+
iLost: entries2.filter((e) => e.mine.territories > 0).length,
|
|
173572
|
+
winnerLost: won.filter((e) => e.winner.territories > 0).length,
|
|
173573
|
+
myTerritories: entries2.reduce((n, e) => n + e.mine.territories, 0),
|
|
173574
|
+
winnerTerritories: won.reduce((n, e) => n + e.winner.territories, 0)
|
|
173575
|
+
};
|
|
173576
|
+
}
|
|
173577
|
+
function earlyLossesByEra(entries2) {
|
|
173578
|
+
const out = {};
|
|
173579
|
+
for (const era of ["pre-tool", "pre-rule-4f", "current"]) {
|
|
173580
|
+
const of = entries2.filter((e) => e.era === era);
|
|
173581
|
+
if (!of.length) continue;
|
|
173582
|
+
const byFormat = {};
|
|
173583
|
+
for (const f of [...new Set(of.map((e) => e.format))].sort()) byFormat[f] = lossAggregate(of.filter((e) => e.format === f));
|
|
173584
|
+
out[era] = { all: lossAggregate(of), byFormat };
|
|
173585
|
+
}
|
|
173586
|
+
return out;
|
|
173587
|
+
}
|
|
173337
173588
|
var LARGE_MAP_FACTOR = 5;
|
|
173338
173589
|
function benchmarkByEra(entries2) {
|
|
173339
173590
|
const basis = {};
|
|
@@ -173474,6 +173725,7 @@ async function calibrationHarness(dir, opts = {}) {
|
|
|
173474
173725
|
const byFormat = {};
|
|
173475
173726
|
const benchByFormat = {};
|
|
173476
173727
|
const eraEntries = [];
|
|
173728
|
+
const lossEntries = [];
|
|
173477
173729
|
let done = 0;
|
|
173478
173730
|
for (const input2 of src.inputs) {
|
|
173479
173731
|
opts.signal?.throwIfAborted();
|
|
@@ -173515,11 +173767,25 @@ async function calibrationHarness(dir, opts = {}) {
|
|
|
173515
173767
|
winners: seated.filter((p) => p.state === "Won").map((p) => p.id),
|
|
173516
173768
|
...opts.turns ? { turns: opts.turns } : {}
|
|
173517
173769
|
});
|
|
173770
|
+
const o = input2.opening;
|
|
173771
|
+
const { era, basis } = openingEra({ planned: o.planned, ...o.gameId !== void 0 ? { gameId: o.gameId } : {} });
|
|
173772
|
+
const allies = (id) => {
|
|
173773
|
+
const team = seated.find((p) => p.id === id)?.team;
|
|
173774
|
+
return typeof team === "number" && team >= 0 ? seated.filter((p) => p.id !== id && p.team === team).map((p) => p.id) : [];
|
|
173775
|
+
};
|
|
173776
|
+
const won = seated.filter((p) => p.state === "Won").map((p) => p.id);
|
|
173777
|
+
const iWon = won.includes(me);
|
|
173778
|
+
const winner = iWon ? me : won[0];
|
|
173779
|
+
lossEntries.push({
|
|
173780
|
+
era,
|
|
173781
|
+
format,
|
|
173782
|
+
mine: openingLosses({ player: me, history: h.boards, allies: allies(me) }),
|
|
173783
|
+
winner: winner === void 0 ? null : openingLosses({ player: winner, history: h.boards, allies: allies(winner) }),
|
|
173784
|
+
iWon
|
|
173785
|
+
});
|
|
173518
173786
|
if (bench.turns.length) {
|
|
173519
173787
|
counts.benchmarked++;
|
|
173520
173788
|
(benchByFormat[format] ??= []).push(bench);
|
|
173521
|
-
const o = input2.opening;
|
|
173522
|
-
const { era, basis } = openingEra({ planned: o.planned, ...o.gameId !== void 0 ? { gameId: o.gameId } : {} });
|
|
173523
173789
|
const flags = openingFlags({
|
|
173524
173790
|
me,
|
|
173525
173791
|
history: h.boards,
|
|
@@ -173540,10 +173806,120 @@ async function calibrationHarness(dir, opts = {}) {
|
|
|
173540
173806
|
const benchmark = {};
|
|
173541
173807
|
for (const [format, list4] of Object.entries(benchByFormat)) benchmark[format] = aggregateBenchmarks(list4);
|
|
173542
173808
|
benchmark.all = aggregateBenchmarks(Object.values(benchByFormat).flat());
|
|
173543
|
-
return { counts, calibration, benchmark, byEra: benchmarkByEra(eraEntries) };
|
|
173809
|
+
return { counts, calibration, benchmark, byEra: benchmarkByEra(eraEntries), earlyLosses: earlyLossesByEra(lossEntries) };
|
|
173810
|
+
}
|
|
173811
|
+
|
|
173812
|
+
// src/tools/calibration-job.ts
|
|
173813
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
173814
|
+
import { readFile as readFile26 } from "node:fs/promises";
|
|
173815
|
+
import { join as join31 } from "node:path";
|
|
173816
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
173817
|
+
import { Worker } from "node:worker_threads";
|
|
173818
|
+
var HARNESS_LIMIT_MS = 3 * 60 * 60 * 1e3;
|
|
173819
|
+
var harnessFolder = (dir) => join31(dir, "calibration");
|
|
173820
|
+
var harnessResultPath = (dir) => join31(harnessFolder(dir), "harness.json");
|
|
173821
|
+
var jobs = /* @__PURE__ */ new Map();
|
|
173822
|
+
async function readSaved(dir) {
|
|
173823
|
+
try {
|
|
173824
|
+
const v = JSON.parse(await readFile26(harnessResultPath(dir), "utf8"));
|
|
173825
|
+
return typeof v.finishedAt === "string" && typeof v.result === "object" && v.result !== null ? v : void 0;
|
|
173826
|
+
} catch {
|
|
173827
|
+
return void 0;
|
|
173828
|
+
}
|
|
173544
173829
|
}
|
|
173830
|
+
var iso4 = (ms) => new Date(ms).toISOString();
|
|
173831
|
+
var minutes2 = (ms) => Math.round(ms / 6e4);
|
|
173832
|
+
async function harnessJob(dir, opts = {}) {
|
|
173833
|
+
const now = opts.now ?? Date.now;
|
|
173834
|
+
const limit = opts.limitMs ?? HARNESS_LIMIT_MS;
|
|
173835
|
+
const job = jobs.get(dir);
|
|
173836
|
+
if (job?.state === "running") {
|
|
173837
|
+
const ran = now() - job.startedAt;
|
|
173838
|
+
if (ran > limit) {
|
|
173839
|
+
job.stop();
|
|
173840
|
+
const error62 = `The harness was stopped after ${minutes2(limit)} minute${minutes2(limit) === 1 ? "" : "s"} (${job.done} of ${job.total ?? "?"} games done).`;
|
|
173841
|
+
jobs.set(dir, { state: "failed", error: error62 });
|
|
173842
|
+
return harnessJob(dir, opts);
|
|
173843
|
+
}
|
|
173844
|
+
const previous = await readSaved(dir);
|
|
173845
|
+
return { status: "running", done: job.done, total: job.total, startedAt: iso4(job.startedAt), minutesRunning: minutes2(ran), ...previous ? { previous } : {} };
|
|
173846
|
+
}
|
|
173847
|
+
if (job?.state === "failed") {
|
|
173848
|
+
if (!opts.peek) jobs.delete(dir);
|
|
173849
|
+
return { status: "failed", error: job.error };
|
|
173850
|
+
}
|
|
173851
|
+
const saved = await readSaved(dir);
|
|
173852
|
+
if (saved && !opts.rerun) return { status: "done", finishedAt: saved.finishedAt, result: saved.result };
|
|
173853
|
+
if (opts.peek) return { status: "none" };
|
|
173854
|
+
const startedAt = now();
|
|
173855
|
+
const running = { state: "running", startedAt, done: 0, total: null, stop: () => void 0 };
|
|
173856
|
+
const handle = (opts.run ?? defaultRunner())(dir, (done, total) => {
|
|
173857
|
+
running.done = done;
|
|
173858
|
+
running.total = total;
|
|
173859
|
+
});
|
|
173860
|
+
running.stop = handle.stop;
|
|
173861
|
+
jobs.set(dir, running);
|
|
173862
|
+
handle.done.then(
|
|
173863
|
+
async (result2) => {
|
|
173864
|
+
if (jobs.get(dir) !== running) return;
|
|
173865
|
+
try {
|
|
173866
|
+
await writeJsonAtomic(harnessResultPath(dir), harnessFolder(dir), { finishedAt: iso4(now()), result: result2 });
|
|
173867
|
+
jobs.delete(dir);
|
|
173868
|
+
} catch (e) {
|
|
173869
|
+
jobs.set(dir, { state: "failed", error: `The harness finished but its result could not be saved: ${messageOf2(e)}` });
|
|
173870
|
+
}
|
|
173871
|
+
},
|
|
173872
|
+
(e) => {
|
|
173873
|
+
if (jobs.get(dir) === running) jobs.set(dir, { state: "failed", error: messageOf2(e) });
|
|
173874
|
+
}
|
|
173875
|
+
);
|
|
173876
|
+
return { status: "started", startedAt: iso4(startedAt), ...saved ? { previous: saved } : {} };
|
|
173877
|
+
}
|
|
173878
|
+
var messageOf2 = (e) => (e instanceof Error ? e.message : String(e)).slice(0, 300);
|
|
173879
|
+
function workerFile(base = import.meta.url) {
|
|
173880
|
+
for (const rel of ["./calibration-worker.js", "./tools/calibration-worker.js"]) {
|
|
173881
|
+
const p = fileURLToPath2(new URL(rel, base));
|
|
173882
|
+
if (existsSync4(p)) return p;
|
|
173883
|
+
}
|
|
173884
|
+
return void 0;
|
|
173885
|
+
}
|
|
173886
|
+
function defaultRunner() {
|
|
173887
|
+
const file2 = workerFile();
|
|
173888
|
+
return file2 ? workerRunner(file2) : inProcessRunner;
|
|
173889
|
+
}
|
|
173890
|
+
function workerRunner(file2) {
|
|
173891
|
+
return (dir, onProgress) => {
|
|
173892
|
+
const worker = new Worker(file2, { workerData: { dir } });
|
|
173893
|
+
const done = new Promise((resolve6, reject) => {
|
|
173894
|
+
worker.on("message", (m) => {
|
|
173895
|
+
if (m.type === "progress") onProgress(m.done, m.total);
|
|
173896
|
+
else if (m.type === "done") resolve6(m.result);
|
|
173897
|
+
else if (m.type === "error") reject(new Error(m.message));
|
|
173898
|
+
});
|
|
173899
|
+
worker.on("error", reject);
|
|
173900
|
+
worker.on("exit", (code2) => reject(new Error(`The harness worker exited (code ${code2}) before it finished.`)));
|
|
173901
|
+
});
|
|
173902
|
+
return { done, stop: () => void worker.terminate() };
|
|
173903
|
+
};
|
|
173904
|
+
}
|
|
173905
|
+
var inProcessRunner = (dir, onProgress) => {
|
|
173906
|
+
const stop = new AbortController();
|
|
173907
|
+
return { done: calibrationHarness(dir, { progress: onProgress, signal: stop.signal }), stop: () => stop.abort(new Error("The harness was stopped.")) };
|
|
173908
|
+
};
|
|
173545
173909
|
|
|
173546
173910
|
// src/tools/calibration.ts
|
|
173911
|
+
var HARNESS_WAIT_MS = 25e3;
|
|
173912
|
+
async function harnessView(dir, rerun, waitMs = HARNESS_WAIT_MS) {
|
|
173913
|
+
let view = await harnessJob(dir, { rerun });
|
|
173914
|
+
const until = Date.now() + waitMs;
|
|
173915
|
+
while ((view.status === "started" || view.status === "running") && Date.now() < until) {
|
|
173916
|
+
await new Promise((r) => setTimeout(r, Math.min(500, Math.max(0, until - Date.now()))));
|
|
173917
|
+
const peek = await harnessJob(dir, { peek: true });
|
|
173918
|
+
if (peek.status === "none") break;
|
|
173919
|
+
view = peek.status === "failed" ? await harnessJob(dir) : peek;
|
|
173920
|
+
}
|
|
173921
|
+
return view;
|
|
173922
|
+
}
|
|
173547
173923
|
var MAX_SAMPLES = 2e3;
|
|
173548
173924
|
var CALIBRATION_NOTE = "Each sample is one income estimate a planned turn worked from, against that opponent's true income (base plus full bonuses, cards and the army cap aside) on the board the turn was played on, read from the finished game's history. ratio = estimate \xF7 truth; meanError = estimate \u2212 truth in armies. Reported only: nothing plans on it. Only games whose decision log was given the end-of-game truth count (games played on builds with the decision log, finished, their history read); `method` (the tracker's, incl. rise-capped) is logged only since #569. The consequences block is a proxy: a lost territory has many causes.";
|
|
173549
173925
|
async function calibrationGames(dir) {
|
|
@@ -173582,28 +173958,23 @@ function registerCalibrationTool(server, dataDir2) {
|
|
|
173582
173958
|
{
|
|
173583
173959
|
title: "Score the income estimates against finished games",
|
|
173584
173960
|
_meta: mintMeta("lookup", ["how accurate are the income estimates", "calibrate opponent income", "estimate accuracy"]),
|
|
173585
|
-
description: `Score the opponent income estimates this server planned with against the truth its finished games kept (the decision log's end-of-game truth): each estimate \xF7 the true income, and its signed error in armies, overall and by format, seats, phase (turns 1\u20134, 5\u201310, 11+), frontier coverage band, estimate source, thin evidence, the tracker's income method (rise-capped or not; logged since #569), leader vs trailer, and phase by coverage; the catch-up lag after a true income jump of 1.5\xD7 or more (turns until the estimate reaches two thirds of the truth; only jumps on a planned turn, the rest counted as unwatched); a consequences proxy (turns that lost a territory the plan did not concede, with an estimate under half the truth vs without); the largest misses; each pipeline stage's figure \xF7 the truth (visible, observed, tracked, prior, stated, blend, thin, known; logged since #568); for each estimate under two thirds of the truth, the tracker step that held it (rise cap, tripwire, window, could-earn ceiling, ambiguous armies, readings, a later stage, or no track; logged since #586); and what correcting the tracked figure by its coverage band would have read at dampings 0 to 1 (leave one game out). \`samples: true\` adds the scored rows (at most ${MAX_SAMPLES}), name-free, as a fixture set; \`harness: true\`
|
|
173961
|
+
description: `Score the opponent income estimates this server planned with against the truth its finished games kept (the decision log's end-of-game truth): each estimate \xF7 the true income, and its signed error in armies, overall and by format, seats, phase (turns 1\u20134, 5\u201310, 11+), frontier coverage band, estimate source, thin evidence, the tracker's income method (rise-capped or not; logged since #569), leader vs trailer, and phase by coverage; the catch-up lag after a true income jump of 1.5\xD7 or more (turns until the estimate reaches two thirds of the truth; only jumps on a planned turn, the rest counted as unwatched); a consequences proxy (turns that lost a territory the plan did not concede, with an estimate under half the truth vs without); the largest misses; each pipeline stage's figure \xF7 the truth (visible, observed, tracked, prior, stated, blend, thin, known; logged since #568); for each estimate under two thirds of the truth, the tracker step that held it (rise cap, tripwire, window, could-earn ceiling, ambiguous armies, readings, a later stage, or no track; logged since #586); and what correcting the tracked figure by its coverage band would have read at dampings 0 to 1 (leave one game out). \`samples: true\` adds the scored rows (at most ${MAX_SAMPLES}), name-free, as a fixture set; \`harness: true\` adds the #318 harness over the cached boards (tracker, fog prior and plan estimate by coverage band, and the opening benchmark): it runs in the background, since it can take most of an hour on many games, so the first call starts it and later calls say \`running\` (games done of total) until it is \`done\`; the result is kept, so a later call returns it at once (\`rerun: true\` starts a fresh run). Games are numbered by their place in the report, never by id, and no player is named. Makes no war.app request; writes only the harness result, in this server's own data. Read-only.`,
|
|
173586
173962
|
annotations: toolAnnotations({ title: "Income estimate calibration", readOnly: true, destructive: false, idempotent: true, openWorld: false }),
|
|
173587
173963
|
inputSchema: external_exports.object({
|
|
173588
173964
|
samples: external_exports.boolean().optional().describe(`Also return the scored rows, name-free (default false; at most ${MAX_SAMPLES}).`),
|
|
173589
|
-
harness: external_exports.boolean().optional().describe("Also
|
|
173965
|
+
harness: external_exports.boolean().optional().describe("Also the #318 harness over the cached boards and the opening benchmark (default false): started in the background on the first call; call again until its status is `done`."),
|
|
173966
|
+
rerun: external_exports.boolean().optional().describe("With `harness`, start a fresh harness run over a kept result (default false)."),
|
|
173590
173967
|
format: external_exports.enum(["1v1", "ffa", "team"]).optional().describe("Only games of this format.")
|
|
173591
173968
|
})
|
|
173592
173969
|
},
|
|
173593
|
-
async ({ samples, harness, format }) => {
|
|
173970
|
+
async ({ samples, harness, rerun, format }) => {
|
|
173594
173971
|
const dir = dataDir2();
|
|
173595
173972
|
if (!dir) refuse("This server has no data directory, so there is nothing to score.", "Nothing to do here.");
|
|
173596
173973
|
const src = await calibrationGames(dir);
|
|
173597
173974
|
const games = format ? src.games.filter((g) => g.format === format) : src.games;
|
|
173598
173975
|
const report2 = incomeCalibration(games);
|
|
173599
173976
|
const rows = samples ? incomeSamples(games) : [];
|
|
173600
|
-
const
|
|
173601
|
-
const extra = harness ? await calibrationHarness(dir, {
|
|
173602
|
-
...callerWantsProgress() ? {
|
|
173603
|
-
progress: (done, total) => void reportProgress(done, total, `calibration harness: ${done} of ${total} games`).catch(() => void 0)
|
|
173604
|
-
} : {},
|
|
173605
|
-
...signal ? { signal } : {}
|
|
173606
|
-
}) : void 0;
|
|
173977
|
+
const job = harness ? await harnessView(dir, rerun === true) : void 0;
|
|
173607
173978
|
return respond(void 0, ["compact"], () => ({
|
|
173608
173979
|
readAs: CALIBRATION_NOTE,
|
|
173609
173980
|
sources: {
|
|
@@ -173618,11 +173989,28 @@ function registerCalibrationTool(server, dataDir2) {
|
|
|
173618
173989
|
empty: "No finished game with the end-of-game truth in its decision log yet: the truth is written when a finished game's history is read (warapp_backfill_history, warapp_my_games' sweep, warapp_get_game on it)."
|
|
173619
173990
|
},
|
|
173620
173991
|
...samples ? { samples: rows.slice(0, MAX_SAMPLES), ...rows.length > MAX_SAMPLES ? { samplesLeftOut: rows.length - MAX_SAMPLES } : {} } : {},
|
|
173621
|
-
...
|
|
173992
|
+
...job ? { harness: harnessOut(job) } : {}
|
|
173622
173993
|
}));
|
|
173623
173994
|
}
|
|
173624
173995
|
);
|
|
173625
173996
|
}
|
|
173997
|
+
function harnessOut(job) {
|
|
173998
|
+
switch (job.status) {
|
|
173999
|
+
case "done":
|
|
174000
|
+
return { status: "done", finishedAt: job.finishedAt, ...job.result, approximations: HARNESS_APPROXIMATIONS, note: "A kept result: `rerun: true` starts a fresh run." };
|
|
174001
|
+
case "failed":
|
|
174002
|
+
return { status: "failed", error: job.error, note: "Call again with `harness: true` to start a fresh run." };
|
|
174003
|
+
case "started":
|
|
174004
|
+
case "running":
|
|
174005
|
+
return {
|
|
174006
|
+
...job,
|
|
174007
|
+
...job.previous ? { previous: { finishedAt: job.previous.finishedAt, ...job.previous.result, approximations: HARNESS_APPROXIMATIONS } } : {},
|
|
174008
|
+
note: "The harness runs in the background: call warapp_calibration with `harness: true` again in a few minutes for its progress, then its result."
|
|
174009
|
+
};
|
|
174010
|
+
default:
|
|
174011
|
+
return job;
|
|
174012
|
+
}
|
|
174013
|
+
}
|
|
173626
174014
|
|
|
173627
174015
|
// src/tools/turn-history.ts
|
|
173628
174016
|
var MAX_HISTORY_TURNS = 20;
|