gigaboard 1.4.2 → 1.5.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.
Files changed (33) hide show
  1. package/dist/{board-model-BMtkLQvL.d.cts → board-model-BIVxSCWC.d.cts} +73 -2
  2. package/dist/{board-model-BMtkLQvL.d.ts → board-model-BIVxSCWC.d.ts} +73 -2
  3. package/dist/{chunk-EJUGH25P.js → chunk-53XWDREK.js} +4 -3
  4. package/dist/chunk-53XWDREK.js.map +1 -0
  5. package/dist/{chunk-SO6AOEFF.js → chunk-6F3FZAG7.js} +116 -18
  6. package/dist/chunk-6F3FZAG7.js.map +1 -0
  7. package/dist/{chunk-UBD62NOI.cjs → chunk-FUP2LDMO.cjs} +121 -16
  8. package/dist/chunk-FUP2LDMO.cjs.map +1 -0
  9. package/dist/{chunk-D45G3J5E.cjs → chunk-N4WTPXFC.cjs} +4 -2
  10. package/dist/chunk-N4WTPXFC.cjs.map +1 -0
  11. package/dist/core.cjs +72 -44
  12. package/dist/core.d.cts +17 -12
  13. package/dist/core.d.ts +17 -12
  14. package/dist/core.js +1 -1
  15. package/dist/{gigachess-C08uAeFw.d.ts → gigachess-DN-ncmAU.d.ts} +1 -1
  16. package/dist/{gigachess-Dr5gCN68.d.cts → gigachess-XpNGPM2m.d.cts} +1 -1
  17. package/dist/index.cjs +868 -250
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +55 -8
  20. package/dist/index.d.ts +55 -8
  21. package/dist/index.js +775 -189
  22. package/dist/index.js.map +1 -1
  23. package/dist/server.cjs +11 -11
  24. package/dist/server.d.cts +2 -2
  25. package/dist/server.d.ts +2 -2
  26. package/dist/server.js +1 -1
  27. package/dist/{types-CcOgT5ov.d.ts → types-4W8ULiE2.d.ts} +1 -1
  28. package/dist/{types-DfqRXtbD.d.cts → types-Dox7oLof.d.cts} +1 -1
  29. package/package.json +2 -2
  30. package/dist/chunk-D45G3J5E.cjs.map +0 -1
  31. package/dist/chunk-EJUGH25P.js.map +0 -1
  32. package/dist/chunk-SO6AOEFF.js.map +0 -1
  33. package/dist/chunk-UBD62NOI.cjs.map +0 -1
