import { defineConfig } from 'vitepress'

export default defineConfig({
  title: 'DCC-MCP-Core',
  description: 'Production-grade MCP + Skills foundation for AI-assisted DCC workflows',
  base: '/dcc-mcp-core/',
  cleanUrls: true,
  lastUpdated: true,

  head: [
    ['link', { rel: 'icon', type: 'image/svg+xml', href: '/dcc-mcp-core/logo.svg' }],
  ],

  locales: {
    root: {
      label: 'English',
      lang: 'en-US',
      themeConfig: {
        nav: [
          { text: 'Guide', link: '/guide/what-is-dcc-mcp-core' },
          { text: 'API', link: '/api/models' },
          { text: 'RFCs', link: '/rfcs/' },
          {
            text: 'v0.19.64', // x-release-please-version
            items: [
              { text: 'Changelog', link: 'https://github.com/loonghao/dcc-mcp-core/blob/main/CHANGELOG.md' },
              { text: 'PyPI', link: 'https://pypi.org/project/dcc-mcp-core/' },
            ]
          }
        ],
        sidebar: {
          '/guide/': [
            {
              text: 'Introduction',
              items: [
                { text: 'What is DCC-MCP-Core?', link: '/guide/what-is-dcc-mcp-core' },
                { text: 'Getting Started', link: '/guide/getting-started' },
              ]
            },
            {
              text: 'MCP + Skills System',
              items: [
                { text: 'MCP Integration Guide', link: '/guide/mcp-skills-integration' },
                { text: 'Skills System', link: '/guide/skills' },
                { text: 'Skill Scopes & Policies', link: '/guide/skill-scopes-policies' },
                { text: 'Agents Reference', link: '/guide/agents-reference' },
                { text: 'Thin Harness', link: '/guide/thin-harness' },
                { text: 'REST API Surface', link: '/guide/rest-api-surface' },
                { text: 'CLI Reference', link: '/guide/cli-reference' },
                { text: 'Gateway Election', link: '/guide/gateway-election' },
                { text: 'Gateway', link: '/guide/gateway' },
                { text: 'Gateway Diagnostics', link: '/guide/gateway-diagnostics' },
                { text: 'Migration: Embedded → Daemon', link: '/guide/migration/from-embedded-to-daemon' },
                { text: 'Tunnel Relay', link: '/guide/tunnel-relay' },
                { text: 'Remote Server', link: '/guide/remote-server' },
                { text: 'Production Deployment', link: '/guide/production-deployment' },
              ]
            },
            {
              text: 'Core Concepts',
              items: [
                { text: 'Actions & Registry', link: '/guide/actions' },
                { text: 'Event System', link: '/guide/events' },
                { text: 'MCP Protocols', link: '/guide/protocols' },
                { text: 'Naming Actions & Tools', link: '/guide/naming' },
                { text: 'Transport Layer', link: '/guide/transport' },
                { text: 'Capabilities', link: '/guide/capabilities' },
                { text: 'Prompts', link: '/guide/prompts' },
              ]
            },
            {
              text: 'Advanced',
              items: [
                { text: 'Architecture', link: '/guide/architecture' },
                { text: 'Custom Skills', link: '/guide/custom-actions' },
                { text: 'DCC Thread Safety', link: '/guide/dcc-thread-safety' },
                { text: 'Process Management', link: '/guide/process' },
                { text: 'Sandbox & Security', link: '/guide/sandbox' },
                { text: 'Shared Memory', link: '/guide/shm' },
                { text: 'Telemetry', link: '/guide/telemetry' },
                { text: 'Capture', link: '/guide/capture' },
                { text: 'USD Bridge', link: '/guide/usd' },
                { text: 'Artefacts', link: '/guide/artefacts' },
                { text: 'Job Persistence', link: '/guide/job-persistence' },
                { text: 'Project Persistence', link: '/guide/project-persistence' },
                { text: 'Scheduler', link: '/guide/scheduler' },
                { text: 'Workflows', link: '/guide/workflows' },
                { text: 'FAQ', link: '/guide/faq' },
              ]
            },
            {
              text: 'DCC Integration',
              items: [
                { text: 'Admin UI', link: '/guide/admin-ui' },
                { text: 'Analytics Dashboard', link: '/guide/analytics-dashboard' },
                { text: 'Sentry Error Monitoring', link: '/guide/sentry' },
                { text: 'UI Control Workflows', link: '/guide/ui-control-workflows' },
                { text: 'Host Adapter', link: '/guide/host-adapter' },
                { text: 'Adapter Runtime Contracts', link: '/guide/adapter-runtime-contracts' },
                { text: 'Adapter Install Lifecycle', link: '/guide/adapter-install-lifecycle' },
                { text: 'Adapter Dispatcher Migration', link: '/guide/adapter-dispatcher-migration' },
              ]
            },
            {
              text: 'Catalog & Skills',
              items: [
                { text: 'Catalog', link: '/guide/catalog' },
                { text: 'Marketplace', link: '/guide/marketplace' },
                { text: 'Skill Maintenance', link: '/guide/skill-maintenance' },
                { text: 'Rez Skill Packages', link: '/guide/rez-skill-packages' },
                { text: 'Context Bundles', link: '/guide/context-bundles' },
                { text: 'Translate', link: '/guide/translate' },
              ]
            },
            {
              text: 'Observability & Networking',
              items: [
                { text: 'Observability', link: '/guide/observability' },
                { text: 'Middleware', link: '/guide/middleware' },
                { text: 'OpenAPI Mount', link: '/guide/openapi-mount' },
                { text: 'DCC REST Skill API', link: '/guide/dcc-rest-skill-api' },
                { text: 'Cross-DCC Verification', link: '/guide/cross-dcc-verification' },
              ]
            },
          ],
          '/api/': [
            {
              text: 'API Reference',
              items: [
                { text: 'Models', link: '/api/models' },
                { text: 'Actions', link: '/api/actions' },
                { text: 'Events', link: '/api/events' },
                { text: 'Skills', link: '/api/skills' },
                { text: 'Protocols', link: '/api/protocols' },
                { text: 'Transport', link: '/api/transport' },
                { text: 'HTTP Server', link: '/api/http' },
                { text: 'Process', link: '/api/process' },
                { text: 'Sandbox', link: '/api/sandbox' },
                { text: 'Shared Memory', link: '/api/shm' },
                { text: 'Telemetry', link: '/api/telemetry' },
                { text: 'Capture', link: '/api/capture' },
                { text: 'USD', link: '/api/usd' },
                { text: 'Utilities', link: '/api/utilities' },
                { text: 'Observability', link: '/api/observability' },
                { text: 'Resources', link: '/api/resources' },
                { text: 'Workflow', link: '/api/workflow' },
              ]
            },
            {
              text: 'Remote-Server Extensions',
              items: [
                { text: 'Auth (API Key + OAuth/CIMD)', link: '/api/auth' },
                { text: 'Batch Dispatch', link: '/api/batch' },
                { text: 'Elicitation', link: '/api/elicitation' },
                { text: 'Plugin Manifest', link: '/api/plugin-manifest' },
                { text: 'Rich Content (MCP Apps)', link: '/api/rich-content' },
                { text: 'DCC API Executor', link: '/api/dcc-api-executor' },
              ]
            },
            {
              text: 'Agent Tools',
              items: [
                { text: 'Cancellation', link: '/api/cancellation' },
                { text: 'Checkpoint', link: '/api/checkpoint' },
                { text: 'Docs Resources', link: '/api/docs-resources' },
                { text: 'Feedback', link: '/api/feedback' },
                { text: 'Introspection', link: '/api/introspection' },
                { text: 'Recipes', link: '/api/recipes' },
                { text: 'Workflow YAML', link: '/api/workflow-yaml' },
              ],
            },
            {
              text: 'DCC Integration',
              items: [
                { text: 'Bridge', link: '/api/bridge' },
                { text: 'Gateway Election', link: '/api/gateway-election' },
                { text: 'Hot Reload', link: '/api/hot-reload' },
                { text: 'Server Factory', link: '/api/factory' },
                { text: 'Callable Dispatcher', link: '/api/dispatcher' },
                { text: 'Adapter Context', link: '/api/adapter-context' },
                { text: 'Guardrails', link: '/api/guardrails' },
                { text: 'Project', link: '/api/project' },
              ],
            }
          ],
          '/rfcs/': [
            {
              text: 'Request for Comments',
              items: [
                { text: 'Overview', link: '/rfcs/' },
                { text: '0001: Gateway Election Resilience', link: '/rfcs/0001-gateway-election-resilience' },
                { text: '0002: Event Bus & Webhooks', link: '/rfcs/0002-event-bus-and-webhooks' },
                { text: '0003: Traffic Interception & Agent Debugging', link: '/rfcs/0003-traffic-interception-and-replay' },
              ],
            }
          ]
        },
      }
    },
    zh: {
      label: '简体中文',
      lang: 'zh-CN',
      link: '/zh/',
      themeConfig: {
        nav: [
          { text: '指南', link: '/zh/guide/what-is-dcc-mcp-core' },
          { text: 'API', link: '/zh/api/models' },
          {
            text: 'v0.19.64', // x-release-please-version
            items: [
              { text: '更新日志', link: 'https://github.com/loonghao/dcc-mcp-core/blob/main/CHANGELOG.md' },
              { text: 'PyPI', link: 'https://pypi.org/project/dcc-mcp-core/' },
            ]
          }
        ],
        sidebar: {
          '/zh/guide/': [
            {
              text: '介绍',
              items: [
                { text: '什么是 DCC-MCP-Core？', link: '/zh/guide/what-is-dcc-mcp-core' },
                { text: '快速开始', link: '/zh/guide/getting-started' },
              ]
            },
            {
              text: 'MCP + Skills 系统',
              items: [
                { text: 'MCP + Skills 集成指南', link: '/zh/guide/mcp-skills-integration' },
                { text: 'Skills 技能包', link: '/zh/guide/skills' },
                { text: 'Skill 作用域与策略', link: '/zh/guide/skill-scopes-policies' },
                { text: 'Agent 参考', link: '/zh/guide/agents-reference' },
                { text: 'Thin Harness', link: '/zh/guide/thin-harness' },
                { text: 'REST API 面板', link: '/zh/guide/rest-api-surface' },
                { text: 'CLI 参考', link: '/zh/guide/cli-reference' },
                { text: '网关选举机制', link: '/zh/guide/gateway-election' },
                { text: 'Gateway', link: '/zh/guide/gateway' },
                { text: '网关争用与调试', link: '/zh/guide/gateway-diagnostics' },
                { text: '迁移：内嵌 → 守护进程', link: '/zh/guide/migration/from-embedded-to-daemon' },
                { text: '隧道中继', link: '/zh/guide/tunnel-relay' },
                { text: '远程服务器', link: '/zh/guide/remote-server' },
                { text: '生产环境部署', link: '/zh/guide/production-deployment' },
              ]
            },
            {
              text: '核心概念',
              items: [
                { text: 'Actions 动作', link: '/zh/guide/actions' },
                { text: '事件系统', link: '/zh/guide/events' },
                { text: 'MCP 协议', link: '/zh/guide/protocols' },
                { text: '命名 Actions 与 Tools', link: '/zh/guide/naming' },
                { text: '传输层', link: '/zh/guide/transport' },
                { text: 'Capabilities', link: '/zh/guide/capabilities' },
                { text: 'Prompts', link: '/zh/guide/prompts' },
              ]
            },
            {
              text: '进阶',
              items: [
                { text: '架构设计', link: '/zh/guide/architecture' },
                { text: '自定义 Skill', link: '/zh/guide/custom-actions' },
                { text: 'DCC 线程安全', link: '/zh/guide/dcc-thread-safety' },
                { text: '进程管理', link: '/zh/guide/process' },
                { text: '沙箱与安全', link: '/zh/guide/sandbox' },
                { text: '共享内存', link: '/zh/guide/shm' },
                { text: '遥测', link: '/zh/guide/telemetry' },
                { text: '画面捕获', link: '/zh/guide/capture' },
                { text: 'USD 桥接', link: '/zh/guide/usd' },
                { text: 'Artefacts', link: '/zh/guide/artefacts' },
                { text: 'Job Persistence', link: '/zh/guide/job-persistence' },
                { text: '项目持久化', link: '/zh/guide/project-persistence' },
                { text: 'Scheduler', link: '/zh/guide/scheduler' },
                { text: 'Workflows', link: '/zh/guide/workflows' },
                { text: '常见问题', link: '/zh/guide/faq' },
              ]
            },
            {
              text: 'DCC 集成',
              items: [
                { text: '管理界面', link: '/zh/guide/admin-ui' },
                { text: '分析仪表盘', link: '/zh/guide/analytics-dashboard' },
                { text: 'Sentry 错误监控', link: '/zh/guide/sentry' },
                { text: 'UI Control 工作流', link: '/zh/guide/ui-control-workflows' },
                { text: '主机适配器', link: '/zh/guide/host-adapter' },
                { text: '适配器运行时契约', link: '/zh/guide/adapter-runtime-contracts' },
                { text: '适配器安装生命周期', link: '/zh/guide/adapter-install-lifecycle' },
                { text: '适配器调度器迁移', link: '/zh/guide/adapter-dispatcher-migration' },
              ]
            },
            {
              text: '目录与技能',
              items: [
                { text: '技能目录', link: '/zh/guide/catalog' },
                { text: '市场技能包', link: '/zh/guide/marketplace' },
                { text: '技能维护', link: '/zh/guide/skill-maintenance' },
                { text: 'Rez 技能包', link: '/zh/guide/rez-skill-packages' },
                { text: '上下文束', link: '/zh/guide/context-bundles' },
                { text: '翻译', link: '/zh/guide/translate' },
              ]
            },
            {
              text: '可观测性与网络',
              items: [
                { text: '可观测性', link: '/zh/guide/observability' },
                { text: '中间件', link: '/zh/guide/middleware' },
                { text: 'OpenAPI 挂载', link: '/zh/guide/openapi-mount' },
                { text: 'DCC REST Skill API', link: '/zh/guide/dcc-rest-skill-api' },
                { text: '跨 DCC 验证', link: '/zh/guide/cross-dcc-verification' },
              ]
            },
          ],
          '/zh/api/': [
            {
              text: 'API 参考',
              items: [
                { text: '数据模型', link: '/zh/api/models' },
                { text: 'Actions', link: '/zh/api/actions' },
                { text: '事件', link: '/zh/api/events' },
                { text: 'Skills', link: '/zh/api/skills' },
                { text: '协议', link: '/zh/api/protocols' },
                { text: '传输层', link: '/zh/api/transport' },
                { text: 'HTTP 服务器', link: '/zh/api/http' },
                { text: '进程管理', link: '/zh/api/process' },
                { text: '沙箱', link: '/zh/api/sandbox' },
                { text: '共享内存', link: '/zh/api/shm' },
                { text: '遥测', link: '/zh/api/telemetry' },
                { text: '画面捕获', link: '/zh/api/capture' },
                { text: 'USD', link: '/zh/api/usd' },
                { text: '工具函数', link: '/zh/api/utilities' },
                { text: '可观测性', link: '/zh/api/observability' },
                { text: 'Resources', link: '/zh/api/resources' },
                { text: 'Workflow', link: '/zh/api/workflow' },
              ]
            },
            {
              text: '远程服务器扩展',
              items: [
                { text: '认证 (API Key + OAuth/CIMD)', link: '/zh/api/auth' },
                { text: '批量分发', link: '/zh/api/batch' },
                { text: 'Elicitation 用户交互', link: '/zh/api/elicitation' },
                { text: '插件清单', link: '/zh/api/plugin-manifest' },
                { text: 'Rich Content (MCP Apps)', link: '/zh/api/rich-content' },
                { text: 'DCC API Executor', link: '/zh/api/dcc-api-executor' },
              ]
            },
            {
              text: 'Agent 工具',
              items: [
                { text: '取消机制', link: '/zh/api/cancellation' },
                { text: '检查点', link: '/zh/api/checkpoint' },
                { text: '文档资源', link: '/zh/api/docs-resources' },
                { text: '反馈', link: '/zh/api/feedback' },
                { text: '内省', link: '/zh/api/introspection' },
                { text: '配方', link: '/zh/api/recipes' },
                { text: '工作流 YAML', link: '/zh/api/workflow-yaml' },
              ],
            },
            {
              text: 'DCC 集成',
              items: [
                { text: '桥接', link: '/zh/api/bridge' },
                { text: '网关选举', link: '/zh/api/gateway-election' },
                { text: '热重载', link: '/zh/api/hot-reload' },
                { text: '服务器工厂', link: '/zh/api/factory' },
                { text: '可调用对象调度器', link: '/zh/api/dispatcher' },
                { text: '适配器上下文', link: '/zh/api/adapter-context' },
                { text: '防护栏', link: '/zh/api/guardrails' },
                { text: '项目', link: '/zh/api/project' },
              ],
            }
          ]
        },
        outline: {
          label: '页面导航',
        },
        lastUpdated: {
          text: '最后更新于',
        },
        docFooter: {
          prev: '上一页',
          next: '下一页',
        },
      }
    }
  },

  themeConfig: {
    logo: '/logo.svg',
    socialLinks: [
      { icon: 'github', link: 'https://github.com/loonghao/dcc-mcp-core' }
    ],
    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2025 Hal Long'
    },
    search: {
      provider: 'local'
    },
    editLink: {
      pattern: 'https://github.com/loonghao/dcc-mcp-core/edit/main/docs/:path'
    },
  },

  markdown: {
    lineNumbers: true,
  },
})
