/**
 * @ai-assistant/ui - Shared UI Components
 *
 * 共享 UI 组件库，供 web 和 desktop 包使用
 */

// API Client
export {
  configureApiClient,
  getHealth,
  listSessions,
  createSession,
  getSession,
  deleteSession,
  getMessages,
  sendMessage,
  createWebSocket,
  getWorkingDirectory,
  listFiles,
  readFile,
  getFileTree,
  getConfig,
  updateConfig,
  // Commands API
  listCommands,
  getCommand,
  executeCommand,
  searchCommands,
  reloadCommands,
  // Commands CRUD
  createCommand,
  getCommandContent,
  updateCommand,
  deleteCommand,
  // MCP API
  listMCPServers,
  getMCPServer,
  connectMCPServer,
  disconnectMCPServer,
  enableMCPServer,
  disableMCPServer,
  listMCPTools,
  getMCPTool,
  getMCPConfig,
  // Hooks API
  getHooksConfig,
  updateHooksConfig,
  getFileEditedHooks,
  updateFileEditedHooks,
  getFileCreatedHooks,
  updateFileCreatedHooks,
  getFileDeletedHooks,
  updateFileDeletedHooks,
  getSessionCompletedHooks,
  updateSessionCompletedHooks,
  testHookCommand,
  // Agents API
  listAgents,
  getAgent,
  createAgent,
  updateAgent,
  deleteAgent,
  listPresetAgents,
  getAgentDefaults,
  updateAgentDefaults,
  // Checkpoints API
  listCheckpoints,
  getCheckpointStats,
  getLatestCheckpoint,
  getCheckpoint,
  createCheckpoint,
  deleteCheckpoint,
  getCheckpointDiff,
  getFileDiff,
  restoreCheckpoint,
  previewRestore,
  unrevert,
  getUnrevertStatus,
  checkSafety,
  cleanupCheckpoints,
  getSessionCheckpoints,
  getMessageCheckpoints,
  // Providers API
  listProviders,
  getProvider,
  getProviderModels,
  testProviderConnection,
  registerProvider,
  updateProviderConfig,
  deleteProvider,
  addProviderModel,
  deleteProviderModel,
  // Context API
  getContextUsage,
  compressContext,
  // File Search API
  searchFiles,
} from './api/client.js';

// Types
export type {
  Session,
  Message,
  HealthStatus,
  FileInfo,
  FileListResponse,
  FileReadResponse,
  FileTreeNode,
  FileTreeResponse,
  ServerConfig,
  // Command types
  CommandInfo,
  CommandSearchResult,
  CommandExecuteResult,
  CommandListResponse,
  // Command CRUD types
  CreateCommandInput,
  UpdateCommandInput,
  CommandContent,
  // MCP types
  MCPServerStatus,
  MCPServerStatusType,
  MCPToolInfo,
  MCPConfig,
  MCPServerConfigInfo,
  // Hooks types
  HookConfig,
  FileHookConfig,
  ShellCommandConfig,
  HookTestResult,
  // Agent types
  AgentMode,
  AgentModelConfig,
  AgentToolConfig,
  PermissionRule,
  AgentBashPermission,
  AgentFilePermission,
  AgentGitPermission,
  AgentPermission,
  AgentListItem,
  AgentDetail,
  AgentInput,
  AgentDefaults,
  // Checkpoint types
  CheckpointTrigger,
  FileChangeType,
  CheckpointListItem,
  CheckpointDetail,
  FileChange,
  DiffInfo,
  FileDiffDetail,
  RestoreMode,
  RestoreOptions,
  RestoreResult,
  SafetyCheckResult,
  CheckpointStats,
  UnrevertStatus,
  UnrevertResult,
  // Provider types
  BuiltinProviderType,
  ProviderType,
  ModelCapabilities,
  ModelInfo,
  ProviderListItem,
  ProviderDetail,
  CustomProviderDefinition,
  ProviderConfig,
  ConnectionTestResult,
  // Context types
  TokenUsage,
  ContextUsageInfo,
  CompressionStatus,
  CompressionResult,
  // File Search types
  FileSearchResult,
  FileSearchResponse,
  // Agent Mode types
  AgentModeType,
} from './api/client.js';

// Primitives (shadcn/ui style)
export * from './primitives/index.js';

// Utils
export { cn } from './utils/cn.js';
export * from './utils/animations.js';

// Components
export { ChatMessage, StreamingMessage, TypingIndicator } from './components/ChatMessage.js';
export { ChatInput } from './components/ChatInput.js';
export { AgentModeSelector } from './components/AgentModeSelector.js';
export { CommandMenu, type CommandMenuItem } from './components/CommandMenu.js';
export { FileMenu, type FileMenuItem } from './components/FileMenu.js';
export {
  FileMentionTag,
  FileMentionText,
  parseFileMentions,
  type FileMentionTagProps,
  type ParsedSegment,
} from './components/FileMentionTag.js';
export { CommandPanel } from './components/CommandPanel.js';
export { CommandEditor } from './components/CommandEditor.js';
export { MCPPanel } from './components/MCPPanel.js';
export { HooksPanel } from './components/HooksPanel.js';
export { HookEditor } from './components/HookEditor.js';
export { AgentsPanel } from './components/AgentsPanel.js';
export { AgentEditor } from './components/AgentEditor.js';
export { AgentDefaultsEditor } from './components/AgentDefaultsEditor.js';
export { ProvidersPanel } from './components/ProvidersPanel.js';
export { ProviderEditor } from './components/ProviderEditor.js';
export { CheckpointPanel } from './components/CheckpointPanel.js';
export { CheckpointDiffViewer } from './components/CheckpointDiffViewer.js';
export { RestoreDialog } from './components/RestoreDialog.js';
export { PermissionDialog } from './components/PermissionDialog.js';
export type { PermissionRequest, PermissionType, PermissionRequestContext, DiffInfo as PermissionDiffInfo } from './components/PermissionDialog.js';
export { Sidebar } from './components/Sidebar.js';
export { FileBrowser } from './components/FileBrowser.js';
export { ConfigPanel } from './components/ConfigPanel.js';
export { ContextUsage } from './components/ContextUsage.js';
export { Toaster } from './components/Toaster.js';
export { Skeleton, MessageSkeleton, SessionSkeleton, FileSkeleton } from './components/Skeleton.js';
export { Markdown } from './components/Markdown.js';
export { CodeBlock, InlineCode } from './components/CodeBlock.js';

// Toast function (re-export from sonner)
export { toast } from 'sonner';

// Hooks
export { useChat } from './hooks/useChat.js';
export { useCommands } from './hooks/useCommands.js';
export { useFileMention } from './hooks/useFileMention.js';
export { useTheme, ThemeProvider, themeInitScript, type Theme, type ResolvedTheme } from './hooks/useTheme.js';

// Theme Components
export { ThemeToggle, ThemeToggleCompact } from './components/ThemeToggle.js';
