import type { AgentMessage } from './message';

/** Agent 工作模式 */
export type AgentMode = 'build' | 'plan';

/** Agent 运行配置 */
export interface AgentConfig {
  mode: AgentMode;
  model?: string;
  apiUrl?: string;
  apiKey?: string;
  systemPrompt?: string;
  temperature?: number;
  maxTokens?: number;
}

/** Agent 预置定义 —— 绑定提示词、模型、温度等预设 */
export interface AgentDefinition {
  id: string;
  name: string;
  description?: string;
  systemPrompt: string;
  model?: string;
  temperature?: number;
  maxTokens?: number;
  maxTurns?: number;
  subAgentIds?: string[];
}

/** Agent 上下文 —— 当前编码环境的完整快照 */
export interface AgentContext {
  openFiles: { path: string; content: string }[];
  fileTree: string[];
  cursorPosition?: { file: string; line: number; column: number };
  selection?: { file: string; text: string; startLine: number; endLine: number };
  conversationHistory: AgentMessage[];
}

/** Agent 单次运行结果 */
export interface AgentResult {
  agentId: string;
  content: string;
  turns: number;
  toolCalls: { type: string; params: Record<string, string> }[];
  error?: string;
}

/** 会话消息 —— 记录每条消息来源 Agent */
export interface SessionMessage {
  id: string;
  role: 'user' | 'agent' | 'system';
  agentId?: string;
  content: string;
  timestamp: number;
}
