Current version: 4.5.1
Type definitions for the nodots-backgammon project. This package provides TypeScript type definitions and interfaces for representing backgammon game states, moves, and related functionality.
This package contains TypeScript type definitions for:
- Game state and management
- Board representation
- Checker movements and positions
- Dice rolls and cube decisions
- Player information and states
- Move validation and game rules
- Game offers and decisions
Install the package from npm:
npm install @nodots-llc/backgammon-typesThe type definitions are organized into the following modules:
board.ts- Board state and position typeschecker.ts- Checker representation and movementcheckercontainer.ts- Container management for checkerscube.ts- Doubling cube related typesdice.ts- Dice roll types and validationgame.ts- Core game state and managementmove.ts- Move representation and validationoffer.ts- Game offers (double, resign, etc.)pip.ts- Pip counting and managementplay.ts- Play action types and validationplayer.ts- Player state and management
Import the types you need in your TypeScript files:
import { Game, Move, Player, Board } from '@nodots-llc/backgammon-types'Types are designed to be consumed directly in applications and other packages in this ecosystem (core, ai, api, client). The package ships .d.ts files alongside ESM/CJS-compatible JS for broad tooling support.
New Features:
- Added AI telemetry and override tracking types for game history
OverrideReason- Enum for categorizing AI move override reasons (plan-origin-not-legal, mapping-failed, no-gnu-hints, etc.)OverrideInfo- Interface for override metadata with reasonCode and reasonTextAITelemetryStep- Comprehensive telemetry interface for AI move execution including:- Position and roll tracking (positionId, roll, rollSource)
- One-shot plan context (planLength, planIndex, planSource)
- Engine and mapping diagnostics (hintCount, mappedOriginId, mappingStrategy, mappingOutcome)
- CORE legality snapshots for debugging mismatches
- Dice handling telemetry (singleDieRemaining)
Improvements:
- Enhanced workspace build system with TypeScript project references
- Added clean scripts for package maintenance
- Improved package.json configuration with proper exports field for history module
- Build optimizations using
tsc -bfor faster incremental builds
Breaking Changes:
- None - all changes are backward compatible additions
- Documentation updates and version alignment to 4.1.x
- No breaking type changes from 3.x series
Breaking Changes:
- Removed
allowDrawsetting from game configuration - Backgammon doesn't support draws as a game outcome
New Features:
- Enhanced roll-for-start functionality with dedicated type definitions
- Added
BackgammonDiceRollingForStartandBackgammonDiceRolledForStartfor starting phase dice states - Added
BackgammonPlayerRollingForStartandBackgammonPlayerRolledForStartfor starting phase player states
Improvements:
- Fixed moves on activePlay to be required fields in all appropriate states
- Better import organization and type safety
- Updated .gitignore to exclude compiled files from package
New Features:
- Added
BackgammonGameMetadatainterface for game metadata (title, description, tags, tournament info) - Added
BackgammonGameStatisticsinterface for game statistics tracking (moves, rolls, timing, pip counts) - Added
BackgammonGameTiminginterface for time management and limits - Enhanced
BackgammonGameinterface with new optional attributes:metadata?: BackgammonGameMetadata- Game metadata and tournament informationstatistics?: BackgammonGameStatistics- Game statistics and historytiming?: BackgammonGameTiming- Time management settingsversion: string- Game format version for compatibilityrules- Backgammon rule variations (Crawford, Jacoby, Beaver, etc.)settings- Game settings (undo, resign, hints, etc.)
Breaking Changes:
- None - all new attributes are optional and backward compatible
- Node.js (Latest LTS recommended)
- npm
- Clone the repository
- Install dependencies:
npm install
To compile the TypeScript files:
npm run buildThis will generate the compiled JavaScript and type definition files in the dist directory.
npm run build- Compiles the TypeScript codenpm run prepare- Runs automatically before the package is packed or installed
MIT License - See LICENSE file for details
Ken Riley [email protected]
Note: This package provides shared TypeScript types used by core, ai, api, and client packages.