fuji/packages/engine/package.json
coyotte508 0c59dab3d1 Undo against bots: replay to BGS log positions (engine 0.1.12)
BGS undoes the only human's last saved move by calling replay(data, { to })
with the log length recorded before that move, and requires
logLength(result) === to. The wrapper passed `to` to the internal replay as
a history index, so most undo requests failed or landed elsewhere; admin
replays, which also send log positions, had the same problem.

With a position, replay now rewinds to the first point where the journal
reaches it, then reapplies later name changes and drops, and does not queue
chat announcements of replayed moves again. Choices that add no journal
entry (live route and readiness edits, preparation before the last player is
ready) are not restored: undoing one reopens them for every player, and the
bots choose again. replay(data) without a position, createAnalysis and the
internal history-index replay are unchanged.

Tests play complete 2-4 player games against bots: every undo point reaches
its log length and deep-equals the saved state unless unannounced choices
preceded the move; otherwise the reopened phase stays playable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:59:26 +02:00

29 lines
663 B
JSON

{
"name": "fuji-engine",
"version": "0.1.12",
"private": true,
"license": "AGPL-3.0-only",
"files": [
"dist"
],
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./wrapper": "./dist/wrapper.js"
},
"scripts": {
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
"test": "tsc --outDir dist-test && node --test dist-test/src/*.spec.js",
"prepack": "pnpm build"
},
"dependencies": {
"seedrandom": "3.0.5"
},
"devDependencies": {
"@types/node": "24.10.1",
"@types/seedrandom": "3.0.8",
"typescript": "5.9.3"
}
}