// User / Auth types
export interface Agent {
  id: string
  username: string
  role: 'agent' | 'admin'
  created_at: string
  updated_at: string
}

export interface AuthResponse {
  access_token: string
  token_type: string
}

// Project types
export interface Project {
  id: string
  name: string
  description: string | null
  agent_id: string
  created_at: string
  updated_at: string
}

// Folder types
export interface Folder {
  id: string
  name: string
  project_id: string
  parent_id: string | null
  path: string
  created_at: string
  updated_at: string
}

// Document types
export interface Tag {
  id: string
  name: string
  color: string
}

export interface DocumentReasoning {
  reasoning_type: 'chain' | 'idea' | 'context' | 'reflection'
  confidence: number | null
  reasoning_steps: Array<{
    step: number
    thought: string
    conclusion: string | null
  }>
  model_source: string | null
}

export interface Document {
  id: string
  title: string
  content: string
  project_id: string
  folder_id: string | null
  path: string
  tags: Tag[]
  reasoning: DocumentReasoning | null
  created_at: string
  updated_at: string
}

// Tree view node
export interface TreeNode {
  id: string
  name: string
  type: 'folder' | 'document'
  children?: TreeNode[]
  parent_id: string | null
}

// API responses
export interface ProjectsResponse {
  projects: Project[]
}

export interface FoldersResponse {
  folders: Folder[]
}

export interface DocumentsResponse {
  documents: Document[]
}

// Form inputs
export interface LoginForm {
  username: string
  password: string
}

export interface RegisterForm {
  username: string
  password: string
}

export interface ProjectForm {
  name: string
  description: string
}

export interface FolderForm {
  name: string
  parent_id: string | null
}

export interface DocumentForm {
  title: string
  content: string
  folder_id: string | null
}

export interface TagForm {
  name: string
  color: string
}
