fix(SCOPONE-0008): complete iteration 1 remove ai lag

This commit is contained in:
Giancarmine Salucci
2026-04-02 20:51:43 +02:00
parent 019c4380be
commit 5b360bf191
5 changed files with 407 additions and 5 deletions

View File

@@ -0,0 +1,43 @@
import type { AIDecisionProgress, AIMove } from './ai';
import type { CardTrackerSnapshot } from './card-tracker';
import type { Difficulty, GameState, PlayerIndex } from './types';
export interface AIWorkerChooseMoveRequest {
type: 'choose-move';
requestId: string;
state: GameState;
playerIdx: PlayerIndex;
difficulty: Difficulty;
trackerSnapshot: CardTrackerSnapshot | null;
}
export interface AIWorkerProgressMessage {
type: 'progress';
requestId: string;
progress: AIDecisionProgress;
}
export interface AIWorkerResultMessage {
type: 'result';
requestId: string;
move: AIMove;
}
export interface AIWorkerSerializedError {
message: string;
name: string;
stack?: string;
}
export interface AIWorkerErrorMessage {
type: 'error';
requestId: string;
error: AIWorkerSerializedError;
}
export type AIWorkerRequestMessage = AIWorkerChooseMoveRequest;
export type AIWorkerResponseMessage =
| AIWorkerProgressMessage
| AIWorkerResultMessage
| AIWorkerErrorMessage;