Spaces:
Sleeping
Sleeping
| import { Chess, Square, Move, Color, PieceSymbol } from 'chess.js' | |
| export type { Chess, Square, Move, Color, PieceSymbol } | |
| export interface ChessPiece { | |
| type: PieceSymbol | |
| color: Color | |
| } | |
| export interface GameState { | |
| board: Chess | |
| gameActive: boolean | |
| playerColor: Color | |
| selectedSquare: Square | null | |
| legalMoves: Move[] | |
| gameHistory: GameHistoryEntry[] | |
| gameOver: boolean | |
| gameResult: GameResult | null | |
| promotionMove: Move | null | |
| promotionDialogActive: boolean | |
| aiThinking: boolean | |
| aiModelLoaded: boolean | |
| aiModelLoading: boolean | |
| } | |
| export interface GameHistoryEntry { | |
| move: string | |
| moveData: Move | |
| player: 'Human' | 'AI' | |
| timestamp: Date | |
| capturedPiece?: ChessPiece | |
| } | |
| export interface GameResult { | |
| isGameOver: boolean | |
| winner: Color | null | |
| message: string | |
| terminationReason: string | |
| details?: string | |
| } | |
| export interface DraggedPiece { | |
| piece: ChessPiece | |
| square: Square | |
| } | |
| export interface SquarePosition { | |
| x: number | |
| y: number | |
| } | |
| export interface AudioSettings { | |
| enabled: boolean | |
| volume: number | |
| } | |
| export enum GameTermination { | |
| CHECKMATE = 'checkmate', | |
| STALEMATE = 'stalemate', | |
| INSUFFICIENT_MATERIAL = 'insufficient_material', | |
| THREEFOLD_REPETITION = 'threefold_repetition', | |
| FIFTY_MOVE_RULE = 'fifty_move_rule', | |
| RESIGNATION = 'resignation', | |
| TIMEOUT = 'timeout' | |
| } | |
| export interface PieceFrequencies { | |
| [key: string]: number | |
| } | |
| export interface AudioEngineConfig { | |
| sampleRate: number | |
| volume: number | |
| enabled: boolean | |
| } | |
| export const CHESS_MODELS: string[] = [ | |
| 'mlabonne/chesspythia-70m', | |
| 'EleutherAI/pythia-70m-deduped', | |
| 'nlpguy/amdchess-v9', | |
| 'mlabonne/grandpythia-200k-70m', | |
| 'facebook/opt-125m', | |
| 'bharathrajcl/chess_llama_68m', | |
| 'Locutusque/TinyMistral-248M-v2.5', | |
| 'Q-bert/ChessGPT', | |
| 'nlpguy/smolchess-v2', | |
| 'nlpguy/amdchess-v2', | |
| 'amd/AMD-Llama-135m', | |
| 'nlpguy/amdchess-v5', | |
| 'distilbert/distilgpt2' | |
| ] |