CI / build + unit + e2e (pull_request) Successful in 1m55s
Add the 9th modular LLM ability: a turn-transient `TurnResult.disasters`
lever letting the LLM declare natural/man-made disasters (earthquake /
flood / volcanic / wildfire / famine / plague / epidemic) on a nation or
a region, applying a DETERMINISTIC (type, severity) stat dip (no hidden
randomness). Like the hybrid layer it owns no GameState field, needs no
db.ts change, and leaves no durable list — an ongoing plague/epidemic is
simply re-declared each turn it persists.
- shared/protocol.ts: DisasterType / DisasterSeverity / DisasterEvent /
DisastersOps, and `TurnResult.disasters` (between `ideology` and
`markers`; required, default `{ events: [] }`).
- server/abilities/disasters.ts: the ability module (validate / apply /
schemaLine / constraint / isMeaningful / inert stub / empty payload; no
stateFields). `DISASTER_EFFECTS` is the deterministic (type, severity)
dip table (population never touched). Target resolution mirrors hybrid
(a region key hits its SOLE owner; 0/2+ owners dropped) but has NO
`from` field, so there is no self-target drop. Dips clamp to 0-100,
mirror to the target's regions (regionStats), and re-derive the target
nation's stats (same 0-region / no-entry guards).
- Registered last in ABILITIES (after ideology). System-prompt goldens
regenerated (one schema line + one constraint bullet each); the
user.txt golden stays byte-identical (payload() is {}).
- New server/abilities/disasters.test.ts (33 tests); registry.test.ts
updated to the 9-ability contract.
- Secondary cleanups from the v0.40 refactor: AGENTS.md (abilities/ in
the Layout tree + a "how to add a new ability" bullet + a disasters
bullet), delete the orphaned validateTakeovers JSDoc, fold both inline
`as unknown` casts into the top-level ./abilities import, and de-dup
`str` (now imported from ./abilities/shared).
Version bumped 0.40.0 -> 0.41.0.
82 lines
2.9 KiB
JSON
82 lines
2.9 KiB
JSON
{
|
|
"name": "history",
|
|
"version": "0.41.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"
|
|
}
|
|
}
|