package/dist/core.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- export { c as createGigachessAdapter, p as preloadGigachessAdapter } from './gigachess-Dr5gCN68.cjs';
2
- import { c as colorOf, p as pieceTypeOf, P as PackedMove, S as SquareIndex, a as PieceType, A as AnimDescriptor, b as Arrow, d as Premove } from './board-model-BMtkLQvL.cjs';
3
- export { e as ArrowCustomSvg, f as ArrowHeadStyle, g as ArrowLabel, B as BOARD_CELL_BB, h as BOARD_CELL_BK, i as BOARD_CELL_BN, j as BOARD_CELL_BP, k as BOARD_CELL_BQ, l as BOARD_CELL_BR, m as BOARD_CELL_EMPTY, n as BOARD_CELL_WB, o as BOARD_CELL_WK, q as BOARD_CELL_WN, r as BOARD_CELL_WP, s as BOARD_CELL_WQ, t as BOARD_CELL_WR, u as BoardCell, v as BoardModel, w as BoardModelOptions, x as BoardSnapshot, y as BoardStore, C as CancelEvent, z as ClickEvent, D as Color, F as DragController, G as DragControllerOptions, H as DragEvent, I as DragMoveEvent, J as DragStartEvent, K as DragState, L as DropEvent, E as EngineAdapter, M as LegalMoveEntry, N as LegalMoveIndex, O as LegalMoveIndexOptions, Q as MOVE2_PROMO_BISHOP, R as MOVE2_PROMO_KNIGHT, T as MOVE2_PROMO_NONE, U as MOVE2_PROMO_QUEEN, V as MOVE2_PROMO_ROOK, W as PositionHash, X as SyncPositionOptions, Y as Unsubscribe, Z as ZobristKey, _ as createBoardModel, $ as createBoardStore, a0 as createDragController, a1 as createLegalMoveIndex, a2 as encodeBoardCell, a3 as isEmptyCell, a4 as isSquareIndex, a5 as packMove, a6 as toSquareIndex, a7 as unpackMove, a8 as writeBoardCell } from './board-model-BMtkLQvL.cjs';
1
+ export { c as createGigachessAdapter, p as preloadGigachessAdapter } from './gigachess-XpNGPM2m.cjs';
2
+ import { c as colorOf, p as pieceTypeOf, P as PackedMove, S as SquareIndex, a as PieceType, A as AnimDescriptor, b as Arrow, d as Premove } from './board-model-BIVxSCWC.cjs';
3
+ export { e as ArrowCustomSvg, f as ArrowHeadStyle, g as ArrowLabel, B as BOARD_CELL_BB, h as BOARD_CELL_BK, i as BOARD_CELL_BN, j as BOARD_CELL_BP, k as BOARD_CELL_BQ, l as BOARD_CELL_BR, m as BOARD_CELL_EMPTY, n as BOARD_CELL_WB, o as BOARD_CELL_WK, q as BOARD_CELL_WN, r as BOARD_CELL_WP, s as BOARD_CELL_WQ, t as BOARD_CELL_WR, u as BoardCell, v as BoardModel, w as BoardModelOptions, x as BoardSnapshot, y as BoardStore, C as CancelEvent, z as ClickEvent, D as Color, F as DragController, G as DragControllerOptions, H as DragEvent, I as DragMoveEvent, J as DragStartEvent, K as DragState, L as DropEvent, E as EngineAdapter, M as LegalMoveEntry, N as LegalMoveIndex, O as LegalMoveIndexOptions, Q as MOVE2_PROMO_BISHOP, R as MOVE2_PROMO_KNIGHT, T as MOVE2_PROMO_NONE, U as MOVE2_PROMO_QUEEN, V as MOVE2_PROMO_ROOK, W as NULL_MOVE_SAN, X as NULL_MOVE_SANS, Y as NULL_MOVE_UCI, Z as NULL_MOVE_WORD, _ as PositionHash, $ as SyncPositionOptions, a0 as Unsubscribe, a1 as ZobristKey, a2 as createBoardModel, a3 as createBoardStore, a4 as createDragController, a5 as createLegalMoveIndex, a6 as encodeBoardCell, a7 as isEmptyCell, a8 as isNullMove, a9 as isNullMoveSan, aa as isNullMoveUci, ab as isSquareIndex, ac as packMove, ad as toSquareIndex, ae as unpackMove, af as writeBoardCell } from './board-model-BIVxSCWC.cjs';
4
4
 
5
5
  /**
6
6
  * Animation planner: diff two board snapshots and classify the change.
@@ -30,11 +30,15 @@ declare function planAnimations(prev: Readonly<Uint8Array>, next: Readonly<Uint8
30
30
  /**
31
31
  * Lightweight, side-effect-free inspector. Used by tests to decompose a
32
32
  * packed move without pulling an engine as a runtime dep.
33
+ *
34
+ * @remarks
35
+ * A pass reports `kind: "pass"`. Its word has no from/to fields, so `from`
36
+ * and `to` come back as square 0 and must not be read — gate on `kind`.
33
37
  */
34
38
  declare function decodePackedMove(m: PackedMove): {
35
39
  from: SquareIndex;
36
40
  to: SquareIndex;
37
- kind: "normal" | "promotion" | "en-passant" | "castle";
41
+ kind: "normal" | "promotion" | "en-passant" | "castle" | "pass";
38
42
  promotion: PieceType | null;
39
43
  };
