export interface ChatMessage {
  id: string;
  role: "user" | "assistant";
  text: string;
  timestamp: number;
  user_email?: string;
}

export interface Conversation {
  id: string;
  messages: ChatMessage[];
  created_at: number;
  updated_at: number;
}

export interface MessageAttachment {
  path: string;
  mime_type: string;
  name: string;
}

export interface IncomingMessage {
  text: string;
  conversation_id?: string;
  user_email?: string;
  attachments?: MessageAttachment[];
}

export interface ReplyPayload {
  conversation_id: string;
  text: string;
}

export interface NotifyPayload {
  text: string;
  level: "info" | "warning" | "error";
}

export type AgentStatus = "thinking" | "tool_use" | "tool_done" | "tool_error" | "idle";

export interface WSMessage {
  type: "reply" | "notify" | "error" | "status";
  conversation_id?: string;
  text: string;
  timestamp: number;
  level?: string;
  status?: AgentStatus;
  tool_name?: string;
}

export interface StatusEvent {
  event: string;
  tool_name?: string;
  conversation_id?: string;
}
