CI / build + unit + e2e (pull_request) Successful in 2m33s
Per-nation named leaders (Nation.leader) and a required TurnResult.leaders
lever ({ changes: [{ target, name, cause }] }). Each change sets the target
nation's leader and applies a deterministic stability dip by cause
(assassination -15, death -3, appointed 0) mirrored to its regions and
re-derived into its stats, plus a narration event (military for an
assassination, political for a death/appointment). An assassination/death
requires the target to already have a leader (a leaderless target is
dropped); an appointment always creates/sets one. Unknown/ambiguous targets
are dropped, never thrown.
- shared/types.ts: optional Nation.leader
- shared/protocol.ts: LeaderCause/LeaderChange/LeaderOps, LEADER_STABILITY_EFFECT,
TurnResult.leaders (required, between nuclear and markers), leader in nationForPrompt
- server/engine.ts: validateLeaderOps, applyLeaderChange, the applyTurnResult
leader block (after nuclear, before markers), isMeaningful, system-prompt
contract + constraint, validateTurnResult + runTurn fallback
- server/stub.ts: leaders always { changes: [] } (e2e unaffected)
- tests: 15 engine.test.ts leader tests + 2 db.test.ts round-trips
- version 0.37.0 -> 0.38.0, CHANGELOG entry
82 lines
2.9 KiB
JSON
82 lines
2.9 KiB
JSON
{
|
|
"name": "history",
|
|
"version": "0.38.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "AI-driven alternate-history simulator — the LLM is the world engine (Pax Historia style).",
|
|
"scripts": {
|
|
"dev": "concurrently -n server,client -c blue,magenta \"tsx watch server/index.ts\" \"vite\"",
|
|
"build": "vite build && tsup server/index.ts --format esm --target node22 --out-dir server/dist --external better-sqlite3",
|
|
"start": "node server/dist/index.js",
|
|
"test": "vitest run",
|
|
"generate:regions": "node scripts/generate-regions.mjs",
|
|
"coarsen:regions": "node scripts/coarsen-regions.mjs",
|
|
"cleanup:regions": "node scripts/cleanup-regions.mjs",
|
|
"smooth:regions": "node scripts/smooth-regions.mjs",
|
|
"fill:regions": "node scripts/fill-gaps.mjs",
|
|
"split:regions": "node scripts/split-arkhangel.mjs",
|
|
"split:regions:band": "node scripts/split-arkhangel-band.mjs",
|
|
"build:region-keys": "node scripts/build-region-keys.mjs",
|
|
"build:region-adjacency": "node scripts/build-region-adjacency.mjs",
|
|
"build:region-centroids": "node scripts/build-region-centroids.mjs",
|
|
"build:region-geo": "node scripts/build-region-geo.mjs",
|
|
"build:region-resources": "node scripts/build-region-resources.mjs",
|
|
"extract:admin0-pop": "node scripts/extract-admin0-pop.mjs",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint .",
|
|
"e2e": "playwright test"
|
|
},
|
|
"dependencies": {
|
|
"@radix-ui/react-dialog": "^1.1.6",
|
|
"@radix-ui/react-label": "^2.1.2",
|
|
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
"@radix-ui/react-select": "^2.1.7",
|
|
"@radix-ui/react-tabs": "^1.1.3",
|
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
"better-sqlite3": "^11.10.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cn": "^0.4.0",
|
|
"express": "^4.21.2",
|
|
"lucide-react": "^0.469.0",
|
|
"maplibre-gl": "^6.10.0",
|
|
"next-themes": "^0.4.6",
|
|
"radix-ui": "^1.7.0",
|
|
"react": "^19.3.0",
|
|
"react-dom": "^19.3.0",
|
|
"sonner": "^1.7.4",
|
|
"tailwind-merge": "^3.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.20.0",
|
|
"@playwright/test": "^1.62.1",
|
|
"@tailwindcss/vite": "^4.1.4",
|
|
"@turf/area": "^7.4.0",
|
|
"@turf/bbox": "^7.4.0",
|
|
"@turf/boolean-point-in-polygon": "^7.4.0",
|
|
"@turf/centroid": "^7.4.0",
|
|
"@turf/difference": "^7.4.0",
|
|
"@turf/distance": "^7.4.0",
|
|
"@turf/simplify": "^7.4.0",
|
|
"@turf/turf": "^7.4.0",
|
|
"@turf/union": "^7.4.0",
|
|
"@types/better-sqlite3": "^7.6.13",
|
|
"@types/express": "^4.17.25",
|
|
"@types/node": "^22.13.0",
|
|
"@types/react": "^19.3.0",
|
|
"@types/react-dom": "^19.3.0",
|
|
"@vitejs/plugin-react": "^4.4.1",
|
|
"concurrently": "^9.1.0",
|
|
"eslint": "^9.20.0",
|
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
"globals": "^16.0.0",
|
|
"tailwindcss": "^4.1.4",
|
|
"tsup": "^8.3.5",
|
|
"tsx": "^4.19.2",
|
|
"typescript": "~5.8.3",
|
|
"typescript-eslint": "^8.24.0",
|
|
"vite": "^6.3.5",
|
|
"vitest": "^3.2.4"
|
|
}
|
|
}
|