40
44
  /**
@@ -99,17 +103,18 @@ interface ArrowModel {
99
103
  * Atomic replace of the **managed** subset. User-drawn arrows are
100
104
  * untouched. Every incoming arrow is stamped `managed: true` — callers
101
105
  * don't have to set the flag explicitly, and the method's name carries
102
- * the intent. Identity preservation works the same way as
103
- * {@link setAll}: arrows whose identity key already exists are reused
104
- * from the stored frozen instances so consumer `Object.is` checks stay
105
- * cheap across commits.
106
+ * the intent. Entries whose identity key already exists keep their
107
+ * slot (never duplicated); when their styling differs the stored
108
+ * instance is replaced so the change commits and repaints, while
109
+ * visually-identical re-submits reuse the stored frozen instance so
110
+ * consumer `Object.is` checks stay cheap across commits.
106
111
  */
107
112
  setManaged(arrows: readonly Arrow[]): void;
108
113
  /**
109
- * Replace the entire arrow set in one atomic step. Preserves identity
110
- * for arrows whose `(from, to, color)` tuple was already present —
111
- * freshly-provided arrows are frozen and keyed; removed ones are
112
- * dropped. Single `lastChanged` flag covers the whole batch.
114
+ * Replace the entire arrow set in one atomic step. Entries whose
115
+ * identity key already exists keep their slot (never duplicated);
116
+ * changed styling replaces the stored instance in place, identical
117
+ * re-submits reuse it. Single `lastChanged` flag covers the batch.
113
118
  */
114
119
  setAll(arrows: readonly Arrow[]): void;
115
120
  /** Whether the last call actually changed the state. */
package/dist/core.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { c as createGigachessAdapter, p as preloadGigachessAdapter } from './gigachess-C08uAeFw.js';
2
- import { c as colorOf, p as pieceTypeOf, P as PackedMove, S as SquareIndex, a as PieceType, A as AnimDescriptor, b as Arrow, d as Premove } from './board-model-BMtkLQvL.js';
3
- export { e as ArrowCustomSvg, f as ArrowHeadStyle, g as ArrowLabel, B as BOARD_CELL_BB, h as BOARD_CELL_BK, i as BOARD_CELL_BN, j as BOARD_CELL_BP, k as BOARD_CELL_BQ, l as BOARD_CELL_BR, m as BOARD_CELL_EMPTY, n as BOARD_CELL_WB, o as BOARD_CELL_WK, q as BOARD_CELL_WN, r as BOARD_CELL_WP, s as BOARD_CELL_WQ, t as BOARD_CELL_WR, u as BoardCell, v as BoardModel, w as BoardModelOptions, x as BoardSnapshot, y as BoardStore, C as CancelEvent, z as ClickEvent, D as Color, F as DragController, G as DragControllerOptions, H as DragEvent, I as DragMoveEvent, J as DragStartEvent, K as DragState, L as DropEvent, E as EngineAdapter, M as LegalMoveEntry, N as LegalMoveIndex, O as LegalMoveIndexOptions, Q as MOVE2_PROMO_BISHOP, R as MOVE2_PROMO_KNIGHT, T as MOVE2_PROMO_NONE, U as MOVE2_PROMO_QUEEN, V as MOVE2_PROMO_ROOK, W as PositionHash, X as SyncPositionOptions, Y as Unsubscribe, Z as ZobristKey, _ as createBoardModel, $ as createBoardStore, a0 as createDragController, a1 as createLegalMoveIndex, a2 as encodeBoardCell, a3 as isEmptyCell, a4 as isSquareIndex, a5 as packMove, a6 as toSquareIndex, a7 as unpackMove, a8 as writeBoardCell } from './board-model-BMtkLQvL.js';
1
+ export { c as createGigachessAdapter, p as preloadGigachessAdapter } from './gigachess-DN-ncmAU.js';
2
+ import { c as colorOf, p as pieceTypeOf, P as PackedMove, S as SquareIndex, a as PieceType, A as AnimDescriptor, b as Arrow, d as Premove } from './board-model-BIVxSCWC.js';
3
+ export { e as ArrowCustomSvg, f as ArrowHeadStyle, g as ArrowLabel, B as BOARD_CELL_BB, h as BOARD_CELL_BK, i as BOARD_CELL_BN, j as BOARD_CELL_BP, k as BOARD_CELL_BQ, l as BOARD_CELL_BR, m as BOARD_CELL_EMPTY, n as BOARD_CELL_WB, o as BOARD_CELL_WK, q as BOARD_CELL_WN, r as BOARD_CELL_WP, s as BOARD_CELL_WQ, t as BOARD_CELL_WR, u as BoardCell, v as BoardModel, w as BoardModelOptions, x as BoardSnapshot, y as BoardStore, C as CancelEvent, z as ClickEvent, D as Color, F as DragController, G as DragControllerOptions, H as DragEvent, I as DragMoveEvent, J as DragStartEvent, K as DragState, L as DropEvent, E as EngineAdapter, M as LegalMoveEntry, N as LegalMoveIndex, O as LegalMoveIndexOptions, Q as MOVE2_PROMO_BISHOP, R as MOVE2_PROMO_KNIGHT, T as MOVE2_PROMO_NONE, U as MOVE2_PROMO_QUEEN, V as MOVE2_PROMO_ROOK, W as NULL_MOVE_SAN, X as NULL_MOVE_SANS, Y as NULL_MOVE_UCI, Z as NULL_MOVE_WORD, _ as PositionHash, $ as SyncPositionOptions, a0 as Unsubscribe, a1 as ZobristKey, a2 as createBoardModel, a3 as createBoardStore, a4 as createDragController, a5 as createLegalMoveIndex, a6 as encodeBoardCell, a7 as isEmptyCell, a8 as isNullMove, a9 as isNullMoveSan, aa as isNullMoveUci, ab as isSquareIndex, ac as packMove, ad as toSquareIndex, ae as unpackMove, af as writeBoardCell } from './board-model-BIVxSCWC.js';
4
4
 
