// onboarding + setup + guide + explore + walkthrough

export const onboardingEn = {
  onboarding: {
    subtitle: 'Your knowledge base is empty. Pick a starter template to get going.',
    templates: {
      en: { title: 'English', desc: 'Pre-built structure with Profile, Notes, Projects, and more.' },
      zh: { title: '中文', desc: '预置画像、笔记、项目等中文目录结构。' },
      empty: { title: 'Empty', desc: 'Just the essentials — README, CONFIG, and INSTRUCTION.' },
    },
    importHint: 'Already have notes? Set MIND_ROOT to your existing directory in Settings.',
    syncHint: 'Want cross-device sync? Run',
    syncHintSuffix: 'in the terminal after setup.',
    initError: 'Initialization failed. Please refresh the page or try a different template.',
    dismiss: 'Dismiss',
  },
  setup: {
    stepTitles: ['Knowledge Base', 'AI Configuration', 'Agent Connection', 'Confirm'],
    // Step 1
    kbPath: 'Knowledge base path',
    kbPathHint: 'Absolute path to your notes directory.',
    kbPathDefault: '~/MindOS/mind',
    kbPathBrowse: 'Browse...',
    kbPathUseDefault: (path: string) => `Use ${path}`,
    kbPathHasFiles: (n: number) => `This directory already contains ${n} file${n > 1 ? 's' : ''}. You can skip the template or merge (existing files won't be overwritten).`,
    kbTemplateSkip: 'Skip template',
    kbTemplateMerge: 'Choose a template to merge',
    template: 'Starter template',
    templateSkip: 'Skip (directory already has files)',
    // Step 2
    aiProvider: 'AI Provider',
    aiProviderHint: 'Choose your preferred AI service.',
    aiSkip: 'Skip — configure later',
    apiKey: 'API Key',
    apiKeyExisting: 'Existing key configured. Leave blank to keep it.',
    model: 'Model',
    listModels: 'Browse',
    noModelsFound: 'No models found',
    baseUrl: 'Base URL',
    baseUrlHint: 'Optional. For proxies or custom API endpoints.',
    // Step 3
    webPort: 'Web UI port',
    mcpPort: 'MCP server port',
    portHint: 'Valid range: 1024–65535',
    portRestartWarning: 'The service will start on these ports after setup completes.',
    portInUse: (p: number) => `Port ${p} is already in use.`,
    portSuggest: (p: number) => `Use ${p}`,
    portChecking: 'Checking…',
    portSelf: 'Current port',
    portConflict: 'Web UI and MCP ports must be different.',
    portVerifyHint: 'Click outside each field to verify, or wait for auto-check.',
    // Step 4
    authToken: 'Auth Token',
    authTokenHint: 'Bearer token for MCP / API clients. Auto-generated.',
    authTokenUsage: 'Used for MCP connections and API clients. When configuring an Agent, this token is written automatically — no manual steps needed.',
    authTokenUsageWhat: 'What is this?',
    authTokenSeed: 'Custom seed (optional)',
    authTokenSeedHint: 'Enter a passphrase to derive a deterministic token.',
    generateToken: 'Generate',
    copyToken: 'Copy',
    copiedToken: 'Copied!',
    webPassword: 'Web Password',
    webPasswordHint: 'Protect your knowledge base from unauthorized browser access.',
    webPasswordRequired: 'Password is required to protect your data.',
    advancedPorts: 'Advanced Settings',
    tokenSectionTitle: 'Auth Token (auto-generated)',
    tokenSectionHint: 'Used by AI agents to connect to your MindOS server.',
    // Step 5 — Agent Connection
    agentToolsTitle: 'Agent Connection',
    connectionModeTitle: 'Connection Mode',
    connectionModeCliHint: 'Recommended · Lower token usage',
    connectionModeMcpHint: 'Optional · Higher token usage',
    agentToolsHint: 'Select which AI agents to configure. This step is optional.',
    agentToolsHintCliOnly: 'Agent selection applies when MCP mode is enabled. CLI works with all agents that have bash access.',
    agentToolsHintNone: 'No connection mode selected. Select at least one mode to connect agents.',
    agentTransport: 'Transport',
    agentScope: 'Scope',
    agentToolsLoading: 'Loading agents…',
    agentToolsEmpty: 'No supported agents detected.',
    agentNoneSelected: 'No agents selected. You can configure agents later in Settings.',
    agentSkipLater: 'Clear all',
    agentSelectDetected: 'Select detected agents',
    agentNoneDetected: 'No agents detected on your system.',
    agentShowMore: (n: number) => `Show ${n} more agents`,
    agentAdvanced: 'Advanced options',
    agentScopeGlobal: 'Install for all projects',
    agentScopeProject: 'This project only',
    badgeInstalled: 'Installed',
    badgeDetected: 'Detected',
    badgeNotFound: 'Not found',
    agentNotInstalled: 'not installed',
    agentDetected: 'detected',
    agentNotFound: 'not found',
    agentGetIt: 'Get it →',
    agentStatusOk: 'configured',
    agentStatusError: 'failed',
    agentInstalling: 'Configuring…',
    agentTransportAuto: 'Auto (recommended)',
    agentTransportLabel: 'Transport',
    agentVerified: 'verified',
    agentUnverified: 'unverified',
    agentVerifyNote: 'stdio agents are verified after restart',
    // Skill (kept for type compat — UI section removed in v0.7)
    skillWhat: '',
    skillAutoHint: () => '',
    skillLabel: 'Skill',
    skillInstalling: 'Installing skill…',
    skillInstalled: 'Skill installed',
    skillFailed: 'Skill install failed',
    // Step 2 — AI skip card
    aiSkipTitle: 'Skip for now',
    aiSkipDesc: 'You can add an API key later in Settings → AI.',
    // Step 6 — Review
    reviewHint: 'Verify your settings, then press Complete Setup.',
    reviewInstallResults: 'Agent configuration results:',
    phaseSaving: 'Saving configuration…',
    phaseAgents: 'Configuring agents…',
    phaseSkill: 'Installing skill…',
    phaseDone: 'Setup complete!',
    retryAgent: 'Retry',
    agentFailedCount: (n: number) => `${n} agent${n > 1 ? 's' : ''} failed`,
    agentCountSummary: (n: number) => `${n} agent${n > 1 ? 's' : ''}`,
    agentFailureNote: 'Agent failures are non-blocking — you can enter MindOS and retry from Settings → Connections.',
    portAvailable: 'Available',
    portChanged: 'Port changed — please restart the server for it to take effect.',
    restartRequired: 'Server restart required for these changes to take effect.',
    restartNow: 'Restart now',
    restarting: 'Restarting…',
    restartDone: 'Server is restarting. Redirecting shortly…',
    restartManual: 'Restart manually:',
    // Buttons
    back: 'Back',
    next: 'Next',
    complete: 'Complete Setup',
    skip: 'Skip',
    // Status
    completing: 'Saving...',
    completeDone: 'Setup complete!',
    completeFailed: 'Setup failed. Please try again.',
    // Health Check (shown when setupPhase === 'done')
    healthKb: 'Knowledge Base',
    healthKbNone: 'Not configured',
    healthAi: 'AI Provider',
    healthAiNone: 'Not configured — AI features disabled',
    healthAiAction: 'Add an API key in Settings → AI.',
    healthAgents: 'Agent Connection',
    healthAgentsOk: (n: number) => `${n} agent${n > 1 ? 's' : ''} configured`,
    healthAgentsPartial: 'Configuration in progress...',
    healthAgentsNone: 'No agents configured',
    healthAgentsAction: 'You can add agents later in Settings → Connections.',
    healthSkills: 'Skills',
    healthSkillsOk: 'Skills installed successfully',
    healthSkillsError: 'Skill installation failed',
    healthSkillsSkipped: 'Skipped',
    healthSkillsInstalling: 'Installing skills...',
    healthSkillsAction: 'You can install skills manually later.',
    healthTokenTitle: 'Auth Token',
    healthTokenCopy: 'Copy token',
    healthTokenHint: 'Used by CLI remote mode and MCP connections. Also available in Settings → Connections.',
    healthGoHome: 'Go to MindOS',
    // Welcome banner (shown after first onboard)
    welcomeTitle: 'Welcome to MindOS!',
    welcomeDesc: 'Setup is complete. Start by asking MindOS a question, browsing your knowledge base, or configuring MCP agents.',
    welcomeLinkReconfigure: 'Reconfigure',
    welcomeLinkAskAI: 'MindOS',
    welcomeLinkMCP: 'MCP Settings',
  },
  guide: {
    title: 'Quick Start',
    showGuide: 'Show getting started guide',
    close: 'Close',
    skip: 'Skip',
    stepLocked: 'Complete the previous step first',
    import: {
      title: 'Import your files',
      cta: 'Import',
      desc: 'Upload your resume, project docs, or notes — anything you want AI agents to know about you.',
      button: 'Import Files',
    },
    ai: {
      title: 'Save with AI',
      cta: 'Try it',
      desc: 'Ask MindOS to capture knowledge from this conversation into your knowledge base:',
      prompt: 'Help me distill the key takeaways from our conversation into a reusable SOP in my knowledge base.',
      promptEmpty: 'Help me design a knowledge base folder structure that fits my needs',
    },
    agent: {
      title: 'Connect other Agents',
      cta: 'Copy prompt',
      desc: 'Open Cursor, Claude Code, or any Agent with MindOS CLI and paste:',
      copyPrompt: 'Summarize what we discussed and save it to my MindOS knowledge base as a reusable SOP.',
      copy: 'Copy',
      copied: 'Copied!',
    },
    done: {
      title: "You're all set!",
      titleFinal: "You've mastered MindOS essentials!",
      steps: [
        { hint: 'Next: try saving an article into your KB →', prompt: 'Help me save the key points from this article into MindOS.' },
        { hint: 'Next: try turning experience into a reusable SOP →', prompt: 'Help me distill this conversation into a reusable workflow in MindOS.' },
      ],
    },
  },
  // explore: moved to use-cases.yaml → generated/explore-i18n.generated.ts
  walkthrough: {
    step: (current: number, total: number) => `${current} of ${total}`,
    next: 'Next',
    back: 'Back',
    skip: 'Skip tour',
    done: 'Done',
    exploreCta: 'Explore what you can do →',
    steps: [
      {
        title: 'Your Project Memory',
        body: 'Organize projects, SOPs, and preferences in Spaces. Everything is local-first and under your control.',
      },
      {
        title: 'AI That Already Knows You',
        body: 'MindOS reads your knowledge base automatically. Ask about your projects without restating the background every time.',
      },
      {
        title: 'Connect Any Agent',
        body: 'Link Cursor, Claude Code, or Windsurf via MCP — they all share the same project memory.',
      },
    ],
  },
} as const;

