// Re-export 自 ts-rs 生成的真相源。
// 手写的 desktopCommands 常量和前端别名仍保留在此文件。

export type { TargetTool } from './generated/TargetTool'
export type { OutputFormat } from './generated/OutputFormat'
export type { WakeupProfile } from './generated/WakeupProfile'
export type { MemoryScope } from './generated/MemoryScope'
export type { DesktopErrorKind } from './generated/DesktopErrorKind'
export type { DesktopErrorEnvelope } from './generated/DesktopErrorEnvelope'
export type { DesktopDaemonRequest } from './generated/DesktopDaemonRequest'
export type { DesktopMetadataDto } from './generated/DesktopMetadataDto'

export type { DesktopRouteRequest } from './generated/DesktopRouteRequest'
export type { DesktopWakeupRequest } from './generated/DesktopWakeupRequest'
export type { DesktopPromptOptimizeRequest } from './generated/DesktopPromptOptimizeRequest'
export type { DesktopWorkbenchRequest } from './generated/DesktopWorkbenchRequest'
export type { DesktopRecordLookupRequest } from './generated/DesktopRecordLookupRequest'
export type { DesktopSessionBrowserRequest } from './generated/DesktopSessionBrowserRequest'
export type { DesktopSessionDetailRequest } from './generated/DesktopSessionDetailRequest'
export type { DesktopSessionActionRequest } from './generated/DesktopSessionActionRequest'
export type { DesktopStatusRequest } from './generated/DesktopStatusRequest'
export type { DesktopImportSessionRequest } from './generated/DesktopImportSessionRequest'
export type { DesktopMemoryDraftRequest } from './generated/DesktopMemoryDraftRequest'
export type { DesktopMemoryActionRequest } from './generated/DesktopMemoryActionRequest'

export type { DesktopContextResponse } from './generated/DesktopContextResponse'
export type { DesktopWakeupResponse } from './generated/DesktopWakeupResponse'
export type { DesktopWorkbenchResponse } from './generated/DesktopWorkbenchResponse'
export type { DesktopRecordResponse } from './generated/DesktopRecordResponse'
export type { DesktopHistoryResponse } from './generated/DesktopHistoryResponse'
export type { DesktopWriteResponse } from './generated/DesktopWriteResponse'
export type { DesktopSessionItem } from './generated/DesktopSessionItem'
export type { DesktopSessionBrowserResponse } from './generated/DesktopSessionBrowserResponse'
export type { DesktopSessionMessage } from './generated/DesktopSessionMessage'
export type { DesktopSessionDetailResponse } from './generated/DesktopSessionDetailResponse'
export type { DesktopSessionActionResponse } from './generated/DesktopSessionActionResponse'
export type { DesktopStatusResponse } from './generated/DesktopStatusResponse'
export type { ImportSessionResponse as DesktopImportSessionResponse } from './generated/ImportSessionResponse'
export type { PromptOptimizeResponse as DesktopPromptOptimizeResponse } from './generated/PromptOptimizeResponse'

export type { DesktopWikiLintRequest } from './generated/DesktopWikiLintRequest'
export type { DesktopWikiLintResponse } from './generated/DesktopWikiLintResponse'
export type { DesktopWikiIndexRequest } from './generated/DesktopWikiIndexRequest'
export type { DesktopWikiIndexResponse } from './generated/DesktopWikiIndexResponse'
export type { LintReport } from './generated/LintReport'
export type { BrokenCrossRef } from './generated/BrokenCrossRef'
export type { OrphanNote } from './generated/OrphanNote'
export type { PruneSuggestion } from './generated/PruneSuggestion'
export type { PruneReason } from './generated/PruneReason'

// 前端命名别名（shorter / without Dto suffix）
export type { DesktopLifecycleActionDto as DesktopLifecycleAction } from './generated/DesktopLifecycleActionDto'
export type { TranscriptCandidate as ImportCandidateDto } from './generated/TranscriptCandidate'
export type { CandidateSignal as ImportCandidateSignal } from './generated/CandidateSignal'

// payload 字段在 Rust 侧是 serde_json::Value，TS 侧按 unknown 处理
export type JsonValue = unknown

// ---- Command names (手写，保留) ----

export const desktopCommands = {
  runContext: 'desktop_run_context_command',
  buildWakeup: 'desktop_build_wakeup_command',
  optimizePrompt: 'desktop_optimize_prompt_command',
  loadWorkbench: 'desktop_load_workbench_command',
  getRecord: 'desktop_get_record_command',
  getHistory: 'desktop_get_history_command',
  browseSessions: 'desktop_browse_sessions_command',
  getSession: 'desktop_get_session_command',
  collectStatus: 'desktop_collect_status_command',
  continueSession: 'desktop_continue_session_command',
  deleteSession: 'desktop_delete_session_command',
  recordManual: 'desktop_record_manual_command',
  proposeMemory: 'desktop_propose_memory_command',
  applyMemoryAction: 'desktop_apply_memory_action_command',
  importSession: 'desktop_import_session_command',
  wikiLint: 'desktop_wiki_lint_command',
  readWikiIndex: 'desktop_read_wiki_index_command',
} as const

export type DesktopCommandName =
  (typeof desktopCommands)[keyof typeof desktopCommands]