5
5
  /**
6
6
  * Animation planner: diff two board snapshots and classify the change.
@@ -30,11 +30,15 @@ declare function planAnimations(prev: Readonly<Uint8Array>, next: Readonly<Uint8
30
30
  /**
31
31
  * Lightweight, side-effect-free inspector. Used by tests to decompose a
32
32
  * packed move without pulling an engine as a runtime dep.
33
+ *
34
+ * @remarks
35
+ * A pass reports `kind: "pass"`. Its word has no from/to fields, so `from`
36
+ * and `to` come back as square 0 and must not be read — gate on `kind`.
33
37
  */
34
38
  declare function decodePackedMove(m: PackedMove): {
35
39
  from: SquareIndex;
36
40
  to: SquareIndex;
37
- kind: "normal" | "promotion" | "en-passant" | "castle";
41
+ kind: "normal" | "promotion" | "en-passant" | "castle" | "pass";
38
42
  promotion: PieceType | null;
39
43
  };
40
44
  /**
@@ -99,17 +103,18 @@ interface ArrowModel {
99
103
  * Atomic replace of the **managed** subset. User-drawn arrows are
100
104
  * untouched. Every incoming arrow is stamped `managed: true` — callers
101
105
  * don't have to set the flag explicitly, and the method's name carries
102
- * the intent. Identity preservation works the same way as
103
- * {@link setAll}: arrows whose identity key already exists are reused
104
- * from the stored frozen instances so consumer `Object.is` checks stay
105
- * cheap across commits.
106
+ * the intent. Entries whose identity key already exists keep their
107
+ * slot (never duplicated); when their styling differs the stored
108
+ * instance is replaced so the change commits and repaints, while
109
+ * visually-identical re-submits reuse the stored frozen instance so
110
+ * consumer `Object.is` checks stay cheap across commits.
106
111
  */
107
112
  setManaged(arrows: readonly Arrow[]): void;
