/**
 * API Handlers Index
 *
 * Combines all domain-specific handlers into a unified apiHandlers object.
 * TypeScript will error if any endpoint from ApiSchemas is missing.
 *
 * Handler files are organized by domain:
 * - topics.ts - Topic API handlers
 * - messages.ts - Message API handlers
 * - models.ts - Model API handlers
 * - providers.ts - Provider API handlers
 * - translate.ts - Translate API handlers
 */

import type { ApiImplementation } from '@shared/data/api/apiTypes'

import { agentChannelHandlers } from './agentChannels'
import { agentHandlers } from './agents'
import { agentSessionHandlers } from './agentSessions'
import { agentWorkspaceHandlers } from './agentWorkspaces'
import { assistantHandlers } from './assistants'
import { fileHandlers } from './files'
import { groupHandlers } from './groups'
import { jobHandlers } from './jobs'
import { knowledgeHandlers } from './knowledges'
import { mcpServerHandlers } from './mcpServers'
import { messageHandlers } from './messages'
import { miniAppHandlers } from './miniApps'
import { modelHandlers } from './models'
import { noteHandlers } from './notes'
import { paintingHandlers } from './paintings'
import { pinHandlers } from './pins'
import { promptHandlers } from './prompts'
import { providerHandlers } from './providers'
import { searchHandlers } from './search'
import { skillHandlers } from './skills'
import { tagHandlers } from './tags'
import { temporaryChatHandlers } from './temporaryChats'
import { topicHandlers } from './topics'
import { translateHandlers } from './translate'

/**
 * Complete API handlers implementation
 * Must implement every path+method combination from ApiSchemas
 *
 * Handlers are spread from individual domain modules for maintainability.
 * TypeScript ensures exhaustive coverage - missing handlers cause compile errors.
 */
export const apiHandlers: ApiImplementation = {
  ...agentHandlers,
  ...assistantHandlers,
  ...agentChannelHandlers,
  ...topicHandlers,
  ...messageHandlers,
  ...fileHandlers,
  ...temporaryChatHandlers,
  ...modelHandlers,
  ...paintingHandlers,
  ...providerHandlers,
  ...agentSessionHandlers,
  ...skillHandlers,
  ...knowledgeHandlers,
  ...translateHandlers,
  ...mcpServerHandlers,
  ...miniAppHandlers,
  ...noteHandlers,
  ...tagHandlers,
  ...groupHandlers,
  ...pinHandlers,
  ...promptHandlers,
  ...agentWorkspaceHandlers,
  ...jobHandlers,
  ...searchHandlers
}
