ce1fb0d60b
Map raw backend response (evaluation/continuationMoves) to frontend model (eval/winChance/continuations). Add getFenHistory() call after loading a game or PGN so runAnalysis() gets per-ply FEN history and triggers analyzeGame() instead of falling back to single-position analysis. Remove !hasAnnotations guard so positionAnalysis card shows even when a game is loaded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
747 B
TypeScript
36 lines
747 B
TypeScript
export interface AnalysisRequest {
|
|
fen: string;
|
|
depth: number;
|
|
}
|
|
|
|
export interface RawAnalysisResponse {
|
|
fen: string;
|
|
evaluation: number;
|
|
depth: number;
|
|
bestMove: string;
|
|
mate: number | null;
|
|
continuationMoves: string[];
|
|
}
|
|
|
|
export interface AnalysisResponse {
|
|
eval: number;
|
|
winChance: number;
|
|
depth: number;
|
|
bestMove: string;
|
|
mate: number | null;
|
|
continuations: string[];
|
|
}
|
|
|
|
export type MoveQuality = 'brilliant' | 'best' | 'good' | 'inaccuracy' | 'mistake' | 'blunder';
|
|
|
|
export interface AnnotatedMove {
|
|
san: string;
|
|
fen: string;
|
|
evalBefore: number | null;
|
|
evalAfter: number | null;
|
|
quality: MoveQuality | null;
|
|
bestMove: string | null;
|
|
winChanceBefore: number | null;
|
|
winChanceAfter: number | null;
|
|
}
|