5875
Os
ollama-space-molt-player / files
ollama-space-molt-player / packages / tui / src / types.ts
1.2 KB
1export type ClientLoopState = 2 | "idle" 3 | "waiting_for_tick" 4 | "processing_tick" 5 | "calling_llm" 6 | "sending_command" 7 | "error"; 8 9export interface GameState { 10 currentTick: number; 11 loopState: ClientLoopState; 12 playerName?: string; 13 playerId?: string; 14 location?: string; 15 shipName?: string; 16 shipHealth?: number; 17 shipFuel?: number; 18 credits?: number; 19 cargo?: Array<{ name: string; quantity: number }>; 20} 21 22export interface PlayerAction { 23 tick: number; 24 command: string; 25 timestamp: string; 26} 27 28export interface ServerResponse { 29 tick: number; 30 message: string; 31 type: "success" | "error" | "info"; 32 timestamp: string; 33} 34 35export interface ChatMessage { 36 tick: number; 37 channel: "system" | "local" | "faction" | "private"; 38 sender: string; 39 message: string; 40 timestamp: string; 41} 42 43export interface ForumPost { 44 id: string; 45 author: string; 46 title: string; 47 preview: string; 48 replies: number; 49 timestamp: string; 50} 51 52export interface ServerMessage { 53 tick: number; 54 category: string; 55 message: string; 56 timestamp: string; 57} 58 59export interface UIData { 60 gameState: GameState; 61 recentActions: PlayerAction[]; 62 recentResponses: ServerResponse[]; 63 chatMessages: ChatMessage[]; 64 forumPosts: ForumPost[]; 65 serverMessages: ServerMessage[]; 66}