export const onboardingZh = {
  onboarding: {
    subtitle: '知识库为空，选择一个模板快速开始。',
    templates: {
      en: { title: 'English', desc: '预置 Profile、Notes、Projects 等英文目录结构。' },
      zh: { title: '中文', desc: '预置画像、笔记、项目等中文目录结构。' },
      empty: { title: '空白', desc: '仅包含 README、CONFIG 和 INSTRUCTION 基础文件。' },
    },
    importHint: '已有笔记？在设置中将 MIND_ROOT 指向已有目录即可。',
    syncHint: '需要跨设备同步？完成初始化后在终端运行',
    syncHintSuffix: '即可。',
    initError: '初始化失败。请刷新页面或尝试其他模板。',
    dismiss: '关闭',
  },
  setup: {
    stepTitles: ['知识库', 'AI 配置', 'Agent 连接', '确认'],
    // Step 1
    kbPath: '知识库路径',
    kbPathHint: '笔记目录的绝对路径。',
    kbPathDefault: '~/MindOS/mind',
    kbPathBrowse: '浏览...',
    kbPathUseDefault: (path: string) => `使用 ${path}`,
    kbPathHasFiles: (n: number) => `该目录已有 ${n} 个文件。可以跳过模板，或选择合并（已有文件不会被覆盖）。`,
    kbTemplateSkip: '跳过模板',
    kbTemplateMerge: '选择模板合并',
    template: '初始模板',
    templateSkip: '跳过（目录已有文件）',
    // Step 2
    aiProvider: 'AI 服务商',
    aiProviderHint: '选择你偏好的 AI 服务。',
    aiSkip: '跳过 — 稍后配置',
    apiKey: 'API 密钥',
    apiKeyExisting: '已配置密钥。留空即保持不变。',
    model: '模型',
    listModels: '选择模型',
    noModelsFound: '未找到可用模型',
    baseUrl: '接口地址',
    baseUrlHint: '可选。用于代理或自定义 API 端点。',
    // Step 3
    webPort: 'Web UI 端口',
    mcpPort: 'MCP 服务端口',
    portHint: '有效范围：1024–65535',
    portRestartWarning: '完成配置后，服务将以这些端口启动。',
    portInUse: (p: number) => `端口 ${p} 已被占用。`,
    portSuggest: (p: number) => `使用 ${p}`,
    portChecking: '检测中…',
    portSelf: '当前端口',
    portConflict: 'Web UI 端口和 MCP 端口不能相同。',
    portVerifyHint: '点击输入框外部验证，或等待自动检测。',
    // Step 4
    authToken: '认证令牌',
    authTokenHint: 'MCP / API 客户端使用的 Bearer Token，自动生成。',
    authTokenUsage: '用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入，无需手动填写。',
    authTokenUsageWhat: '这是什么？',
    authTokenSeed: '自定义种子（可选）',
    authTokenSeedHint: '输入口令短语生成确定性 Token。',
    generateToken: '生成',
    copyToken: '复制',
    copiedToken: '已复制！',
    webPassword: '访问密码',
    webPasswordHint: '保护你的知识库，防止未授权的浏览器访问。',
    webPasswordRequired: '密码是必填项，用于保护你的数据。',
    advancedPorts: '高级设置',
    tokenSectionTitle: '认证令牌（已自动生成）',
    tokenSectionHint: 'AI Agent 连接你的 MindOS 服务器时使用。',
    // Step 5 — Agent Connection
    agentToolsTitle: 'Agent 连接',
    connectionModeTitle: '连接模式',
    connectionModeCliHint: '推荐 · 更省 token',
    connectionModeMcpHint: '可选 · 消耗更多 token',
    agentToolsHint: '选择要配置的 AI Agent。此步骤可选。',
    agentToolsHintCliOnly: 'Agent 选择在 MCP 模式启用时生效。CLI 可直接用于所有支持 bash 的 Agent。',
    agentToolsHintNone: '未选择连接模式。请至少选择一种模式以连接 Agent。',
    agentTransport: '传输方式',
    agentScope: '范围',
    agentToolsLoading: '正在加载 Agent…',
    agentToolsEmpty: '未检测到受支持的 Agent。',
    agentNoneSelected: '未选择 Agent。可稍后在设置中配置。',
    agentSkipLater: '清除选择',
    agentSelectDetected: '选择已检测到的 Agent',
    agentNoneDetected: '未在系统中检测到已安装的 Agent。',
    agentShowMore: (n: number) => `显示另外 ${n} 个 Agent`,
    agentAdvanced: '高级选项',
    agentScopeGlobal: '为所有项目安装',
    agentScopeProject: '仅当前项目',
    badgeInstalled: '已安装',
    badgeDetected: '已检测到',
    badgeNotFound: '未找到',
    agentNotInstalled: '未安装',
    agentDetected: '已检测到',
    agentNotFound: '未找到',
    agentGetIt: '去安装 →',
    agentStatusOk: '已配置',
    agentStatusError: '失败',
    agentInstalling: '配置中…',
    agentTransportAuto: '自动（推荐）',
    agentTransportLabel: '传输方式',
    agentVerified: '已验证',
    agentUnverified: '未验证',
    agentVerifyNote: 'stdio agent 需重启后验证',
    // Skill (kept for type compat — UI section removed in v0.7)
    skillWhat: '',
    skillAutoHint: () => '',
    skillLabel: '技能',
    skillInstalling: '正在安装技能…',
    skillInstalled: '技能已安装',
    skillFailed: '技能安装失败',
    // Step 2 — AI skip card
    aiSkipTitle: '暂时跳过',
    aiSkipDesc: '稍后可在 设置 → AI 中添加 API 密钥。',
    // Step 6 — Review
    reviewHint: '确认设置无误后，点击完成。',
    reviewInstallResults: 'Agent 配置结果：',
    phaseSaving: '正在保存配置…',
    phaseAgents: '正在配置 Agent…',
    phaseSkill: '正在安装 Skill…',
    phaseDone: '设置完成！',
    retryAgent: '重试',
    agentFailedCount: (n: number) => `${n} 个 Agent 配置失败`,
    agentCountSummary: (n: number) => `${n} 个 Agent`,
    agentFailureNote: 'Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → 连接 中重试。',
    portAvailable: '可用',
    portChanged: '端口已变更 — 请重启服务以使其生效。',
    restartRequired: '以下变更需要重启服务后生效。',
    restartNow: '立即重启',
    restarting: '重启中…',
    restartDone: '服务正在重启，稍后自动跳转…',
    restartManual: '手动重启命令：',
    // Buttons
    back: '上一步',
    next: '下一步',
    complete: '完成设置',
    skip: '跳过',
    // Status
    completing: '保存中...',
    completeDone: '设置完成！',
    completeFailed: '设置失败，请重试。',
    // Health Check
    healthKb: '知识库',
    healthKbNone: '未配置',
    healthAi: 'AI 服务',
    healthAiNone: '未配置 — AI 功能不可用',
    healthAiAction: '可在 设置 → AI 中添加 API 密钥。',
    healthAgents: 'Agent 连接',
    healthAgentsOk: (n: number) => `已配置 ${n} 个 Agent`,
    healthAgentsPartial: '正在配置中...',
    healthAgentsNone: '未配置 Agent',
    healthAgentsAction: '可稍后在 设置 → 连接 中添加。',
    healthSkills: 'Skills',
    healthSkillsOk: 'Skill 安装成功',
    healthSkillsError: 'Skill 安装失败',
    healthSkillsSkipped: '已跳过',
    healthSkillsInstalling: '正在安装 Skill…',
    healthSkillsAction: '可稍后手动安装 Skill。',
    healthTokenTitle: '认证令牌',
    healthTokenCopy: '复制令牌',
    healthTokenHint: 'CLI 远程模式和 MCP 连接时使用。也可在 设置 → 连接 中找到。',
    healthGoHome: '进入 MindOS',
    // Welcome banner
    welcomeTitle: '欢迎使用 MindOS！',
    welcomeDesc: '初始化完成。现在可以直接问 MindOS、浏览知识库，或配置 MCP Agent。',
    welcomeLinkReconfigure: '重新配置',
    welcomeLinkAskAI: 'MindOS',
    welcomeLinkMCP: 'MCP 设置',
  },
  guide: {
    title: '快速上手',
    showGuide: '显示新手引导',
    close: '关闭',
    skip: '跳过',
    stepLocked: '请先完成上一步',
    import: {
      title: '导入你的文件',
      cta: '导入',
      desc: '上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。',
      button: '导入文件',
    },
    ai: {
      title: 'AI 帮你沉淀',
      cta: '试试',
      desc: '让 MindOS 把对话中的经验沉淀到知识库：',
      prompt: '帮我把这次对话的关键收获整理成一份可复用的 SOP，存到我的知识库里。',
      promptEmpty: '帮我设计一个适合我的知识库目录结构',
    },
    agent: {
      title: '连接其他 Agent',
      cta: '复制提示词',
      desc: '打开 Cursor、Claude Code 或任意 MCP Agent，粘贴以下提示词，让知识流入 MindOS：',
      copyPrompt: '把我们刚才讨论的内容总结一下，存到我的 MindOS 知识库里，形成可复用的 SOP。',
      copy: '复制',
      copied: '已复制！',
    },
    done: {
      title: '你已准备好使用 MindOS',
      titleFinal: '你已掌握 MindOS 核心用法',
      steps: [
        { hint: '下一步：试试把一篇文章存进来 →', prompt: '帮我把这篇文章的要点整理到 MindOS 里。' },
        { hint: '下一步：试试把经验沉淀为 SOP →', prompt: '帮我把这次对话的经验沉淀到 MindOS，形成可复用的工作流。' },
      ],
    },
  },
  // explore: moved to use-cases.yaml → generated/explore-i18n.generated.ts
  walkthrough: {
    step: (current: number, total: number) => `${current} / ${total}`,
    next: '下一步',
    back: '上一步',
    skip: '跳过引导',
    done: '完成',
    exploreCta: '探索更多用法 →',
    steps: [
      {
        title: '你的项目记忆',
        body: '用 Space 管理项目、SOP 和偏好规则。数据存在本地，完全由你掌控。',
      },
      {
        title: '不用重讲背景的 AI',
        body: 'MindOS 会自动读取你的知识库。问它项目相关的事，不需要每次都重复交代背景。',
      },
      {
        title: '多 Agent 共享记忆',
        body: '通过 MCP 连接 Cursor、Claude Code、Windsurf，它们共享同一份项目记忆。',
      },
    ],
  },
};
