import type { GenerationLifecycleStatus, TaskRefundStatus, TextTokenUsage } from "../../utils/taskLifecycle";

export type WorkbenchMode = "chat" | "image" | "video";

export interface WorkbenchChatAttachment {
  kind: "image" | "video" | "audio" | "file";
  name: string;
  token: string;
  previewUrl?: string;
  remoteUrl?: string;
}

export interface WorkbenchChatMessage {
  id: string;
  role: "user" | "assistant";
  author: string;
  mode: WorkbenchMode;
  body: string;
  prompt?: string;
  createdAt: string;
  status?: "thinking" | "queued" | "completed" | "failed" | "stopping" | "local_timeout";
  taskLifecycleStatus?: GenerationLifecycleStatus;
  taskRefundStatus?: TaskRefundStatus;
  taskUsage?: TextTokenUsage;
  taskId?: string;
  conversationId?: number;
  taskProgress?: number;
  taskStatusLabel?: string;
  attachments?: WorkbenchChatAttachment[];
  resultUrl?: string;
  resultType?: "image" | "video";
  resultOriginalUrl?: string;
  resultOssKey?: string;
  resultMimeType?: string;
  result?: {
    title: string;
    summary: string;
    specs: string[];
  };
}

export interface WorkbenchResultActionPayload {
  title: string;
  prompt: string;
  resultUrl: string;
  resultType: "image" | "video";
  taskId?: string;
  resultOriginalUrl?: string;
  resultOssKey?: string;
  resultMimeType?: string;
}
