Source code of the Chinese chess engine on https://cv.cm/ (/chinese-chess/).

The page runs the engine as a separate program in a Web Worker and only exchanges plain
messages with it (moves in, a snapshot of the game out). This zip is that program's
complete source.

src/vendor/xqwlight/  XiangQi Wizard Light (JavaScript) by Morning Yellow,
                      https://github.com/xqbase/xqwlight, GPL-2.0-or-later (see LICENSE
                      there). position.js, search.js and book.js are concatenated
                      unchanged, with exports added at the end.
src/shared/xiangqi.ts, src/client/chinese-chess/engine.worker.ts
                      cv.cm's rules, game-end checks and worker entry on top of the
                      engine, GPL-2.0-or-later.
src/shared/xiangqi-state.ts
                      the message and snapshot types the worker shares with the page
                      (no engine code), MIT License (cv.cm), compatible with the GPL.

Build: the source imports no packages; cv.cm bundles it with Vite. To build it yourself with
esbuild (checked with 0.25):
npx esbuild src/client/chinese-chess/engine.worker.ts --bundle --format=esm --minify --outfile=engine.js
Questions: m@cv.cm
