import type {
  ChatConversationSummary,
  ChatMessage,
  ChatConversationRequest,
  ChatRuntimeSnapshot,
} from '../mainChatPanel/types';
import type { ErrorLogItem } from '../errorLogApi';

export type ChatWorkspaceView = 'chat' | 'runtime' | 'errors';

export type ChatWorkspaceSelection = {
  activeSessionId: string;
  activeView: ChatWorkspaceView;
  isConversationPaneClosed: boolean;
  isMobileConversationView: boolean;
};

export type ConversationListState = {
  items: ChatConversationSummary[];
  isLoading: boolean;
  errorMessage: string;
  searchText: string;
};

export type ConversationRoomState = {
  sessionId: string;
  messages: ChatMessage[];
  requests: ChatConversationRequest[];
  isLoading: boolean;
  loadingLabel: string;
  errorMessage: string;
};

export type RuntimePaneState = {
  snapshot: ChatRuntimeSnapshot | null;
  isLoading: boolean;
  errorMessage: string;
};

export type ErrorPaneState = {
  items: ErrorLogItem[];
  selectedItem: ErrorLogItem | null;
  isLoading: boolean;
  errorMessage: string;
};
