// ask + changes + hints

export const aiChatEn = {
  ask: {
    title: 'MindOS',
    fabLabel: 'Ask MindOS',
    placeholder: 'Ask a question... @ files, / skills',
    emptyPrompt: 'How can I help?',
    emptyHint: 'Type @ to reference files · / to use skills · drag images',
    executingTool: 'Executing tool…',
    toolRunning: 'Running...',
    copyMessage: 'Copy',
    editMessage: 'Edit',
    regenerateMessage: 'Regenerate',
    toolInput: 'Input',
    toolOutput: 'Output',
    send: 'send',
    newlineHint: 'new line',
    panelComposerResize: 'Drag up to enlarge the input area',
    panelComposerFooter: 'Resize height',
    panelComposerResetHint: 'Double-click to reset height',
    panelComposerKeyboard: 'Arrow keys adjust height; Home/End min/max',
    attachFile: 'Context',
    attachFileLabel: 'Document',
    attachImageLabel: 'Image',
    uploadedFiles: 'Uploaded',
    uploadsProcessing: 'Wait for uploaded files to finish processing before sending.',
    skillsHint: 'skills',
    attachCurrent: 'attach current file',
    stopTitle: 'Stop',
    cancelReconnect: 'Cancel reconnect',
    connecting: 'Thinking with you...',
    thinking: 'Thinking...',
    thinkingLabel: 'Thinking',
    searching: 'Searching knowledge base...',
    generating: 'Generating response...',
    stopped: 'Generation stopped.',
    errorNoResponse: 'AI returned no content. Possible causes: model does not support streaming, proxy compatibility issue, or request exceeds context limit.',
    concurrentLimit: 'Too many sessions are running at once. Stop one or wait for it to finish, then try again.',
    sessionRunningRetry: 'That session is still running. Try again after it finishes.',
    sessionRunningIndicator: 'Running',
    sessionUnreadIndicator: 'Finished in background',
    leaveWhileRunning: 'A chat is still running. Leaving now will lose its remaining output.',
    reconnecting: (attempt: number, max: number) => `Connection lost. Reconnecting (${attempt}/${max})...`,
    reconnectFailed: 'Connection failed after multiple attempts.',
    agentTimeout: 'The AI agent took too long to respond. Please try a simpler question, or try again later.',
    fileTooLarge: (name: string, size: string) => `File "${name}" is too large (${size}). Maximum file size is 10 MB.`,
    totalFilesTooLarge: (size: string) => `Total attached files are too large (${size}). Maximum total size is 100 MB.`,
    proxyCompatMode: 'Using compatibility mode (non-streaming)...',
    proxyCompatFailed: (err: string) => `Compatibility mode failed: ${err}. Please check your Base URL, API key, and model name.`,
    proxyCompatDetecting: 'Detecting proxy compatibility, switching to non-streaming mode...',
    proxyCompatAlsoFailed: (err: string) => `Compatibility mode also failed: ${err}. Please check your Base URL, API key, and model name.`,
    retry: 'Retry',
    suggestions: [
      { label: 'Organize inbox', prompt: 'Organize my inbox files into the right spaces' },
      { label: 'Research a topic', prompt: 'Research the latest trends in AI agents' },
      { label: 'Draft weekly review', prompt: 'Draft a weekly review based on my recent notes' },
      { label: 'Brainstorm ideas', prompt: 'Brainstorm 3 creative ideas for my next project' },
    ],
    /** Categorized prompts for homepage explore section */
    homeCategories: [
      {
        label: 'Knowledge',
        items: [
          { label: 'Organize into Spaces', desc: 'Sort scattered notes by topic', prompt: 'Help me organize my recent unstructured notes into appropriate spaces with proper tags' },
          { label: 'Sync & Deduplicate', desc: 'Clean up cross-platform overlap', prompt: 'Find duplicate or overlapping content across my spaces and help me consolidate them' },
          { label: 'Auto-tag & Categorize', desc: 'Add structure to raw notes', prompt: 'Review my untagged notes and suggest categories and tags for each' },
          { label: 'Weekly Digest', desc: 'Summarize this week\'s changes', prompt: 'Summarize everything I added or changed this week across all spaces' },
        ],
      },
      {
        label: 'Writing',
        items: [
          { label: 'Blog from Notes', desc: 'Turn drafts into polished posts', prompt: 'Turn my draft notes into a polished blog post with clear structure' },
          { label: 'Product Copy', desc: 'Landing page & descriptions', prompt: 'Write compelling product description and landing page copy based on my notes' },
          { label: 'Polish & Refine', desc: 'Improve clarity and tone', prompt: 'Review this document for clarity, tone, and structure, then rewrite the weak parts' },
          { label: 'Slide Deck Outline', desc: 'Presentation structure from notes', prompt: 'Create a slide deck outline from my notes on this topic' },
        ],
      },
      {
        label: 'Analysis',
        items: [
          { label: 'Competitive Overview', desc: 'Compare products & differentiators', prompt: 'Compare the products in my research notes and identify key differentiators' },
          { label: 'Extract Insights', desc: 'Patterns across reading notes', prompt: 'What are the most important insights and patterns across my reading notes?' },
          { label: 'Decision Framework', desc: 'Pros, cons, recommendation', prompt: 'Help me structure this decision with pros, cons, risks, and a recommendation' },
          { label: 'GTM Strategy', desc: 'Go-to-market from research', prompt: 'Help me build a go-to-market plan based on my product and market research notes' },
        ],
      },
      {
        label: 'Innovation',
        items: [
          { label: 'Challenge My Assumptions', desc: 'Find blind spots in my thinking', prompt: 'Review my notes and challenge the key assumptions I\'m making. What am I missing?' },
          { label: 'What If Scenarios', desc: 'Explore alternative futures', prompt: 'Based on my research, generate 3 contrarian "what if" scenarios I haven\'t considered' },
          { label: 'Combine & Remix Ideas', desc: 'Cross-pollinate across domains', prompt: 'Find unexpected connections between ideas in different spaces and suggest novel combinations' },
          { label: 'Spot the Opportunity', desc: 'Gaps others are missing', prompt: 'Analyze my market research notes and identify underserved niches or emerging opportunities' },
        ],
      },
    ],
    modeChat: 'Chat',
    modeAgent: 'Agent',
    modeChatHint: 'Can search / read KB · saves tokens',
    modeAgentHint: 'Full tool access · can modify KB',
    sessionHistory: 'Session History',
    clearAll: 'Clear all',
    confirmClear: 'Confirm clear?',
    noSessions: 'No saved sessions.',
    renameSession: 'Rename',
    draftingHint: 'AI is still running — you can draft the next step now.',
    providerCapsule: 'Switch model provider',
    providerDefault: 'Default',
    providerNoKey: 'No configured providers',
    selectModel: 'Select model',
    searchModels: 'Search models...',
    loadingModels: 'Loading models...',
    saveToKB: 'Save to knowledge base',
    saveToKBTitle: 'Save to Knowledge Base',
    savedToKB: 'Saved to {path}',
    saveNew: 'New file',
    saveAppend: 'Append',
    previewContent: 'Preview content',
    cancelSave: 'Cancel',
    confirmSave: 'Save',
    saving: 'Saving...',
    fileExistsSwitch: 'File exists — switched to append mode',
    saveSession: 'Save Session',
    formatFull: 'Full conversation',
    formatAiOnly: 'AI only',
    saveDirectly: 'Save directly',
    saveDirectlyDesc: 'Save conversation as-is to a folder',
    organizeToNote: 'Organize to note',
    organizeToNoteDesc: 'AI extracts key insights into a note',
    targetFolder: 'Folder',
    fileName: 'Filename',
    saveGenerating: 'Generating summary...',
    saveRetry: 'Retry',
    historySearch: 'Search conversations...',
    historyStats: (n: number) => `${n} conversation${n === 1 ? '' : 's'}`,
    historyPinned: 'Pinned',
    historyToday: 'Today',
    historyYesterday: 'Yesterday',
    historyThisWeek: 'This week',
    historyOlder: 'Older',
    historyExport: 'Export',
    historyEmpty: 'No conversations yet',
    historyEmptyHint: 'Start a new chat to begin',
    historyCapacity: (n: number) => `${n} of 30`,
    historyDeleteConfirm: 'Delete this conversation?',
    historyMsgs: (n: number) => `${n} msg${n === 1 ? '' : 's'}`,
  },
  changes: {
    unreadBanner: (n: number) => `${n} content change${n === 1 ? '' : 's'} unread`,
    reviewNow: 'Review now',
    dismiss: 'Dismiss notification',
    title: 'Content changes',
    subtitle: 'Review recent edits across user and agent operations.',
    eventsCount: (n: number) => `${n} event${n === 1 ? '' : 's'}`,
    unreadCount: (n: number) => `${n} unread`,
    refresh: 'Refresh',
    markSeen: 'Mark seen',
    markAllRead: 'Mark all read',
    filters: {
      filePath: 'File path',
      filePathPlaceholder: 'e.g. Projects/plan.md',
      source: 'Agents (source)',
      operation: 'Tools (operation)',
      operationAll: 'All operations',
      keyword: 'Keyword',
      keywordPlaceholder: 'summary / op / path',
      all: 'All',
      agent: 'Agent',
      user: 'User',
      system: 'System',
    },
    loading: 'Loading changes...',
    empty: 'No content changes yet.',
    emptyHint: 'Changes made to your files will appear here when you or an agent edits content.',
    open: 'Open',
    unchangedLines: (n: number) => `... ${n} unchanged lines ...`,
    operations: {
      save_file: 'Save file',
      append_to_file: 'Append to file',
      insert_lines: 'Insert lines',
      update_lines: 'Update lines',
      insert_after_heading: 'Insert after heading',
      update_section: 'Update section',
      create_file: 'Create file',
      delete_file: 'Delete file',
      rename_file: 'Rename file',
      move_file: 'Move file',
      create_space: 'Create space',
      rename_space: 'Rename space',
      append_csv: 'Append to CSV',
      import_file: 'Import file',
      legacy_agent_diff_import: 'Import from Agent Diff',
    },
    /** Frontend-side summary translations for known backend summary patterns */
    summaries: {
      updatedFileContent: 'Updated file content',
      appendedContent: 'Appended content to file',
      insertedLines: (n: number) => `Inserted ${n} line(s)`,
      updatedLines: (start: number, end: number) => `Updated lines ${start}-${end}`,
      insertedAfterHeading: (h: string) => `Inserted content after heading "${h}"`,
      updatedSection: (h: string) => `Updated section "${h}"`,
      movedToTrash: 'Moved to trash',
      renamedFile: (name: string) => `Renamed file to ${name}`,
      createdFile: 'Created file',
      movedFile: (p: string) => `Moved file to ${p}`,
      createdSpace: 'Created space',
      renamedSpace: (name: string) => `Renamed space to ${name}`,
      appendedCsvRow: (n: number) => `Appended CSV row (${n} cell${n === 1 ? '' : 's'})`,
      importedFile: 'Imported file into knowledge base',
      importedLegacyDiff: 'Imported legacy agent diff',
    },
    relativeTime: {
      justNow: 'just now',
      minutesAgo: (n: number) => `${n}m ago`,
      hoursAgo: (n: number) => `${n}h ago`,
      daysAgo: (n: number) => `${n}d ago`,
    },
  },
  /** Disabled-state and contextual tooltip hints */
  hints: {
    noValidFiles: 'No valid files selected',
    aiOrganizing: 'AI is organizing',
    importInProgress: 'Import in progress',
    templateInitializing: 'Another template is being initialized',
    configureAiKey: 'Configure API key in Settings → AI',
    syncInProgress: 'Sync already in progress',
    toggleInProgress: 'Toggle operation in progress',
    typeMessage: 'Type a message',
    mentionInProgress: 'Mention or command in progress',
    cleanupInProgress: 'Cleanup already in progress',
    tokenResetInProgress: 'Token reset in progress',
    aiNotConfigured: 'AI not configured or generation in progress',
    generationInProgress: 'Generation in progress or AI not configured',
    cannotJumpForward: 'Cannot jump forward in setup',
    testInProgressOrNoKey: 'Test in progress or no API key',
    workflowStepRunning: 'Workflow step already running',
    workflowRunning: 'Workflow step is running',
    sessionHistory: 'Session history',
    newSession: 'New session',
    attachFile: 'Attach local file',
    maximizePanel: 'Focus mode',
    restorePanel: 'Exit focus',
    dockToSide: 'Dock to side panel',
    openAsPopup: 'Open as popup',
    closePanel: 'Close',
    newChat: 'New chat',
    closeSession: 'Close session',
  },
} as const;