108
113
  /**
109
- * Replace the entire arrow set in one atomic step. Preserves identity
110
- * for arrows whose `(from, to, color)` tuple was already present —
111
- * freshly-provided arrows are frozen and keyed; removed ones are
112
- * dropped. Single `lastChanged` flag covers the whole batch.
114
+ * Replace the entire arrow set in one atomic step. Entries whose
115
+ * identity key already exists keep their slot (never duplicated);
116
+ * changed styling replaces the stored instance in place, identical
117
+ * re-submits reuse it. Single `lastChanged` flag covers the batch.
113
118
  */
114
119
  setAll(arrows: readonly Arrow[]): void;
115
120
  /** Whether the last call actually changed the state. */
package/dist/core.js CHANGED
@@ -1,3 +1,3 @@
1
- export { BOARD_CELL_BB, BOARD_CELL_BK, BOARD_CELL_BN, BOARD_CELL_BP, BOARD_CELL_BQ, BOARD_CELL_BR, BOARD_CELL_EMPTY, BOARD_CELL_WB, BOARD_CELL_WK, BOARD_CELL_WN, BOARD_CELL_WP, BOARD_CELL_WQ, BOARD_CELL_WR, Color, MOVE2_PROMO_BISHOP, MOVE2_PROMO_KNIGHT, MOVE2_PROMO_NONE, MOVE2_PROMO_QUEEN, MOVE2_PROMO_ROOK, PACKAGE_VERSION, PieceType, animationInspect, colorOf, createArrowModel, createBoardModel, createBoardStore, createDragController, createGigachessAdapter, createLegalMoveIndex, createPremoveBuffer, decodePackedMove, encodeBoardCell, isEmptyCell, isSquareIndex, makeArrow, makePremove, packMove, pieceTypeOf, planAnimations, preloadGigachessAdapter, toSquareIndex, unpackMove, writeBoardCell } from './chunk-SO6AOEFF.js';
1
+ export { BOARD_CELL_BB, BOARD_CELL_BK, BOARD_CELL_BN, BOARD_CELL_BP, BOARD_CELL_BQ, BOARD_CELL_BR, BOARD_CELL_EMPTY, BOARD_CELL_WB, BOARD_CELL_WK, BOARD_CELL_WN, BOARD_CELL_WP, BOARD_CELL_WQ, BOARD_CELL_WR, Color, MOVE2_PROMO_BISHOP, MOVE2_PROMO_KNIGHT, MOVE2_PROMO_NONE, MOVE2_PROMO_QUEEN, MOVE2_PROMO_ROOK, NULL_MOVE_SAN, NULL_MOVE_SANS, NULL_MOVE_UCI, NULL_MOVE_WORD, PACKAGE_VERSION, PieceType, animationInspect, colorOf, createArrowModel, createBoardModel, createBoardStore, createDragController, createGigachessAdapter, createLegalMoveIndex, createPremoveBuffer, decodePackedMove, encodeBoardCell, isEmptyCell, isNullMove, isNullMoveSan, isNullMoveUci, isSquareIndex, makeArrow, makePremove, packMove, pieceTypeOf, planAnimations, preloadGigachessAdapter, toSquareIndex, unpackMove, writeBoardCell } from './chunk-6F3FZAG7.js';
2
2
  //# sourceMappingURL=core.js.map
3
3
  //# sourceMappingURL=core.js.map
@@ -1,4 +1,4 @@
1
- import { E as EngineAdapter } from './board-model-BMtkLQvL.js';
1
+ import { E as EngineAdapter } from './board-model-BIVxSCWC.js';
2
2
 
3
3
  /**
4
4
  * Synchronous engine adapter wrapping `gigachess`.
@@ -1,4 +1,4 @@
1
- import { E as EngineAdapter } from './board-model-BMtkLQvL.cjs';
1
+ import { E as EngineAdapter } from './board-model-BIVxSCWC.cjs';
2
2
 
3
3
  /**
4
4
  * Synchronous engine adapter wrapping `gigachess`.