gigachess 0.2.1 → 0.4.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/README.md +103 -108
- package/dist/attacks.d.ts +6 -3
- package/dist/attacks.d.ts.map +1 -1
- package/dist/attacks.js +45 -1
- package/dist/board.d.ts +111 -45
- package/dist/board.d.ts.map +1 -1
- package/dist/board.js +747 -14
- package/dist/castling.d.ts +41 -0
- package/dist/castling.d.ts.map +1 -0
- package/dist/castling.js +267 -0
- package/dist/chess.d.ts +30 -28
- package/dist/chess.d.ts.map +1 -1
- package/dist/chess.js +835 -458
- package/dist/chess960.d.ts +1 -1
- package/dist/chess960.d.ts.map +1 -1
- package/dist/chess960.js +2 -2
- package/dist/chessjs.d.ts +13 -0
- package/dist/chessjs.d.ts.map +1 -0
- package/dist/chessjs.js +23 -0
- package/dist/chessops/board.d.ts +1 -1
- package/dist/chessops/board.d.ts.map +1 -1
- package/dist/chessops/chess.js +1 -1
- package/dist/chessops/convert.d.ts +1 -1
- package/dist/chessops/convert.d.ts.map +1 -1
- package/dist/chessops/convert.js +1 -6
- package/dist/chessops/fenInternal.d.ts +1 -1
- package/dist/chessops/fenInternal.d.ts.map +1 -1
- package/dist/chessops/fenInternal.js +2 -2
- package/dist/chessops/index.js +2 -2
- package/dist/chessops/setup.js +1 -1
- package/dist/chessops/types.js +1 -1
- package/dist/chesstree.d.ts +1 -1
- package/dist/chesstree.d.ts.map +1 -1
- package/dist/chesstree.js +5 -5
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/fen.d.ts.map +1 -1
- package/dist/fen.js +84 -48
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -8
- package/dist/packedMove.js +2 -2
- package/dist/san.d.ts.map +1 -1
- package/dist/san.js +148 -172
- package/dist/squareSet.js +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/zobrist.d.ts +22 -0
- package/dist/zobrist.d.ts.map +1 -1
- package/dist/zobrist.js +107 -36
- package/dist/zobristBlob.js +1 -1
- package/package.json +8 -6
package/dist/chess960.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as chess from "./chess.js";
|
|
2
2
|
import type { Setup } from "./types.js";
|
|
3
|
-
export {
|
|
3
|
+
export { dests, allDests, isCheck, isCheckmate, isStalemate, perft, makeMove } from "./chess.js";
|
|
4
4
|
export declare class Chess960 extends chess.Chess {
|
|
5
5
|
static fromSetup(setup: Setup): Chess960;
|
|
6
6
|
}
|
package/dist/chess960.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chess960.d.ts","sourceRoot":"","sources":["../src/chess960.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"chess960.d.ts","sourceRoot":"","sources":["../src/chess960.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKjG,qBAAa,QAAS,SAAQ,KAAK,CAAC,KAAK;IAGvC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ;CAGzC;AAGD,eAAO,MAAM,UAAU,sBAAgB,CAAC;AACxC,eAAO,MAAM,cAAc,0BAAoB,CAAC;AAChD,eAAO,MAAM,QAAQ,oBAAc,CAAC"}
|
package/dist/chess960.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/chess960.ts — Chess960 (Fischer Random) support, X-FEN/Shredder dual
|
|
2
|
-
// MIT
|
|
2
|
+
// MIT gigachess, clean-room from specs + FIDE notes (no G P L)
|
|
3
3
|
// Re-uses core chess.ts logic which already handles 960 castling via generic rook sets
|
|
4
4
|
import * as chess from "./chess.js";
|
|
5
|
-
export {
|
|
5
|
+
export { dests, allDests, isCheck, isCheckmate, isStalemate, perft, makeMove } from "./chess.js";
|
|
6
6
|
// Chess960 position is same as Setup but with chess960 flag handling for FEN
|
|
7
7
|
// Provide helper to create Chess960 position with 960 castling parsing already done via fen.ts
|
|
8
8
|
export class Chess960 extends chess.Chess {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Chess, INITIAL_FEN, type ColorName, type PieceChar, type VerboseMove, type HistoryEntry, } from "./chess.js";
|
|
2
|
+
export { Chess960 } from "./chess960.js";
|
|
3
|
+
export declare const WHITE = "w";
|
|
4
|
+
export declare const BLACK = "b";
|
|
5
|
+
export declare const PAWN = "p";
|
|
6
|
+
export declare const KNIGHT = "n";
|
|
7
|
+
export declare const BISHOP = "b";
|
|
8
|
+
export declare const ROOK = "r";
|
|
9
|
+
export declare const QUEEN = "q";
|
|
10
|
+
export declare const KING = "k";
|
|
11
|
+
export declare const DEFAULT_POSITION = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
|
|
12
|
+
export declare const SQUARES: readonly ["a8", "b8", "c8", "d8", "e8", "f8", "g8", "h8", "a7", "b7", "c7", "d7", "e7", "f7", "g7", "h7", "a6", "b6", "c6", "d6", "e6", "f6", "g6", "h6", "a5", "b5", "c5", "d5", "e5", "f5", "g5", "h5", "a4", "b4", "c4", "d4", "e4", "f4", "g4", "h4", "a3", "b3", "c3", "d3", "e3", "f3", "g3", "h3", "a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2", "a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1"];
|
|
13
|
+
//# sourceMappingURL=chessjs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chessjs.d.ts","sourceRoot":"","sources":["../src/chessjs.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,EACL,WAAW,EACX,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,eAAO,MAAM,KAAK,MAAM,CAAC;AACzB,eAAO,MAAM,KAAK,MAAM,CAAC;AAEzB,eAAO,MAAM,IAAI,MAAM,CAAC;AACxB,eAAO,MAAM,MAAM,MAAM,CAAC;AAC1B,eAAO,MAAM,MAAM,MAAM,CAAC;AAC1B,eAAO,MAAM,IAAI,MAAM,CAAC;AACxB,eAAO,MAAM,KAAK,MAAM,CAAC;AACzB,eAAO,MAAM,IAAI,MAAM,CAAC;AAExB,eAAO,MAAM,gBAAgB,6DAA6D,CAAC;AAE3F,eAAO,MAAM,OAAO,2YASV,CAAC"}
|
package/dist/chessjs.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/chessjs.ts — chess.js-compatible wrapper API for GigaChess
|
|
2
|
+
// Optional drop-in wrapper mirroring chess.js API ergonomics over the native Board engine.
|
|
3
|
+
export { Chess, INITIAL_FEN, } from "./chess.js";
|
|
4
|
+
export { Chess960 } from "./chess960.js";
|
|
5
|
+
export const WHITE = "w";
|
|
6
|
+
export const BLACK = "b";
|
|
7
|
+
export const PAWN = "p";
|
|
8
|
+
export const KNIGHT = "n";
|
|
9
|
+
export const BISHOP = "b";
|
|
10
|
+
export const ROOK = "r";
|
|
11
|
+
export const QUEEN = "q";
|
|
12
|
+
export const KING = "k";
|
|
13
|
+
export const DEFAULT_POSITION = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
|
|
14
|
+
export const SQUARES = [
|
|
15
|
+
"a8", "b8", "c8", "d8", "e8", "f8", "g8", "h8",
|
|
16
|
+
"a7", "b7", "c7", "d7", "e7", "f7", "g7", "h7",
|
|
17
|
+
"a6", "b6", "c6", "d6", "e6", "f6", "g6", "h6",
|
|
18
|
+
"a5", "b5", "c5", "d5", "e5", "f5", "g5", "h5",
|
|
19
|
+
"a4", "b4", "c4", "d4", "e4", "f4", "g4", "h4",
|
|
20
|
+
"a3", "b3", "c3", "d3", "e3", "f3", "g3", "h3",
|
|
21
|
+
"a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2",
|
|
22
|
+
"a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1",
|
|
23
|
+
];
|
package/dist/chessops/board.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { SquareSet } from "./squareSet.js";
|
|
|
3
3
|
import type { ByColor, ByRole, Color, Piece, Role, Square } from "./types.js";
|
|
4
4
|
export declare class Board implements Iterable<[Square, Piece]>, ByRole<SquareSet>, ByColor<SquareSet> {
|
|
5
5
|
/** Internal engine (immutable) board. Mutating methods replace it wholesale. */
|
|
6
|
-
_b: engine.
|
|
6
|
+
_b: engine.BoardLike;
|
|
7
7
|
private constructor();
|
|
8
8
|
static empty(): Board;
|
|
9
9
|
static default(): Board;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.d.ts","sourceRoot":"","sources":["../../src/chessops/board.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAK9E,qBAAa,KAAM,YAAW,QAAQ,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC;IAC5F,gFAAgF;IAChF,EA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// The facade keeps the baseline mutable-instance semantics (play() mutates the
|
|
3
3
|
// position, exactly like baseline) while delegating all rules to the immutable
|
|
4
|
-
//
|
|
4
|
+
// gigachess engine. Caller-provided values (Setup, Move) are never mutated.
|
|
5
5
|
import { Result } from "@badrap/result";
|
|
6
6
|
import * as engine from "../chess.js";
|
|
7
7
|
import * as engineAttacks from "../attacks.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BoardLike as EngineBoard } from "../board.js";
|
|
2
2
|
import type { Move as EngineMove, Position as EnginePosition } from "../types.js";
|
|
3
3
|
import { Role as ERole, Color as EColor } from "../types.js";
|
|
4
4
|
import type { CastlingRights as EngineCastlingRights } from "../types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/chessops/convert.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/chessops/convert.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,UAAU,IAAI,gBAAgB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EA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AC,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAI5D"}
|
package/dist/chessops/convert.js
CHANGED
|
@@ -17,12 +17,7 @@ export const pieceFromEngine = (p) => ({
|
|
|
17
17
|
});
|
|
18
18
|
/** Facade Board -> engine board, normalized to unsigned bit patterns. */
|
|
19
19
|
export const boardToEngine = (b) => {
|
|
20
|
-
|
|
21
|
-
const out = {};
|
|
22
|
-
for (const k of Object.keys(src)) {
|
|
23
|
-
out[k] = { lo: src[k].lo >>> 0, hi: src[k].hi >>> 0 };
|
|
24
|
-
}
|
|
25
|
-
return out;
|
|
20
|
+
return engineBoardMod.cloneBoard(b._b);
|
|
26
21
|
};
|
|
27
22
|
export const boardFromEngine = (b) => {
|
|
28
23
|
const facade = Board.empty();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BoardLike as EngineBoard } from "../board.js";
|
|
2
2
|
export declare const INITIAL_BOARD_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
|
|
3
3
|
export declare const INITIAL_EPD = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -";
|
|
4
4
|
export declare const INITIAL_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fenInternal.d.ts","sourceRoot":"","sources":["../../src/chessops/fenInternal.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"fenInternal.d.ts","sourceRoot":"","sources":["../../src/chessops/fenInternal.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AAI5D,eAAO,MAAM,iBAAiB,gDAAgD,CAAC;AAC/E,eAAO,MAAM,WAAW,yDAAyD,CAAC;AAClF,eAAO,MAAM,WAAW,6DAA6D,CAAC;AACtF,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,SAAS,0BAA0B,CAAC;AACjD,eAAO,MAAM,SAAS,8BAA8B,CAAC;AAErD;gCACgC;AAChC,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAIvE;AAWD;;kCAEkC;AAClC,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAU9D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/baseline/fenInternal.ts — engine bridge shared by the baseline-compatible
|
|
2
2
|
// facade modules (ADR-014). Not part of the public API. Single-sourced FEN
|
|
3
|
-
// constants + placement codecs (
|
|
4
|
-
// `
|
|
3
|
+
// constants + placement codecs (gigachess-adopt task 3.2; formerly
|
|
4
|
+
// `gigachess`, ADR-015).
|
|
5
5
|
import { parseFen as engineParseFen, makeFen as engineMakeFen } from "../fen.js";
|
|
6
6
|
import { Color } from "../types.js";
|
|
7
7
|
export const INITIAL_BOARD_FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";
|
package/dist/chessops/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/baseline/index.ts — baseline-compatible public API (ADR-014).
|
|
2
2
|
// Mirrors the baseline root module layout: `import { Chess, parseFen, ... }
|
|
3
|
-
// from "
|
|
3
|
+
// from "gigachess/chessops" (formerly gigachess/baseline, ADR-015)`. Backed by the immutable gigachess engine.
|
|
4
4
|
export * from "./types.js";
|
|
5
5
|
export * from "./squareSet.js";
|
|
6
6
|
export * from "./board.js";
|
|
@@ -10,7 +10,7 @@ export * from "./fen.js";
|
|
|
10
10
|
export * from "./san.js";
|
|
11
11
|
export * from "./util.js";
|
|
12
12
|
export * from "./debug.js";
|
|
13
|
-
// Integrated tree analysis (change
|
|
13
|
+
// Integrated tree analysis (change gigachess-unified-api-and-perf, task 3.3):
|
|
14
14
|
// the workstation consumes chessops + chesstree from ONE package. Re-exports
|
|
15
15
|
// the clean-room chesstree layer (buildTree / pgnImport / pgnExport /
|
|
16
16
|
// TreeWrapper) alongside the chessops-shaped API.
|
package/dist/chessops/setup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/baseline/setup.ts — baseline-exact Setup interface and helpers (ADR-014).
|
|
2
|
-
// Pockets/remainingChecks are always undefined:
|
|
2
|
+
// Pockets/remainingChecks are always undefined: gigachess implements standard
|
|
3
3
|
// chess only (no Crazyhouse/3check — variants are out of project scope).
|
|
4
4
|
import { Board } from "./board.js";
|
|
5
5
|
import { SquareSet } from "./squareSet.js";
|
package/dist/chessops/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/baseline/types.ts — baseline-exact public types (string enums, constants)
|
|
2
2
|
// Part of the baseline-compatible public API (ADR-014). Backed by the
|
|
3
|
-
// immutable
|
|
3
|
+
// immutable gigachess engine; callers' inputs are never mutated.
|
|
4
4
|
export const FILE_NAMES = ["a", "b", "c", "d", "e", "f", "g", "h"];
|
|
5
5
|
export const RANK_NAMES = ["1", "2", "3", "4", "5", "6", "7", "8"];
|
|
6
6
|
export const ROLE_CHARS = ["q", "n", "r", "b", "p", "k"];
|
package/dist/chesstree.d.ts
CHANGED
|
@@ -138,6 +138,6 @@ export declare const pgnExport: {
|
|
|
138
138
|
/** Renders a node list as a one-line PGN mainline (no result token). */
|
|
139
139
|
renderVariationPgn(game: Game, nodeList: TreeNode[]): string;
|
|
140
140
|
};
|
|
141
|
-
/** chesstree-compatible alias — `import { buildTree } from "
|
|
141
|
+
/** chesstree-compatible alias — `import { buildTree } from "gigachess/chesstree"`. */
|
|
142
142
|
export declare const buildTree: typeof build;
|
|
143
143
|
//# sourceMappingURL=chesstree.d.ts.map
|
package/dist/chesstree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chesstree.d.ts","sourceRoot":"","sources":["../src/chesstree.ts"],"names":[],"mappings":"AAkBA,MAAM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WAAW,CAEjD;AA+FD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,eAAO,MAAM,SAAS;IACpB;;8BAE0B;wBACN,WAAW,GAAG,MAAM;IAOxC,wEAAwE;6BAC/C,IAAI,YAAY,QAAQ,EAAE,GAAG,MAAM;CAsB7D,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,SAAS,cAAQ,CAAC"}
|
package/dist/chesstree.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/chesstree.ts — clean-room chesstree-compatible analysis-tree layer
|
|
2
|
-
// (`
|
|
2
|
+
// (`gigachess/chesstree`). Public shapes mirror the `@itshak/chesstree`
|
|
3
3
|
// `.d.ts` ONLY — no third-party engine code was read or copied (same clean-room policy
|
|
4
|
-
// as the chessops compat, ADR-014/015). All logic is backed by the
|
|
5
|
-
// engine (`parseSan`/`makeMove`/`makeFen`/`makeUci`) and `
|
|
6
|
-
// Not part of the third-party baseline; MIT like the rest of
|
|
4
|
+
// as the chessops compat, ADR-014/015). All logic is backed by the gigachess
|
|
5
|
+
// engine (`parseSan`/`makeMove`/`makeFen`/`makeUci`) and `gigachess/pgn`.
|
|
6
|
+
// Not part of the third-party baseline; MIT like the rest of gigachess.
|
|
7
7
|
import { parsePgn } from "./pgn.js";
|
|
8
8
|
import { parseFen, makeFen } from "./fen.js";
|
|
9
9
|
import { makeMove, isCheck } from "./chess.js";
|
|
@@ -510,5 +510,5 @@ export const pgnExport = {
|
|
|
510
510
|
return `${headers.join("\n")}\n\n${tokens.join(" ")}`;
|
|
511
511
|
},
|
|
512
512
|
};
|
|
513
|
-
/** chesstree-compatible alias — `import { buildTree } from "
|
|
513
|
+
/** chesstree-compatible alias — `import { buildTree } from "gigachess/chesstree"`. */
|
|
514
514
|
export const buildTree = build;
|
package/dist/core.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export * from "./util.js";
|
|
|
5
5
|
export * from "./fen.js";
|
|
6
6
|
export * from "./san.js";
|
|
7
7
|
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, isAttacked, kingAttackers, } from "./attacks.js";
|
|
8
|
-
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isThreefoldRepetition, perft, makeMove, play,
|
|
8
|
+
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isThreefoldRepetition, perft, makeMove, play, } from "./chess.js";
|
|
9
9
|
export type { CastlingPlan } from "./chess.js";
|
|
10
10
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,KAAK,EACL,QAAQ,EACR,IAAI,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,KAAK,EACL,QAAQ,EACR,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/core.ts —
|
|
1
|
+
// src/core.ts — gigachess core entry (standard rules only) for tree-shaking
|
|
2
2
|
// Exports board, squareSet, attacks, fen, san, chess (standard rules)
|
|
3
3
|
// Side-effect free, tree-shakeable per ADR-012
|
|
4
4
|
export * from "./squareSet.js";
|
|
@@ -8,4 +8,4 @@ export * from "./util.js";
|
|
|
8
8
|
export * from "./fen.js";
|
|
9
9
|
export * from "./san.js";
|
|
10
10
|
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, isAttacked, kingAttackers, } from "./attacks.js";
|
|
11
|
-
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isThreefoldRepetition, perft, makeMove, play,
|
|
11
|
+
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isThreefoldRepetition, perft, makeMove, play, } from "./chess.js";
|
package/dist/fen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fen.d.ts","sourceRoot":"","sources":["../src/fen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAkB,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fen.d.ts","sourceRoot":"","sources":["../src/fen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAkB,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AA0F1E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAgS9G;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CA2F/F"}
|
package/dist/fen.js
CHANGED
|
@@ -6,12 +6,35 @@ import { Color, Role, Err, Ok } from "./types.js";
|
|
|
6
6
|
import { squareFile, squareRank, squareName } from "./util.js";
|
|
7
7
|
import * as attacks from "./attacks.js";
|
|
8
8
|
import { zobristTablesLoaded, calculateZobrist } from "./zobrist.js";
|
|
9
|
+
import { CASTLE_WK, CASTLE_WQ, CASTLE_BK, CASTLE_BQ, CASTLING_RIGHTS_TABLE, CASTLING_FEN_STR, } from "./castling.js";
|
|
9
10
|
// helpers to create CastlingRights
|
|
10
11
|
function makeCastling(whiteSet, blackSet) {
|
|
11
12
|
const whiteKing = whiteSet.has(7);
|
|
12
13
|
const whiteQueen = whiteSet.has(0);
|
|
13
14
|
const blackKing = blackSet.has(63);
|
|
14
15
|
const blackQueen = blackSet.has(56);
|
|
16
|
+
let isStd = true;
|
|
17
|
+
for (const s of whiteSet) {
|
|
18
|
+
if (s !== 7 && s !== 0) {
|
|
19
|
+
isStd = false;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (isStd) {
|
|
24
|
+
for (const s of blackSet) {
|
|
25
|
+
if (s !== 63 && s !== 56) {
|
|
26
|
+
isStd = false;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (isStd) {
|
|
32
|
+
const mask = (whiteKing ? CASTLE_WK : 0) |
|
|
33
|
+
(whiteQueen ? CASTLE_WQ : 0) |
|
|
34
|
+
(blackKing ? CASTLE_BK : 0) |
|
|
35
|
+
(blackQueen ? CASTLE_BQ : 0);
|
|
36
|
+
return CASTLING_RIGHTS_TABLE[mask];
|
|
37
|
+
}
|
|
15
38
|
return {
|
|
16
39
|
white: new Set(whiteSet),
|
|
17
40
|
black: new Set(blackSet),
|
|
@@ -316,7 +339,7 @@ export function parseFen(fen, opts) {
|
|
|
316
339
|
// Structural validation (square name + rank for the side to move) stays
|
|
317
340
|
// unconditional per purechess-rules. The capturability check moves behind
|
|
318
341
|
// `strict` (design D3): real-world corpora (lichess FENs after any double
|
|
319
|
-
// push) and
|
|
342
|
+
// push) and gigachess's own makeFen output contain unreachable ep squares,
|
|
320
343
|
// and baseline accepts them — rejecting them broke round-trip for ~4.7% of
|
|
321
344
|
// real-game positions.
|
|
322
345
|
let epSquare = null;
|
|
@@ -406,16 +429,23 @@ export function parseFen(fen, opts) {
|
|
|
406
429
|
if (turn === Color.Black && whiteAttacked)
|
|
407
430
|
return Err({ code: "fen/oppositeCheck" });
|
|
408
431
|
}
|
|
409
|
-
|
|
432
|
+
const is960 = !!opts?.chess960;
|
|
433
|
+
const kingSqPair = [wkSq ?? -1, bkSq ?? -1];
|
|
434
|
+
curBoard.kingSq = kingSqPair;
|
|
435
|
+
const chk = attacks.kingAttackers(curBoard, turn);
|
|
410
436
|
const setup = {
|
|
411
437
|
board: curBoard,
|
|
412
438
|
turn,
|
|
413
439
|
castling,
|
|
440
|
+
castlingMask: castling.mask,
|
|
441
|
+
isChess960: is960 || castling.mask === undefined,
|
|
414
442
|
epSquare,
|
|
415
443
|
halfmoves: half,
|
|
416
444
|
fullmoves: full,
|
|
417
445
|
halfmove: half,
|
|
418
446
|
fullmove: full,
|
|
447
|
+
kingSq: kingSqPair,
|
|
448
|
+
checkers: chk,
|
|
419
449
|
};
|
|
420
450
|
// Seed the initial Zobrist key when the Polyglot tables are already loaded
|
|
421
451
|
// (lazy-loading contract — see src/zobrist.ts); makeMove then maintains it
|
|
@@ -474,60 +504,66 @@ export function makeFen(setup, opts) {
|
|
|
474
504
|
let castlingStr = "";
|
|
475
505
|
const chess960 = !!opts?.chess960;
|
|
476
506
|
const shredder = !!opts?.shredder;
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
const hasBlack = blackSet.size > 0;
|
|
481
|
-
if (!hasWhite && !hasBlack) {
|
|
482
|
-
castlingStr = "-";
|
|
507
|
+
if (!chess960 && !shredder && !setup.isChess960 && (setup.castlingMask !== undefined || setup.castling.mask !== undefined)) {
|
|
508
|
+
const m = (setup.castlingMask ?? setup.castling.mask) & 0x0F;
|
|
509
|
+
castlingStr = CASTLING_FEN_STR[m];
|
|
483
510
|
}
|
|
484
511
|
else {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
if (blackSet.has(63))
|
|
492
|
-
castlingStr += "k";
|
|
493
|
-
if (blackSet.has(56))
|
|
494
|
-
castlingStr += "q";
|
|
495
|
-
if (castlingStr === "")
|
|
496
|
-
castlingStr = "-";
|
|
512
|
+
const whiteSet = setup.castling.white;
|
|
513
|
+
const blackSet = setup.castling.black;
|
|
514
|
+
const hasWhite = whiteSet.size > 0;
|
|
515
|
+
const hasBlack = blackSet.size > 0;
|
|
516
|
+
if (!hasWhite && !hasBlack) {
|
|
517
|
+
castlingStr = "-";
|
|
497
518
|
}
|
|
498
519
|
else {
|
|
499
|
-
if (
|
|
500
|
-
//
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
if (isStandard) {
|
|
510
|
-
if (canShredderWhiteK)
|
|
511
|
-
castlingStr += "K";
|
|
512
|
-
if (canShredderWhiteQ)
|
|
513
|
-
castlingStr += "Q";
|
|
514
|
-
if (canShredderBlackK)
|
|
515
|
-
castlingStr += "k";
|
|
516
|
-
if (canShredderBlackQ)
|
|
517
|
-
castlingStr += "q";
|
|
518
|
-
emitted = true;
|
|
519
|
-
}
|
|
520
|
-
if (!emitted) {
|
|
521
|
-
// fallback to X-FEN
|
|
522
|
-
castlingStr = makeXFenString(setup);
|
|
523
|
-
}
|
|
520
|
+
if (!chess960) {
|
|
521
|
+
// standard KQkq
|
|
522
|
+
if (whiteSet.has(7))
|
|
523
|
+
castlingStr += "K";
|
|
524
|
+
if (whiteSet.has(0))
|
|
525
|
+
castlingStr += "Q";
|
|
526
|
+
if (blackSet.has(63))
|
|
527
|
+
castlingStr += "k";
|
|
528
|
+
if (blackSet.has(56))
|
|
529
|
+
castlingStr += "q";
|
|
524
530
|
if (castlingStr === "")
|
|
525
531
|
castlingStr = "-";
|
|
526
532
|
}
|
|
527
533
|
else {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
534
|
+
if (shredder) {
|
|
535
|
+
// Shredder: emit KQkq if rooks on standard squares else fallback to file letters
|
|
536
|
+
let emitted = false;
|
|
537
|
+
const canShredderWhiteK = whiteSet.has(7);
|
|
538
|
+
const canShredderWhiteQ = whiteSet.has(0);
|
|
539
|
+
const canShredderBlackK = blackSet.has(63);
|
|
540
|
+
const canShredderBlackQ = blackSet.has(56);
|
|
541
|
+
const isStandard = (canShredderWhiteK || canShredderWhiteQ || canShredderBlackK || canShredderBlackQ) &&
|
|
542
|
+
[...whiteSet].every(s => s === 7 || s === 0) &&
|
|
543
|
+
[...blackSet].every(s => s === 63 || s === 56);
|
|
544
|
+
if (isStandard) {
|
|
545
|
+
if (canShredderWhiteK)
|
|
546
|
+
castlingStr += "K";
|
|
547
|
+
if (canShredderWhiteQ)
|
|
548
|
+
castlingStr += "Q";
|
|
549
|
+
if (canShredderBlackK)
|
|
550
|
+
castlingStr += "k";
|
|
551
|
+
if (canShredderBlackQ)
|
|
552
|
+
castlingStr += "q";
|
|
553
|
+
emitted = true;
|
|
554
|
+
}
|
|
555
|
+
if (!emitted) {
|
|
556
|
+
// fallback to X-FEN
|
|
557
|
+
castlingStr = makeXFenString(setup);
|
|
558
|
+
}
|
|
559
|
+
if (castlingStr === "")
|
|
560
|
+
castlingStr = "-";
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
castlingStr = makeXFenString(setup);
|
|
564
|
+
if (castlingStr === "")
|
|
565
|
+
castlingStr = "-";
|
|
566
|
+
}
|
|
531
567
|
}
|
|
532
568
|
}
|
|
533
569
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,12 +5,13 @@ export * from "./util.js";
|
|
|
5
5
|
export * from "./fen.js";
|
|
6
6
|
export * from "./san.js";
|
|
7
7
|
export * from "./pgn.js";
|
|
8
|
-
export
|
|
8
|
+
export { isCheck960, isCheckmate960, perft960 } from "./chess960.js";
|
|
9
9
|
export * from "./zobrist.js";
|
|
10
10
|
export * from "./packedMove.js";
|
|
11
|
-
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, isAttacked, } from "./attacks.js";
|
|
11
|
+
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, lineRay, LINE_RAY_LO, LINE_RAY_HI, isAttacked, } from "./attacks.js";
|
|
12
12
|
export { kingAttackers } from "./attacks.js";
|
|
13
|
-
export {
|
|
13
|
+
export { CASTLE_PATH_LO, CASTLE_PATH_HI, CASTLE_CLEAR_STD, } from "./castling.js";
|
|
14
|
+
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, isLegal, perft, countLegalMoves, legalMovesInto, forEachLegalMove, MoveCounter, makeMove, play, INITIAL_FEN, } from "./chess.js";
|
|
14
15
|
export type { CastlingPlan } from "./chess.js";
|
|
15
16
|
export { pgnImport, buildTree, build, pgnExport, TreeWrapperImpl, } from "./chesstree.js";
|
|
16
17
|
export type { TreeWrapper, TreeNode, Path, Comment, Glyph, Clock, Shape, Eval as TreeEval, Game, Player, AnalyseData, } from "./chesstree.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,GAAG,EACH,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,OAAO,EACP,KAAK,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,SAAS,EACT,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,IAAI,QAAQ,EAChB,IAAI,EACJ,MAAM,EACN,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
// src/index.ts —
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// chess.js-superset core class extended with native tree navigation
|
|
5
|
-
// (`toTree`/`loadTree`), so `turbochess/core` stays free of PGN/tree code.
|
|
1
|
+
// src/index.ts — GigaChess root entry (MIT): Native Rust-Mirrored API
|
|
2
|
+
// Exports native Board, Undo, bitboards, Zobrist, packed moves, and rules.
|
|
3
|
+
// Note: The chess.js-compatible Chess class is exported via "gigachess/chessjs".
|
|
6
4
|
export * from "./squareSet.js";
|
|
7
5
|
export * from "./board.js";
|
|
8
6
|
export * from "./types.js";
|
|
@@ -10,13 +8,14 @@ export * from "./util.js";
|
|
|
10
8
|
export * from "./fen.js";
|
|
11
9
|
export * from "./san.js";
|
|
12
10
|
export * from "./pgn.js";
|
|
13
|
-
export
|
|
11
|
+
export { isCheck960, isCheckmate960, perft960 } from "./chess960.js";
|
|
14
12
|
export * from "./zobrist.js";
|
|
15
13
|
export * from "./packedMove.js";
|
|
16
14
|
// attacks: explicit to avoid duplicate kingAttackers with chess
|
|
17
|
-
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, isAttacked, } from "./attacks.js";
|
|
15
|
+
export { knightAttacks, kingAttacks, pawnAttacks, bishopAttacks, rookAttacks, queenAttacks, ensureMagicTablesLoaded, magicTablesLoaded, ray, between, lineRay, LINE_RAY_LO, LINE_RAY_HI, isAttacked, } from "./attacks.js";
|
|
18
16
|
export { kingAttackers } from "./attacks.js";
|
|
17
|
+
export { CASTLE_PATH_LO, CASTLE_PATH_HI, CASTLE_CLEAR_STD, } from "./castling.js";
|
|
19
18
|
// chess core (avoid duplicate Position and kingAttackers)
|
|
20
|
-
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, isLegal, perft, makeMove, play, INITIAL_FEN, } from "./chess.js";
|
|
19
|
+
export { dests, allDests, detectCastling, isCheck, isCheckmate, isStalemate, isInsufficientMaterial, isFiftyMoveDraw, isSeventyFiveMoveDraw, isThreefoldRepetition, isLegal, perft, countLegalMoves, legalMovesInto, forEachLegalMove, MoveCounter, makeMove, play, INITIAL_FEN, } from "./chess.js";
|
|
21
20
|
// chesstree integration (tree shapes + analysis API, folded into the root)
|
|
22
21
|
export { pgnImport, buildTree, build, pgnExport, TreeWrapperImpl, } from "./chesstree.js";
|
package/dist/packedMove.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/packedMove.ts — 16-bit packed move encoding ("moves2", design D3)
|
|
2
|
-
// 2-byte format matching
|
|
2
|
+
// 2-byte format matching gigachess 16-bit moves2 wire format:
|
|
3
3
|
// bits 0..5 (6 bits) from square index (0..63, a1 = 0)
|
|
4
4
|
// bits 6..11 (6 bits) to square index (0..63)
|
|
5
5
|
// bits 12..15 (4 bits) promotion code (0 = none, 1 = N, 2 = B, 3 = R, 4 = Q)
|
|
6
6
|
// Games pack into a flat Uint16Array (160 bytes per 80-ply game) for 25x–50x
|
|
7
7
|
// memory reduction over object moves, with ultra-fast binary replay and a
|
|
8
8
|
// direct Tauri IPC bridge (little-endian Uint8Array form).
|
|
9
|
-
// MIT
|
|
9
|
+
// MIT gigachess.
|
|
10
10
|
import { Role } from "./types.js";
|
|
11
11
|
/** moves2 promotion codes (NOT the Role enum — spec-mandated encoding). */
|
|
12
12
|
export const PROMO_NONE = 0;
|
package/dist/san.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"san.d.ts","sourceRoot":"","sources":["../src/san.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"san.d.ts","sourceRoot":"","sources":["../src/san.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiB7E,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAG,MAAM,CAsJzD;AAGD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CA6L3E;AAGD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAuB5D;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAgB1C"}
|