export const aiChatZh = {
  ask: {
    title: 'MindOS',
    fabLabel: '问 MindOS',
    placeholder: '输入问题… @ 附加文件，/ 技能',
    emptyPrompt: '有什么可以帮你？',
    emptyHint: '输入 @ 引用文件 · / 使用技能 · 拖拽图片',
    executingTool: '正在执行工具…',
    toolRunning: '运行中...',
    copyMessage: '复制',
    editMessage: '编辑',
    regenerateMessage: '重新生成',
    toolInput: '输入',
    toolOutput: '输出',
    send: '发送',
    newlineHint: '换行',
    panelComposerResize: '向上拖拽以拉高输入区',
    panelComposerFooter: '拉高输入区',
    panelComposerResetHint: '双击恢复默认高度',
    panelComposerKeyboard: '方向键调节高度；Home/End 最小或最大',
    attachFile: '上下文',
    attachFileLabel: '文档',
    attachImageLabel: '图片',
    uploadedFiles: '已上传',
    uploadsProcessing: '请等待上传文件处理完成后再发送。',
    skillsHint: '技能',
    attachCurrent: '附加当前文件',
    stopTitle: '停止',
    cancelReconnect: '取消重连',
    connecting: '正在和你一起思考...',
    thinking: '思考中...',
    thinkingLabel: '思考中',
    searching: '正在搜索知识库...',
    generating: '正在生成回复...',
    stopped: '已停止生成。',
    errorNoResponse: 'AI 未返回有效内容。可能原因：模型不支持流式输出、中转站兼容性问题、或请求超出上下文限制。',
    concurrentLimit: '同时运行的会话太多了。请先停止或等待现有任务完成，再重试。',
    sessionRunningRetry: '该会话正在运行，请等它完成后再试。',
    sessionRunningIndicator: '运行中',
    sessionUnreadIndicator: '已在后台完成',
    leaveWhileRunning: '还有对话正在运行，现在离开会丢失剩余输出。',
    reconnecting: (attempt: number, max: number) => `连接中断，正在重连 (${attempt}/${max})...`,
    reconnectFailed: '多次重连失败，请检查网络后重试。',
    agentTimeout: 'AI 响应超时，请尝试更简单的问题，或稍后重试。',
    fileTooLarge: (name: string, size: string) => `文件「${name}」过大（${size}），单个文件最大 10 MB。`,
    totalFilesTooLarge: (size: string) => `附件总大小过大（${size}），附件总大小最大 100 MB。`,
    proxyCompatMode: '正在以兼容模式调用...',
    proxyCompatFailed: (err: string) => `兼容模式失败：${err}。请检查 Base URL、API Key 和模型名称。`,
    proxyCompatDetecting: '正在检测接口兼容性，切换到兼容模式重试...',
    proxyCompatAlsoFailed: (err: string) => `兼容模式也失败了：${err}。请检查 Base URL、API Key 和模型名称。`,
    retry: '重试',
    suggestions: [
      { label: '整理收集箱', prompt: '把收集箱里的文件整理到对应空间' },
      { label: '调研一个话题', prompt: '调研一下 AI Agent 的最新趋势' },
      { label: '起草周报', prompt: '根据最近的笔记起草一份周报' },
      { label: '想新 idea', prompt: '为我的下一个项目想 3 个新 idea' },
    ],
    homeCategories: [
      {
        label: '知识管理',
        items: [
          { label: '整理到 Space', desc: '按主题归类零散笔记', prompt: '帮我把最近的零散笔记整理到合适的 Space，并打好标签' },
          { label: '同步去重', desc: '清理跨平台重复内容', prompt: '找出我各个 Space 中重复或重叠的内容，帮我合并整理' },
          { label: '自动打标签', desc: '给未分类笔记加结构', prompt: '检查我未标记的笔记，建议合适的分类和标签' },
          { label: '每周摘要', desc: '汇总本周变更', prompt: '总结我这周在所有 Space 中新增和修改的内容' },
        ],
      },
      {
        label: '内容创作',
        items: [
          { label: '笔记变博客', desc: '草稿变成精修文章', prompt: '把我的草稿笔记改写成一篇结构清晰的博客文章' },
          { label: '产品文案', desc: '落地页与产品描述', prompt: '根据我的笔记写一段有吸引力的产品描述和落地页文案' },
          { label: '润色优化', desc: '提升清晰度和语气', prompt: '审阅这篇文档的清晰度、语气和结构，重写不好的部分' },
          { label: '演示大纲', desc: '从笔记生成演讲结构', prompt: '根据我关于这个主题的笔记，创建一个演示文稿大纲' },
        ],
      },
      {
        label: '分析洞察',
        items: [
          { label: '竞品对比', desc: '比较产品差异化', prompt: '对比我调研笔记中的产品，找出关键差异点' },
          { label: '提炼洞察', desc: '发现阅读笔记中的规律', prompt: '我的阅读笔记中有哪些最重要的见解和规律？' },
          { label: '决策框架', desc: '利弊分析与建议', prompt: '帮我用利弊、风险和建议来结构化这个决策' },
          { label: 'GTM 策略', desc: '从调研到上市方案', prompt: '根据我的产品和市场调研笔记，帮我制定一份上市计划' },
        ],
      },
      {
        label: '启发创新',
        items: [
          { label: '挑战假设', desc: '找出思维盲点', prompt: '审视我的笔记，挑战我正在做的关键假设。我遗漏了什么？' },
          { label: '反常识探索', desc: '探索替代可能性', prompt: '根据我的调研，生成 3 个我没考虑过的反常识场景' },
          { label: '跨域融合', desc: '不同领域的创意碰撞', prompt: '在我不同 Space 的想法中找到意想不到的联系，并建议新颖的组合' },
          { label: '发现机会', desc: '别人没看到的空白', prompt: '分析我的市场调研笔记，找出未被充分服务的小众市场或新兴机会' },
        ],
      },
    ],
    modeChat: '对话',
    modeAgent: 'Agent',
    modeChatHint: '可搜索/阅读知识库 · 省 token',
    modeAgentHint: '完整工具权限 · 可修改知识库',
    sessionHistory: '对话历史',
    clearAll: '清除全部',
    confirmClear: '确认清除？',
    noSessions: '暂无历史对话。',
    renameSession: '重命名',
    draftingHint: 'AI 仍在执行，你可以先输入下一步。',
    providerCapsule: '切换模型服务商',
    providerDefault: '默认',
    providerNoKey: '暂无已配置的服务商',
    selectModel: '选择模型',
    searchModels: '搜索模型...',
    loadingModels: '加载模型中...',
    saveToKB: '保存到知识库',
    saveToKBTitle: '保存到知识库',
    savedToKB: '已保存到 {path}',
    saveNew: '新建文件',
    saveAppend: '追加',
    previewContent: '预览内容',
    cancelSave: '取消',
    confirmSave: '保存',
    saving: '保存中...',
    fileExistsSwitch: '文件已存在，已切换为追加模式',
    saveSession: '保存对话',
    formatFull: '完整对话',
    formatAiOnly: '仅 AI 回复',
    saveDirectly: '直接保存',
    saveDirectlyDesc: '将对话原文保存到指定文件夹',
    organizeToNote: '整理为笔记',
    organizeToNoteDesc: 'AI 提取关键内容整理为笔记',
    targetFolder: '文件夹',
    fileName: '文件名',
    saveGenerating: '正在生成摘要...',
    saveRetry: '重试',
    historySearch: '搜索对话...',
    historyStats: (n: number) => `${n} 个对话`,
    historyPinned: '已固定',
    historyToday: '今天',
    historyYesterday: '昨天',
    historyThisWeek: '本周',
    historyOlder: '更早',
    historyExport: '导出',
    historyEmpty: '暂无对话',
    historyEmptyHint: '开始新对话吧',
    historyCapacity: (n: number) => `${n} / 30`,
    historyDeleteConfirm: '确定删除此对话？',
    historyMsgs: (n: number) => `${n} 条消息`,
  },
  changes: {
    unreadBanner: (n: number) => `${n} 条内容变更未读`,
    reviewNow: '立即查看',
    dismiss: '关闭提醒',
    title: '内容变更',
    subtitle: '集中查看用户与 Agent 的最近编辑记录。',
    eventsCount: (n: number) => `${n} 条事件`,
    unreadCount: (n: number) => `${n} 条未读`,
    refresh: '刷新',
    markSeen: '标记已读',
    markAllRead: '全部已读',
    filters: {
      filePath: '文件路径',
      filePathPlaceholder: '例如：Projects/plan.md',
      source: 'Agents（来源）',
      operation: '工具（操作）',
      operationAll: '全部操作',
      keyword: '关键词',
      keywordPlaceholder: '摘要 / 操作 / 路径',
      all: '全部',
      agent: 'Agent',
      user: '用户',
      system: '系统',
    },
    loading: '正在加载变更...',
    empty: '暂无内容变更。',
    emptyHint: '你或 Agent 编辑文件时，变更会显示在这里。',
    open: '打开',
    unchangedLines: (n: number) => `... ${n} 行未变更 ...`,
    operations: {
      save_file: '保存文件',
      append_to_file: '追加到文件',
      insert_lines: '插入行',
      update_lines: '更新行',
      insert_after_heading: '标题后插入',
      update_section: '更新章节',
      create_file: '创建文件',
      delete_file: '删除文件',
      rename_file: '重命名文件',
      move_file: '移动文件',
      create_space: '创建空间',
      rename_space: '重命名空间',
      append_csv: '追加到 CSV',
      import_file: '导入文件',
      legacy_agent_diff_import: '从 Agent Diff 导入',
    },
    summaries: {
      updatedFileContent: '更新了文件内容',
      appendedContent: '追加了文件内容',
      insertedLines: (n: number) => `插入了 ${n} 行`,
      updatedLines: (start: number, end: number) => `更新了第 ${start}-${end} 行`,
      insertedAfterHeading: (h: string) => `在标题「${h}」后插入了内容`,
      updatedSection: (h: string) => `更新了章节「${h}」`,
      movedToTrash: '移到了回收站',
      renamedFile: (name: string) => `重命名为 ${name}`,
      createdFile: '创建了文件',
      movedFile: (p: string) => `移动到了 ${p}`,
      createdSpace: '创建了空间',
      renamedSpace: (name: string) => `重命名空间为 ${name}`,
      appendedCsvRow: (n: number) => `追加了 CSV 行（${n} 个单元格）`,
      importedFile: '导入了文件到知识库',
      importedLegacyDiff: '从 Agent Diff 导入了变更',
    },
    relativeTime: {
      justNow: '刚刚',
      minutesAgo: (n: number) => `${n} 分钟前`,
      hoursAgo: (n: number) => `${n} 小时前`,
      daysAgo: (n: number) => `${n} 天前`,
    },
  },
  /** 禁用态和上下文提示文案 */
  hints: {
    noValidFiles: '未选择有效文件',
    aiOrganizing: 'AI 正在整理中',
    importInProgress: '正在导入',
    templateInitializing: '正在初始化另一个模板',
    configureAiKey: '请在 设置 → AI 中配置 API 密钥',
    syncInProgress: '正在同步中',
    toggleInProgress: '正在切换中',
    typeMessage: '请输入消息',
    mentionInProgress: '正在输入提及或命令',
    cleanupInProgress: '正在清理中',
    tokenResetInProgress: '正在重置令牌',
    aiNotConfigured: 'AI 未配置或正在生成',
    generationInProgress: '正在生成或 AI 未配置',
    cannotJumpForward: '无法跳过前序步骤',
    testInProgressOrNoKey: '正在测试或未配置 API 密钥',
    workflowStepRunning: '工作流步骤正在运行',
    workflowRunning: '工作流步骤正在运行',
    sessionHistory: '会话历史',
    newSession: '新会话',
    attachFile: '附加本地文件',
    maximizePanel: '专注模式',
    restorePanel: '退出专注',
    dockToSide: '停靠到侧边栏',
    openAsPopup: '弹窗模式',
    closePanel: '关闭',
    newChat: '新对话',
    closeSession: '关闭会话',
  },
};
