export type SessionStatus
  = | 'active'
    | 'paused'
    | 'completed'
    | 'error'
    | 'archived'

export interface SessionState {
  status: SessionStatus
  updatedAt: number
  lastActiveAt: number
  title?: string
  titleLocked?: boolean
  errorMessage?: string
}

export interface ModelConfig {
  modelId: string
  provider?: string
  config?: Record<string, unknown>
}

export interface SessionConfigOverride {
  model?: ModelConfig
  systemPromptOverride?: string
  disabledTools?: string[]
}

export interface ConversationContext {
  messages: unknown[]
  messageCount: number
  lastMessagePreview?: string
  toolCallCount: number
}

export interface SessionStats {
  usage: {
    promptTokens: number
    completionTokens: number
    totalTokens: number
  }
  responseCount: number
  avgResponseTime?: number
}

export interface SessionSnapshot {
  id: string
  createdAt: number
  state: SessionState
  configOverride?: SessionConfigOverride
  context: ConversationContext
  stats: SessionStats
  metadata?: Record<string, unknown>
  messageQueue?: unknown
  title?: string
  updatedAt?: number
}
